/* ---------------------------------------------------------------------
 * 1. Font
 * ------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('/assets/inter-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------
 * 2. Tokens
 * ------------------------------------------------------------------- */
:root {
  --bg:#ffffff;
  --ink:#0f1222;
  --muted:#5c6072;
  --border:#e8e9ef;
  --accent:#5e6aff;
  --accent-2:#b053f0;
  --signal:#c9660b;
  --ok:#22a06b;
  --code-bg:#f7f8fb;
  --dark-bg:#0b0c10;
}

/* ---------------------------------------------------------------------
 * 3. Reset / base
 * ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 'Inter', ui-sans-serif, system-ui, sans-serif;
}

code, pre { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); }

ul { list-style: none; margin: 0; padding: 0; }

main { display: block; }

/* ---------------------------------------------------------------------
 * 4. Typography
 * ------------------------------------------------------------------- */
h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 780;
  letter-spacing: -.03em;
  line-height: 1.08;
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .75rem;
}

h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .5rem; }

.h1-grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  /* --ink, not --accent: at 12.8px even bold, --accent's contrast on
     --bg (~4.2:1) falls short of the 4.5:1 body-text target. */
  color: var(--ink);
  margin: 0 0 .75rem;
}

.lede { color: var(--muted); max-width: 60ch; margin: 0; }

/* ---------------------------------------------------------------------
 * 5. Layout primitives
 * ------------------------------------------------------------------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------------
 * 6. Nav
 * ------------------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a:not(.btn):not(.btn-outline) {
  color: var(--ink);
  font-size: .93rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:not(.btn):not(.btn-outline):hover { color: var(--accent); }

/* ---------------------------------------------------------------------
 * 7. Buttons
 * ------------------------------------------------------------------- */
.btn, .btn-outline, .btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .75em 1.3em;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

/* --ink, not --accent: white-on-accent measured ~4.22:1, short of the
   4.5:1 AA target for this button's text size/weight. Dark ink fill
   (~17:1) matches the direction-B mockup the owner chose. --accent stays
   reserved for links, :focus-visible, and the three gradient spots. */
.btn {
  background: var(--ink);
  color: #fff;
}
.btn:hover, .btn:focus-visible { background: #232741; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn-outline:hover, .btn-outline:focus-visible { border-color: var(--accent); color: var(--accent); }

/* White fill stays intentionally: now that .btn is dark ink, .btn-dark
   (used only inside .agent-dark, on --dark-bg) needs to remain the one
   button that still reads clearly against a dark surface. */
.btn-dark {
  background: #fff;
  color: var(--dark-bg);
  border-color: #fff;
}
.btn-dark:hover, .btn-dark:focus-visible { filter: brightness(0.92); }

/* ---------------------------------------------------------------------
 * 8. Hero
 * ------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
  padding: 112px 0 96px;
}

.hero-copy { max-width: 52ch; }

.hero-sub {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 20px 0 32px;
  max-width: 46ch;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

.hero-fact {
  margin: 20px 0 0;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------------
 * 9. Cards (shared shadow/border treatment)
 * ------------------------------------------------------------------- */
.code-card, .feature, .plan {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(15 18 34/.04), 0 8px 24px rgb(15 18 34/.06);
}

/* ---------------------------------------------------------------------
 * 10. Code card (hero visual + protocol panels reuse the token styles)
 * ------------------------------------------------------------------- */
.code-card {
  background: var(--code-bg);
  overflow: hidden;
  animation: rise .5s ease-out both;
}

.cc-head {
  display: flex;
  align-items: center;
  gap: .5em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow-x: auto;
}

.cc-line {
  display: block;
  padding: 3px 20px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .85rem;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre;
  animation: fadein .3s ease-out both;
}
.cc-line:first-child { margin-top: 14px; }
.cc-line:last-child { margin-bottom: 14px; }

/* tok-key stays --ink (not --accent): --accent's contrast on --code-bg
   is ~4:1, short of the 4.5:1 body-text target — fine for a large bold
   button label, not for a small monospace key, so weight alone carries
   the highlight here. tok-ok/tok-signal size up to clear the 18px+ bold
   "large text" AA threshold at their ~3.1–3.7:1 ratios against --code-bg. */
.tok-key { color: var(--ink); font-weight: 700; }
.tok-str { color: var(--muted); }
.tok-ok { color: var(--ok); font-weight: 700; font-size: 1.2rem; }
.tok-signal { color: var(--signal); font-weight: 700; font-size: 1.2rem; }

/* ---------------------------------------------------------------------
 * 11. How-it-works steps
 * ------------------------------------------------------------------- */
.steps {
  padding: 112px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

/* The section heading is a grid item too (it's a direct child of .steps
   alongside the three .step cards) — without this it would take the
   first column cell and push the cards out of their 3-across row. Spanning
   every column keeps it full-width at both 3-column and the <=640px
   1-column breakpoint below, where "1 / -1" still just spans the one
   column that exists. */
.steps h2 { grid-column: 1 / -1; }

.step { display: flex; flex-direction: column; gap: 12px; }

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--code-bg);
  /* --ink, not --accent: at this badge's size, --accent's contrast on
     --code-bg falls short of 4.5:1 for regular/bold small text. */
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
}

/* ---------------------------------------------------------------------
 * 12. Protocol tabs (CSS-only radio pattern, no JS)
 * ------------------------------------------------------------------- */
.protocols { padding: 112px 0; }

.sr-tab {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.tabs-row {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 24px 0 0;
}

.tab-label {
  padding: 10px 18px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  user-select: none;
}
.tab-label:hover { color: var(--ink); }

#tab-rest:checked ~ .tabs-row label[for="tab-rest"],
#tab-mcp:checked ~ .tabs-row label[for="tab-mcp"],
#tab-smtp:checked ~ .tabs-row label[for="tab-smtp"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

#tab-rest:focus-visible ~ .tabs-row label[for="tab-rest"],
#tab-mcp:focus-visible ~ .tabs-row label[for="tab-mcp"],
#tab-smtp:focus-visible ~ .tabs-row label[for="tab-smtp"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panels { margin-top: 20px; }

.panel {
  display: none;
  margin: 0;
  padding: 20px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .85rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

#tab-rest:checked ~ .panels #panel-rest,
#tab-mcp:checked ~ .panels #panel-mcp,
#tab-smtp:checked ~ .panels #panel-smtp {
  display: block;
}

/* ---------------------------------------------------------------------
 * 13. Features grid
 * ------------------------------------------------------------------- */
.features {
  padding: 112px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Same reasoning as .steps h2 above: the heading is a grid item too (a
   direct child of .features alongside the six .feature cards) — without
   this it would take the first column cell and push the cards out of
   their 3-across rows. */
.features h2 { grid-column: 1 / -1; }

.feature { padding: 28px; background: var(--bg); }
.feature h3 { color: var(--ink); }
.feature p { margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------------
 * 14. Agent-first dark section (full-bleed, the only dark surface)
 * ------------------------------------------------------------------- */
.agent-dark {
  width: 100%;
  background: var(--dark-bg);
  color: #fff;
  padding: 112px 0;
}
.agent-dark p { color: rgb(255 255 255/.72); }
.agent-dark a:not(.btn-dark) { color: #fff; }
.agent-dark .code-card {
  background: rgb(255 255 255/.06);
  border-color: rgb(255 255 255/.14);
  box-shadow: none;
}
.agent-dark .cc-head { border-bottom-color: rgb(255 255 255/.14); color: rgb(255 255 255/.6); }
.agent-dark .cc-line { color: #fff; }

/* ---------------------------------------------------------------------
 * 15. Pricing
 * ------------------------------------------------------------------- */
.pricing {
  padding: 112px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Same reasoning as .steps h2 / .features h2 above: the heading is a grid
   item too (a direct child of .pricing alongside the three .plan cards). */
.pricing h2 { grid-column: 1 / -1; }

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--bg);
  overflow: hidden;
}

.plan-popular {
  border-color: transparent;
}
.plan-popular::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.plan-price {
  font-size: 2.4rem;
  font-weight: 780;
  letter-spacing: -.02em;
  color: var(--ink);
}
.plan-price span { font-size: 1rem; font-weight: 500; color: var(--muted); }

/* Tinted, not filled: white-on-accent measured ~4.22:1 here too. A soft
   accent tint with --ink text keeps the pill on-brand while landing at
   full contrast. */
.badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(94, 106, 255, .12);
  color: var(--ink);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ---------------------------------------------------------------------
 * 16. FAQ
 * ------------------------------------------------------------------- */
.faq { padding: 112px 0; max-width: 760px; margin: 0 auto; }

.faq details {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  flex: none;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent);
  transition: transform .15s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* ---------------------------------------------------------------------
 * 17. Final CTA band (gradient border wrapper + solid inner block)
 *
 * .cta-band-wrap carries the section's vertical rhythm and is combined
 * with .container on the same element (class="cta-band-wrap container")
 * for horizontal centering — so it must only ever set margin-top/
 * margin-bottom here, never the margin shorthand. .container sets
 * margin: 0 auto for centering; a later same-specificity "margin: … 0"
 * shorthand rule would zero out that auto, pinning the whole band to
 * the left edge on any viewport wider than 1080px+48px (exactly the bug
 * this replaced). The gradient border itself now lives on the nested
 * .cta-band div, which carries no .container class and so has no such
 * conflict to avoid.
 * ------------------------------------------------------------------- */
.cta-band-wrap {
  margin-top: 112px;
  margin-bottom: 112px;
}

.cta-band {
  padding: 2px;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.cta-band-inner {
  border-radius: 18px;
  background: var(--bg);
  padding: 64px 40px;
  text-align: center;
}
.cta-band-inner h2 { margin: 0 0 24px; }

/* ---------------------------------------------------------------------
 * 18. Footer
 * ------------------------------------------------------------------- */
.footer {
  padding: 48px 0 64px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: .88rem;
  color: var(--muted);
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------------------------------------------------------------------
 * 19. Motion: hero card rise + line stagger
 * ------------------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.cc-line:nth-child(1) { animation-delay: .15s; }
.cc-line:nth-child(2) { animation-delay: .23s; }
.cc-line:nth-child(3) { animation-delay: .31s; }
.cc-line:nth-child(4) { animation-delay: .39s; }
.cc-line:nth-child(5) { animation-delay: .47s; }
.cc-line:nth-child(6) { animation-delay: .55s; }
.cc-line:nth-child(7) { animation-delay: .63s; }
.cc-line:nth-child(8) { animation-delay: .71s; }

/* ---------------------------------------------------------------------
 * 20. Focus
 * ------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
 * 21. Responsive
 * ------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 88px 0 64px; }
  .hero-copy { max-width: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-links a.hide-sm { display: none; }
  .features, .steps, .pricing { grid-template-columns: 1fr; }
  .steps, .protocols, .features, .agent-dark, .pricing, .faq { padding: 72px 0; }
  .cta-band-wrap { margin-top: 72px; margin-bottom: 72px; }
  .cta-band-inner { padding: 48px 24px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 72px 0 48px; }
  .cc-head, .cc-line { padding-left: 16px; padding-right: 16px; }
  .plan, .feature { padding: 24px; }
}

/* ---------------------------------------------------------------------
 * 22. Reduced motion: kill every animation/transition above
 * ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
