/* go-agentic-gateway · marketing site
   Visual identity mirrors the embedded WebUI: deep teal/navy ground, a cyan
   accent and an amber node, with Newsreader for display type, Instrument Sans
   for UI and body, and Spline Sans Mono for labels and code.

   Sections, in page order:
     1 tokens        4 buttons       7 routes + diagram   10 get started
     2 base          5 navigation    8 ledger             11 shots + cta
     3 type/layout   6 hero          9 access checks      12 footer, reveal
*/

/* ---- 1. tokens ---- */
:root {
  --serif: "Newsreader", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;

  --accent: #1e9fe0;
  --accent-2: #4fd4f7;
  --accent-soft: rgba(30, 159, 224, 0.14);
  --glow: rgba(30, 159, 224, 0.28);
  --amber: #f5a524;            /* the node at the gate */
  --mint: #7fe3cb;

  --bg: #061114;
  --bg-2: #081619;
  --surface: #0c1d22;
  --surface-2: #122830;
  --inset: #081a1e;
  --line: rgba(233, 239, 241, 0.14);
  --line-strong: rgba(233, 239, 241, 0.30);
  --text: #e9eef1;
  --text-2: #a6b8bd;
  --text-3: #7f949b;

  --radius: 22px;
  --radius-sm: 12px;
  --maxw: 1120px;
  --gap: clamp(1rem, 3vw, 2rem);

  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 32px 64px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

[data-theme="light"] {
  --accent: #0d72ad;
  --accent-2: #1e9fe0;
  --accent-soft: #e4eff5;
  --glow: rgba(30, 159, 224, 0.22);

  --bg: #eff2f4;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f9fa;
  --inset: #eef2f4;
  --line: #d5dddf;
  --line-strong: #b9c4c8;
  --text: #141a1d;
  --text-2: #4f5d61;
  --text-3: #5f6f73;

  --shadow-md: 0 6px 16px rgba(14, 32, 38, 0.08), 0 2px 6px rgba(14, 32, 38, 0.05);
  --shadow-lg: 0 26px 52px rgba(14, 32, 38, 0.12);

  color-scheme: light;
}

/* ---- 2. base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.02rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(60rem 40rem at 78% -8%, var(--glow), transparent 60%),
    radial-gradient(48rem 36rem at -12% 12%, rgba(127, 227, 203, 0.06), transparent 55%);
  background-attachment: fixed;
}

/* faint technical grid over the hero area only */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 78vh;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

:where(h1, h2, h3) { font-family: var(--serif); font-weight: 500; letter-spacing: -0.012em; }

a { color: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #041420;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---- 3. type and layout helpers ---- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.1rem, 4vw, 2rem);
  position: relative;
  z-index: 1;
}
.prose.wide { max-width: 40rem; }

.kicker,
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 1rem;
}
.eyebrow { display: inline-block; padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }

h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.06;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.section-lead { color: var(--text-2); font-size: 1.1rem; max-width: 34rem; margin: 0 0 2rem; }
.prose p { margin: 0 0 1.15rem; color: var(--text-2); }
.prose p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--accent-soft);
  color: var(--accent-2);
  padding: 0.08em 0.38em;
  border-radius: 6px;
}
.prose code { color: var(--text); }

/* ---- 4. buttons ---- */
.btn {
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent);
  color: #041420;
  box-shadow: 0 6px 18px -6px var(--glow);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 26px -8px var(--glow); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-2); }

/* ---- 5. navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem clamp(1.1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark { display: block; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.brand-name { font-family: var(--mono); font-weight: 500; font-size: 0.98rem; letter-spacing: -0.01em; }
.brand-dim { color: var(--text-3); }

.nav-links { display: flex; gap: 1.35rem; margin-left: auto; }
.nav-links a {
  text-decoration: none;
  color: var(--text-2);
  font-size: 0.95rem;
  position: relative;
  transition: color 0.15s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -14px;
  height: 2px;
  background: var(--accent);
  transition: right 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { right: 0; }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after { right: 0; }

.nav-cta { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent-2); border-color: var(--accent); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  position: absolute;
  transition: opacity 0.18s, transform 0.18s;
}
.ic-sun { opacity: 0; transform: rotate(-40deg); }
.ic-moon { opacity: 1; }
[data-theme="light"] .ic-sun { opacity: 1; transform: none; }
[data-theme="light"] .ic-moon { opacity: 0; transform: rotate(40deg); }

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.menu-toggle span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text-2); transition: transform 0.2s, opacity 0.2s; }
.menu-toggle span:nth-child(1) { top: 13px; }
.menu-toggle span:nth-child(2) { top: 18px; }
.menu-toggle span:nth-child(3) { top: 23px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  padding: 0.5rem clamp(1.1rem, 4vw, 2rem) 1rem;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a { padding: 0.7rem 0.2rem; color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--accent-2); }

/* ---- 6. hero ---- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(3.5rem, 9vw, 7.5rem) clamp(1.1rem, 4vw, 2rem) 3rem; position: relative; }
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.0;
  margin: 1.4rem 0 1.2rem;
  max-width: 16ch;
  font-weight: 400;
}
.hero-lead { font-size: 1.22rem; color: var(--text-2); max-width: 46rem; margin: 0 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.6rem; }

/* terminal mock */
.hero-term {
  max-width: 48rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--inset);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.term-bar span:first-child { background: var(--amber); }
.term-bar em { margin-left: auto; font-family: var(--mono); font-size: 0.78rem; color: var(--text-3); font-style: normal; }
.term {
  margin: 0;
  padding: 1.1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  color: var(--text-2);
}
.c-dim { color: var(--text-3); }
.c-ok { color: var(--accent-2); font-weight: 600; }
.c-bad { color: var(--amber); font-weight: 600; }

.hero-facts {
  list-style: none;
  margin: 2.6rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.hero-facts li { padding-left: 0.1rem; font-size: 0.98rem; color: var(--text-2); border-top: 2px solid var(--accent); padding-top: 0.7rem; }
.hero-facts b { color: var(--text); font-weight: 600; display: block; margin-bottom: 0.15rem; }

/* ---- 7. routes and request-flow diagram ---- */
.routes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 0 0 3rem; }
.route {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.4rem 1.5rem;
}
.route code { font-size: 1.02rem; background: none; color: var(--accent-2); padding: 0; }
.route p { margin: 0.6rem 0 0; color: var(--text-2); font-size: 0.97rem; }

.diagram {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.4rem;
  align-items: stretch;
}
.dcol,
.dside {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.5rem;
}
.dcol-main { display: flex; flex-direction: column; }
.dside { display: flex; flex-direction: column; }
.dside .node { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.darrow-side { padding: 0.9rem 0; }
.darrow-side .dash { height: 14px; }

.node {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 1rem 1.2rem;
}
.node-tag { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 0.35rem; }
.node-title { display: block; font-weight: 600; font-size: 1.02rem; }
.node-sub { display: block; color: var(--text-3); font-size: 0.86rem; margin-top: 0.25rem; }

.node-agent { border-color: var(--line-strong); }
.node-gw {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 34px -14px var(--glow);
}
.node-gw .node-title { font-family: var(--mono); font-size: 0.92rem; color: var(--accent-2); }
.node-gw .node-sub { color: var(--text-3); }
.node-audit { border-color: var(--mint); background: linear-gradient(180deg, rgba(127, 227, 203, 0.08), transparent); }
.node-audit .node-title { color: var(--mint); }
.node-control { border-style: dashed; }

.darrow, .dbranch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.darrow .dash, .dbranch .dash {
  width: 2px;
  height: 22px;
  background: linear-gradient(var(--accent), var(--accent-2));
}
.dbranch .dash { height: 16px; background: var(--line-strong); }
.drow { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---- 8. feature ledger ---- */
.ledger { border-top: 1px solid var(--line); margin-top: 0.5rem; }
.ledger-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.ledger-key code {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: none;
  color: var(--accent-2);
  border: 1px solid var(--line);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  display: inline-block;
}
.ledger-body { color: var(--text-2); max-width: 42rem; }
.ledger-body code { font-size: 0.9em; }
.ledger-body a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.ledger-body a:hover { text-decoration: underline; }

/* ---- 9. access checks ---- */
.gov-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.gov-note {
  color: var(--text-2);
  font-size: 0.98rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  padding: 1rem 1.2rem;
  border-radius: 12px;
  max-width: 34rem;
}

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.checks li { display: flex; gap: 1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color 0.15s, transform 0.15s; }
.checks li:hover { border-color: var(--accent); transform: translateX(3px); }
.checks h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; margin: 0 0 0.25rem; }
.checks p { margin: 0; color: var(--text-2); font-size: 0.93rem; }
.ck-n {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---- 10. get started ---- */
.start-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.steps { margin: 1.5rem 0; }
.steps h3 { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; margin: 0 0 0.6rem; color: var(--text); }
pre {
  margin: 0;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-2);
  box-shadow: var(--shadow-md);
}
.start-fineprint { font-size: 0.9rem; color: var(--text-3); }

.start-docs {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.5rem;
}
.start-docs h3 { margin: 0 0 1rem; font-family: var(--sans); font-size: 0.95rem; }
.start-docs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.start-docs a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.start-docs a:hover { text-decoration: underline; }
.start-docs span { display: block; color: var(--text-3); font-size: 0.86rem; font-weight: 400; margin-top: 0.15rem; }
.start-docs li code { font-weight: 400; }

/* ---- 11. console shots and cta band ---- */
.shot { margin: 2.4rem 0 0; }
.shot-frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--inset);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.shot-frame img { display: block; width: 100%; height: auto; }
.shot figcaption {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.55;
  margin-top: 0.75rem;
}
.shot figcaption a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.shot figcaption a:hover { text-decoration: underline; }
.shot.narrow { max-width: 34rem; }

.cta-band {
  margin-top: 3rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(40rem 20rem at 50% -30%, var(--glow), transparent 70%),
    var(--surface);
  padding: clamp(2rem, 5vw, 3.5rem);
}
.cta-band h2 { margin: 0 0 1.4rem; }
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.8rem; }

/* ---- 12. footer and reveal ---- */
.foot { border-top: 1px solid var(--line); margin-top: 3rem; background: var(--bg-2); position: relative; z-index: 1; }
.foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem clamp(1.1rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  align-items: start;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.92rem; }
.foot-links a { color: var(--text-2); text-decoration: none; }
.foot-links a:hover { color: var(--accent-2); }
.foot-meta { grid-column: 1 / -1; margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.84rem; font-family: var(--mono); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .diagram,
  .start-grid,
  .gov-grid { grid-template-columns: 1fr; }
  .routes { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: 1fr; gap: 0.9rem; }
  .foot-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ledger-row { grid-template-columns: 1fr; gap: 0.7rem; }
  .drow { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
