/* ============================================================
   tanstaafl.info portal — dark quantum theme (no framework, no build)
   ============================================================ */

:root {
  --bg: #0b1020;
  --bg-alt: #0e1530;
  --card: #131b3a;
  --card-border: #24305c;
  --text: #e8ecf8;
  --muted: #9aa5c4;
  --accent: #3ee6c5;
  --accent-2: #7aa2ff;
  --danger: #ff7a90;
  --warning: #ffb547;
  --accent-tint: rgba(62, 230, 197, .12);
  --accent-line: rgba(62, 230, 197, .4);
  --accent-2-tint: rgba(122, 162, 255, .12);
  --danger-tint: rgba(255, 122, 144, .1);
  --danger-line: rgba(255, 122, 144, .4);
  --grid-line: rgba(122, 162, 255, .05);
  --radius: 14px;
  --container: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 680px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 32, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  padding-top: 14px; padding-bottom: 14px;
}
.logo {
  font-weight: 800; font-size: 1.25rem; letter-spacing: .02em;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo-accent { color: var(--accent); }

.site-nav { display: flex; gap: 18px; margin-left: 8px; }
.site-nav a { color: var(--muted); font-size: .95rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.locale-switch { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; }
.locale-sep { color: var(--muted); }
.locale-link { color: var(--muted); }
.locale-link.is-active { color: var(--accent); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2bb8ff);
  color: #06121f;
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(62, 230, 197, .25); }
.btn-ghost { border-color: var(--card-border); color: var(--text); background: transparent; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-wide { width: 100%; }
.btn-link {
  background: none; border: none; color: var(--muted);
  font-size: .9rem; cursor: pointer; padding: 0;
}
.btn-link:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  padding: 110px 0 90px;
  background:
    radial-gradient(700px 340px at 75% 0%, rgba(62, 230, 197, .12), transparent 65%),
    radial-gradient(600px 300px at 15% 10%, rgba(122, 162, 255, .12), transparent 60%),
    linear-gradient(rgba(122, 162, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 255, .05) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  border-bottom: 1px solid var(--card-border);
}
.eyebrow {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--card-border); color: var(--accent);
  font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 22px;
}
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; max-width: 20ch; }
.hero-subtitle { max-width: 62ch; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); }
.section-lead { color: var(--muted); max-width: 70ch; margin-bottom: 2em; }
.subheading { margin-top: 1.4em; }

/* ---------- cards ---------- */
.cards { display: grid; gap: 18px; }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.cards-5 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 22px;
}
.card p:last-child { margin-bottom: 0; }
.card-kicker { color: var(--accent); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(62, 230, 197, .12); color: var(--accent);
  font-size: .75rem; white-space: nowrap;
}
.badge-duration { background: rgba(122, 162, 255, .14); color: var(--accent-2); }

/* ---------- differentiation ---------- */
.diff-list { counter-reset: diff; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.diff-list li {
  counter-increment: diff;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 16px 18px 16px 54px; position: relative;
}
.diff-list li::before {
  content: counter(diff, decimal-leading-zero);
  position: absolute; left: 18px; top: 16px;
  color: var(--accent); font-weight: 800; font-size: .9rem;
}

/* ---------- roadmap timeline ---------- */
.timeline { position: relative; margin-top: 10px; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--accent), var(--accent-2));
  opacity: .5;
}
.timeline-item { position: relative; padding: 0 0 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute; left: -26px; top: 6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg);
  border: 3px solid var(--accent);
}
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.timeline-head h3 { margin: 0; }
.timeline-body p { max-width: 76ch; }
.timeline-result { color: var(--muted); }
.timeline-result strong { color: var(--accent); }

/* ---------- team ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.tag {
  padding: 8px 14px; border-radius: 999px; font-size: .9rem;
  background: var(--card); border: 1px solid var(--card-border);
}

/* ---------- investors ---------- */
.investors-note { color: var(--muted); margin: 26px 0 18px; font-style: italic; }

/* ---------- forms ---------- */
.lead-form, .auth-form { margin-top: 8px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: .9rem; color: var(--muted); }
.form-field input, .form-field select, .form-field textarea {
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 10px;
  padding: 11px 14px; font-size: 1rem; font-family: inherit;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.contact-hint { color: var(--muted); font-size: .9rem; margin-top: 22px; }

/* ---------- auth pages ---------- */
.auth-title { font-size: 1.7rem; }
.auth-switch { color: var(--muted); margin-top: 18px; }

/* ---------- dashboard ---------- */
.flow-steps, .status-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* ---------- flash ---------- */
.flash {
  margin-top: 16px; padding: 12px 18px; border-radius: 10px; font-size: .95rem;
}
.flash-notice { background: rgba(62, 230, 197, .12); border: 1px solid rgba(62, 230, 197, .4); }
.flash-alert { background: rgba(255, 122, 144, .1); border: 1px solid rgba(255, 122, 144, .4); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 36px 0 44px; color: var(--muted); font-size: .9rem;
}
.footer-note { max-width: 90ch; }
.footer-sep { margin: 0 8px; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .site-nav { display: none; }
  .hero { padding: 70px 0 60px; }
  .section { padding: 56px 0; }
  .form-row-2 { grid-template-columns: 1fr; }
}

/* ---------- prose, audience cards, telegram contact ---------- */
.prose p { max-width: 76ch; }
.prose p:last-child { margin-bottom: 0; }
/* Cards right after a prose block keep the same gap as after .section-lead */
.prose + .cards { margin-top: 2em; }
.section-lead + .hero-actions { margin-top: 0; }  /* the lead's 2em is the gap */
.section .hero-actions { animation: none; }  /* the entrance is for the hero only */

.hero-page { padding: 70px 0 40px; }

.card-link { display: block; color: var(--text); transition: border-color .15s ease, transform .15s ease; }
.card-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.card-link p { color: var(--muted); }
.card-cta { color: var(--accent); font-weight: 600; }

.contact-links { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.contact-card h3 { margin-bottom: .3em; }
.contact-card p { margin-bottom: 0; }

/* ============================================================
   Motion & 3D (three.js visuals: app/javascript/visuals/*)
   ============================================================ */

/* ---------- hero with live wave canvas ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-home { min-height: calc(100svh - 60px); display: flex; align-items: center; }
.hero-page { min-height: 52svh; display: flex; align-items: flex-end; }
.hero > .container { position: relative; z-index: 2; width: 100%; }
.hero-canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 1.2s ease;
}
.hero.has-wave .hero-canvas { opacity: 1; }
.hero.has-wave::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(rgba(122, 162, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 162, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 16, 32, .78) 0%, rgba(11, 16, 32, .35) 55%, rgba(11, 16, 32, 0) 80%),
    linear-gradient(0deg, var(--bg) 0%, rgba(11, 16, 32, 0) 22%);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

/* Apple-style entrance of the hero copy (CSS only, ends fully visible) */
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.hero .eyebrow, .hero-title, .hero-subtitle, .hero-actions {
  animation: rise 1s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-title    { animation-delay: .08s; }
.hero-subtitle { animation-delay: .18s; }
.hero-actions  { animation-delay: .28s; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; z-index: 2; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
}
.scroll-hint:hover { text-decoration: none; color: var(--text); }
.scroll-hint::after {
  content: ""; width: 1px; height: 38px;
  background: linear-gradient(var(--accent), transparent);
  animation: hint 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hint {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(16px); opacity: 0; }
}

/* ---------- reveal on scroll (classes added by JS only) ---------- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition:
    opacity .8s ease var(--reveal-delay, 0ms),
    transform .9s cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- "How it works" pinned scroll story ---------- */
/* Without JS: a plain section listing the four steps. */
.story { position: relative; border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); }
.story-sticky { padding: 84px 0; }
.story-canvas, .story-progress { display: none; }
.story-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.story-step {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 22px;
}
.story-num { color: var(--accent); font-weight: 800; letter-spacing: .06em; font-size: .85rem; }
.story-formula, .js .story-step .story-formula { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: .02em; margin: .3em 0 0; color: var(--text); }

/* With JS: a tall section whose inner frame sticks while the scene plays. */
.js .story { height: 460vh; background: var(--bg); }
.js .story-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; padding: 0;
  overflow: hidden; display: flex; align-items: center;
}
.js .story-sticky::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 16, 32, .92) 0%, rgba(11, 16, 32, .6) 34%, rgba(11, 16, 32, 0) 60%);
}
.js .story-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.js .story-overlay { position: relative; z-index: 2; width: 100%; pointer-events: none; }
.js .story-title { /* kicker */
  font-size: .85rem; font-weight: 400; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.8rem;
}
.js .story-steps { display: block; position: relative; max-width: 31rem; min-height: 17rem; }
.js .story-step {
  position: absolute; top: 0; left: 0; right: 0;
  background: none; border: 0; padding: 0; border-radius: 0;
  opacity: 0; transform: translateY(32px); filter: blur(6px);
  transition: opacity .55s ease, transform .8s cubic-bezier(.2, .7, .2, 1), filter .55s ease;
}
.js .story-step.is-past { transform: translateY(-32px); }
.js .story-step.is-active { opacity: 1; transform: none; filter: none; }
.js .story-step h3 { font-size: clamp(1.9rem, 3.8vw, 3rem); font-weight: 800; margin: .35em 0 .45em; line-height: 1.1; }
.js .story-step p { color: var(--muted); font-size: 1.12rem; max-width: 27rem; }
.js .story-progress {
  display: block; width: 11rem; height: 2px; margin-top: 2.2rem;
  background: var(--card-border); border-radius: 2px; overflow: hidden;
}
.js .story-progress span {
  display: block; height: 100%; background: var(--accent);
  transform-origin: left; transform: scaleX(0);
}
.story.no-webgl .story-sticky::before { background: none; }

@media (max-width: 760px) {
  .js .story-sticky { align-items: flex-end; padding-bottom: 9vh; }
  .js .story-sticky::before {
    background: linear-gradient(0deg, rgba(11, 16, 32, .96) 0%, rgba(11, 16, 32, .75) 42%, rgba(11, 16, 32, 0) 70%);
  }
  .js .story-steps { min-height: 15rem; }
  .js .story-step h3 { font-size: 1.7rem; }
  .js .story-step p { font-size: 1rem; }
  .hero-home { min-height: calc(92svh - 60px); }
  .scroll-hint { display: none; }
}

/* ---------- icons: line sprite /icons.svg, colour from currentColor ---------- */
.icon {
  width: 22px; height: 22px; flex: none; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.with-icon { display: flex; align-items: center; gap: 12px; }
/* a tile gives a line icon the weight of a sign: accent on accent-tint */
.with-icon .icon, .flow-step > .icon, .hub-node > .icon, .card-link > .icon {
  box-sizing: border-box; padding: 9px; border-radius: 12px;
  color: var(--accent); background: var(--accent-tint);
}
.with-icon .icon { width: 42px; height: 42px; }
.flow-step > .icon { display: block; width: 46px; height: 46px; margin-bottom: 12px; }
.hub-node > .icon { display: block; margin: 0 auto 10px; width: 50px; height: 50px; }
.hub-node.is-cut > .icon { color: var(--muted); background: var(--accent-2-tint); }
.hub-core .icon { color: var(--accent); margin-right: 8px; }
.hub-core.is-missing .icon { color: var(--danger); }
.compare-role { display: flex; align-items: center; gap: 12px; }
.compare-role .icon { width: 30px; height: 30px; color: var(--accent); }
.card-link > .icon { width: 56px; height: 56px; padding: 12px; margin-bottom: 14px; }
.lane-title .icon { width: 22px; height: 22px; margin-right: 6px; color: var(--accent); }

/* ---------- figures: diagrams drawn from tokens (no icons, no images) ---------- */
.figure {
  margin: 2em 0 0; padding: 28px;
  border: 1px solid var(--card-border); border-radius: var(--radius);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
}
.section-alt .figure { background-color: var(--bg); }
.figure figcaption { color: var(--muted); font-size: .9rem; margin-top: 18px; max-width: 76ch; }
h2 + .figure { margin-top: 0; }
.figure + .prose { margin-top: 2em; }
.figure + .cards { margin-top: 2em; }
.figure + h3 { margin-top: 2.2em; }
h3 + .figure { margin-top: 0; }
.section-lead + .figure { margin-top: 0; }
.figure-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.figure-legend li { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot-accent { background: var(--accent); } .dot-accent-2 { background: var(--accent-2); } .dot-muted { background: var(--muted); }

/* flow: steps joined by arrows; a column on narrow screens */
.flow { display: flex; gap: 34px; margin: 0; padding: 0; list-style: none; }
.flow-step {
  position: relative; flex: 1 1 0; min-width: 0;
  padding: 16px 18px; border: 1px solid var(--card-border); border-radius: var(--radius);
  background: var(--card);
}
.flow-step + .flow-step::before {
  content: ""; position: absolute; left: -34px; top: 50%; width: 34px; height: 1px; background: var(--accent-line);
}
.flow-step + .flow-step::after {
  content: ""; position: absolute; left: -9px; top: calc(50% - 4px);
  border: 4px solid transparent; border-left: 6px solid var(--accent);
}
.flow-num { display: block; color: var(--accent); font-weight: 800; font-size: .85rem; letter-spacing: .05em; }
.flow-step strong { display: block; margin: 2px 0 4px; }
.flow-note { display: block; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.flow-step.is-key { border-color: var(--accent-line); background: linear-gradient(var(--accent-tint), var(--accent-tint)), var(--card); }
.flow-step .badge { margin-top: 10px; }

/* finding: one audit finding as it appears in the report */
.finding { max-width: 760px; }
.finding-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.finding-sev {
  padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  color: var(--danger); background: var(--danger-tint); border: 1px solid var(--danger-line);
}
.finding-id { color: var(--muted); font-size: .9rem; }
.finding-chain { position: relative; margin: 0; padding: 0; list-style: none; }
.finding-chain::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--accent-line); }
.finding-chain li { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 9px 0 9px 22px; }
.finding-chain li::before {
  content: ""; position: absolute; left: -4px; top: 17px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--accent);
}
.chain-key { color: var(--accent); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding-top: 3px; }
.risk-math { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-variant-numeric: tabular-nums; }
.risk-math b { font-size: 1.15rem; }
.risk-math .op { color: var(--muted); }
.risk-math .total { color: var(--danger); font-size: 1.35rem; font-weight: 800; }

/* compare: a role, what hurts now, what changes */
.compare { display: grid; grid-template-columns: minmax(150px, .8fr) 1fr 34px 1fr; gap: 0; }
.compare > * { padding: 14px 16px; border-top: 1px solid var(--card-border); }
.compare-head { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; border-top: 0; padding-top: 0; }
.compare-role { font-weight: 700; }
.compare-now { color: var(--muted); }
.compare-arrow { color: var(--accent); text-align: center; padding-left: 0; padding-right: 0; }
.compare-gain { color: var(--text); }

/* hub: separate parts feeding one platform */
.hub-nodes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.hub-node {
  position: relative; padding: 14px 16px; border: 1px solid var(--card-border); border-radius: var(--radius);
  background: var(--card); text-align: center;
}
.hub-node strong { display: block; }
.hub-node, .flow-step { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.hub-node span { color: var(--muted); font-size: .88rem; }
.hub-node::after { content: ""; position: absolute; left: 50%; bottom: -27px; width: 1px; height: 26px; background: var(--accent-line); }
.hub-node.is-cut::after { content: none; }  /* separate systems: nothing joins them */
.hub-core {
  margin-top: 26px; padding: 16px 18px; border-radius: var(--radius); text-align: center;
  border: 1px solid var(--accent-line); background: linear-gradient(var(--accent-tint), var(--accent-tint)), var(--card);
}
.hub-core strong { color: var(--accent); }
.hub-core.is-missing { border: 1px dashed var(--danger-line); background: var(--danger-tint); }
.hub-core.is-missing strong { color: var(--danger); }

/* lanes: columns of releases with the parts that land in each */
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lane { padding: 16px; border: 1px solid var(--card-border); border-radius: var(--radius); background: rgba(19, 27, 58, .6); }
.lane-title { margin: 0 0 4px; font-size: 1rem; }
.lane-note { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.lane ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.chip {
  display: block; padding: 8px 12px; border-radius: 10px; font-size: .9rem; line-height: 1.4;
  border: 1px solid var(--card-border); background: var(--card);
}
.chip code { color: var(--accent-2); font-size: .85rem; }
.chip.is-done { border-color: var(--accent-line); }
.chip.is-done::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.chip.is-empty { border-style: dashed; color: var(--muted); background: transparent; }

/* market: segments and the tools that cover them */
.market { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: stretch; }
.lane.is-target { border-color: var(--accent-line); background: linear-gradient(var(--accent-tint), var(--accent-tint)), rgba(19, 27, 58, .6); }
.lane.is-target .lane-title { color: var(--accent); }

/* waves: three trends meeting at one point */
.waves svg { display: block; width: 100%; height: auto; }
.waves .wave-a { stroke: var(--accent); } .waves .wave-b { stroke: var(--accent-2); } .waves .wave-c { stroke: var(--muted); }
.waves path { fill: none; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.waves .meet { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.waves .meet-glow { fill: var(--accent-tint); stroke: none; transform-box: fill-box; transform-origin: center; }
.waves text { fill: var(--muted); font-size: 14px; }
.figure-legend.is-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 22px; margin-top: 18px; }
.figure-legend.is-wide li { align-items: flex-start; }
.figure-legend.is-wide .dot { margin-top: 7px; }

/* code: a real Unio excerpt */
.code {
  margin: 0; padding: 20px 22px; overflow-x: auto;
  border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--bg);
  font: .88rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text);
}
.figure > .code { padding: 0; border: 0; border-radius: 0; background: none; }  /* the figure is the frame */
.code .k { color: var(--accent-2); } .code .s { color: var(--accent); } .code .c { color: var(--muted); }


@media (max-width: 760px) {
  .figure { padding: 18px; }
  .finding-chain li { grid-template-columns: 1fr; gap: 2px; }
  .compare { grid-template-columns: 1fr; }
  .hub-nodes { grid-template-columns: 1fr; }
  .hub-node:not(:last-child)::after { content: none; }
  .compare-head, .compare-arrow { display: none; }
  .compare-role { padding-bottom: 2px; }
  .compare-now, .compare-gain { border-top: 0; padding-top: 2px; }
  .compare-gain::before { content: "→ "; color: var(--accent); }
  .waves text { font-size: 30px; }
  .illo .t-scale text { font-size: 15px; }  /* wide drawings shrink most on a phone */
}

/* figures draw in: JS sets .will-draw (parts hidden at once, no transition) and a --d
   delay per part, then .is-drawn on scroll — only the way in is animated */
.figure.will-draw :is(.flow-step, .hub-node, .hub-core, .lane, .chip, .compare > :not(.compare-head),
  .finding-head, .finding-chain li, .figure-legend li, .code, .illo, figcaption) { opacity: 0; transform: translateY(10px); }
.figure.will-draw.is-drawn :is(.flow-step, .hub-node, .hub-core, .lane, .chip, .compare > :not(.compare-head),
  .finding-head, .finding-chain li, .figure-legend li, .code, .illo, figcaption) {
  opacity: 1; transform: none;
  transition: opacity .5s ease var(--d, 0s), transform .6s cubic-bezier(.2, .7, .2, 1) var(--d, 0s);
}
/* arrows of a flow grow towards the step they lead to */
.figure.will-draw .flow-step + .flow-step::before { transform: scaleX(0); transform-origin: left; }
.figure.will-draw .flow-step + .flow-step::after { opacity: 0; }
.figure.will-draw.is-drawn .flow-step + .flow-step::before { transform: none; transition: transform .35s ease calc(var(--d) - .1s); }
.figure.will-draw.is-drawn .flow-step + .flow-step::after { opacity: 1; transition: opacity .2s ease calc(var(--d) + .2s); }
/* the key step lights up once the whole chain is there */
.figure.will-draw .flow-step.is-key { border-color: var(--card-border); }
.figure.will-draw.is-drawn .flow-step.is-key {
  border-color: var(--accent);
  transition: opacity .5s ease var(--d), transform .6s cubic-bezier(.2, .7, .2, 1) var(--d), border-color .6s ease var(--end);
}
/* hub lines run down into the core */
.figure.will-draw .hub-node::after { transform: scaleY(0); transform-origin: top; }
.figure.will-draw.is-drawn .hub-node::after { transform: none; transition: transform .3s ease calc(var(--d) + .35s); }
/* the finding's timeline runs down, its dots fill in turn */
.figure.will-draw .finding-chain::before { transform: scaleY(0); transform-origin: top; }
.figure.will-draw.is-drawn .finding-chain::before { transform: none; transition: transform 1.1s cubic-bezier(.4, 0, .2, 1) .2s; }
.figure.will-draw.is-drawn .finding-chain li::before { background: var(--accent); transition: background-color .3s ease calc(var(--d) + .3s); }
/* waves are drawn left to right, then the meeting point opens */
.figure.will-draw.waves svg { clip-path: inset(0 100% 0 0); }
.figure.will-draw.is-drawn.waves svg { clip-path: inset(0 0 0 0); transition: clip-path 1.6s cubic-bezier(.4, 0, .2, 1) .1s; }
.figure.will-draw.waves .meet-glow { transform: scale(0); }
.figure.will-draw.is-drawn.waves .meet-glow { transform: none; transition: transform .7s cubic-bezier(.3, 1.6, .5, 1) 1.5s; }

@media (max-width: 960px) {  /* breakpoint-md */
  .flow { flex-direction: column; gap: 26px; }
  .flow-step + .flow-step::before { left: 50%; top: -26px; width: 1px; height: 26px; }
  .flow-step + .flow-step::after { left: calc(50% - 4px); top: -9px; border: 4px solid transparent; border-top: 6px solid var(--accent); }
  .figure.will-draw .flow-step + .flow-step::before { transform: scaleY(0); transform-origin: top; }
}

/* ---------- illustrations: inline SVG line art in the blueprint style ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; }
.illo { margin: 0; }
.illo svg { display: block; width: 100%; height: auto; overflow: visible; }
.illo .ln { fill: none; stroke: var(--muted); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.illo .ln-soft { fill: none; stroke: var(--card-border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.illo .wall { fill: none; stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.illo .ac { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.illo .a2 { fill: none; stroke: var(--accent-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.illo .dg { fill: none; stroke: var(--danger); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.illo .dash { stroke-dasharray: 4 4; }
.illo .fill-card { fill: var(--card); }
.illo .fill-bg { fill: var(--bg); }
.illo .fill-ac { fill: var(--accent); stroke: none; }
.illo .fill-dg { fill: var(--danger); stroke: none; }
.illo .fill-dg-tint { fill: var(--danger-tint); stroke: none; }
.illo .fill-ac-tint { fill: var(--accent-tint); stroke: none; }
.illo text { fill: var(--muted); font: 12px ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.illo .t-text { fill: var(--text); }
.illo .t-ac { fill: var(--accent); }
.illo .t-dg { fill: var(--danger); }
.illo .t-big { font-size: 15px; font-weight: 700; }
.illo .t-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.illo .pulse { transform-box: fill-box; transform-origin: center; opacity: 0; }
.figure.is-drawn .illo .pulse, .illo.is-drawn .pulse { animation: ring 1.6s ease-out .9s 3 both; }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }
.finding-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 32px; align-items: center; }
.finding-layout .finding { max-width: none; }
@media (max-width: 960px) {  /* breakpoint-md */
  .split, .finding-layout { grid-template-columns: 1fr; gap: 28px; }
  .split .illo { max-width: 520px; }
  .finding-layout .illo { max-width: 380px; }
}

/* ---------- focus & reduced motion (from docs/design-system) ---------- */
.btn:focus-visible, .card-link:focus-visible, .site-nav a:focus-visible, .locale-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card-link { transition: none; }
  .btn:hover, .card-link:hover { transform: none; }
  .hero .eyebrow, .hero-title, .hero-subtitle, .hero-actions, .scroll-hint::after { animation: none; }
  .js .story-step, .reveal { transition: none; filter: none; }
  .hero-canvas { transition: none; }
  .illo .pulse { animation: none !important; opacity: 0; }
}
