/* ---------- Fonts ---------- */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Geist Pixel';
  src: url('/fonts/GeistPixel-Square.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Theme ---------- */

:root {
  --bg: #fafafa;
  --bg-raise: #ffffff;
  --border: #e5e5e5;
  --fg: #0a0a0a;
  --fg-muted: #525252;
  --accent: #1f6feb;
  --accent-weak: #eef4ff;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --code-bg: #0a0a0a;
  --code-fg: #fafafa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

code {
  background: #efefef;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 20px 24px;
  border-radius: 12px;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 13.5px;
  text-align: left;
}
pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
pre b { font-weight: 600; color: #d1e3ff; }

.tok-k { color: #f78c6c; }
.tok-s { color: #c3e88d; }
.tok-c { color: #676e95; font-style: italic; }
.tok-v { color: #82aaff; }
.tok-o { color: #89ddff; }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--fg-muted); }

/* ---------- Brand lockup ---------- */

.brand-hitpay {
  font-family: 'Geist Mono', monospace;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.brand-mpp {
  font-family: 'Geist Pixel', 'Geist Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-left: 0.35em;
}
.brand-hitpay.small, .brand-mpp.small { font-size: 14px; }

/* ---------- Banner ---------- */

.banner {
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 13.5px;
  padding: 10px 16px;
  text-align: center;
  border-bottom: 1px solid #fde68a;
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
}
.banner b { font-weight: 600; }
.banner-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--warn);
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Header ---------- */

.site-head {
  position: sticky;
  top: 0;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.brand { color: inherit; text-decoration: none; font-size: 17px; display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand > .brand-mpp { margin-left: 0; }
.brand-logo { height: 22px; width: auto; display: block; }
.brand-sep { color: #c9c9c9; font-weight: 300; font-size: 20px; line-height: 1; }
.site-nav { display: flex; gap: 22px; font-size: 14px; }
.site-nav a { color: var(--fg-muted); }
.site-nav a:hover { color: var(--fg); text-decoration: none; }

/* ---------- Hero ---------- */

.hero {
  padding: 120px 24px 96px;
  text-align: center;
}
.hero-title {
  font-size: clamp(48px, 8vw, 84px);
  line-height: 1;
  font-weight: 400;
  margin: 0 0 18px;
}
.hero-title .brand-hitpay,
.hero-title .brand-mpp { font-size: inherit; }
.hero-sub-title {
  font-family: 'Geist Mono', monospace;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--fg-muted);
  margin: 0 0 28px;
  letter-spacing: -0.005em;
}
.hero-sub {
  max-width: 58ch;
  margin: 0 auto 40px;
  color: var(--fg-muted);
  font-size: 17px;
}

/* ---------- Install block (primary CTA) ---------- */

.install-block {
  display: inline-flex;
  align-items: stretch;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 12px;
  overflow: hidden;
  font-family: 'Geist Mono', monospace;
}
.install-cmd {
  margin: 0;
  padding: 14px 18px 14px 20px;
  background: transparent;
  border-radius: 0;
  font-size: 14.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.copy-btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-left: 1px solid #2a2a2a;
  color: #a3a3a3;
  padding: 0 16px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.copy-btn:hover { color: #fff; background: #1a1a1a; }
.copy-btn.copied { color: #86efac; }
.copy-btn svg { flex: 0 0 auto; }

/* ---------- Sections (Q&A style) ---------- */

.section { padding: 72px 24px; }
.center-section { text-align: center; }
.center-section .answer,
.center-section .step,
.center-section .topology,
.center-section .flow,
.center-section .components,
.center-section .state-grid,
.center-section .props,
.center-section .endpoints {
  text-align: left;
}

.question {
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 0 0 28px;
  color: var(--fg);
}

.answer {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--fg-muted);
}
.answer p + p { margin-top: 16px; }
.answer p { font-size: 16.5px; line-height: 1.65; }

.answer-inline {
  max-width: 62ch;
  margin: 0 auto 20px;
  font-size: 14.5px;
}

.plain-list {
  list-style: disc;
  padding-left: 22px;
  margin: 12px 0 0;
  color: var(--fg-muted);
  font-size: 15px;
}
.plain-list li { margin: 6px 0; }
.plain-list b { color: var(--fg); }

/* ---------- Architecture ---------- */

.topology {
  font-size: 12.2px;
  background: var(--bg-raise);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 22px 28px;
  margin: 28px auto 32px;
  width: fit-content;
  max-width: 100%;
}
.topology b { color: var(--accent); font-weight: 600; }

.components {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}
@media (max-width: 720px) {
  .components { grid-template-columns: 1fr; }
}
.component {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-raise);
}
.component-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.component-name {
  font-size: 13.5px;
  background: var(--accent-weak);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.component-where {
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.component p {
  margin: 0;
  font-size: 14.5px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ---------- Current state ---------- */

.state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
@media (max-width: 720px) { .state-grid { grid-template-columns: 1fr; } }
.state-col {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  background: var(--bg-raise);
  text-align: left;
}
.state-head {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
}
.state-head-ok { background: #dcfce7; color: #166534; }
.state-head-soon { background: #fef3c7; color: #854d0e; }
.state-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14.5px;
}
.state-col ul li {
  padding: 9px 0;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
}
.state-col ul li:first-child { border-top: 0; padding-top: 0; }

/* ---------- Steps ---------- */

.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 20px;
  margin: 32px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: left;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.step:first-of-type { border-top: 0; padding-top: 24px; }
.step-n {
  font-family: 'Geist Pixel', 'Geist Mono', monospace;
  font-size: 18px;
  color: var(--accent);
  background: var(--accent-weak);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
}
.step-body h3 { margin: 4px 0 10px; font-weight: 600; font-size: 17px; }
.step-body p { color: var(--fg-muted); font-size: 15px; max-width: 62ch; }

/* ---------- Flow ---------- */

.flow {
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--bg-raise);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 22px 28px;
  margin: 24px auto 0;
  width: fit-content;
  max-width: 100%;
  border-radius: 12px;
}
.flow b { color: var(--accent); }

.props {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) { .props { grid-template-columns: 1fr; } }
.props li {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raise);
  font-size: 14px;
  color: var(--fg-muted);
}
.props b { color: var(--fg); }

/* ---------- Endpoints table ---------- */

.endpoints {
  width: 100%;
  max-width: 720px;
  margin: 20px auto 0;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
.endpoints th, .endpoints td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.endpoints th {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  font-weight: 500;
}
.http {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.http-get { color: #075985; background: #e0f2fe; }
.http-post { color: #166534; background: #dcfce7; }

/* ---------- Tabs (one-time vs save-payment-method) ---------- */

.tab-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-raise);
  overflow: hidden;
  margin: 32px 0 0;
}

.tab-strip {
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 2), 1fr);
  border-bottom: 1px solid var(--border);
}

.tab {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--fg);
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 500;
  padding: 18px 20px;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.tab:last-child { border-right: 0; }
.tab:hover:not([aria-selected="true"]) { background: #f5f5f5; }
.tab[aria-selected="true"] {
  background: var(--code-bg);
  color: var(--code-fg);
  cursor: default;
}

.tab-panel { padding: 32px 28px; }
.tab-panel[hidden] { display: none; }

/* Steps inside a tab panel get tighter top padding since the panel pads. */
.tab-panel .step:first-of-type { padding-top: 0; }

@media (max-width: 720px) {
  .tab { font-size: 13px; padding: 14px 12px; }
  .tab-panel { padding: 24px 18px; }
}

/* Tag pill used in the endpoints table to show which method an endpoint
   belongs to (hitpay vs hitpay-save). */
.method-pill {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  background: #f1f1f1;
  border: 1px solid var(--border);
}
.method-pill-save { color: #5b21b6; background: #f5f3ff; border-color: #ddd6fe; }

/* Inline variant headings inside a step body — a small label that pairs a
   method pill with a short description, sitting above each variant's code
   block. Reused by Step 4 (Protect your handler) and Step 5 (From the agent). */
.step-body h4.variant-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--fg);
}
.step-body h4.variant-h:first-of-type { margin-top: 16px; }

/* ---------- Footer ---------- */

.site-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  margin-top: 40px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 10px;
}
