/* Second Brain GD landing page. Same palette as the app's Morning theme (scripts/core/sb_theme.gd). */
:root {
  --bg: #2b3c54;
  --bg-2: #31445e;
  --panel: #33475f;
  --panel-2: #3b5270;
  --border: #4b6483;
  --forest: #3e6189;
  --forest-light: #79a5d3;
  --mint: #a9d4ff;
  --mint-soft: #d9edff;
  --text: #f1f6fc;
  --muted: #b5c6da;
  --faint: #8196ae;
  --warn: #ffd27a;
  --info: #a6dcff;
  --warm: #ffd2a1;
  --radius: 14px;
  --max: 1120px;
  --font: "Segoe UI Variable Text", "Segoe UI", Inter, Ubuntu, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "JetBrains Mono", "DejaVu Sans Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mint); }
a:hover { color: var(--mint-soft); }
:focus-visible { outline: 2px solid var(--mint-soft); outline-offset: 3px; border-radius: 6px; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: .1em .35em; border-radius: 5px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -.01em; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; justify-content: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--mint); color: #13233a; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.overline { color: var(--mint); font-size: .74rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .8em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(43, 60, 84, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav { max-width: var(--max); margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .06em; font-size: .92rem; }
.brand b { color: var(--mint); }
.nav-links { list-style: none; display: flex; gap: 6px; margin: 0 0 0 auto; padding: 0; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: .95rem; }
.nav-links a:hover { color: var(--mint-soft); background: rgba(255, 255, 255, .04); }
.nav-links .nav-cta { color: var(--text); border: 1px solid var(--border); background: var(--panel-2); }
.nav-toggle { display: none; margin-left: auto; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 1.1rem; cursor: pointer; }

/* Hero */
.hero { position: relative; min-height: min(92vh, 860px); display: grid; place-items: center; overflow: hidden; padding: 80px 16px; }
.hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(60% 50% at 80% 10%, rgba(62, 97, 137, .55), transparent 70%),
  radial-gradient(50% 50% at 10% 95%, rgba(255, 210, 161, .12), transparent 70%); }
.hero-graph { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
.hero-inner { position: relative; text-align: center; max-width: 820px; }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5.4rem); font-weight: 800; letter-spacing: .02em; margin-bottom: .2em; animation: rise .9s ease both; }
.accent { color: var(--mint); text-shadow: 0 0 42px rgba(169, 212, 255, .45); }
.tagline { font-size: clamp(1.15rem, 2.6vw, 1.6rem); color: var(--mint-soft); margin-bottom: .9em; animation: rise .9s .1s ease both; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; margin: 0 auto 1.8em; animation: rise .9s .2s ease both; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; animation: rise .9s .3s ease both; }
.hero-note { margin-top: 2em; color: var(--muted); font-size: .92rem; }
/* Movement only: the hero text is never invisible, even for link previews and crawlers. */
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); text-decoration: none; font-weight: 600;
  transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover { color: var(--mint-soft); border-color: var(--forest-light); transform: translateY(-1px); }
.btn-primary { background: var(--mint); color: #13233a; border-color: var(--mint); }
.btn-primary:hover { background: var(--mint-soft); color: #13233a; }

/* Cards */
.cards { display: grid; gap: 18px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: border-color .2s ease, transform .2s ease; }
.card:hover { border-color: var(--forest-light); transform: translateY(-2px); }
.card p { color: var(--muted); margin: 0; }
.principles { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.principles li { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; color: var(--mint-soft); font-size: .9rem; background: var(--bg-2); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.steps p { color: var(--muted); margin: 0; font-size: .95rem; }
.step-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: var(--mint-soft); font-weight: 700; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.shots figure { margin: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shots img { aspect-ratio: 16 / 10; object-fit: cover; }
.shots figcaption { padding: 10px 14px; color: var(--muted); font-size: .9rem; }
.caption-note { color: var(--faint); font-size: .85rem; margin-top: 12px; }

/* Architecture */
.arch { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; }
.arch-node { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.arch-node p { margin: 0 0 .3em; font-size: .93rem; }
.arch-node .muted { font-size: .83rem; }
.arch-godot { border-color: var(--forest-light); }
.arch-api { border-color: var(--forest-light); }
.arch-link { display: grid; place-items: center; position: relative; min-width: 34px; }
.arch-link::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: linear-gradient(90deg, var(--forest), var(--mint), var(--forest)); background-size: 200% 100%; animation: flow 2.4s linear infinite; }
.arch-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes flow { from { background-position: 0 0; } to { background-position: -200% 0; } }
.note { color: var(--muted); margin-top: 22px; font-size: .95rem; }

/* Roadmap */
.legend { color: var(--muted); font-size: .95rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; vertical-align: middle; }
.badge-done { background: rgba(169, 212, 255, .16); color: var(--mint); border: 1px solid rgba(169, 212, 255, .45); }
.badge-wip { background: rgba(255, 210, 161, .14); color: var(--warm); border: 1px solid rgba(255, 210, 161, .4); }
.badge-idea { background: rgba(255, 255, 255, .05); color: var(--muted); border: 1px dashed var(--faint); }
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 26px; }
.road-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.road-col ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.road-col li { margin: .35em 0; }
.road-col:first-child ul { color: var(--text); }

/* Journal */
.entry { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--mint); border-radius: var(--radius); padding: 22px 24px; }
.entry header { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.entry p { color: var(--muted); margin: 0; }
.entry + .entry { margin-top: 16px; }

.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-inner span { display: inline-flex; gap: 8px; align-items: center; }


/* ---------- v2: hero with a real screen ---------- */
.hero-split { min-height: auto; padding: clamp(56px, 8vw, 96px) 16px clamp(48px, 7vw, 80px); }
.hero-split .hero-grid { position: relative; max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.02fr 1.15fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.hero-split .hero-inner { text-align: left; max-width: none; }
.hero-split .lead { margin-left: 0; }
.hero-split .hero-actions { justify-content: flex-start; }
.hero-shot { position: relative; margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: 0 30px 80px -20px rgba(5, 12, 24, .7), 0 0 0 1px rgba(169, 212, 255, .08), 0 0 60px -10px rgba(121, 165, 211, .35);
  transform: perspective(1400px) rotateY(-5deg) rotateX(2deg); transition: transform .5s ease; animation: rise .9s .25s ease both; }
.hero-shot:hover { transform: none; }
.hero-shot img { width: 100%; }

/* The live graph in the hero (js/brain-demo.js): the hero's background is a small working Brain,
   the Archivist answers in its panel, the capture bar sits at the bottom. */
.hero-live { display: block; padding-bottom: 28px; }
.live-graph { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hero-live .hero-grid { pointer-events: none; min-height: 520px; grid-template-columns: 1fr 1fr; align-items: stretch; }
.hero-live .hero-inner, .hero-live .archivist, .hero-capture { pointer-events: auto; }
.hero-live .hero-inner { align-self: center; position: relative; isolation: isolate; }
/* A soft veil behind the text, so the graph behind it stays a background */
.hero-live .hero-inner::before { content: ""; position: absolute; inset: -60px -90px -60px -120px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--bg) 78%, transparent), transparent); }
.archivist { align-self: end; justify-self: end; width: min(360px, 100%); display: grid; gap: 10px; padding: 14px 16px 16px; border-radius: 16px;
  background: rgba(51, 71, 95, .88); border: 1px solid var(--border); backdrop-filter: blur(6px);
  box-shadow: 0 24px 60px -24px rgba(5, 12, 24, .8), 0 0 0 1px rgba(169, 212, 255, .06); }
.a-head { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.a-badge { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  color: #13233a; background: var(--mint); box-shadow: 0 0 16px rgba(169, 212, 255, .5); }
.a-state { margin-left: auto; font: 500 .72rem var(--mono); color: var(--mint); transition: color .2s; }
.a-state[data-s="listening"], .a-state[data-s="reading"] { color: var(--warm); }
.a-pause { font: inherit; font-size: .7rem; line-height: 1; color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px; cursor: pointer; }
.a-pause:hover { color: var(--text); border-color: var(--mint); }
/* The feed: a fixed height, newest at the bottom, older lines fading out at the top (no layout jump) */
.a-log { height: 250px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  -webkit-mask-image: linear-gradient(transparent, #000 20%); mask-image: linear-gradient(transparent, #000 20%); }
.a-log > * { flex: none; }
.a-you { align-self: flex-end; max-width: 90%; padding: 7px 12px; border-radius: 12px 12px 4px 12px; background: rgba(169, 212, 255, .1);
  border: 1px solid rgba(169, 212, 255, .25); color: var(--text); font-size: .86rem; line-height: 1.4; animation: rise .3s ease both; }
.a-you .k, .a-progress .k { font: 600 .62rem var(--mono); letter-spacing: .1em; color: var(--mint); margin-right: 6px; }
.a-you .k.warm { color: var(--warm); }
.a-progress { display: grid; gap: 7px; padding: 9px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border);
  font-size: .84rem; color: var(--muted); animation: rise .3s ease both; }
.a-progress .bar { height: 4px; border-radius: 2px; background: rgba(169, 212, 255, .15); overflow: hidden; }
.a-progress .bar i { display: block; height: 100%; width: 0; background: var(--mint); transition: width .3s linear; }
.r-links { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.r-links span { font-size: .72rem; color: var(--mint-soft); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.a-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.a-choices button { font: inherit; font-size: .76rem; color: var(--mint-soft); background: none; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; cursor: pointer; transition: border-color .2s, color .2s; }
.a-choices button.on { border-color: var(--warm); color: var(--warm); }
.a-say { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.a-receipt { display: grid; gap: 2px; padding: 9px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border);
  font-size: .85rem; animation: rise .35s ease both; }
.a-receipt .r-kind { font: 600 .66rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mint); }
.a-receipt .r-kind.wait { color: var(--warm); }
.a-receipt .r-main { color: var(--text); font-weight: 600; }
.a-receipt .r-meta { color: var(--muted); }
.a-receipt .r-undo { justify-self: start; margin-top: 4px; font: inherit; font-size: .78rem; color: var(--mint-soft); background: none;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.a-receipt .r-undo:hover { border-color: var(--mint); }
.a-receipt.old { opacity: .6; }
.hero-capture { position: relative; max-width: 640px; margin: 22px auto 0; text-align: center; }
.live-capture { position: relative; display: flex; gap: 8px; }
/* Speaking (F8), during the scripted scene: an audio meter and the words as they come, over the field */
.live-voice { position: absolute; inset: 0 58px 0 0; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--warm); box-shadow: 0 0 0 3px rgba(255, 210, 161, .18);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; pointer-events: none; }
.live-voice.on { opacity: 1; visibility: visible; }
.lv-key { font: 600 .7rem var(--mono); color: #13233a; background: var(--warm); border-radius: 5px; padding: 2px 6px; }
.lv-meter { display: flex; align-items: center; gap: 3px; height: 22px; flex: none; }
.lv-meter i { width: 3px; height: 25%; border-radius: 2px; background: var(--warm); transition: height .12s; }
.lv-said { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.live-capture input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--text); background: rgba(51, 71, 95, .92);
  border: 1px solid var(--border); border-radius: 999px; padding: 13px 20px; outline: none; }
.live-capture input::placeholder { color: var(--faint); }
.live-capture input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(169, 212, 255, .25); }
.live-capture button { width: 50px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 1.15rem; cursor: pointer; }
.live-capture button:hover { border-color: var(--mint); }
.live-try { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; color: var(--faint); font-size: .85rem; }
.live-try button { font: inherit; color: var(--mint-soft); background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.live-try button:hover { border-color: var(--mint); }
.live-note { margin: 6px 0 0; color: var(--faint); font-size: .8rem; }
html:not(.js) .hero-capture, html:not(.js) .archivist { display: none; }
@media (max-width: 960px) {
  .hero-live .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .live-graph { opacity: .45; }
  .archivist { justify-self: stretch; width: auto; }
  .a-log { height: 220px; }
}

/* Section heads */
.section-head { max-width: 760px; margin-bottom: 34px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* CODE method */
.code-flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: c; }
.code-flow li { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px 20px; }
.code-flow li::after { content: "→"; position: absolute; right: -14px; top: 30px; color: var(--forest-light); font-weight: 700; z-index: 1; }
.code-flow li:last-child::after { content: none; }
.code-letter { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--forest); color: var(--mint-soft); font-weight: 800; font-size: 1.2rem; margin-bottom: 12px; }
.code-flow p { color: var(--muted); font-size: .95rem; margin: 0; }
.para { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 22px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.para div { padding: 16px 18px; background: var(--bg-2); }
.para div + div { border-left: 1px solid var(--border); }
.para b { color: var(--mint-soft); display: block; }
.para span { color: var(--muted); font-size: .9rem; }

/* Feature rows */
.feature { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.feature + .feature { margin-top: clamp(56px, 8vw, 96px); }
.feature.flip .feature-text { order: 2; }
.cards + .feature { margin-top: clamp(48px, 7vw, 80px); }
.agent-card { border-top: 3px solid var(--ag); }
.agent-letter { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--ag) 18%, transparent); color: var(--ag); font-weight: 800; font-size: 1.2rem; }
.feature-text p { color: var(--muted); }
.feature-text ul { color: var(--muted); padding-left: 1.1em; margin: 0 0 1em; }
.feature-text li { margin: .3em 0; }
.shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--panel);
  box-shadow: 0 24px 60px -24px rgba(5, 12, 24, .7); cursor: zoom-in; }
.shot img { width: 100%; }
.shot figcaption { padding: 9px 14px; color: var(--muted); font-size: .86rem; border-top: 1px solid var(--border); }
.mini-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mini-shots .shot figcaption { font-size: .8rem; padding: 7px 10px; }
.says { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.say { display: inline-block; border: 1px solid rgba(255, 210, 161, .45); background: rgba(255, 210, 161, .08); color: var(--warm);
  border-radius: 999px; padding: 4px 12px; font-size: .86rem; }
.say::before { content: "🎙 "; font-size: .8em; }

/* MCP flow */
.mcp-flow { display: grid; grid-template-columns: 1fr auto 1.1fr auto 1fr; gap: 14px; align-items: center; margin: 0 0 clamp(48px, 7vw, 80px); }
.mcp-side { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mcp-chip { border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 6px 14px; font-size: .9rem; color: var(--text); }
.mcp-chip.mcp-any { border-style: dashed; color: var(--muted); background: transparent; }
.mcp-arrow { display: flex; flex-direction: column; align-items: center; color: var(--faint); font-size: .8rem; min-width: 96px; }
.mcp-arrow::before { content: "⇄"; font-size: 1.6rem; color: var(--mint); line-height: 1; margin-bottom: 4px; }
.mcp-core { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 22px 18px; border-radius: var(--radius);
  border: 1px solid rgba(169, 212, 255, .55); background: radial-gradient(circle at 50% 30%, rgba(169, 212, 255, .16), var(--panel) 70%);
  box-shadow: 0 0 40px -10px rgba(169, 212, 255, .45); }
.mcp-core b { font-size: 1.25rem; color: var(--mint-soft); }
.mcp-core span { color: var(--warm); font-size: .95rem; }
.mcp-core .mcp-core-sub { color: var(--muted); font-size: .82rem; }
@media (max-width: 860px) {
  .mcp-flow { grid-template-columns: 1fr; }
  .mcp-arrow::before { content: "⇅"; }
}

/* Voice band */
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.voice-grid .card h3 { font-size: 1rem; color: var(--mint-soft); }
.voice-grid .says { margin-top: 10px; }
.keys { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 26px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: .85em; background: var(--panel-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; color: var(--text); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.gallery .shot figcaption { font-size: .8rem; padding: 7px 10px; }
.gallery .shot-lead { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.gallery .shot-lead img { flex: 1; min-height: 0; object-fit: cover; object-position: left top; }
.gallery .shot-lead figcaption { font-size: .9rem; }

/* Roadmap v2 */
.road-col h4 { margin: 1.1em 0 .3em; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.road-col h4:first-of-type { margin-top: .4em; }
.badge-parked { background: rgba(200, 182, 255, .12); color: #d9ccff; border: 1px solid rgba(200, 182, 255, .4); }

/* Journal v2: rail + phase filters + cards + dialog */
.rail { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; margin: 10px 0 30px; padding: 0 4px; overflow-x: auto; scrollbar-width: thin; }
.rail::before { content: ""; position: absolute; left: 14px; right: 14px; top: 13px; height: 2px; background: linear-gradient(90deg, var(--forest), var(--mint)); opacity: .6; }
.rail button { position: relative; flex: 1 0 36px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font: inherit; font-size: .72rem; display: grid; justify-items: center; gap: 6px; min-width: 36px; }
.rail .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 2px var(--ph, var(--mint)); background: var(--ph, var(--mint)); margin-top: 5px; transition: transform .15s ease; }
.rail button:hover .dot, .rail button:focus-visible .dot { transform: scale(1.35); }
.rail button:hover { color: var(--text); }
.rail button.dim { opacity: .3; }
.phase-graph { --ph: #a9d4ff; } .phase-brain { --ph: #ffd2a1; } .phase-voice { --ph: #9fe3c4; } .phase-modules { --ph: #c8b6ff; } .phase-foundation { --ph: #8196ae; } .phase-agents { --ph: #ffd27a; }
.phases { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.phases button { font: inherit; font-size: .9rem; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.phases button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ph, var(--mint)); }
.phases button[data-phase="all"]::before { background: linear-gradient(90deg, #a9d4ff, #ffd2a1, #9fe3c4, #c8b6ff); }
.phases button[aria-pressed="true"] { color: var(--text); border-color: var(--forest-light); background: var(--panel-2); }
.loops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.loop-card { display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; padding: 0; transition: border-color .2s ease, transform .2s ease; }
.loop-card:hover, .loop-card:focus-visible { border-color: var(--forest-light); transform: translateY(-2px); }
.loop-card[hidden] { display: none; }
.loop-thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--panel-2), var(--bg-2)); overflow: hidden; display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.loop-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.loop-thumb .glyph { font-size: 2rem; font-weight: 800; color: var(--ph); opacity: .7; letter-spacing: .04em; }
.loop-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.loop-meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--faint); }
.loop-tag { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ph); }
.loop-body h3 { margin: 0; font-size: 1.02rem; }
.loop-body .excerpt { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.loop-more { margin-top: auto; padding-top: 4px; color: var(--mint); font-size: .85rem; font-weight: 600; }
dialog.reader { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-2); color: var(--text); box-shadow: 0 40px 120px rgba(0, 0, 0, .6); }
dialog.reader::backdrop { background: rgba(10, 18, 30, .72); backdrop-filter: blur(4px); }
.reader-img img { width: 100%; max-height: 52vh; object-fit: cover; object-position: top; border-bottom: 1px solid var(--border); }
.reader-body { padding: 22px 26px 26px; }
.reader-body p { color: var(--muted); }
.reader-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: rgba(43, 60, 84, .9); color: var(--text); font-size: 1.2rem; cursor: pointer; }
dialog.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
dialog.lightbox::backdrop { background: rgba(8, 14, 24, .88); }
dialog.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 12px; border: 1px solid var(--border); }
dialog.lightbox p { color: var(--muted); text-align: center; margin: 10px 0 0; }

/* Open-source band */
.os-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 26px; }
.os-grid .card h3 { font-size: 1rem; }
.os-grid .card a { font-weight: 600; font-size: .9rem; display: inline-block; margin-top: 10px; }

/* ---------- Docs page ---------- */
.docs-layout { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; }
.docs-nav { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 88px); overflow-y: auto; padding: 28px 0 40px; font-size: .92rem; }
.docs-nav h4 { margin: 1.4em 0 .4em; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); }
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.docs-nav a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.docs-nav a:hover { color: var(--text); }
.docs-nav a.active { color: var(--mint-soft); border-left-color: var(--mint); background: rgba(169, 212, 255, .05); }
.docs-search { width: 100%; font: inherit; font-size: .9rem; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 18px; }
.docs-main { padding: 28px 0 100px; min-width: 0; }
.docs-main > header { padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.docs-main h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.doc { padding-top: 34px; scroll-margin-top: 70px; }
.doc + .doc { border-top: 1px solid rgba(75, 100, 131, .5); margin-top: 34px; }
.doc h2 { font-size: 1.6rem; }
.doc h3 { margin-top: 1.5em; }
.doc p, .doc li { color: #d6e2ef; }
.doc li { margin: .35em 0; }
.doc .kicker { color: var(--mint); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .4em; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .93rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { color: var(--mint-soft); font-weight: 600; background: var(--panel); }
.doc td { color: #d6e2ef; }
pre { position: relative; background: #1f2d40; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 0 0 1.2em; font-size: .86rem; line-height: 1.55; }
pre code { background: none; padding: 0; font-size: inherit; color: #dce9f7; }
.copy { position: absolute; top: 8px; right: 8px; font: inherit; font-size: .75rem; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 9px; cursor: pointer; }
.copy:hover { color: var(--text); }
.steps-doc { counter-reset: s; list-style: none; padding: 0; }
.steps-doc > li { counter-increment: s; position: relative; padding-left: 44px; margin: 0 0 18px; }
.steps-doc > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: var(--mint-soft); font-weight: 700; font-size: .9rem; }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--mint); background: var(--panel); border-radius: 10px; padding: 12px 16px; margin: 0 0 1.2em; }
.callout p:last-child { margin: 0; }
.callout.warn { border-left-color: var(--warn); }
.callout.parked { border-left-color: #c8b6ff; }
.doc-shot { margin: 0 0 1.4em; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.doc-cards a { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); transition: border-color .2s ease; }
.doc-cards a:hover { border-color: var(--forest-light); }
.doc-cards span { display: block; color: var(--muted); font-size: .88rem; margin-top: 4px; }
.nav-links a[aria-current="page"] { color: var(--mint-soft); }

/* Reveal on scroll (enabled by JS only) */
.js .reveal { opacity: 0.35; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible.loop-card:hover { transform: translateY(-2px); }
.js .reveal.visible { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .cards-3, .roadmap, .shots { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .arch { grid-template-columns: 1fr; }
  .arch-link { min-height: 30px; }
  .arch-link::before { left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto;
    background: linear-gradient(180deg, var(--forest), var(--mint), var(--forest)); background-size: 100% 200%; animation: flow-v 2.4s linear infinite; }
  @keyframes flow-v { from { background-position: 0 0; } to { background-position: 0 -200%; } }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; gap: 2px; }
  .nav-links.open { display: flex; }
  .nav { position: relative; }
  .steps { grid-template-columns: 1fr; }
  .hero { min-height: 80vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
  .hero-split .hero-grid, .feature { grid-template-columns: 1fr; }
  .feature.flip .feature-text { order: 0; }
  .hero-shot { transform: none; }
  .code-flow, .para, .os-grid, .gallery { grid-template-columns: 1fr 1fr; }
  .gallery .shot-lead { grid-row: auto; }
  .code-flow li::after { content: none; }
  .para div + div { border-left: 0; }
  .voice-grid, .loops, .doc-cards { grid-template-columns: 1fr 1fr; }
  .docs-layout { grid-template-columns: 1fr; gap: 0; }
  .docs-nav { position: static; max-height: none; padding-bottom: 0; }
  .docs-nav nav { display: none; }
  .docs-nav.open nav { display: block; }
}
@media (max-width: 620px) {
  .code-flow, .para, .os-grid, .gallery, .voice-grid, .loops, .doc-cards, .mini-shots { grid-template-columns: 1fr; }
  .gallery .shot-lead { grid-column: auto; }
  .rail { justify-content: flex-start; }
}
.docs-toc-toggle { display: none; }
@media (max-width: 960px) { .docs-toc-toggle { display: inline-flex; margin-bottom: 12px; } }
.loop-card { position: relative; }
.loop-open { all: unset; cursor: pointer; }
.loop-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.loop-open:focus-visible::after { outline: 2px solid var(--mint-soft); outline-offset: 2px; }
.loop-card:focus-within { border-color: var(--forest-light); }
.loops.collapsed .loop-card:nth-child(n+7) { display: none; }
.loops-more { margin-top: 26px; }
.loops:not(.collapsed) + p .loops-more { display: none; }
@media (max-width: 720px) {
  .hero.hero-split { min-height: auto; }
  pre { padding-top: 38px; }
}

/* How-to guides (howto.html, generated by tools/howto/build_page.py) */
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 22px; }
.guide-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: border-color .2s ease, transform .2s ease; }
.guide-card:hover { border-color: var(--mint); transform: translateY(-2px); }
.guide-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; display: block; border-bottom: 1px solid var(--border); }
.guide-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.guide-card-body > span { color: var(--muted); font-size: .9rem; }
.guide-card-meta { font-size: .78rem !important; color: var(--mint) !important; }
.badge-real { background: rgba(169, 240, 199, .14); color: #a9f0c7; border: 1px solid rgba(169, 240, 199, .4); }
.badge-scripted { background: rgba(169, 212, 255, .1); color: var(--mint-soft); border: 1px solid rgba(169, 212, 255, .35); }
.guide h2 .badge { font-size: .7rem; vertical-align: middle; margin-left: 8px; }
.guide-goal { font-size: 1.08rem; }
.guide-steps { counter-reset: g; list-style: none; padding: 0; margin: 1.4em 0; }
.guide-step { counter-increment: g; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 22px; align-items: start; margin: 0 0 28px; }
.guide-step-text { position: relative; padding-left: 44px; }
.guide-step-text::before { content: counter(g); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: var(--mint-soft); font-weight: 700; font-size: .9rem; }
.guide-do { margin: 0 0 .5em; }
.guide-see { margin: 0; color: var(--muted) !important; font-size: .94rem; }
.guide-step .shot { margin: 0; }
.guide-trouble li b { color: var(--text); }
.guide-next { color: var(--muted); }
@media (max-width: 860px) {
  .guide-step { grid-template-columns: 1fr; gap: 12px; }
}

/* Flow diagrams (docs, how-to): chips → arrow → a glowing core → chips. Plain HTML, real text. */
.flow { display: flex; align-items: center; gap: 12px; margin: 20px 0 28px; padding: 22px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); background: rgba(10, 20, 36, .18); }
.flow-group { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.flow-group .chip, .flow-tail .chip { border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 4px 11px; font-size: .84rem; color: var(--text); white-space: nowrap; }
.flow .chip.any { border-style: dashed; color: var(--muted); background: transparent; }
.flow .chip.warm { border-color: rgba(255, 210, 161, .55); color: var(--warm); }
.flow-arrow { display: flex; flex-direction: column; align-items: center; color: var(--faint); font-size: .76rem; min-width: 70px; text-align: center; }
.flow-arrow::before { content: "→"; font-size: 1.4rem; color: var(--mint); line-height: 1; margin-bottom: 3px; }
.flow-arrow.both::before { content: "⇄"; }
.flow-core { flex: 1.1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 16px 12px;
  border-radius: var(--radius); border: 1px solid rgba(169, 212, 255, .55);
  background: radial-gradient(circle at 50% 30%, rgba(169, 212, 255, .16), var(--panel) 70%); box-shadow: 0 0 36px -12px rgba(169, 212, 255, .5); }
.flow-core b { font-size: 1.05rem; color: var(--mint-soft); }
.flow-core span { color: var(--warm); font-size: .86rem; }
.flow-core small { color: var(--muted); font-size: .76rem; }
.flow-note { margin: -16px 0 26px; color: var(--muted); font-size: .86rem; text-align: center; }
.tree { margin: 20px 0 28px; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(10, 20, 36, .18);
  font-family: var(--mono); font-size: .86rem; }
.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--border); }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { margin: 6px 0; }
.tree li span { font-family: var(--font); color: var(--muted); margin-left: 8px; }
.tree .root { color: var(--mint-soft); }
.tree .core-file { color: var(--warm); }
@media (max-width: 720px) {
  .flow { flex-direction: column; }
  .flow-arrow::before { content: "↓"; }
  .flow-arrow.both::before { content: "⇅"; }
}

/* Home: the "How it thinks" band (links to semantic.html) */
.think-band { padding: clamp(48px, 7vw, 80px) 0; background: radial-gradient(60% 80% at 85% 50%, rgba(62, 97, 137, .5), transparent 70%); border-top: 1px solid var(--border); }
.think-band-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.think-band h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.think-mini { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .18); }
.tm-q { margin: 0 0 4px; color: var(--mint-soft); font-weight: 600; }
.tm-row { display: grid; grid-template-columns: 116px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .12); font-size: .9rem; }
.tm-row span { color: var(--faint); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tm-words b { color: var(--faint); font-weight: 600; }
.tm-meaning b { color: var(--text); font-weight: 600; }
.tm-meaning i { font: 700 .66rem/1 var(--mono); font-style: normal; color: var(--warm); border: 1px solid rgba(255, 210, 161, .45); border-radius: 4px; padding: 2px 4px; }
@media (max-width: 860px) { .think-band-inner { grid-template-columns: 1fr; } }


/* Hero: the Archivist sits centred above the capture bar, as one console */
.hero-capture .archivist { justify-self: auto; align-self: auto; width: 100%; margin: 0 0 12px; text-align: left; }
.hero-capture .a-log { height: 170px; }
/* A full-height hero: the content in the middle, the graph filling the whole background behind it */
.hero-live.hero-split { min-height: clamp(600px, calc(100vh - 140px), 860px); display: flex; flex-direction: column; justify-content: center; padding: 56px 16px; }
.hero-live .hero-grid { min-height: 0; width: 100%; }
@media (max-width: 960px) { .hero-live.hero-split { min-height: 0; padding: 40px 16px; } }
.hero-live.hero-split { padding-top: clamp(40px, 6vw, 72px); }
/* the console (Archivist + capture) is the hero's right column */
.hero-live .hero-grid > .hero-capture { margin: 0; max-width: 500px; width: 100%; justify-self: end; align-self: center; }
.hero-live .hero-grid > .hero-capture .live-try, .hero-live .hero-grid > .hero-capture .live-note { text-align: center; }
@media (max-width: 960px) { .hero-live .hero-grid > .hero-capture { justify-self: stretch; max-width: none; } }
