/* ─────────────────────────────── fonts ─────────────────────────────── */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
}

/* ─────────────────────────────── tokens ─────────────────────────────── */
:root {
  --bg: #000;
  --fg: #f3f5f7;
  --text: #c3cad2;
  --muted: #8b949e;
  --dim: #7d8590;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --panel: rgba(4, 6, 9, 0.72);
  --accent: #00bdb3;          /* the teal from v1, kept on purpose */
  --accent-soft: rgba(0, 189, 179, 0.16);
  --violet: #9aa6ff;
  --warm: #ffc48a;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.intro { overflow: hidden; }
::selection { background: var(--accent); color: #000; }
a { color: inherit; }
img, svg { display: block; }
p { margin: 0; }
h1, h2, h3 { margin: 0; color: var(--fg); font-weight: 700; }
code { font-family: var(--mono); font-size: 0.88em; color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* ─────────────────────────────── stage ─────────────────────────────── */
#cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.nebula {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 32% at 22% 30%, rgba(0, 189, 179, 0.075), transparent 70%),
    radial-gradient(36% 30% at 78% 64%, rgba(120, 110, 255, 0.07), transparent 70%),
    radial-gradient(28% 22% at 60% 18%, rgba(255, 170, 110, 0.035), transparent 70%);
  opacity: 0;
  transition: opacity 2.4s ease 0.4s;
  animation: drift 60s ease-in-out infinite alternate;
}
html.live .nebula, html:not(.js) .nebula { opacity: 1; }
/* a 60 s drift nobody notices on a phone; spare its GPU the moving full-screen layer */
@media (pointer: coarse) { .nebula { animation: none; } }
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); }
  to   { transform: translate3d(2%, 1.5%, 0) rotate(6deg) scale(1.08); }
}
main { position: relative; z-index: 2; overflow-x: hidden; overflow-x: clip; }

.fx { position: fixed; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.halo {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--r, 180px) * 4); height: calc(var(--r, 180px) * 4);
  margin: calc(var(--r, 180px) * -2) 0 0 calc(var(--r, 180px) * -2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 235, 255, 0.10) 0, rgba(0, 189, 179, 0.05) 30%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
html.intro .halo { opacity: 1; animation: breathe 4s ease-in-out infinite; }
html.intro.imploding .halo { opacity: 0; transition-duration: 0.3s; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.flash, .shock { position: absolute; left: var(--x, 50%); top: var(--y, 50%); opacity: 0; }
.flash {
  width: 240vmax; height: 240vmax;
  margin: -120vmax 0 0 -120vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0, rgba(255, 236, 214, 0.5) 4%, rgba(160, 220, 255, 0.12) 16%, transparent 38%);
}
.shock {
  width: 40px; height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 24px rgba(160, 230, 255, 0.6), inset 0 0 18px rgba(255, 255, 255, 0.4);
}
/* press and hold: the hole itself. Black enough to swallow the text under it, with a thin hot rim */
.hole {
  position: absolute; left: 0; top: 0; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%;
  background: radial-gradient(circle, #000 0 84%, rgba(0, 0, 0, 0.5) 93%, transparent 100%);
  box-shadow: 0 0 0 1px rgba(255, 214, 170, 0.5), 0 0 28px 3px rgba(255, 160, 80, 0.32), inset 0 0 12px rgba(255, 190, 130, 0.22);
  opacity: 0; transition: opacity 0.3s ease; will-change: transform;
}
.fx.holing .hole { opacity: 1; }
.fx.nova .flash { animation: flash-s 0.8s ease-out forwards; }
.fx.nova .shock { animation: shock 1.1s cubic-bezier(0.1, 0.6, 0.2, 1) forwards; }
@keyframes flash-s { 0% { opacity: 0; transform: scale(0.08); } 10% { opacity: 0.45; transform: scale(0.4); } 100% { opacity: 0; transform: scale(0.55); } }
html.holding { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fx.bang .flash { animation: flash 1.1s ease-out forwards; }
.fx.bang .shock { animation: shock 1.3s cubic-bezier(0.1, 0.6, 0.2, 1) forwards; }
@keyframes flash { 0% { opacity: 0; transform: scale(0.2); } 8% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes shock { 0% { opacity: 1; transform: scale(0.2); border-width: 6px; } 100% { opacity: 0; transform: scale(60); border-width: 0.2px; } }
html.shake main, html.shake #cosmos { animation: shake 0.42s linear; }
@keyframes shake {
  0%, 100% { transform: none; }
  15% { transform: translate(5px, -3px); } 30% { transform: translate(-4px, 4px); }
  45% { transform: translate(3px, 2px); } 60% { transform: translate(-2px, -2px); }
  80% { transform: translate(1px, 1px); }
}

/* ─────────────────────────────── topbar ─────────────────────────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter);
  padding-top: max(18px, env(safe-area-inset-top));
  font-family: var(--mono);
  font-size: 13px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  transition: opacity 0.8s ease, transform 0.8s var(--ease);
}
html.js:not(.live) .topbar:not(:focus-within) { opacity: 0; transform: translateY(-12px); pointer-events: none; }
html.reduced .topbar { transition: none; }
.topbar.scrolled {
  background: rgba(0, 0, 0, 0.86);
  box-shadow: 0 1px 0 var(--line);
}
/* the canvas under the bar changes every frame, so a backdrop blur is re-computed every
   frame too: only worth it where there is GPU to spare */
@media (hover: hover) and (pointer: fine) {
  .topbar.scrolled {
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.brand { color: var(--fg); text-decoration: none; font-weight: 600; letter-spacing: 0.02em; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; gap: clamp(12px, 2.4vw, 28px); }
.topbar nav a { color: var(--muted); text-decoration: none; transition: color 0.2s; position: relative; }
.topbar nav a:hover, .topbar nav a[aria-current="true"] { color: var(--fg); }
.topbar nav a[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--accent);
}

/* ─────────────────────────────── layout ─────────────────────────────── */
.section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(96px, 16vh, 168px) 0 clamp(64px, 10vh, 120px);
}
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 var(--gutter); }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 18px;
}
.title {
  font-size: clamp(46px, 9vw, 120px);
  line-height: 1.02;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.title-s { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; margin-bottom: 18px; }
.lede { font-size: clamp(20px, 2.6vw, 30px); color: var(--fg); line-height: 1.3; font-weight: 500; }
.lede-s { font-size: clamp(17px, 1.7vw, 20px); color: var(--text); max-width: 62ch; }
.sub { color: var(--muted); max-width: 52ch; }
.sub a, .prose a { color: var(--fg); text-decoration-color: var(--accent); text-underline-offset: 3px; }
em { color: var(--fg); font-style: normal; }

/* ghosts: crisp DOM copies of what the particles draw. With particles running they stay
   invisible (but readable by assistive tech): when the particles move on, the shape goes
   with them. Without JS or with reduced motion, the DOM copy is what you see. */
html.js .ghost { opacity: 0; }
html:not(.js) .ghost, html.reduced .ghost { opacity: 1 !important; }
.title.ghost, .title-hero { text-shadow: 0 0 22px rgba(255, 255, 255, 0.22); }

/* section content is built by particles: the page sets each child's opacity from the
   scroll position, so the crisp DOM text condenses as its particles land and dissolves
   as they leave (inline styles, hence the !important for keyboard focus) */
html.js:not(.reduced) .section > * { opacity: 0; }
html.js:not(.reduced) .section.is-faded > * { pointer-events: none; }
html.js:not(.reduced) .section:focus-within > * { opacity: 1 !important; pointer-events: auto; }

/* ─────────────────────────────── hero ─────────────────────────────── */
.hero { display: flex; align-items: center; text-align: center; padding-top: 80px; padding-bottom: 80px; }
.hero .wrap { display: flex; flex-direction: column; align-items: center; }
.title-hero {
  font-size: clamp(64px, 14.2vw, 214px);
  line-height: 0.95;
  text-transform: uppercase;
  margin: 6px 0 clamp(20px, 3vw, 36px);
}
.title-hero span { display: inline; }
.hero .lede { max-width: 22ch; margin-bottom: 14px; }
.hero .sub { margin: 0 auto; }
.scroll-cue {
  position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom));
  width: 1px; height: 56px; margin-left: -0.5px;
  background: linear-gradient(to bottom, transparent, var(--line-strong));
  overflow: hidden;
}
.scroll-cue span {
  position: absolute; left: -1px; top: 0; width: 3px; height: 14px; border-radius: 2px; background: var(--accent);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { from { transform: translateY(-14px); } to { transform: translateY(56px); } }

/* ─────────────────────────────── story ─────────────────────────────── */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.prose p + p { margin-top: 1.1em; }
.prose p { font-size: clamp(17px, 1.6vw, 19px); }
.timeline { list-style: none; margin: 0; padding: 4px 0 4px 34px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px;
  background: linear-gradient(to bottom, var(--line-strong), var(--line-strong) 85%, transparent);
  opacity: 0; transition: opacity 0.6s ease;
}
html:not(.js) .timeline::before, html.reduced .timeline::before { opacity: 1; }
.timeline li { position: relative; padding-bottom: 22px; }
.timeline li:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -32px; top: 8px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--fg); box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  opacity: 0; transition: opacity 0.6s ease;
}
html:not(.js) .tl-dot, html.reduced .tl-dot { opacity: 1; }
.timeline time { font-family: var(--mono); font-size: 13px; color: var(--accent); display: block; line-height: 1.9; }
.timeline p { color: var(--text); font-size: 16px; }
.timeline a { color: var(--fg); text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ─────────────────────────────── cards ─────────────────────────────── */
.cards { display: grid; gap: clamp(14px, 2vw, 22px); margin-top: clamp(28px, 4vw, 48px); }
.cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.now-card { padding-top: clamp(26px, 3vw, 36px); }
.now-card h3 { font-size: clamp(22px, 2.4vw, 30px); }
.now-card p a { color: var(--fg); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.04em; }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(0.4); opacity: 0.9; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
.card {
  position: relative;
  display: block;
  padding: clamp(22px, 2.6vw, 32px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 2px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s ease, background 0.3s ease;
}
/* HUD-style corner brackets: drawn by particles while held, by CSS otherwise */
.card::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  --c: rgba(255, 255, 255, 0.75); --l: 16px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--l) no-repeat;
  opacity: 0; transition: opacity 0.6s ease;
}
html:not(.js) .card::before, html.reduced .card::before { opacity: 1; }
.card h3 { font-size: clamp(20px, 2vw, 24px); margin: 6px 0 10px; letter-spacing: -0.01em; }
.card p { font-size: 15.5px; color: var(--text); }
.card-idx, .lang { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.lang { color: var(--accent); }
.proj:hover, .proj:focus-visible { border-color: var(--line-strong); background: rgba(10, 14, 18, 0.85); }
.proj h3 .arr { margin-left: 0.4em; font-family: var(--mono); font-size: 0.7em; color: var(--dim); transition: color 0.2s; }
.proj:hover h3 .arr { color: var(--accent); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; font-family: var(--mono); font-size: 12px; }
.tags li { padding: 3px 9px; border: 1px solid var(--line); color: var(--muted); border-radius: 99px; }

/* ─────────────────────────────── asena ─────────────────────────────── */
.asena { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.stats { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(4, auto); gap: 12px 28px; justify-content: start; }
.stats b { display: block; font-size: clamp(24px, 2.6vw, 32px); color: var(--fg); line-height: 1.1; font-weight: 600; }
.stats span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.code {
  margin: 0;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d5dbe1;
  overflow-x: auto;
  tab-size: 2;
}
.code code { font-size: inherit; color: inherit; }
.code .d { color: var(--accent); }
.code .k { color: var(--violet); }
.code .t { color: #e8eef4; font-weight: 600; }
.code .s { color: var(--warm); }
.code .f { color: #8fd8ff; }
.code .c { color: var(--dim); -webkit-user-select: none; user-select: none; }
.fine { margin-top: 22px; font-size: 15px; color: var(--muted); max-width: 62ch; }
.links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 22px; font-family: var(--mono); font-size: 14px; }
.links a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 2px; transition: color 0.2s; }
.links a:hover { color: var(--accent); }

.constellation { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; margin: 0 auto; }
.constellation svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.constellation svg line { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; stroke-dasharray: 2 4; }
.node {
  position: absolute; left: var(--x, 50%); top: var(--y, 50%);
  width: 0; height: 0;
  text-decoration: none; color: var(--muted);
  font-family: var(--mono); font-size: 12px;
}
.node .dot {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg); box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  opacity: 0; transition: opacity 0.6s ease;
}
.node.core .dot { left: -9px; top: -9px; width: 18px; height: 18px; background: var(--accent); box-shadow: 0 0 22px rgba(0, 189, 179, 0.8); }
html:not(.js) .node .dot, html.reduced .node .dot { opacity: 1; }
/* the wolf at the centre of the pack: stars when the particles run, the logo itself when they don't */
.node.core .wolf { position: absolute; width: var(--wolf, 200px); height: var(--wolf, 200px); max-width: none; left: calc(var(--wolf, 200px) / -2); top: calc(var(--wolf, 200px) / -2); }
html:not(.js) .wolf, .constellation:not(.laid-out) .wolf { display: none; }
.node .label { position: absolute; top: -9px; white-space: nowrap; padding: 0 2px; transition: color 0.2s; line-height: 18px; }
.node.r .label { left: 12px; }
.node.l .label { right: 12px; }
.node.t .label { left: 50%; transform: translateX(-50%); top: auto; bottom: 10px; }
.node.b .label { left: 50%; transform: translateX(-50%); top: 10px; }
.node.core .label { left: 50%; transform: translateX(-50%); top: calc(var(--wolf, 200px) / 2 + 6px); color: var(--fg); font-weight: 600; font-size: 13px; }
.node:hover .label, .node:focus-visible .label { color: var(--accent); }
/* before JS lays the ring out, fall back to a plain list */
html:not(.js) .constellation, .constellation:not(.laid-out) { aspect-ratio: auto; display: flex; flex-wrap: wrap; gap: 8px 16px; }
html:not(.js) .constellation .node, .constellation:not(.laid-out) .node { position: static; width: auto; height: auto; }
html:not(.js) .constellation .node .label, .constellation:not(.laid-out) .node .label { position: static; }
.constellation:not(.laid-out) .dot { display: none; }

/* ─────────────────────────────── proof ─────────────────────────────── */
.charts { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; margin-top: clamp(28px, 4vw, 48px); }
.chart { margin: 0; }
.chart figcaption b { display: block; color: var(--fg); font-size: clamp(19px, 1.9vw, 23px); font-weight: 600; letter-spacing: -0.01em; }
.chart figcaption span { display: block; margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bars { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 11px; }
.bars li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: baseline;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.4; color: var(--muted);
}
.bars .mine { color: var(--fg); }
.bar-val { font-variant-numeric: tabular-nums; }
/* the rail is always there; the bar on it is drawn by particles (or by CSS without them) */
.bar-track { grid-column: 1 / -1; height: 9px; border-bottom: 1px solid var(--line); box-sizing: content-box; }
.bar-track i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); min-width: 4px; border-radius: 1px; background: rgba(255, 255, 255, 0.42); }
.mine .bar-track i { background: var(--accent); box-shadow: 0 0 14px rgba(0, 189, 179, 0.5); }
.chart-note { margin-top: 20px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.chart-note a { color: var(--fg); white-space: nowrap; text-decoration-color: var(--accent); text-underline-offset: 3px; margin-left: 4px; }

/* ─────────────────────────────── granny ─────────────────────────────── */
.asena.top { align-items: start; }
.loop { position: relative; width: 100%; max-width: 540px; aspect-ratio: 1 / 0.8; margin: 0 auto; }
.loop svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.loop svg path, .loop svg line { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; stroke-dasharray: 2 4; }
.loop .node { cursor: default; color: var(--text); }
.loop .node .dot { left: -8px; top: -8px; width: 16px; height: 16px; }
.loop .node.r .label { left: 26px; }
.loop .node.l .label { right: 26px; }
.loop .node.t .label { bottom: 22px; }
.loop .node.tag .label { color: var(--accent); font-size: 11px; letter-spacing: 0.04em; }
.loop .node.tag.b .label { top: 9px; }
.loop .node.tag.l .label { right: 12px; }
html:not(.js) .loop, .loop:not(.laid-out) { aspect-ratio: auto; display: flex; flex-wrap: wrap; gap: 8px 6px; }
html:not(.js) .loop .node, .loop:not(.laid-out) .node { position: static; width: auto; height: auto; }
html:not(.js) .loop .node .label, .loop:not(.laid-out) .node .label { position: static; }
html:not(.js) .loop .node:not(.tag):not(:nth-last-child(3))::after, .loop:not(.laid-out) .node:not(.tag):not(:nth-last-child(3))::after { content: " \2192"; color: var(--dim); }
html:not(.js) .loop .tag, html:not(.js) .loop svg, .loop:not(.laid-out) .tag, .loop:not(.laid-out) svg, .loop:not(.laid-out) .dot { display: none; }

/* ─────────────────────────────── contact ─────────────────────────────── */
.contact { display: flex; flex-direction: column; justify-content: center; padding-bottom: 0; }
.contact .wrap { flex: 1; justify-content: center; }
.singularity {
  position: relative;
  width: clamp(200px, 30vw, 300px);
  aspect-ratio: 1;
  margin: 0 auto clamp(28px, 5vw, 56px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.singularity .orb {
  position: absolute; inset: 22%; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, rgba(255, 255, 255, 0.9), rgba(200, 235, 255, 0.35) 30%, rgba(0, 189, 179, 0.08) 62%, transparent 72%);
  box-shadow: 0 0 60px rgba(160, 220, 255, 0.18);
}
.contact .lede-s { margin: 0 auto; }
.say { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.say-box { position: relative; display: inline-block; }
.say-mirror { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; font: 500 16px/1.3 var(--mono); letter-spacing: 0.06em; color: var(--fg); white-space: pre; }
.say-mirror.ph { color: var(--dim); }
html.ink .say-mirror { display: flex; opacity: 0; }   /* never seen: it is where the box's ink is sampled from */
.say input {
  width: min(280px, 78vw); padding: 8px 4px; text-align: center;
  font: 500 16px/1.3 var(--mono); letter-spacing: 0.06em; color: var(--fg);
  background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; outline: 0;
  transition: border-color 0.2s;
}
.say input::placeholder { color: var(--dim); }
.say input:focus { border-bottom-color: var(--accent); }
.say-ghost {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  white-space: nowrap; font: 700 100px/1 var(--sans); text-transform: uppercase; color: var(--fg);
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.22); pointer-events: none;
}
.singularity.saying .orb { opacity: 0 !important; }
.hint-hold { margin-top: 26px; }
html:not(.js) .hint-hold, html.reduced .hint-hold, html:not(.js) .say, html.no-canvas .say { display: none; }
.links.big { justify-content: center; font-size: clamp(14px, 1.6vw, 16px); margin-top: 30px; }
.hint-2 { margin-top: 10px !important; }
.hint { margin-top: 34px; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 28px var(--gutter) max(28px, env(safe-area-inset-bottom));
  margin-top: 64px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--dim);
  position: relative; z-index: 2;
}
.egg { color: var(--dim); transition: color 0.4s; cursor: default; }
.egg:hover { color: #b8862b; }

/* ─────────────────────────────── responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .story, .asena, .charts { grid-template-columns: minmax(0, 1fr); }
  .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, auto); }
  .constellation { max-width: 460px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .title-hero { font-size: clamp(64px, 25vw, 140px); line-height: 0.92; }
  .title-hero span { display: block; }
  .cards-4, .cards-3, .cards-2 { grid-template-columns: minmax(0, 1fr); }
  .topbar { font-size: 12px; }
  .topbar nav { gap: 12px; }
  .topbar nav .nv-wide { display: none; }
  .node { font-size: 11px; }
  .bars li { font-size: 12px; }
  .bar-track { height: 6px; }
  .code { font-size: 12px; padding: 16px; }
  .foot { flex-direction: column; }
}
@media (max-width: 400px) {
  .topbar nav { gap: 10px; }
}
@media (max-width: 350px) {
  .topbar nav .nv-mid { display: none; }
}

/* ─────────────────────────────── motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nebula { animation: none; }
  .scroll-cue span { animation: none; transform: translateY(20px); }
  .pulse::after { animation: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.intro) { scroll-behavior: smooth; }
}

/* ─────────────────────────────── ink ─────────────────────────────── */
/* With particles running, nothing here is painted by the browser: every word, rule and
   frame is dots on the canvas, one per pixel, so at rest it reads as ordinary text. The
   DOM keeps its layout and stays clickable, selectable and readable by assistive tech;
   it is just never shown. */
html.ink .section > *,
html.ink.js:not(.reduced) .section:focus-within > * { opacity: 0 !important; }
html.ink .topbar,
html.ink .topbar.scrolled { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.ink .topbar > * { opacity: 0; }
html.ink .topbar nav a { transition: none; }   /* ink is sampled the moment the current link changes */
html.ink .scroll-cue span, html.ink .pulse::after { animation: none; }
/* the dark fill of cards and code blocks, kept under the canvas (see layoutPanes) */
.panes { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 0; pointer-events: none; }
.panes > div { position: absolute; left: 0; top: 0; opacity: 0; }
.panes > div > div { position: absolute; border-radius: 2px; }
html:not(.ink) .panes { display: none; }
.focus-ring {
  position: fixed; left: 0; top: 0; z-index: 12; pointer-events: none; border-radius: 3px;
  border: 1px dotted var(--accent); box-shadow: 0 0 12px rgba(0, 189, 179, 0.35);
  opacity: 0; transition: opacity 0.15s ease;
}
.focus-ring.on { opacity: 1; }
html.measuring .topbar { transform: none !important; transition: none !important; }

/* sampling pass: measure final positions, not mid-reveal ones */
html.measuring .reveal { transform: none !important; transition: none !important; }
