/* ============================================================================
   Latch — public marketing site
   Design: technical-editorial. Literary serif display + monospace DNS labels +
   clean sans body. Signal-lime accent (reads "connected/live"). Dual theme via
   prefers-color-scheme; code panels stay terminal-dark in both.
   Self-contained: no external fonts, no external assets, no build step.
   ========================================================================== */

/* ---- Tokens: light is the base, dark overrides below ---------------------- */
:root {
  --bg:         #f4f3ec;
  --bg-2:       #ebe8db;
  --surface:    #ffffff;
  --surface-2:  #faf9f2;
  --ink:        #16180f;
  --ink-2:      #55584b;
  --ink-3:      #83867a;
  --line:       rgba(20, 22, 15, 0.11);
  --line-2:     rgba(20, 22, 15, 0.055);

  --accent:      #b7e82b;              /* brand chip fill (constant across themes) */
  --accent-ink:  #10120a;              /* text that sits ON the lime chip */
  --accent-text: #3f6d0a;              /* readable accent for links/emphasis (light) */
  --accent-soft: rgba(120, 168, 20, 0.13);

  --ok:      #3f8f2f;
  --warn:    #a9700d;
  --danger:  #b23a2f;

  /* terminal panels are dark in BOTH themes — a deliberate signature */
  --code-bg:   #0d0f09;
  --code-ink:  #e7ecd8;
  --code-dim:  #7f8a6c;
  --code-line: rgba(255, 255, 255, 0.09);

  --shadow-sm: 0 1px 2px rgba(20, 26, 0, 0.05);
  --shadow-md: 0 1px 2px rgba(20, 26, 0, 0.05), 0 16px 34px -18px rgba(24, 34, 0, 0.28);
  --shadow-lg: 0 2px 4px rgba(20, 26, 0, 0.06), 0 34px 60px -28px rgba(24, 34, 0, 0.36);

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --maxw:      1160px;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --font-body:    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0a0c08;
    --bg-2:       #0e110b;
    --surface:    #13160e;
    --surface-2:  #191d12;
    --ink:        #f1f4e9;
    --ink-2:      #a7ac9b;
    --ink-3:      #6d7263;
    --line:       rgba(255, 255, 255, 0.10);
    --line-2:     rgba(255, 255, 255, 0.05);

    --accent:      #c6f043;
    --accent-ink:  #0a0c08;
    --accent-text: #c6f043;
    --accent-soft: rgba(198, 240, 67, 0.13);

    --ok:      #7cd166;
    --warn:    #e0a53a;
    --danger:  #e0776b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.5), 0 22px 44px -20px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.55), 0 40px 70px -30px rgba(0, 0, 0, 0.8);
  }
}

/* ---- Reset / base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2.5px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 44px); }

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; z-index: 100;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---- Typography ----------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  font-weight: 600;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }

h1 { font-size: clamp(2.7rem, 6.4vw, 4.7rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.08; }
h3 { font-size: clamp(1.28rem, 2.2vw, 1.55rem); letter-spacing: -0.015em; }

.lede { font-size: clamp(1.08rem, 1.9vw, 1.34rem); color: var(--ink-2); line-height: 1.55; max-width: 44ch; }

.mono { font-family: var(--font-mono); }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.82em 1.35em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 550;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  transition: transform .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { box-shadow: 0 8px 22px -8px var(--accent); transform: translateY(-1px); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink-3); background: var(--surface-2); }

.btn .arrow { transition: transform .18s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Header / nav --------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 1.5rem; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-size: 1.42rem; font-weight: 600; letter-spacing: -0.02em; }
.brand .mark { flex: none; }
.brand .mark rect, .brand .mark path { stroke: var(--ink); }
.brand .mark .lit { fill: var(--accent); stroke: none; }

.nav-links { display: flex; align-items: center; gap: 1.7rem; list-style: none; }
.nav-links a { color: var(--ink-2); font-size: 0.95rem; transition: color .15s var(--ease); position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 0.75rem; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.nav-toggle svg { stroke: var(--ink); }

@media (max-width: 860px) {
  .nav-links, .nav-cta .btn--ghost { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav[data-open="true"] + .mobile-menu { display: block; }
}

.mobile-menu { display: none; border-bottom: 1px solid var(--line-2); background: var(--surface); }
.mobile-menu ul { list-style: none; padding: 12px clamp(20px, 5vw, 44px) 20px; display: grid; gap: 4px; }
.mobile-menu a { display: block; padding: 12px 4px; color: var(--ink); border-bottom: 1px solid var(--line-2); font-family: var(--font-mono); font-size: 0.92rem; }
.mobile-menu .btn { margin-top: 12px; width: 100%; justify-content: center; }

/* ---- Section scaffolding -------------------------------------------------- */
section { position: relative; }
.section-pad { padding-block: clamp(72px, 11vw, 132px); }
.section-head { max-width: 62ch; margin-bottom: clamp(38px, 6vw, 60px); }
.section-head .eyebrow { display: block; margin-bottom: 1rem; }
.section-head p { color: var(--ink-2); font-size: 1.08rem; margin-top: 1.1rem; max-width: 56ch; }

.rule { height: 1px; background: var(--line); border: 0; }

/* ---- Hero ----------------------------------------------------------------- */
.hero { padding-top: clamp(56px, 8vw, 92px); padding-bottom: clamp(56px, 8vw, 96px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(38px, 5vw, 72px); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 46px; } }

.hero .eyebrow { display: inline-flex; align-items: center; gap: 0.55rem; margin-bottom: 1.5rem; }
.hero h1 { margin-bottom: 1.4rem; }
.hero h1 .accent { font-style: italic; color: var(--accent-text); }
.hero .lede { max-width: 48ch; margin-bottom: 2.1rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }
.hero-note { margin-top: 1.5rem; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.01em; }
.hero-note b { color: var(--ink-2); font-weight: 600; }

/* signature: the live DNS-records patch panel */
.panel {
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  color: var(--code-ink);
}
.panel-bar { display: flex; align-items: center; gap: 0.5rem; padding: 13px 16px; border-bottom: 1px solid var(--code-line); }
.panel-bar .dots { display: flex; gap: 6px; }
.panel-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,0.16); }
.panel-bar .host { margin-left: auto; font-size: 12px; color: var(--code-dim); letter-spacing: 0.02em; }
.panel-title { padding: 15px 18px 4px; font-size: 12px; color: var(--code-dim); letter-spacing: 0.05em; text-transform: uppercase; }
.panel-body { padding: 6px 12px 14px; display: grid; gap: 2px; }

.rec {
  display: grid; grid-template-columns: 74px 1fr auto; align-items: center;
  gap: 10px; padding: 11px 10px; border-radius: 10px;
  border: 1px solid transparent;
}
.rec:hover { background: rgba(255,255,255,0.03); }
.rec .rtype {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 7px; border-radius: 6px; text-align: center;
  background: rgba(198,240,67,0.14); color: var(--accent);
}
.rec .rval { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rec .rhost { font-size: 13px; color: var(--code-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .rdata { font-size: 11.5px; color: var(--code-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec .rstate { font-size: 11px; display: inline-flex; align-items: center; gap: 5px; color: var(--code-dim); }
.rec .rstate .tick { color: #8fe36f; }

.panel-foot { display: flex; align-items: center; gap: 0.6rem; padding: 13px 18px; border-top: 1px solid var(--code-line); font-size: 12px; color: var(--code-dim); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fe36f; box-shadow: 0 0 0 0 rgba(143,227,111,0.6); animation: pulse 2.4s var(--ease) infinite; flex: none; }
.panel-foot b { color: var(--code-ink); font-weight: 600; }
.panel-foot .spacer { margin-left: auto; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(143,227,111,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(143,227,111,0); }
  100% { box-shadow: 0 0 0 0 rgba(143,227,111,0); }
}

/* trust strip */
.trust { border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.trust .container { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 30px; padding-block: 20px; }
.trust .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.trust .items { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-left: auto; }
.trust .items span { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.trust .items .auto::before { content: "●"; color: var(--ok); font-size: 9px; vertical-align: middle; margin-right: 7px; }
.trust .items .staged::before { content: "◐"; color: var(--warn); font-size: 11px; vertical-align: middle; margin-right: 6px; }
.trust .items .manual::before { content: "○"; color: var(--ink-3); font-size: 11px; vertical-align: middle; margin-right: 6px; }

/* ---- Problem section ------------------------------------------------------ */
.problem { background: var(--bg-2); border-block: 1px solid var(--line-2); }
.fail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 720px) { .fail-grid { grid-template-columns: 1fr; } }
.fail {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.fail .tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; color: var(--danger); text-transform: uppercase; font-weight: 600; }
.fail h3 { font-size: 1.16rem; margin: 10px 0 8px; font-family: var(--font-body); font-weight: 620; letter-spacing: -0.01em; }
.fail p { color: var(--ink-2); font-size: 0.97rem; }
.fail p code { font-family: var(--font-mono); font-size: 0.86em; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; color: var(--ink); }

/* ---- How it works --------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; } }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 26px 30px; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.step .num { font-family: var(--font-mono); font-size: 12px; color: var(--accent-text); letter-spacing: 0.1em; }
.step h3 { font-family: var(--font-body); font-weight: 640; font-size: 1.28rem; letter-spacing: -0.015em; margin: 14px 0 10px; display: flex; align-items: center; gap: 0.55rem; }
.step h3 svg { color: var(--accent-text); flex: none; }
.step p { color: var(--ink-2); font-size: 0.98rem; margin-bottom: 16px; }
.step ul { list-style: none; display: grid; gap: 8px; }
.step li { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); padding-left: 18px; position: relative; line-height: 1.45; }
.step li::before { content: "→"; position: absolute; left: 0; color: var(--accent-text); }
.step .status-line { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.step .status-line b { color: var(--ink-2); font-weight: 600; }

/* ---- Providers ------------------------------------------------------------ */
.prov-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .prov-grid { grid-template-columns: 1fr; } }

.prov-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.prov-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.prov-row:last-child { border-bottom: 0; }
.prov-row .name { font-weight: 600; font-size: 1.02rem; display: flex; align-items: center; gap: 0.6rem; }
.prov-row .desc { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.badge {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge--auto   { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge--staged { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.badge--manual { background: var(--line-2); color: var(--ink-2); border-color: var(--line); }

.prov-note { align-self: center; }
.prov-note h3 { font-family: var(--font-body); font-weight: 640; font-size: 1.35rem; letter-spacing: -0.015em; margin-bottom: 14px; }
.prov-note p { color: var(--ink-2); margin-bottom: 16px; font-size: 1rem; }
.prov-note .legend { display: grid; gap: 10px; }
.prov-note .legend div { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); display: flex; gap: 0.6rem; align-items: baseline; }
.prov-note .legend .dot { flex: none; margin-top: 1px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--auto { background: var(--ok); }
.dot--staged { background: var(--warn); }
.dot--manual { border: 1.5px solid var(--ink-3); }

/* ---- AI-native ------------------------------------------------------------ */
.ai { background: var(--bg-2); border-block: 1px solid var(--line-2); }
.ai-grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(30px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .ai-grid { grid-template-columns: 1fr; } }
.ai-feat { display: grid; gap: 16px; margin-top: 26px; }
.ai-feat .item { display: flex; gap: 14px; }
.ai-feat .item .ic { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-text); }
.ai-feat .item h3 { font-family: var(--font-body); font-weight: 640; font-size: 1.08rem; letter-spacing: -0.01em; margin-bottom: 4px; }
.ai-feat .item p { color: var(--ink-2); font-size: 0.96rem; }
.ai-feat .item p code { font-family: var(--font-mono); font-size: 0.85em; color: var(--accent-text); }

/* conversational transcript card */
.chat { background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.chat-body { padding: 22px; display: grid; gap: 14px; }
.msg { max-width: 86%; padding: 12px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.msg.user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; font-family: var(--font-body); }
.msg.agent { justify-self: start; background: rgba(255,255,255,0.05); color: var(--code-ink); border: 1px solid var(--code-line); border-bottom-left-radius: 5px; font-family: var(--font-body); }
.msg.tool { justify-self: start; background: transparent; border: 1px dashed var(--code-line); color: var(--code-dim); font-family: var(--font-mono); font-size: 12px; max-width: 100%; }
.msg.tool b { color: var(--accent); font-weight: 600; }
.msg .k { color: var(--code-dim); }

/* ---- Pricing -------------------------------------------------------------- */
.price-wedge { text-align: center; margin-bottom: clamp(40px, 6vw, 58px); }
.price-wedge .compare { display: inline-flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; font-family: var(--font-mono); font-size: 0.95rem; margin-top: 1.2rem; color: var(--ink-2); }
.price-wedge .compare .them { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--ink-3); }
.price-wedge .compare .us { color: var(--accent-text); font-weight: 700; font-size: 1.15rem; }
.price-wedge .compare .vs { color: var(--ink-3); }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 880px) { .tiers { grid-template-columns: 1fr; } }
.tier {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px 28px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.tier--wedge { border-color: var(--accent); box-shadow: var(--shadow-md); position: relative; }
.tier--wedge::before {
  content: "The wedge"; position: absolute; top: -12px; left: 28px;
  background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.tier .tname { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.tier .tprice { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; letter-spacing: -0.02em; margin: 10px 0 2px; display: flex; align-items: baseline; gap: 0.3rem; }
.tier .tprice small { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-3); font-weight: 400; letter-spacing: 0; }
.tier .troadmap { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); padding: 3px 9px; border-radius: 999px; margin: 10px 0 2px; }
.tier .tsummary { color: var(--ink-2); font-size: 0.95rem; margin: 12px 0 20px; }
.tier ul { list-style: none; display: grid; gap: 11px; margin-bottom: 26px; }
.tier li { font-size: 0.94rem; color: var(--ink-2); padding-left: 26px; position: relative; line-height: 1.45; }
.tier li::before { content: ""; position: absolute; left: 0; top: 7px; width: 15px; height: 9px; border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(-45deg); }
.tier li.muted { color: var(--ink-3); }
.tier li.muted::before { border-color: var(--ink-3); }
.tier .btn { margin-top: auto; justify-content: center; }
.price-fine { text-align: center; margin-top: 26px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); max-width: 66ch; margin-inline: auto; line-height: 1.6; }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band { text-align: center; }
.cta-band h2 { max-width: 18ch; margin: 0 auto 1rem; }
.cta-band p { color: var(--ink-2); max-width: 52ch; margin: 0 auto 2rem; }
.cta-band .hero-cta { justify-content: center; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-block: clamp(48px, 7vw, 72px); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px 24px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--ink-2); font-size: 0.95rem; max-width: 34ch; }
.footer-brand .mono { color: var(--ink-3); font-size: 12px; margin-top: 16px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px; }
.footer-col ul { list-style: none; display: grid; gap: 11px; }
.footer-col a { color: var(--ink-2); font-size: 0.94rem; transition: color .15s var(--ease); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--line-2); padding-block: 22px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.footer-bottom p { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.footer-bottom .honest { color: var(--ink-2); }

/* ---- Docs page ------------------------------------------------------------ */
.docs-layout { display: grid; grid-template-columns: 232px 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; padding-block: clamp(40px, 6vw, 64px); }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } .docs-nav { position: static; } }

.docs-nav { position: sticky; top: 90px; }
.docs-nav h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 12px; }
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; display: grid; gap: 3px; }
.docs-nav a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--ink-2); font-size: 0.92rem; border-left: 2px solid transparent; }
.docs-nav a:hover { color: var(--ink); background: var(--surface-2); }

.docs-main { min-width: 0; max-width: 760px; }
.docs-main > section { scroll-margin-top: 88px; margin-bottom: clamp(44px, 6vw, 64px); }
.docs-hero { padding: 6px 0 8px; }
.docs-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.docs-hero .lede { max-width: 60ch; }
.docs-main h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 0.7rem; padding-top: 8px; }
.docs-main h3 { font-family: var(--font-body); font-weight: 660; font-size: 1.12rem; letter-spacing: -0.01em; margin: 26px 0 10px; }
.docs-main p { color: var(--ink-2); margin-bottom: 14px; max-width: 68ch; }
.docs-main p code, .docs-main li code, td code { font-family: var(--font-mono); font-size: 0.86em; background: var(--accent-soft); color: var(--ink); padding: 1.5px 6px; border-radius: 5px; }
.docs-main ul { color: var(--ink-2); margin: 0 0 16px 1.1rem; display: grid; gap: 8px; }
.docs-main ul li { padding-left: 4px; }
.docs-lead-note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 20px; }
.docs-lead-note p { margin: 0; color: var(--ink); font-size: 0.95rem; }

.callout { border: 1px solid var(--line); border-left: 3px solid var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 16px 18px; margin: 18px 0; }
.callout .clabel { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn); font-weight: 600; }
.callout p { margin: 6px 0 0; color: var(--ink-2); font-size: 0.94rem; }

/* code blocks */
.code {
  position: relative; background: var(--code-bg); border: 1px solid var(--code-line);
  border-radius: var(--radius); overflow: hidden; margin: 16px 0 20px; box-shadow: var(--shadow-sm);
}
.code-head { display: flex; align-items: center; gap: 0.6rem; padding: 10px 14px; border-bottom: 1px solid var(--code-line); }
.code-head .fname { font-family: var(--font-mono); font-size: 11.5px; color: var(--code-dim); letter-spacing: 0.02em; }
.code-head .method { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 5px; }
.method.post { background: rgba(198,240,67,0.16); color: #c6f043; }
.method.get { background: rgba(120,180,255,0.16); color: #94c4ff; }
.copy-btn { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--code-dim); background: transparent; border: 1px solid var(--code-line); border-radius: 7px; padding: 4px 10px; transition: color .15s var(--ease), border-color .15s var(--ease); }
.copy-btn:hover { color: var(--code-ink); border-color: var(--code-dim); }
.copy-btn.copied { color: #8fe36f; border-color: #8fe36f; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.code code { font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: var(--code-ink); white-space: pre; }
.code .c-key { color: #c6f043; }
.code .c-str { color: #e0c987; }
.code .c-com { color: var(--code-dim); font-style: italic; }
.code .c-fn { color: #94c4ff; }
.code .c-punc { color: var(--code-dim); }

/* record-type table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 16px 0 20px; }
table { border-collapse: collapse; width: 100%; min-width: 540px; font-size: 0.92rem; }
thead th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { color: var(--ink); font-family: var(--font-mono); font-weight: 600; font-size: 0.86rem; }
td .rtype-badge { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }

.endpoint-list { display: grid; gap: 12px; margin: 16px 0; }
.endpoint { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-mono); font-size: 13px; }
.endpoint .m { font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 5px; flex: none; }
.endpoint .m.post { background: rgba(120,168,20,0.16); color: var(--accent-text); }
.endpoint .m.get { background: color-mix(in srgb, #3d7bd1 16%, transparent); color: #3d7bd1; }
.endpoint .path { color: var(--ink); }
.endpoint .ep-desc { margin-left: auto; color: var(--ink-3); font-size: 12px; font-family: var(--font-body); text-align: right; }
@media (max-width: 560px) { .endpoint { flex-wrap: wrap; } .endpoint .ep-desc { margin-left: 0; width: 100%; text-align: left; } }

/* ---- Scroll reveal -------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .live-dot { animation: none; }
  .btn, .step, .brand, .arrow { transition: none !important; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* staggered hero load (only when motion allowed) */
@media (prefers-reduced-motion: no-preference) {
  .hero .rise { opacity: 0; animation: rise .8s var(--ease) forwards; }
  .hero .rise-1 { animation-delay: .05s; }
  .hero .rise-2 { animation-delay: .15s; }
  .hero .rise-3 { animation-delay: .25s; }
  .hero .rise-4 { animation-delay: .35s; }
  .hero .rise-panel { opacity: 0; animation: rise-panel 1s var(--ease) .2s forwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes rise-panel { from { opacity: 0; transform: translateY(28px) scale(.985); } to { opacity: 1; transform: none; } }
