/* ============================================================
   blynk.ae — brand tokens
   Palette derived from frontend/public/blynk-thunder.svg and
   mirrored from frontend/app/globals.css so the marketing site
   and the console never drift apart.
   ============================================================ */

:root {
  --crimson: #c52a3d;
  --coral: #ff5d4c;
  --golden: #fed43d;
  --accent: #fefea5;
  --cyan: #5c8a8a;

  /* Same hues raised in lightness so they survive as *text* on the dark
     surfaces. Hue is held at ~351deg / ~180deg, so these still read as
     crimson and cyan rather than drifting into coral or teal. */
  --crimson-lift: #ee5c74;
  --cyan-lift: #7aa8a8;
  --cyan-deep: #47706f;

  /* --brand paints fills, rings, strokes and marks; --brand-ink is the
     text-safe counterpart. Never use --brand on type. */
  --brand: var(--crimson);
  --brand-ink: var(--crimson);
  --data-ink: var(--cyan-deep);
  --ok-ink: #2a6f4b;

  --ink: #1a1414;
  --muted: #5c4f4f;
  --faint: #7a6663;
  --surface: #fffaf8;
  --surface-2: #ffffff;
  --surface-3: #fff5f0;
  --line: #efe0da;
  --line-soft: #f6ebe6;

  --shadow-sm: 0 1px 2px rgba(26, 20, 20, .06), 0 2px 8px rgba(26, 20, 20, .04);
  --shadow-md: 0 4px 12px rgba(26, 20, 20, .07), 0 14px 40px rgba(26, 20, 20, .07);
  --shadow-lg: 0 10px 30px rgba(197, 42, 61, .1), 0 30px 80px rgba(26, 20, 20, .1);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1180px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="dark"] {
  --brand: var(--crimson);
  --brand-ink: var(--crimson-lift);
  --data-ink: var(--cyan-lift);
  --ok-ink: #6fd39b;

  --ink: #f7f1ef;
  --muted: #c3b3b0;
  --faint: #a2908c;
  --surface: #120e0e;
  --surface-2: #191414;
  --surface-3: #211a1a;
  --line: #2e2424;
  --line-soft: #241d1d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, .6), 0 40px 90px rgba(0, 0, 0, .5);
}

/* ── base ─────────────────────────────────────────────────── */

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

/* A class-level `display` beats the UA sheet's `[hidden] { display: none }`,
   which otherwise leaks .btn / .pill elements the demo means to keep offstage. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

/* Light type on a dark field blooms optically and reads a weight heavier
   than it is. Grayscale smoothing keeps the DM Sans stems honest. */
[data-theme="dark"] body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -.022em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6vw, 4.3rem); }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.14rem; }
p  { margin: 0; text-wrap: pretty; }
a  { color: inherit; text-decoration: none; }
img, svg { display: block; }

code { font-family: var(--mono); font-size: .88em; }

.wrap { width: min(100% - 3rem, var(--wrap)); margin-inline: auto; }

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus {
  position: fixed; inset-block-start: 12px; inset-inline-start: 12px; z-index: 999;
  background: var(--brand); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm);
}

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

.grad {
  background: linear-gradient(102deg, var(--crimson), var(--coral) 58%, var(--golden));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.wordmark { font-style: italic; font-weight: 600; letter-spacing: -.03em; }

/* ── buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font: inherit; font-weight: 500; font-size: .95rem;
  padding: .62rem 1.15rem; border-radius: 999px;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .18s, color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-lg { padding: .82rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: .4rem .85rem; font-size: .85rem; }

.btn-primary {
  background: linear-gradient(100deg, var(--crimson), var(--coral));
  color: #fff; box-shadow: 0 4px 14px rgba(197, 42, 61, .28);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(197, 42, 61, .38); transform: translateY(-1px); }

.btn-outline { border-color: var(--line); background: var(--surface-2); color: var(--ink); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-outline code { font-size: .9rem; }

.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-3); }

.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); cursor: pointer;
  transition: color .2s, border-color .2s, transform .3s var(--ease);
}
.icon-btn:hover { color: var(--brand-ink); border-color: var(--brand); transform: rotate(-18deg); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
[data-theme="light"] .i-moon, [data-theme="dark"] .i-sun { display: none; }

/* ── nav ──────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(1.5) blur(14px);
  background: color-mix(in oklab, var(--surface) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.nav-inner { display: flex; align-items: center; gap: 2rem; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.35rem; }
.brand img { transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-10deg) scale(1.1); }

.nav-links { display: flex; gap: 1.6rem; margin-inline-start: auto; font-size: .94rem; color: var(--muted); }
.nav-links a { position: relative; padding: .2rem 0; transition: color .2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--crimson), var(--golden));
  border-radius: 2px; transition: width .28s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: .6rem; }

@media (max-width: 940px) { .nav-links { display: none; } }
@media (max-width: 620px) { .nav-actions .btn-ghost { display: none; } }

/* ── hero ─────────────────────────────────────────────────── */

.hero { position: relative; padding: clamp(3.5rem, 8vw, 6.5rem) 0 0; overflow: hidden; }

.hero-glow {
  position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(46% 42% at 12% 8%, color-mix(in oklab, var(--golden) 42%, transparent), transparent 62%),
    radial-gradient(44% 40% at 88% 4%, color-mix(in oklab, var(--crimson) 26%, transparent), transparent 60%),
    radial-gradient(40% 46% at 62% 70%, color-mix(in oklab, var(--coral) 16%, transparent), transparent 65%);
  filter: blur(6px); pointer-events: none;
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.hero-grid-lines {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 20%, transparent 78%);
}

.hero-inner {
  position: relative; display: grid; gap: 3rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } .hero-art { order: -1; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.1rem;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 18%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in oklab, var(--brand) 4%, transparent); } }

.hero h1 { margin-bottom: 1.4rem; }

.lede { font-size: 1.12rem; color: var(--muted); max-width: 40rem; }
.lede strong { color: var(--ink); font-weight: 600; }
.lede em { font-style: italic; font-weight: 600; color: var(--ink); }

.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 2.4rem; }
.copy svg { fill: none; stroke: currentColor; stroke-width: 1.7; opacity: .6; }
.copy.copied { border-color: var(--cyan); color: var(--data-ink); }

.stats { display: flex; flex-wrap: wrap; gap: 2.4rem; margin: 0; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.stats div { margin: 0; }
.stats dt { font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.stats dd {
  margin: .15rem 0 0; font-size: 1.9rem; font-weight: 600; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}

/* bolt art */
.hero-art { display: grid; place-items: center; }
.bolt-stage { position: relative; width: min(100%, 420px); aspect-ratio: 1; display: grid; place-items: center; }
.bolt-halo {
  position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--golden) 55%, transparent), transparent 68%);
  filter: blur(28px); animation: breathe 5.5s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.14); opacity: .78; } }

.bolt {
  position: relative; width: 62%; height: auto;
  filter: drop-shadow(0 18px 34px rgba(197, 42, 61, .3));
  animation: float 6.5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-14px) rotate(-2.5deg); } }

.orbit {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed color-mix(in oklab, var(--brand) 26%, transparent);
  animation: spin 26s linear infinite;
}
.orbit span {
  position: absolute; top: -13px; left: 50%; translate: -50% 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: .18rem .7rem;
  font-size: .74rem; font-weight: 500; color: var(--muted);
  box-shadow: var(--shadow-sm); animation: spin 26s linear infinite reverse;
}
/* Negative delays offset each ring so the three labels sit ~120° apart
   instead of stacking at the top. Ring and label share a delay so the
   counter-rotation keeps the text upright. */
.orbit-1, .orbit-1 span { animation-delay: 0s; }
.orbit-2 { inset: 12%; animation-duration: 34s; animation-direction: reverse; }
.orbit-2 span { animation-duration: 34s; animation-direction: normal; }
.orbit-2, .orbit-2 span { animation-delay: -11.3s; }
.orbit-3 { inset: 22%; animation-duration: 44s; }
.orbit-3 span { animation-duration: 44s; }
.orbit-3, .orbit-3 span { animation-delay: -29.3s; }
@keyframes spin { to { rotate: 360deg; } }

/* marquee */
.marquee {
  position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface-2); overflow: hidden; padding: .9rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: 1.6rem; width: max-content; animation: slide 42s linear infinite; }
.marquee span { font-size: .86rem; font-weight: 500; color: var(--faint); letter-spacing: .04em; white-space: nowrap; }
.marquee i { width: 5px; height: 5px; border-radius: 50%; background: var(--golden); flex: none; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ── sections ─────────────────────────────────────────────── */

.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-alt { background: var(--surface-3); border-block: 1px solid var(--line-soft); }

.sec-head { max-width: 46rem; margin-bottom: 3rem; }
.sec-head h2 { margin-bottom: 1rem; }
.sec-sub { color: var(--muted); font-size: 1.05rem; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ── interactive demo ─────────────────────────────────────── */

.demo {
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface-2); box-shadow: var(--shadow-lg); overflow: hidden;
}

.demo-chrome {
  display: flex; align-items: center; gap: 1rem; padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--line); background: var(--surface-3);
}
.dots { display: flex; gap: .4rem; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.dots i:first-child { background: color-mix(in oklab, var(--crimson) 65%, transparent); }
.dots i:nth-child(2) { background: color-mix(in oklab, var(--golden) 80%, transparent); }
.demo-tab { font-size: .88rem; color: var(--muted); }
.demo-meta { margin-inline-start: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .76rem; font-weight: 500; padding: .22rem .7rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.pill code { font-size: .95em; }
.pill-cyan { color: var(--data-ink); border-color: color-mix(in oklab, var(--cyan) 40%, transparent); background: color-mix(in oklab, var(--cyan) 8%, transparent); }
.pill-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: pulse 1.8s infinite; }
.pill-warn { color: var(--brand-ink); border-color: color-mix(in oklab, var(--brand) 40%, transparent); background: color-mix(in oklab, var(--brand) 8%, transparent); }
.pill-ok { color: var(--ok-ink); border-color: color-mix(in oklab, var(--ok-ink) 40%, transparent); background: color-mix(in oklab, var(--ok-ink) 8%, transparent); }

.demo-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.chat { padding: 1.6rem; display: flex; flex-direction: column; gap: 1rem; min-height: 260px; max-height: 620px; overflow-y: auto; scroll-behavior: smooth; }

.msg { max-width: 46rem; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.msg-sys p {
  font-size: .86rem; color: var(--faint); background: var(--surface-3);
  border: 1px dashed var(--line); border-radius: var(--r-md); padding: .6rem .9rem;
}
.msg-user { align-self: flex-end; }
.msg-user p {
  background: linear-gradient(100deg, var(--crimson), var(--coral)); color: #fff;
  padding: .7rem 1.05rem; border-radius: var(--r-lg) var(--r-lg) 6px var(--r-lg);
  box-shadow: 0 4px 14px rgba(197, 42, 61, .22);
}
.msg-agent > p {
  background: var(--surface-3); border: 1px solid var(--line);
  padding: .7rem 1.05rem; border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 6px;
}

.typing { display: inline-flex; gap: .28rem; padding: .2rem 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blip 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blip { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* plan card */
.plan {
  margin-top: .7rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-2); box-shadow: var(--shadow-md); overflow: hidden;
}
.plan-head {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, color-mix(in oklab, var(--crimson) 8%, transparent), transparent 70%);
}
.plan-head h4 { font-size: .98rem; }
.plan-head .pill { margin-inline-start: auto; }

.plan-body { padding: 1.1rem; display: grid; gap: 1.1rem; }
.plan-label { font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: .5rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.steps li { display: flex; align-items: flex-start; gap: .7rem; font-size: .93rem; color: var(--muted); }
.steps .num {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .74rem; font-weight: 600; color: var(--brand-ink);
  background: color-mix(in oklab, var(--brand) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--brand) 28%, transparent);
  transition: background .3s, color .3s, border-color .3s;
}
.steps li.done .num { background: var(--cyan-deep); border-color: var(--cyan-deep); color: #fff; }
.steps li.active .num { background: var(--golden); border-color: var(--golden); color: #3a2b00; animation: pulse 1.2s infinite; }
.steps li.done { color: var(--ink); }

.artifact {
  background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: .8rem .95rem; overflow-x: auto;
}
.artifact pre { margin: 0; font-family: var(--mono); font-size: .82rem; line-height: 1.65; color: var(--muted); }
.artifact .c-k { color: var(--brand-ink); font-weight: 500; }
.artifact .c-s { color: var(--data-ink); }
.artifact .c-n { color: var(--faint); font-style: italic; }

.impact { display: flex; flex-wrap: wrap; gap: .5rem; }

.plan-actions {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  padding: .9rem 1.1rem; border-top: 1px solid var(--line); background: var(--surface-3);
}
.plan-actions .hint { font-size: .8rem; color: var(--faint); margin-inline-start: auto; }
.btn-approve { background: var(--cyan-deep); color: #fff; box-shadow: 0 4px 12px color-mix(in oklab, var(--cyan) 40%, transparent); }
.btn-approve:hover { transform: translateY(-1px); box-shadow: 0 8px 20px color-mix(in oklab, var(--cyan) 50%, transparent); }
.btn-reject { border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); }
.btn-reject:hover { border-color: var(--brand); color: var(--brand-ink); }

/* run panel */
.run { margin-top: .7rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; }
.run-head {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); font-size: .88rem;
}
.run-head code { color: var(--brand-ink); }
.run-body { padding: 1.1rem; }

.bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: .9rem; }
.bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--crimson), var(--golden));
  transition: width .5s var(--ease);
}

.result { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.result table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.result caption {
  caption-side: top; text-align: left; padding: .55rem .8rem;
  font-family: var(--mono); font-size: .76rem; color: var(--faint);
  background: var(--surface-3); border-bottom: 1px solid var(--line-soft);
}
.result th, .result td { padding: .5rem .8rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.result th { background: var(--surface-3); font-weight: 500; color: var(--faint); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.result td { font-family: var(--mono); font-size: .82rem; color: var(--muted); }
.result tr:last-child td { border-bottom: none; }

.undo { margin-top: .9rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; font-size: .85rem; color: var(--faint); }

.composer { border-top: 1px solid var(--line); background: var(--surface-3); padding: 1.1rem 1.6rem 1.3rem; }
.composer-label { font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip {
  font: inherit; font-size: .89rem; cursor: pointer;
  padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  transition: border-color .2s, color .2s, transform .18s var(--ease), background .2s;
}
.chip:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-ink); transform: translateY(-2px); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.reset { margin-top: .9rem; }

.demo-foot { margin-top: 1.2rem; font-size: .9rem; color: var(--faint); text-align: center; }
.demo-foot strong { color: var(--muted); }

/* ── beliefs ──────────────────────────────────────────────── */

.beliefs { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.belief {
  position: relative; padding: 1.6rem 1.4rem 1.5rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.belief:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in oklab, var(--brand) 35%, var(--line)); }
.belief-idx {
  font-family: var(--mono); font-size: .78rem; color: var(--brand-ink);
  display: block; margin-bottom: .7rem; letter-spacing: .08em;
}
.belief h3 { margin-bottom: .5rem; }
.belief p { font-size: .93rem; color: var(--muted); }

/* ── cards ────────────────────────────────────────────────── */

.cards { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.card {
  padding: 1.6rem 1.5rem; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-2); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card-wide { grid-column: span 2; }
@media (max-width: 780px) { .card-wide { grid-column: span 1; } }

.card-accent {
  background: linear-gradient(150deg, color-mix(in oklab, var(--golden) 16%, var(--surface-2)), var(--surface-2) 62%);
  border-color: color-mix(in oklab, var(--golden) 45%, var(--line));
}

.card-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 1rem; color: var(--brand-ink);
  background: color-mix(in oklab, var(--brand) 9%, transparent);
  border: 1px solid color-mix(in oklab, var(--brand) 22%, transparent);
}
.card-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin-bottom: .5rem; }
.card p { font-size: .94rem; color: var(--muted); }

.ticks { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .45rem; }
.ticks li { position: relative; padding-inline-start: 1.5rem; font-size: .89rem; color: var(--muted); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .48em; width: 9px; height: 5px;
  border-left: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan);
  rotate: -45deg;
}

/* ── diagram ──────────────────────────────────────────────── */

.diagram {
  border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface-2);
  padding: 1.4rem; box-shadow: var(--shadow-sm); overflow-x: auto;
}
.diagram svg { width: 100%; min-width: 860px; height: auto; color: var(--faint); }

.dg-lane { font: 500 11px var(--font); letter-spacing: .14em; fill: var(--faint); text-anchor: middle; }
.dg-node rect { fill: var(--surface-3); stroke: var(--line); stroke-width: 1.4; }
.dg-node text { font: 500 13px var(--font); fill: var(--muted); text-anchor: middle; }
.dg-node-brand rect { fill: color-mix(in oklab, var(--crimson) 9%, var(--surface-2)); stroke: color-mix(in oklab, var(--crimson) 34%, transparent); }
.dg-node-brand text { fill: var(--ink); }
.dg-node-gate rect { fill: color-mix(in oklab, var(--golden) 26%, var(--surface-2)); stroke: color-mix(in oklab, var(--golden) 70%, transparent); stroke-width: 2; }
.dg-node-gate text { fill: var(--ink); font-weight: 600; }
.dg-node-strong rect { fill: var(--surface-2); stroke: var(--brand); stroke-width: 1.8; }
.dg-node-strong text { fill: var(--ink); font-weight: 600; }
.dg-node-lake rect { fill: color-mix(in oklab, var(--cyan) 12%, var(--surface-2)); stroke: color-mix(in oklab, var(--cyan) 50%, transparent); }
.dg-node-lake text { fill: var(--ink); }
.dg-box rect { fill: none; stroke: var(--line); stroke-width: 1.4; stroke-dasharray: 6 6; }
.dg-note { font: 400 11px var(--mono); fill: var(--faint); text-anchor: middle; }

.dg-flow path {
  fill: none; stroke: color-mix(in oklab, var(--brand) 50%, transparent);
  stroke-width: 1.8; stroke-dasharray: 7 7;
  animation: dash 1.4s linear infinite;
}
@keyframes dash { to { stroke-dashoffset: -28; } }

.dg-policy rect { fill: color-mix(in oklab, var(--cyan) 10%, transparent); stroke: color-mix(in oklab, var(--cyan) 40%, transparent); stroke-width: 1.4; }
.dg-policy text { font: 500 12px var(--font); fill: var(--cyan); text-anchor: middle; letter-spacing: .02em; }

/* matrix */
.matrix { margin-top: 1.4rem; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface-2); padding: 1.4rem; }
.matrix-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.matrix-head h3 { font-size: 1rem; font-weight: 500; color: var(--muted); }
.matrix-head code { color: var(--ink); }
.matrix-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.matrix-grid li {
  display: flex; flex-direction: column; gap: .1rem; padding: .8rem .95rem;
  border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line-soft);
}
.matrix-grid span { font-size: .78rem; color: var(--faint); letter-spacing: .05em; text-transform: uppercase; }
.matrix-grid b { font-family: var(--mono); font-size: 1.05rem; font-weight: 500; color: var(--ink); }

/* ── governance ───────────────────────────────────────────── */

.gov { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: start; }
@media (max-width: 900px) { .gov { grid-template-columns: 1fr; } }

.gov-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.gov-list li {
  padding-inline-start: 1.2rem; border-inline-start: 2px solid var(--line);
  display: grid; gap: .2rem; transition: border-color .3s;
}
.gov-list li:hover { border-inline-start-color: var(--brand); }
.gov-list strong { font-weight: 600; }
.gov-list span { font-size: .93rem; color: var(--muted); }

.gov-panel {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-md);
  position: sticky; top: 100px;
}
.panel-head { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-3); }
.panel-ts { margin-inline-start: auto; font-family: var(--mono); font-size: .76rem; color: var(--faint); }
.gov-panel pre { margin: 0; padding: 1.1rem; overflow-x: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.75; color: var(--muted); }
.c-k { color: var(--brand-ink); font-weight: 500; }
.c-p { color: var(--faint); }
.c-s { color: var(--data-ink); }
.c-t { color: var(--ok-ink); font-weight: 500; }
.c-f { color: var(--brand-ink); font-weight: 500; }

/* ── cta ──────────────────────────────────────────────────── */

.cta { position: relative; overflow: hidden; padding: clamp(4rem, 9vw, 6.5rem) 0; text-align: center; border-top: 1px solid var(--line-soft); }
.cta-glow {
  position: absolute; inset: -60% -20% auto -20%; height: 200%;
  background:
    radial-gradient(38% 40% at 50% 22%, color-mix(in oklab, var(--golden) 34%, transparent), transparent 62%),
    radial-gradient(46% 44% at 22% 60%, color-mix(in oklab, var(--crimson) 20%, transparent), transparent 62%),
    radial-gradient(40% 40% at 80% 58%, color-mix(in oklab, var(--coral) 18%, transparent), transparent 62%);
  pointer-events: none; animation: drift 18s ease-in-out infinite alternate;
}
.cta-inner { position: relative; display: grid; justify-items: center; gap: 1.2rem; }
.cta-bolt { animation: float 6s ease-in-out infinite; filter: drop-shadow(0 10px 22px rgba(197, 42, 61, .3)); }
.cta p { color: var(--muted); max-width: 34rem; }

.cta-form { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: .6rem; }
.cta-form input {
  font: inherit; font-size: .95rem; padding: .75rem 1.1rem; min-width: 270px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.cta-form input::placeholder { color: var(--faint); }
.cta-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 14%, transparent); }
.cta-note { font-size: .84rem; color: var(--faint); }
.cta-note.ok { color: var(--data-ink); }

/* ── footer ───────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); background: var(--surface-3); padding: 3rem 0 1.6rem; }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: 1.6fr repeat(3, 1fr); }
@media (max-width: 780px) { .footer-inner { grid-template-columns: 1fr 1fr; } }

.footer-brand p { margin-top: .8rem; font-size: .9rem; color: var(--faint); }
.footer-col { display: grid; gap: .5rem; align-content: start; }
.footer-col h4 { font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: .3rem; }
.footer-col a { font-size: .92rem; color: var(--muted); transition: color .2s; }
.footer-col a:hover { color: var(--brand-ink); }

.footer-base {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-size: .84rem; color: var(--faint);
}
.footer-base a { color: var(--brand-ink); }
.footer-tag { font-style: italic; }

/* ── motion preferences ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }

  /* With the orbit animation frozen, every label would settle at 12 o'clock and
     overlap. Fix their angles statically so the ring still reads as a ring. */
  .orbit-2 { rotate: 118deg; }
  .orbit-2 span { rotate: -118deg; }
  .orbit-3 { rotate: 242deg; }
  .orbit-3 span { rotate: -242deg; }
}

/* Readers who ask the OS for more contrast get the quiet tiers collapsed
   upward and the decorative washes pulled out of the way. */
@media (prefers-contrast: more) {
  :root { --muted: #3d3232; --faint: #5c4b49; --line: #d8c4bc; }
  [data-theme="dark"] {
    --muted: #ece1de; --faint: #c9b8b4; --line: #4a3b3b;
    --brand-ink: #ff8496;
  }
  .hero-glow, .cta-glow { opacity: .35; }
  a:hover { text-decoration: underline; text-underline-offset: 3px; }
}
