/* ==========================================================================
   NODAL — tokens, reset, primitives, shell.

   The design is print, not dashboard: warm paper, ink, hairlines, and one
   loud vermilion. Its sibling rebrand of the same reference went dark and
   oceanic; this one is deliberately the opposite so the two cannot be
   mistaken for the same template.

   Accent tokens are overwritten at boot from js/brand.js. The values here
   are the fallback for the moments before the module runs.
   ========================================================================== */

:root {
  /* Paper & ink */
  --paper:        #F7F3EC;
  --paper-2:      #F1EBE1;
  --paper-3:      #EAE2D5;
  --paper-card:   #FDFBF7;
  /* Four ink steps, every one of which clears WCAG AA (4.5:1) against ALL
     three paper tones — the worst case is --paper-2 in `.section.alt`.
     The first ramp looked right and was not: --faint sat at 2.6:1 and is
     used for real text (table headers, field labels, mono captions), not
     decoration. Measure before adding a step; the numbers on --paper-2 are
     16.4 / 8.9 / 6.4 / 5.0 and there is no room for a fifth. */
  --ink:          #191512;
  --ink-2:        #4A4239;
  --ink-3:        #5F574D;
  --faint:        #70685F;

  /* Handed to canvas as literal hex — canvas cannot read CSS vars. */
  --paper-rgbhex: #F7F3EC;
  --ink-rgbhex:   #191512;

  --vermilion:    #C13C16;
  --viridian:     #23624F;
  --ultramarine:  #333DB4;
  --clay:         #A33B3B;

  --line:         rgba(25, 21, 18, .12);
  --line-2:       rgba(25, 21, 18, .20);
  --line-3:       rgba(25, 21, 18, .34);

  --radius:       14px;
  --radius-lg:    20px;

  --shadow-sm:    0 1px 0 rgba(25,21,18,.05);
  --shadow:       0 2px 3px rgba(25,21,18,.04), 0 12px 28px -18px rgba(25,21,18,.30);
  --shadow-lg:    0 3px 6px rgba(25,21,18,.05), 0 30px 60px -34px rgba(25,21,18,.40);

  --wrap:         1200px;
  --nav-h:        66px;

  --sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  font-feature-settings: 'ss01' 1, 'cv05' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The plain-paper grain. One repeating conic pattern at very low alpha —
   no image asset, and it is what stops the flat fills reading as CSS. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  /* color-mix against the tokens, not rgb() literals of the same colours —
     the accents are mirrored in from js/brand.js at boot, and a literal here
     is a value that silently would not follow a rebrand. */
  background-image:
    radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--vermilion) 3%, transparent), transparent 42%),
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--viridian) 3%, transparent), transparent 40%);
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -.012em; }
h1, h2 { font-family: var(--display); line-height: 1.02; letter-spacing: -.018em; }
h3, h4 { font-family: var(--sans); font-weight: 560; letter-spacing: -.014em; line-height: 1.22; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: color-mix(in srgb, var(--vermilion) 18%, transparent); }

:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.wrap {
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}
@media (max-width: 640px) { .wrap { width: min(100% - 32px, var(--wrap)); } }

/* Grid and flex items default to `min-width: auto`, whose content-based
   minimum is the widest unbreakable descendant — a 620px table, a nowrap
   formula, a long mono address. That makes the TRACK wider than the
   viewport, and every sibling stretches with it, so the symptom shows up on
   innocent elements (a lifecycle list, a heading) while the real cause sits
   in a scroll container three columns away. Capping it at 0 lets the inner
   `overflow-x: auto` do its job. This is the single most common cause of
   horizontal scroll on a phone and it is worth fixing structurally. */
.duo > *, .grid-2 > *, .grid-3 > *, .split > *, .compare > *,
.rails > *, .steps > *, .stats > *, .bento > *, .phase > *,
.bounty > *, .sb > * { min-width: 0; }

.section { padding: clamp(64px, 8.5vw, 118px) 0; position: relative; }
.section.alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.section.rule { border-top: 1px solid var(--line); }

.section-head { max-width: 720px; margin-bottom: clamp(34px, 4.4vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
/* text-wrap: balance stops display headlines dropping a single short word
   onto a line of its own — "and by how / much." at 40px serif. */
.section-head h2 { font-size: clamp(34px, 5vw, 58px); margin-bottom: 16px; text-wrap: balance; }
.section-head .lede { color: var(--ink-2); font-size: clamp(16px, 1.35vw, 18.5px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--vermilion);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ''; width: 22px; height: 1px; background: currentColor; opacity: .55;
}
.section-head.center .eyebrow::after {
  content: ''; width: 22px; height: 1px; background: currentColor; opacity: .55;
}

/* ── Reveal ──────────────────────────────────────────────────────────── */
/* Scoped to .js so a script failure cannot hide the page. The class is set
   by an inline script in <head> before any stylesheet loads. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .62s cubic-bezier(.22,.7,.3,1) var(--d, 0ms),
              transform .62s cubic-bezier(.22,.7,.3,1) var(--d, 0ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
@media print { .js [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--bg);
  border-radius: 999px;
  font-size: 14.5px; font-weight: 520; letter-spacing: -.008em;
  cursor: pointer;
  transition: transform .18s, box-shadow .22s, background .18s, color .18s, border-color .18s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1.5px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 14px 22px; font-size: 15.5px; }
.btn-sm { padding: 8.5px 15px; font-size: 13.5px; }

.btn-accent { --bg: var(--vermilion); --fg: #FFF6F2; }
.btn-ghost {
  --bg: transparent; --fg: var(--ink);
  border-color: var(--line-2);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--paper-card); border-color: var(--line-3); }

/* A CTA whose destination does not exist yet. Still legible and still
   focusable — it routes to the roadmap — but it should not read as a live
   product link. */
.btn.is-pending { opacity: .82; }
.btn.is-pending:hover { opacity: 1; }

.disc {
  width: 19px; height: 19px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 14%, transparent);
  transition: transform .22s;
}
.disc svg { width: 11px; height: 11px; }
.btn:hover .disc { transform: translateX(2.5px); }

/* ── Cards, chips, tags ──────────────────────────────────────────────── */
.card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.2vw, 28px);
  position: relative;
}
.card.lit { transition: border-color .24s, box-shadow .28s, transform .24s; }
.card.lit:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.2px; color: var(--ink-2);
}
.chip svg { width: 14px; height: 14px; flex: none; }

.tag {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
}
.tag.on { color: var(--viridian); border-color: color-mix(in srgb, var(--viridian) 34%, transparent); }
.tag.hot { color: var(--vermilion); border-color: color-mix(in srgb, var(--vermilion) 34%, transparent); }

.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--viridian);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--viridian) 45%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
/* Deliberately NOT the live dot: a hollow ring, no pulse. Nothing on this
   site is deployed and the hero must not imply otherwise. */
.dot-wip {
  width: 6px; height: 6px; border-radius: 50%;
  border: 1.5px solid var(--vermilion);
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 90;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.nav.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); }

.nav-inner {
  width: min(100% - 40px, var(--wrap));
  margin-inline: auto;
  display: flex; align-items: center; gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name {
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: .01em;
}

.nav-links {
  display: flex; align-items: center; gap: 3px;
  padding-left: 20px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}
.nav-links a {
  display: block;
  padding: 7px 11px;
  font-size: 14.2px;
  color: var(--ink-2);
  border-radius: 8px;
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--ink); background: var(--paper-3); }
.nav-links a[aria-current='page'] { color: var(--ink); font-weight: 540; }
.nav-links a[aria-current='page']::after {
  content: ''; display: block; height: 1.5px; margin-top: 3px;
  background: var(--vermilion); border-radius: 2px;
}

.nav-cta { margin-left: auto; }

.nav-x {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  color: var(--ink-3);
  transition: color .18s, background .18s;
}
.nav-x:hover { color: var(--ink); background: var(--paper-3); }
.nav-x svg { width: 14px; height: 14px; }

/* Below 1000px this is the ONLY route to any other page, so it has to clear
   the 44px touch minimum. The border box stays 36x34 for the design; the hit
   area is expanded past it. */
.nav-burger {
  display: none;
  position: relative;
  width: 36px; height: 34px;
  background: none; border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 4px;
}
.nav-burger::after { content: ''; position: absolute; inset: -6px -5px; }
.nav-burger span {
  display: block; width: 15px; height: 1.5px; background: var(--ink);
  border-radius: 2px; transition: transform .24s, opacity .18s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.mobile-sheet {
  position: fixed; inset: var(--nav-h) 0 0; z-index: 89;
  background: var(--paper);
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
/* An author `display` beats the UA stylesheet's `[hidden] { display: none }`,
   so without this the sheet is permanently OPEN on every page below 1000px —
   covering the whole site until something toggles it. */
.mobile-sheet[hidden] { display: none; }
.mobile-sheet a {
  padding: 15px 4px;
  font-family: var(--display);
  font-size: 27px;
  border-bottom: 1px solid var(--line);
  animation: sheetIn .38s cubic-bezier(.22,.7,.3,1) backwards;
  animation-delay: calc(var(--i) * 38ms);
}
.mobile-sheet a[aria-current='page'] { color: var(--vermilion); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .mobile-sheet a { animation: none; } }

@media (max-width: 1000px) {
  .nav-links { display: none; }
  .nav-burger { display: grid; margin-left: auto; }
  .nav-cta, .nav-x { display: none; }
}
@media (min-width: 1001px) { .mobile-sheet { display: none !important; } }

/* ── Ticker ──────────────────────────────────────────────────────────── */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--paper-2);
  padding: 11px 0;
  position: relative; z-index: 1;
}
.ticker-track {
  display: flex; align-items: center; width: max-content;
  animation: slide 46s linear infinite;
}
.ticker-track span {
  font-family: var(--mono);
  font-size: 11.8px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.ticker-track i {
  display: block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--vermilion); opacity: .5;
  margin: 0 26px;
}
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: clamp(48px, 6vw, 72px) 0 30px;
  position: relative; z-index: 1;
}
/* Flex rather than a fixed grid: js/main.js removes any footer column left
   with no links (the socials column, while brand.js has no accounts in it),
   and a grid would keep holding an empty track open on the right. */
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 52px);
}
.footer-brand { flex: 2.1 1 300px; }
.footer-col { flex: 1 1 150px; }
.footer-brand p {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 14.6px;
  max-width: 38ch;
}
.footer-col h2 {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint);
}
.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 14.6px;
  color: var(--ink-2);
  transition: color .16s;
}
.footer-col a:hover { color: var(--vermilion); }

.ca-pill {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 16px;
  padding: 7px 12px;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.ca-pill .ca-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--faint); }
.ca-pill .ca-v { font-size: 12px; color: var(--ink-2); }
.ca-pill.copied .ca-v { color: var(--viridian); }

.demo-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 7px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 9px;
  font-size: 12.6px;
  color: var(--ink-3);
}
.demo-badge svg { width: 14px; height: 14px; flex: none; }

.footer-bottom {
  margin-top: clamp(34px, 4vw, 52px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  font-size: 13.4px; color: var(--ink-3);
}
.socials { display: flex; gap: 6px; }
.socials a {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink-3);
  transition: color .18s, border-color .18s, background .18s;
}
.socials a:hover { color: var(--ink); border-color: var(--line-2); background: var(--paper-card); }
.socials svg { width: 14px; height: 14px; }

@media (max-width: 860px) {
  .footer-brand { flex-basis: 100%; }
}
@media (max-width: 520px) {
  .footer-col { flex-basis: 100%; }
  /* Single-column footer means eleven stacked full-width rows — they need to
     be tappable, not just clickable. */
  .footer-col a { padding: 9px 0; }
  .socials a { width: 40px; height: 40px; }
}

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.faq { display: flex; flex-direction: column; gap: 10px; }
.qa {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.qa[open] { border-color: var(--line-2); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 16.2px; font-weight: 520; letter-spacing: -.012em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa-ic {
  flex: none;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--ink-3);
  transition: transform .24s, color .2s, border-color .2s;
}
.qa-ic svg { width: 12px; height: 12px; }
.qa[open] .qa-ic { transform: rotate(45deg); color: var(--vermilion); border-color: color-mix(in srgb, var(--vermilion) 34%, transparent); }
.qa-body { padding: 0 20px 19px; }
.qa-body p { color: var(--ink-2); font-size: 15.2px; max-width: 74ch; }

.faq-group { margin-bottom: 34px; }
.faq-group .qa { margin-bottom: 10px; }
.faq-group-h {
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--vermilion);
  margin-bottom: 14px;
}
