/* ==========================================================================
   dive.css — shared chrome + scroll-story system for the Peel — Kids Brain dive
   Fully offline. System fonts only. No external requests.
   ========================================================================== */

:root {
  --bg: #050507;
  --bg-2: #0c0c10;
  --panel: #121218;
  --panel-2: #17171f;
  --line: #26262e;
  --ink: #f5f5f7;
  --muted: #9a9aa2;
  --dim: #6e6e76;
  --blue: #2997ff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --purple: #bf5af2;
  --teal: #64d2ff;
  --yellow: #ffd60a;
  --radius: 18px;
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.reduced { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

code, pre, .mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, monospace;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(41, 151, 255, 0.35); }

/* ---------- top chrome -------------------------------------------------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 20px;
  background: rgba(5, 5, 7, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar .brand {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.topbar .brand span { color: var(--dim); font-weight: 400; }
.topbar .brand:hover { text-decoration: none; color: var(--teal); }

.dots { display: flex; align-items: center; gap: 10px; }
.dots a {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3a3a42;
  display: block;
  transition: background 0.25s, transform 0.25s;
}
.dots a:hover { background: var(--muted); transform: scale(1.4); }
.dots a.active { background: var(--blue); transform: scale(1.35); }
.dots a .dot-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.readbar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 0;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--blue), var(--purple));
  z-index: 101;
}

/* ---------- typography -------------------------------------------------- */

.eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
}
.eyebrow.green { color: var(--green); }
.eyebrow.red { color: var(--red); }
.eyebrow.purple { color: var(--purple); }
.eyebrow.orange { color: var(--orange); }
.eyebrow.teal { color: var(--teal); }

h1 {
  font-size: clamp(2.6rem, 7.5vw, 5.4rem);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.022em;
}
h2 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.018em;
  margin-bottom: 20px;
}
h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 10px; }

.grad {
  background: linear-gradient(100deg, #fff 10%, var(--blue) 55%, var(--purple) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.grad-green {
  background: linear-gradient(100deg, #fff 15%, var(--green) 70%, var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.grad-red {
  background: linear-gradient(100deg, #fff 15%, var(--red) 70%, var(--orange));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.lede {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 46em;
}
.lede strong { color: var(--ink); font-weight: 600; }
p + p { margin-top: 1em; }

.small { font-size: 14px; color: var(--dim); }

/* ---------- layout ------------------------------------------------------ */

.band {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 130px 24px;
  position: relative;
}
.band.tight { padding: 70px 24px; }
.band.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
}
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 880px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p { color: var(--muted); font-size: 15px; }
.card code { color: var(--teal); font-size: 0.86em; }

.chip {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  margin: 3px 2px;
  white-space: nowrap;
}
.chip.blue   { color: var(--teal);   border-color: rgba(100, 210, 255, 0.35); }
.chip.green  { color: var(--green);  border-color: rgba(48, 209, 88, 0.35); }
.chip.purple { color: var(--purple); border-color: rgba(191, 90, 242, 0.4); }
.chip.orange { color: var(--orange); border-color: rgba(255, 159, 10, 0.4); }
.chip.red    { color: var(--red);    border-color: rgba(255, 69, 58, 0.4); }

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: middle;
}
.badge.t  { background: rgba(41, 151, 255, 0.16); color: var(--blue); }
.badge.f  { background: rgba(255, 69, 58, 0.16);  color: var(--red); }
.badge.i  { background: rgba(155, 155, 165, 0.14); color: var(--muted); }

pre.code {
  background: #0a0a0f;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  color: #c9c9d1;
}
pre.code .k { color: var(--teal); }
pre.code .s { color: #7ee787; }
pre.code .n { color: var(--orange); }
pre.code .c { color: var(--dim); }

/* stat blocks */
.stat { text-align: center; }
.stat .num {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.stat .cap { color: var(--muted); font-size: 15px; margin-top: 6px; }

hr.sep {
  border: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 0 auto; max-width: var(--maxw);
}

/* ---------- reveal on scroll -------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(42px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.6, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1);
}
[data-reveal].in-view { opacity: 1; transform: none; }
html.reduced [data-reveal] { opacity: 1; transform: none; transition: none; }

/* ---------- pinned scroll scenes ---------------------------------------- */

.pin {
  position: relative;
  height: calc(var(--len, 3) * 100vh);
  --p: 0;
}
.pin > .sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
}
html.reduced .pin { height: auto; --p: 1; }
html.reduced .pin > .sticky { position: static; height: auto; min-height: 0; padding: 80px 20px; }

.stage {
  perspective: 1400px;
  perspective-origin: 50% 42%;
}

.scene-cap {
  margin-top: 26px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  max-width: 40em;
}

/* ---------- prev / next page nav ---------------------------------------- */

.pagenav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 30px;
}
.pagenav a {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: var(--ink);
  transition: border-color 0.25s, transform 0.25s;
}
.pagenav a:hover { text-decoration: none; border-color: var(--blue); transform: translateY(-2px); }
.pagenav .dir { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.pagenav .to { font-size: 18px; font-weight: 600; margin-top: 4px; }
.pagenav a.next { text-align: right; grid-column: 2; }
.pagenav a.prev { grid-column: 1; }
@media (max-width: 640px) {
  .pagenav { grid-template-columns: 1fr; }
  .pagenav a.next { grid-column: auto; text-align: left; }
  .pagenav a.prev { grid-column: auto; }
}

footer.site {
  text-align: center;
  padding: 26px 20px 60px;
  color: var(--dim);
  font-size: 13.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 20px;
}
footer.site .rule { letter-spacing: 0.02em; }

/* ==========================================================================
   Page-specific scene styles
   ========================================================================== */

/* ---- screenshots with callout overlays ---- */
figure.shot {
  position: relative;
  margin: 34px auto;
  max-width: 980px;
}
figure.shot.narrow { max-width: 560px; }
figure.shot.mid { max-width: 760px; }
figure.shot .frame { position: relative; }
figure.shot img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
figure.shot figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--dim);
  text-align: center;
}
figure.shot figcaption code { color: var(--teal); font-size: 0.92em; }

/* ==========================================================================
   Showcase visuals — ABSTRACT (capability + positioning, never mechanism)
   ========================================================================== */

/* ---- results / stat band ---- */
.statband {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.statband .stat { padding: 8px 4px; }
.statband .stat .num { font-size: clamp(1.6rem, 3.4vw, 2.8rem); }
.statband .stat .cap { font-size: 13px; }
@media (max-width: 880px) { .statband { grid-template-columns: repeat(2, 1fr); } }

/* pill row of headline facts */
.facts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 30px; }
.fact {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
}
.fact .d { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(48,209,88,0.7); }
.fact.blue .d { background: var(--blue); box-shadow: 0 0 10px rgba(41,151,255,0.7); }
.fact.purple .d { background: var(--purple); box-shadow: 0 0 10px rgba(191,90,242,0.7); }
.fact.teal .d { background: var(--teal); box-shadow: 0 0 10px rgba(100,210,255,0.7); }

/* ---- THE LINE portfolio cards ---- */
.line-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 34px; }
@media (max-width: 880px) { .line-grid { grid-template-columns: 1fr; } }
.line-card {
  display: block;
  position: relative;
  color: var(--ink);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 30px 26px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2,0.6,0.2,1), border-color 0.3s;
}
.line-card:hover { text-decoration: none; transform: translateY(-5px); border-color: var(--blue); }
.line-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  opacity: 0.85;
}
.line-card .kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.line-card h3 { font-size: 1.5rem; margin: 8px 0 8px; }
.line-card p { color: var(--muted); font-size: 15px; }
.line-card .go { margin-top: 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--blue); }

/* ---- abstract canvas stages (neuron / graph) ---- */
.viz-stage {
  position: relative;
  width: 100%;
  height: 58vh;
  min-height: 440px;
  margin: 34px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 6%, rgba(41,151,255,0.08), transparent 55%),
    radial-gradient(100% 80% at 50% 105%, rgba(191,90,242,0.07), transparent 60%),
    #08080d;
}
.viz-stage canvas { display: block; width: 100%; height: 100%; }
.viz-cap { text-align: center; color: var(--dim); font-size: 13.5px; margin-top: 14px; }
html.reduced .viz-stage::after {
  content: attr(data-reduced);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 40px;
  color: var(--muted); font-size: 15px; line-height: 1.6;
}

/* ---- abstract evidence-chain journey (source -> knowledge -> answer) ---- */
.chain { display: flex; align-items: stretch; justify-content: center; gap: 0; flex-wrap: wrap; margin: 40px 0 10px; }
.chain-node {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  min-width: 190px;
  max-width: 240px;
  text-align: center;
  position: relative;
}
.chain-node .ic {
  width: 44px; height: 44px; margin: 0 auto 12px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(41,151,255,0.1);
  border: 1px solid rgba(41,151,255,0.35);
}
.chain-node .t { font-weight: 600; font-size: 15.5px; }
.chain-node .s { font-size: 13px; color: var(--muted); margin-top: 6px; }
.chain-node.source .ic { background: rgba(100,210,255,0.1); border-color: rgba(100,210,255,0.35); }
.chain-node.knowledge .ic { background: rgba(48,209,88,0.1); border-color: rgba(48,209,88,0.4); }
.chain-node.knowledge { border-color: rgba(48,209,88,0.4); box-shadow: 0 0 34px rgba(48,209,88,0.08); }
.chain-node.answer .ic { background: rgba(191,90,242,0.1); border-color: rgba(191,90,242,0.4); }
.chain-arrow { align-self: center; color: var(--dim); padding: 0 14px; font-size: 20px; }
@media (max-width: 880px) {
  .chain { flex-direction: column; align-items: center; }
  .chain-arrow { transform: rotate(90deg); padding: 8px 0; }
  .chain-node { max-width: 100%; }
}

/* proven / refused verdict chips */
.verdict {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 8px; padding: 6px 12px;
}
.verdict.proven { color: var(--green); background: rgba(48,209,88,0.12); border: 1px solid rgba(48,209,88,0.4); }
.verdict.refused { color: var(--red); background: rgba(255,69,58,0.12); border: 1px solid rgba(255,69,58,0.4); }

/* honest research-grade label */
.grade {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted);
  background: rgba(155,155,165,0.1);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  vertical-align: middle;
}

/* big pull quote / thesis */
.thesis {
  max-width: 24em;
  margin: 30px auto;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--ink);
}
.thesis .em { color: var(--green); }

/* skip link */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--blue);
  color: #000;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip:focus { left: 0; }
