:root {
  --ink: #eef6f2;
  --muted: #9bada6;
  --quiet: #718079;
  --paper: #0a100e;
  --surface: #101a16;
  --surface-2: #16221d;
  --green: #62d59a;
  --blue: #73b9df;
  --earth: #b08a60;
  --line: rgba(190, 220, 207, .17);
  --content: 720px;
  --wide: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 7%, rgba(98, 213, 154, .09), transparent 26rem),
    radial-gradient(circle at 90% 25%, rgba(115, 185, 223, .07), transparent 30rem),
    var(--paper);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 1.06rem;
  line-height: 1.75;
}
a { color: inherit; }
.progress { position: fixed; inset: 0 auto auto 0; width: 0; height: 2px; background: var(--green); z-index: 20; }
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  padding: .75rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 14, .88);
  backdrop-filter: blur(14px);
  width: 100%;
  min-width: 0;
}
.back, .languages a { text-decoration: none; color: var(--muted); }
.back:hover, .languages a:hover, .back:focus-visible, .languages a:focus-visible { color: var(--ink); }
.badge { color: var(--quiet); font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; }
.languages { justify-self: end; display: flex; gap: .35rem; }
.languages a { padding: .15rem .45rem; font-size: .8rem; border: 1px solid transparent; border-radius: 999px; }
.languages a.active { color: var(--ink); border-color: var(--line); }

.hero {
  min-height: min(820px, 88vh);
  display: grid;
  place-items: center;
  padding: clamp(5rem, 12vw, 10rem) 1.25rem;
  border-bottom: 1px solid var(--line);
}
.hero-inner { width: 100%; max-width: var(--wide); min-width: 0; }
.serial, .chapter { display: block; color: var(--green); font: 600 .74rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, .display-question { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.035em; }
h1 { max-width: 900px; margin: 1.25rem 0; font-size: clamp(3.3rem, 9vw, 7.8rem); line-height: .94; hyphens: none; overflow-wrap: normal; }
.subtitle { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(1.15rem, 2vw, 1.45rem); }
.hero-trace { display: flex; align-items: center; gap: .75rem; max-width: 620px; margin-top: 4.5rem; color: var(--quiet); font: .72rem/1.2 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.hero-trace i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--green), var(--blue), transparent); }

.scene { padding: clamp(5rem, 10vw, 9rem) 1.25rem; border-bottom: 1px solid var(--line); }
.scene-inner { width: min(100%, var(--content)); margin: 0 auto; }
.scene-inner.wide { width: min(100%, var(--wide)); }
h2 { margin: .8rem 0 2rem; font-size: clamp(2.25rem, 5vw, 4.35rem); line-height: 1.06; }
p { margin: 0 0 1.25rem; }
.lead { color: var(--ink); font-size: clamp(1.28rem, 2.2vw, 1.62rem); line-height: 1.5; }
.muted { color: var(--muted); }
.display-question { margin: 0; padding: clamp(5rem, 12vw, 10rem) 1rem; text-align: center; font-size: clamp(2.6rem, 8vw, 7rem); line-height: 1; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.possibilities { display: flex; flex-wrap: wrap; gap: .55rem; margin: 2rem 0; }
.possibilities span { padding: .45rem .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; }
.decision-list { list-style: none; margin: 0; padding: 0; }
.decision-list li { position: relative; padding: 1rem 0 1rem 1.75rem; border-bottom: 1px solid var(--line); }
.decision-list li::before { content: "↳"; position: absolute; left: 0; color: var(--green); }

.workflow-shell { margin-top: 3rem; padding: clamp(1rem, 3vw, 2.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; }
.workflow { display: block; width: 100%; height: auto; }
.workflow .orbit { fill: none; stroke: var(--line); stroke-width: 1.4; stroke-dasharray: 5 9; }
.workflow .path { fill: none; stroke: url(#loop-gradient); stroke-width: 2.3; marker-end: url(#arrow); }
.workflow .node { fill: var(--surface-2); stroke: var(--line); stroke-width: 1.2; }
.workflow .human { stroke: rgba(98, 213, 154, .7); }
.workflow .ai { stroke: rgba(115, 185, 223, .7); }
.workflow text { fill: var(--ink); text-anchor: middle; font: 600 13px/1 ui-monospace, monospace; letter-spacing: .05em; }
.workflow .small { fill: var(--muted); font-size: 10px; font-weight: 400; }
.workflow-note { max-width: 670px; margin: 1.25rem auto 0; color: var(--quiet); text-align: center; font-size: .84rem; }

.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.example { min-height: 245px; padding: clamp(1.35rem, 3vw, 2.2rem); background: linear-gradient(145deg, var(--surface), rgba(16,26,22,.45)); border: 1px solid var(--line); border-radius: 20px; }
.example .number { color: var(--quiet); font: .72rem/1 ui-monospace, monospace; }
.example h3 { margin: 1.25rem 0 .75rem; font-size: 1.15rem; letter-spacing: .04em; }
.example p { margin: 0; color: var(--muted); font-size: .96rem; }

.discard-field { position: relative; margin: 3rem 0 2rem; min-height: 280px; }
.fragment { position: absolute; padding: .65rem .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 5px; transform: rotate(var(--r)); opacity: var(--o, .72); font: .84rem/1.35 ui-monospace, monospace; }
.fragment:nth-child(1) { left: 2%; top: 8%; --r: -4deg; }
.fragment:nth-child(2) { right: 4%; top: 1%; --r: 3deg; --o: .47; }
.fragment:nth-child(3) { left: 15%; bottom: 8%; --r: 2deg; --o: .34; }
.fragment:nth-child(4) { right: 15%; bottom: 15%; --r: -3deg; --o: .22; }
.selected { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); z-index: 2; padding: 1.2rem 1.5rem; width: min(88%, 340px); border-left: 3px solid var(--green); background: #17251f; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.selected strong { display: block; font: 600 .73rem/1.2 ui-monospace, monospace; color: var(--green); text-transform: uppercase; letter-spacing: .12em; }
.selected span { display: block; margin-top: .55rem; font-family: Georgia, serif; font-size: 1.35rem; }
.plain-truth { margin: 3rem 0; padding-left: 1.4rem; border-left: 2px solid var(--green); font-family: Georgia, serif; font-size: clamp(1.6rem, 3.5vw, 2.7rem); line-height: 1.25; }
.fact-rule { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem 0; }
.fact-rule div { padding: 1.5rem; border-top: 2px solid var(--green); background: var(--surface); }
.fact-rule div + div { border-color: var(--blue); }
.fact-rule strong { display: block; margin-bottom: .55rem; font-size: 1.1rem; }
.fact-rule p { margin: 0; color: var(--muted); font-size: .94rem; }
.self-reference { background: linear-gradient(135deg, rgba(98,213,154,.07), rgba(115,185,223,.06)); }
.instruction { margin: 2.5rem 0; padding: 1.4rem; border: 1px dashed rgba(190,220,207,.35); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.instruction::before { content: "INPUT / "; color: var(--green); }
.closing { min-height: 75vh; display: grid; place-items: center; text-align: center; }
.closing h2 { max-width: 900px; margin-inline: auto; }
.closing-question { color: var(--muted); font: clamp(1rem, 2vw, 1.25rem)/1.5 ui-monospace, monospace; }
footer { padding: 2.5rem 1.25rem 4rem; color: var(--quiet); text-align: center; font-size: .8rem; }
footer a { color: var(--muted); text-underline-offset: .2em; }

@media (max-width: 760px) {
  .scene { padding: 4.5rem 1rem !important; }
  .closing { min-height: 68vh; }
  h1 { font-size: clamp(2.8rem, 12.5vw, 4.5rem) !important; line-height: .96 !important; }
  h2 { font-size: clamp(2rem, 9vw, 3rem) !important; line-height: 1.08 !important; }
  .hero-trace { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; width: auto; }
  .hero-trace i { display: none; }
  .hero-trace span { text-align: left; font-size: .64rem; overflow-wrap: normal; }
  .hero-trace span + span::before { content: "↓"; margin-right: .6rem; color: var(--green); }
  .nav { display: block; padding-right: 6.5rem; }
  .languages { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); }
  .badge { display: none; }
  .split, .examples, .fact-rule { grid-template-columns: 1fr; }
  .examples { gap: .75rem; }
  .example { min-height: 0; }
  .workflow-shell { border-radius: 16px; padding: .5rem; }
  .workflow text { font-size: 11px; }
  .workflow .small { font-size: 8px; }
  .discard-field { min-height: 360px; }
  .fragment:nth-child(1) { left: 0; }
  .fragment:nth-child(2) { right: 0; }
  .fragment:nth-child(3) { left: 2%; }
  .fragment:nth-child(4) { right: 1%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
