/* contextrot — a story in seven chapters.
   Type: Bricolage Grotesque for words, Departure Mono (a pixel font) for anything the
   machine says — and for the one word in each line that matters. Everything is local. */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-var.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
}
@font-face {
  font-family: "Departure";
  src: url("../fonts/departure-mono.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}

:root {
  --bg: #05060a;
  --ink: #f1efe9;
  --ink-2: #a9adba;
  --ink-3: #626778;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --blue: #3b7bff;
  --blue-2: #8db0ff;
  --violet: #9b5cff;
  --red: #ff3b4a;
  --grad: linear-gradient(90deg, var(--blue) 0%, var(--violet) 55%, var(--red) 100%);
  --sans: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "Departure", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --io: cubic-bezier(0.65, 0, 0.35, 1);
  --gut: clamp(18px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.loading { overflow: hidden; }
img, svg, canvas { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--violet); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 6px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* pixel words: the one word in a line that matters */
em {
  font-family: var(--pixel); font-style: normal; font-weight: 400;
  font-size: 0.94em; letter-spacing: -0.03em;
  background: linear-gradient(100deg, var(--blue-2), var(--violet) 55%, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
em.red { background: linear-gradient(100deg, var(--violet), var(--red) 60%); -webkit-background-clip: text; background-clip: text; }
.tag, .eyebrow, .hint, .fine, .mono-num { font-family: var(--pixel); }
.tag { display: block; font-size: 11px; letter-spacing: 0.2em; color: var(--ink-3); margin: 0 0 18px; }

/* ─── stage ──────────────────────────────────────────────── */
#field { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 2; pointer-events: none; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 45% at 75% 45%, rgba(59, 123, 255, 0.09), transparent 70%),
    radial-gradient(40% 40% at 85% 90%, rgba(255, 59, 74, 0.05), transparent 70%),
    var(--bg);
}
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain { 0%,100% { transform: none; } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -4%); } 75% { transform: translate(-4%, -1%); } }
main { position: relative; z-index: 3; }

/* the window frame */
.frame {
  position: fixed; left: 0; top: 0; z-index: 1; pointer-events: none;
  border: 1.5px solid var(--rc, rgba(59, 123, 255, 0.6));
  border-radius: calc(var(--fw, 400px) * 0.028);
  background: rgba(7, 9, 15, 0.55);
  box-shadow: 0 40px 120px -40px rgba(59, 123, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  will-change: transform, width, height, opacity;
  transition: border-color 0.6s;
}
.frame-bar {
  height: var(--bar, 30px); display: flex; align-items: center; gap: 12px;
  padding: 0 calc(var(--fw, 400px) * 0.03); border-bottom: 1.5px solid var(--rc, rgba(59, 123, 255, 0.6));
  font-family: var(--pixel); font-size: 11px; color: var(--ink-3); transition: border-color 0.6s;
}
.frame-dots { display: flex; gap: calc(var(--fw, 400px) * 0.012); }
.frame-dots i { width: calc(var(--fw, 400px) * 0.016); height: calc(var(--fw, 400px) * 0.016); min-width: 6px; min-height: 6px; border-radius: 50%; background: var(--rc, var(--blue)); transition: background-color 0.6s; }
.frame-title { flex: 1; text-align: center; letter-spacing: 0.12em; }
.frame-pct { color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.frame-pct b { font-weight: 400; color: var(--ink); }
.frame-body { position: absolute; left: 0; right: 0; bottom: 0; top: var(--bar, 30px); }
.frame-chart { position: absolute; inset: 68% 4% 13% 4%; width: 92%; height: 19%; overflow: visible; opacity: var(--chart, 0); }
.fc-line { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 10px rgba(141, 176, 255, 0.9)); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--draw, 0)); }
.frame-labels { position: absolute; inset: auto 4% 6% 4%; display: flex; justify-content: space-between; opacity: var(--chart, 0); font-family: var(--pixel); font-size: 13px; color: var(--ink-2); }
.fl b { font-weight: 400; color: #fff; font-size: 22px; margin-right: 6px; }

/* ─── cursor ─────────────────────────────────────────────── */
.cursor { position: fixed; inset: 0; z-index: 100; pointer-events: none; display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.cursor-dot, .cursor-ring { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; mix-blend-mode: difference; }
.cursor-ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 1px solid rgba(255, 255, 255, 0.55);
  display: grid; place-items: center;
  transition: width 0.4s var(--ease), height 0.4s var(--ease), margin 0.4s var(--ease), background-color 0.4s, border-color 0.4s;
}
.cursor-label { font-family: var(--pixel); font-size: 11px; color: var(--bg); opacity: 0; transition: opacity 0.25s; white-space: nowrap; }
.cursor.is-hover .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: rgba(255, 255, 255, 0.92); border-color: transparent; mix-blend-mode: difference; }
.cursor.is-label .cursor-ring { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: var(--ink); border-color: transparent; }
.cursor.is-label .cursor-label { opacity: 1; }
.cursor.is-label .cursor-dot, .cursor.is-hover .cursor-dot { opacity: 0; }

/* ─── loader ─────────────────────────────────────────────── */
.loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; place-content: center; justify-items: center; gap: 16px;
  font-family: var(--pixel); clip-path: inset(0 0 0 0); transition: clip-path 1s var(--io);
}
.loader.done { clip-path: inset(0 0 100% 0); }
.loader.gone { display: none; }
.loader-num { font-size: clamp(66px, 14vw, 176px); line-height: 0.9; font-variant-numeric: tabular-nums; }
.loader-bar { width: min(300px, 60vw); height: 6px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 10px, transparent 10px 12px); }
.loader-bar i { display: block; height: 100%; background: var(--grad); transform-origin: left; transform: scaleX(var(--p, 0)); -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px); mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px); }
.loader-label { font-size: 11px; letter-spacing: 0.24em; color: var(--ink-3); }

/* ─── nav ────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 72px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--gut);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--pixel); font-size: 15px; }
.chapter { display: flex; align-items: center; gap: 12px; font-family: var(--pixel); font-size: 11px; color: var(--ink-3); letter-spacing: 0.12em; }
.ch-num { color: var(--ink); }
.ch-bar { width: 88px; height: 4px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.1) 0 7px, transparent 7px 9px); }
.ch-bar i { display: block; height: 100%; background: var(--grad); background-size: 88px 100%; transform-origin: left; transform: scaleX(0); -webkit-mask: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 9px); mask: repeating-linear-gradient(90deg, #000 0 7px, transparent 7px 9px); }
.ch-title { min-width: 13ch; }
.gh {
  justify-self: end; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-family: var(--pixel); font-size: 13px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(5, 6, 10, 0.5); backdrop-filter: blur(10px);
  transition: background-color 0.3s;
}
.gh:hover { background: rgba(255, 255, 255, 0.1); }

/* ─── reveals ────────────────────────────────────────────── */
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.04em 0.12em; margin: 0 -0.04em -0.12em; }
[data-split] .w > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
[data-split].in .w > span { transform: none; }
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ─── 00 hero ────────────────────────────────────────────── */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 100px var(--gut) 80px; }
.hero-copy { width: min(48vw, 680px); }
.eyebrow { font-size: 11px; letter-spacing: 0.18em; color: var(--ink-3); margin: 0 0 26px; }
.h-hero { font-weight: 750; font-size: clamp(2.6rem, 5.4vw, 5.6rem); line-height: 0.98; letter-spacing: -0.04em; margin: 0 0 26px; }
.hero-sub { font-size: clamp(1.05rem, 1.4vw, 1.3rem); color: var(--ink-2); margin: 0 0 34px; --d: 250ms; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; --d: 400ms; }
.hero-note { position: absolute; right: var(--gut); bottom: 36px; margin: 0; font-family: var(--pixel); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; transition: opacity 0.5s; }

.cmd {
  display: inline-flex; align-items: center; gap: 12px; font-family: var(--pixel); font-size: 17px;
  padding: 14px 14px 14px 20px; border-radius: 14px; background: rgba(10, 12, 20, 0.85);
  border: 1px solid var(--line-2); box-shadow: 0 18px 50px -20px rgba(59, 123, 255, 0.55);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.cmd:hover { border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 22px 60px -18px rgba(155, 92, 255, 0.7); }
.cmd-p { color: var(--violet); }
.cmd-c { display: inline-grid; overflow: hidden; font-size: 11px; letter-spacing: 0.1em; padding: 6px 9px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); color: var(--ink-2); }
.cmd-c > span { grid-area: 1 / 1; transition: transform 0.45s var(--ease), opacity 0.45s; }
.c2 { transform: translateY(120%); opacity: 0; color: #7ef0ae; }
.copied .c1 { transform: translateY(-120%); opacity: 0; }
.copied .c2 { transform: none; opacity: 1; }
.ghost { font-family: var(--pixel); font-size: 13px; color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 3px; }
.ghost:hover { color: var(--ink); }

/* ─── pinned chapters ────────────────────────────────────── */
.pin { position: relative; }
.pin-window { height: 340vh; }
.pin-answer { height: 330vh; }
.pin-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.lines { position: absolute; left: var(--gut); top: 50%; width: min(42vw, 620px); transform: translateY(-50%); height: 50vh; }
.line {
  position: absolute; inset: 0; margin: 0; display: flex; flex-direction: column; justify-content: center;
  font-weight: 700; font-size: clamp(2rem, 3.8vw, 3.9rem); line-height: 1.02; letter-spacing: -0.035em;
  opacity: var(--o, 0); transform: translateY(calc((1 - var(--o, 0)) * var(--dir, 1) * 36px)); filter: blur(calc((1 - var(--o, 0)) * 8px));
}
.line .tag { font-weight: 400; letter-spacing: 0.2em; }

.pin-answer .pin-stage { display: grid; place-content: center; justify-items: center; text-align: center; }
.a-claim, .a-line, .a-big { margin: 0; opacity: var(--o, 0); transform: translateY(calc((1 - var(--o, 0)) * 26px)); filter: blur(calc((1 - var(--o, 0)) * 10px)); }
.a-claim {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; padding: 34px 46px; border-radius: 24px;
  font-weight: 750; font-size: clamp(2.2rem, 4.6vw, 4.6rem); line-height: 1; letter-spacing: -0.04em;
  background: rgba(5, 6, 10, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line);
}
.a-claim .mono-num { color: var(--blue-2); font-size: 1.04em; letter-spacing: -0.04em; }
.a-claim .tag { margin-bottom: 16px; }
.a-result { display: grid; justify-items: center; gap: 18px; }
.a-line { font-weight: 600; font-size: clamp(1.15rem, 1.9vw, 1.7rem); letter-spacing: -0.01em; color: var(--ink); padding: 8px 18px; border-radius: 999px; background: rgba(5, 6, 10, 0.7); backdrop-filter: blur(8px); }
.a-big {
  font-family: var(--pixel); font-size: clamp(4.4rem, 15vw, 15rem); line-height: 0.9; letter-spacing: -0.04em;
  color: #fff; text-shadow: 0 0 60px rgba(141, 176, 255, 0.55), 0 0 4px rgba(255, 255, 255, 0.6);
  transform: translateY(calc((1 - var(--o, 0)) * 26px)) scale(calc(0.9 + var(--o, 0) * 0.1));
}

/* ─── horizontal chapters ────────────────────────────────── */
.hs { position: relative; }
.hs-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.hs-track { display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); padding: 0 var(--gut); will-change: transform; }
.hs[data-hs="right"] .hs-track { flex-direction: row-reverse; }
.panel { flex: none; margin: 0; }
.panel-intro, .panel-outro { width: min(70vw, 760px); }
.h-big { font-weight: 750; font-size: clamp(2.6rem, 6vw, 6.4rem); line-height: 0.96; letter-spacing: -0.04em; margin: 0; }
.h-big.center { text-align: center; }
.hint { font-size: 13px; color: var(--ink-3); margin: 28px 0 0; animation: nudge 1.8s var(--io) infinite; }
.hs[data-hs="right"] .hint { animation-name: nudge-l; }
@keyframes nudge { 50% { transform: translateX(8px); } }
@keyframes nudge-l { 50% { transform: translateX(-8px); } }
.fine { font-size: 11px; color: var(--ink-3); margin: 26px 0 0; letter-spacing: 0.06em; }

.sig {
  width: clamp(280px, 34vw, 480px); border-radius: 22px; overflow: hidden;
  background: rgba(11, 13, 21, 0.85); border: 1px solid var(--line);
  transform: translateY(calc(var(--lift, 0) * 1px)) rotate(calc(var(--tilt, 0) * 1deg));
}
.sig canvas { width: 100%; height: clamp(220px, 34vh, 330px); }
.sig figcaption { display: flex; align-items: baseline; gap: 14px; padding: 18px 22px 22px; border-top: 1px solid var(--line); font-weight: 650; font-size: clamp(1.25rem, 1.9vw, 1.7rem); letter-spacing: -0.02em; }
.sig figcaption span { font-family: var(--pixel); font-weight: 400; font-size: 11px; color: var(--violet); letter-spacing: 0.1em; }

.fac {
  width: clamp(260px, 28vw, 400px); min-height: clamp(320px, 52vh, 460px); padding: 30px 28px; border-radius: 22px;
  background: rgba(11, 13, 21, 0.85); border: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateY(calc(var(--lift, 0) * 1px));
}
.fac-x { font-family: var(--pixel); font-size: clamp(4.4rem, 8vw, 7.4rem); line-height: 0.9; margin: 0 0 10px; letter-spacing: -0.04em; background: linear-gradient(180deg, #fff, var(--red)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fac-x small { font-size: 0.4em; }
.fac.flat .fac-x { background: linear-gradient(180deg, #fff, var(--blue-2)); -webkit-background-clip: text; background-clip: text; }
.fac-name { font-weight: 650; font-size: clamp(1.3rem, 2vw, 1.8rem); letter-spacing: -0.02em; margin: 0 0 auto; }
.fac-name sup { color: var(--ink-3); font-size: 0.6em; }
.fac-none { font-family: var(--pixel); font-size: 13px; color: var(--blue-2); margin: 0; }
.bars { display: grid; gap: 12px; }
.bar { position: relative; display: block; font-family: var(--pixel); font-size: 12px; color: var(--ink-2); padding-top: 18px; }
.bar b { font-weight: 400; color: var(--ink); margin-right: 6px; }
.bar::before { content: ""; position: absolute; left: 0; top: 0; height: 10px; width: calc(var(--v) * 100% * var(--grow, 0)); transition: width 1.2s var(--ease); background: repeating-linear-gradient(90deg, currentColor 0 8px, transparent 8px 10px); }
.bar.bad::before { color: var(--red); } .bar.good::before { color: var(--blue); }
.fac.in .bar { --grow: 1; }

/* ─── 05 run ─────────────────────────────────────────────── */
.sec { position: relative; padding: clamp(120px, 18vh, 200px) var(--gut); }
.run .h-big { margin-bottom: clamp(44px, 7vh, 72px); }
.term {
  max-width: 1100px; margin: 0 auto; border-radius: 20px; overflow: hidden; background: rgba(8, 9, 14, 0.94);
  border: 1px solid var(--line-2); box-shadow: 0 60px 140px -50px rgba(59, 123, 255, 0.4), 0 30px 80px -40px rgba(255, 59, 74, 0.2);
}
.term-bar { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.term-dots { display: flex; gap: 7px; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255,255,255,.14); }
.term-tabs { display: flex; gap: 4px; flex: 1; }
.ttab { font-family: var(--pixel); font-size: 13px; padding: 7px 12px; border-radius: 8px; color: var(--ink-3); transition: background-color 0.3s, color 0.3s; }
.ttab:hover { color: var(--ink-2); }
.ttab[aria-selected="true"] { background: rgba(255,255,255,.09); color: var(--ink); }
.term-note { font-family: var(--pixel); font-size: 11px; color: var(--ink-3); }
.term-screen { position: relative; padding: 24px 26px 28px; min-height: 470px; font-family: var(--pixel); font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: var(--ink-2); overflow: hidden; }
.term-screen.wide { white-space: pre; overflow-x: auto; }
.term-screen .ln { display: block; min-height: 1.6em; animation: ln 0.35s var(--ease) both; }
@keyframes ln { from { opacity: 0; transform: translateY(4px); filter: blur(3px); } }
.t-dim { color: var(--ink-3); } .t-b { color: var(--ink); } .t-blue { color: var(--blue-2); }
.t-red { color: #ff6b76; } .t-violet { color: #b892ff; } .t-amber { color: #ffb03b; } .t-green { color: #6fe3a1; } .t-cyan { color: #6fd8ff; }
.t-badge { display: inline-block; padding: 0 8px; border-radius: 3px; background: var(--red); color: #fff; }
.t-caret { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.18em; background: var(--ink); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.t-prog { display: inline-block; width: 200px; height: 0.6em; background: rgba(255,255,255,.08); overflow: hidden; }
.t-prog i { display: block; height: 100%; background: var(--grad); transform-origin: left; }
.t-bar, .t-gapbar { display: inline-block; height: 0.7em; vertical-align: 0; }
.t-gapbar { background: var(--grad); }
.cc { display: grid; gap: 14px; white-space: normal; }
.cc-log { display: grid; gap: 8px; min-height: 290px; align-content: end; }
.term-screen .cc-msg { padding: 3px 14px; min-height: 0; border-left: 2px solid var(--line-2); font-size: 13.5px; line-height: 1.5; }
.cc-msg.user { border-color: var(--violet); color: var(--ink); }
.cc-msg .who { color: var(--ink-3); margin-right: 10px; }
.cc-input { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; color: var(--ink-3); font-size: 13.5px; }
.cc-status { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; padding: 2px 4px; white-space: nowrap; }
.cc-status .sep { color: var(--ink-3); }
.cc-bar { display: inline-flex; gap: 1.5px; vertical-align: -1px; }
.cc-bar i { width: 7px; height: 12px; background: rgba(255,255,255,.1); transition: background-color 0.4s; }
.cc-warn { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,176,59,.4); background: rgba(255,176,59,.08); color: #ffb03b; font-size: 13px; animation: ln 0.5s var(--ease) both; }
.cc-sys { color: var(--ink-3); font-size: 12.5px; }
.drop { display: inline-block; width: 1ch; text-align: center; }
.tank { display: block; width: 100%; max-width: 560px; height: 210px; margin: 8px 0 14px; }

/* ─── 06 share ───────────────────────────────────────────── */
.share { min-height: 100vh; display: grid; place-items: center; overflow: hidden; }
.waffle { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--cols, 48), 1fr); gap: 5px; padding: 5px; align-content: center; opacity: 0.9; -webkit-mask: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 85%); mask: radial-gradient(70% 70% at 50% 50%, #000 30%, transparent 85%); }
.waffle i { aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.045); transition: background-color 0.5s; }
.waffle i.lit { background: var(--blue); box-shadow: 0 0 22px var(--blue), 0 0 6px var(--blue); animation: pulse 2.4s var(--io) infinite; }
.waffle i.ping { background: rgba(155, 92, 255, 0.55); }
@keyframes pulse { 50% { box-shadow: 0 0 4px var(--blue); } }
.share-copy { position: relative; text-align: center; display: grid; justify-items: center; gap: 22px; padding: 40px; }
.share-copy::before { content: ""; position: absolute; inset: -10% -6%; z-index: -1; background: radial-gradient(closest-side, rgba(5, 6, 10, 0.94), rgba(5, 6, 10, 0.7) 60%, transparent); }
.share .h-big { max-width: 12ch; }
.share .mono-num { color: var(--blue-2); }
.share-sub { color: var(--ink-2); margin: 0; --d: 200ms; }
.share .cmd { --d: 350ms; }

/* ─── 07 end ─────────────────────────────────────────────── */
.end { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; overflow: hidden; }
.pool { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; z-index: 0; }
.end-copy { position: relative; z-index: 1; display: grid; place-content: center; justify-items: center; text-align: center; gap: 18px; padding: 120px var(--gut) 30vh; }
.mega { display: flex; align-items: baseline; gap: 0.3em; font-family: var(--pixel); font-size: clamp(2.4rem, 8.4vw, 8.8rem); line-height: 1; letter-spacing: -0.04em; transition: transform 0.5s var(--ease); }
.mega:hover { transform: scale(1.02); }
.mega-p { color: var(--violet); }
.mega-t { background: linear-gradient(180deg, #fff 30%, var(--blue-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-sub, .agents { font-family: var(--pixel); font-size: 12px; color: var(--ink-3); margin: 0; letter-spacing: 0.06em; }
.agents { color: var(--ink-2); max-width: 60ch; }
.foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 22px var(--gut); font-family: var(--pixel); font-size: 11px; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.06em; }
.foot nav { display: flex; gap: 22px; }
.foot a { text-decoration: none; color: #fff; }
.foot a:hover { text-decoration: underline; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 120; transform: translate(-50%, 220%); visibility: hidden; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-family: var(--pixel); font-size: 13px; transition: transform 0.6s var(--ease), visibility 0s 0.6s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform 0.6s var(--ease); }
.burst { position: fixed; inset: 0; z-index: 110; pointer-events: none; }

/* ─── small screens ──────────────────────────────────────── */
@media (max-width: 900px) {
  body { font-size: 16px; }
  .chapter .ch-bar, .chapter .ch-title { display: none; }
  .hero { align-items: flex-start; padding-top: 110px; }
  .hero-copy { width: 100%; }
  .hero-note { left: var(--gut); right: auto; }
  .lines { left: var(--gut); right: var(--gut); width: auto; top: auto; bottom: 6vh; transform: none; height: 34vh; }
  .line { justify-content: flex-end; }
  .a-claim { padding: 24px 26px; width: calc(100vw - 2 * var(--gut)); }
  .panel-intro, .panel-outro { width: 82vw; }
  .sig { width: 78vw; }
  .fac { width: 72vw; }
  .term-screen { font-size: 11.5px; padding: 18px 14px; min-height: 440px; }
  .term-note { display: none; }
  .foot { justify-content: center; text-align: center; }
}
@media (max-width: 520px) {
  .gh span { display: none; }
  .gh { padding: 9px 11px; }
  .cmd { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0ms !important; }
  [data-reveal], [data-split] .w > span { opacity: 1; transform: none; }
  .grain { display: none; }
}
