:root {
  --ink: #080808;
  --paper: #f2f0e9;
  --signal: #ff3b22;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

::selection { color: var(--ink); background: #fff; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  background: rgba(5, 8, 10, 0.78);
  border-bottom: 1px solid rgba(143, 182, 194, 0.13);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 580;
  letter-spacing: 0.22em;
}

.scroll-lineage {
  position: relative;
  color: var(--paper);
  background: var(--ink);
}

.scroll-stage {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 100svh;
  min-height: 640px;
  display: grid;
  overflow: hidden;
  grid-template-rows: 1fr auto;
  padding: 102px 32px 40px;
  background:
    radial-gradient(circle at 18% 26%, rgba(36, 65, 73, 0.25), transparent 27%),
    radial-gradient(circle at 76% 25%, rgba(29, 57, 65, 0.2), transparent 24%),
    radial-gradient(circle at 54% 72%, rgba(40, 70, 78, 0.26), transparent 34%),
    linear-gradient(180deg, #080b0d 0%, #050708 100%);
}

.topographic-field {
  position: absolute;
  z-index: 1;
  inset: 70px 0 0;
  width: 100%;
  height: calc(100% - 70px);
  opacity: 0.9;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 8%, rgba(0, 0, 0, 0.86) 58%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 8%, rgba(0, 0, 0, 0.86) 58%, transparent 100%);
}

.scroll-stage::before,
.scroll-stage::after {
  position: absolute;
  z-index: 1;
  content: "";
  pointer-events: none;
}

.scroll-stage::before {
  inset: 70px 0 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(151, 197, 208, 0.07) 50%, transparent calc(50% + 1px)),
    linear-gradient(transparent calc(50% - 1px), rgba(151, 197, 208, 0.07) 50%, transparent calc(50% + 1px));
}

.scroll-stage::after {
  top: 50%;
  left: 50%;
  width: min(74vw, 1020px);
  height: min(42vw, 620px);
  border: 1px solid rgba(139, 184, 196, 0.075);
  transform: translate(-50%, -43%);
  box-shadow: inset 0 0 90px rgba(47, 83, 94, 0.055);
}

/* SHALL is pinned to the exact center of the stage row; the surrounding
   lines are anchored at the edge facing SHALL, so multi-line quotes grow
   AWAY from it and its coordinates never change between frames. */
.scroll-phrase {
  --shall-half: 0.696em; /* half of the SHALL box: 1.42em × (0.78 line + 0.2 padding) ÷ 2 */
  position: relative;
  z-index: 3;
  text-align: center;
  font-size: clamp(48px, 7.2vw, 112px);
  font-weight: 780;
  letter-spacing: -0.058em;
  line-height: 0.82;
  text-transform: uppercase;
}

.phrase-line {
  position: absolute;
  right: 0;
  left: 0;
  max-width: 15ch;
  margin: 0 auto;
  color: rgba(205, 210, 211, 0.54);
  text-wrap: balance;
}

.phrase-before { bottom: calc(50% + var(--shall-half)); }
.phrase-after { top: calc(50% + var(--shall-half)); }

.shall-lock {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0;
  left: 0;
  padding: 0.08em 0 0.12em;
  transform: translateY(-50%);
  color: #fff;
  font-size: 1.42em;
  font-weight: 820;
  letter-spacing: -0.025em;
  line-height: 0.78;
  text-shadow: 0 0 56px rgba(255, 255, 255, 0.05);
}

.scroll-footer {
  position: relative;
  z-index: 3;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.source-lock {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.source-lock strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(16px, 1.6vw, 24px);
  font-weight: 640;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.source-lock .source-date {
  color: rgba(242, 240, 233, 0.52);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(11px, 0.95vw, 14px);
  font-weight: 450;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.progress-rail {
  position: absolute;
  z-index: 4;
  right: 32px;
  bottom: 20px;
  left: 32px;
  height: 1px;
  overflow: hidden;
  background: rgba(242, 240, 233, 0.16);
}

.progress-fill {
  width: 3.7%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  transition: width 400ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.scroll-prompt {
  position: relative;
  z-index: 4;
  display: inline-flex;
  gap: 13px;
  align-items: center;
  margin: 0;
  padding: 11px 22px;
  border: 1px solid rgba(151, 197, 208, 0.26);
  border-radius: 999px;
  background: rgba(6, 9, 11, 0.55);
  color: rgba(205, 210, 211, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 220ms ease, border-color 220ms ease;
  animation: prompt-pulse 2.6s ease-in-out infinite;
}

#scroll-prompt-arrow {
  font-size: 12px;
  line-height: 1;
}

.scroll-prompt:hover {
  color: var(--paper);
  border-color: rgba(151, 197, 208, 0.55);
}

.scroll-prompt.is-playing {
  color: var(--signal);
  border-color: rgba(255, 59, 34, 0.5);
  animation: none;
}

@keyframes prompt-pulse {
  0%, 100% { opacity: 0.66; box-shadow: 0 0 0 0 rgba(151, 197, 208, 0); }
  50% { opacity: 1; box-shadow: 0 0 0 7px rgba(151, 197, 208, 0.05); }
}

.scroll-steps {
  position: relative;
  z-index: 3;
  margin-top: -100svh;
  padding-top: 100svh;
  pointer-events: none;
}

.scroll-step { height: 26svh; }
.scroll-step:last-child { height: 100svh; }

.closing {
  position: relative;
  overflow: hidden;
  min-height: 100svh;
  padding: 100px 32px 60px;
  color: var(--paper);
  background: var(--signal);
}

.closing::after {
  position: absolute;
  top: 5%;
  right: -8%;
  content: "S";
  color: rgba(8, 8, 8, 0.08);
  font-size: 90vh;
  font-weight: 850;
  letter-spacing: -0.18em;
  line-height: 0.8;
}

.closing-meta, .closing h1, .closing-rule, .closing-link, .closing-wordmark { position: relative; z-index: 1; }

.closing-meta {
  margin: 0 0 15vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.closing h1 {
  max-width: 1180px;
  margin: 0;
  font-size: clamp(52px, 8.4vw, 130px);
  letter-spacing: -0.065em;
  line-height: 0.86;
}

.closing h1 em {
  font-family: Georgia, serif;
  font-weight: 400;
}

.closing-rule {
  width: 100%;
  height: 1px;
  margin: 9vh 0;
  background: rgba(242, 240, 233, 0.5);
}

.closing .closing-answer { margin-left: auto; text-align: right; }
.closing-answer span { color: var(--ink); }

.closing-wordmark {
  margin: 13vh 0 0;
  font-size: clamp(34px, 11.5vw, 195px);
  font-weight: 850;
  letter-spacing: -0.065em;
  line-height: 0.86;
  text-transform: uppercase;
  white-space: nowrap;
}

.closing-link {
  display: flex;
  width: max-content;
  gap: 50px;
  margin: 16vh 0 0 auto;
  padding-bottom: 7px;
  border-bottom: 1px solid currentColor;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 52px 32px;
  color: var(--paper);
  background: var(--ink);
}

footer p { margin: 0; font-size: 11px; }

.footer-colophon {
  display: grid;
  gap: 10px;
  justify-items: end;
  text-align: right;
}

.footer-colophon p {
  color: rgba(242, 240, 233, 0.48);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.footer-mail {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(242, 240, 233, 0.35);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-mail:hover { color: var(--signal); border-color: currentColor; }

@media (max-width: 900px) {
  .nav { padding: 0 20px; }
  .scroll-stage, .closing { padding-left: 20px; padding-right: 20px; }
  .scroll-phrase { font-size: clamp(46px, 10vw, 80px); }
  .progress-rail { right: 20px; left: 20px; }
  footer { grid-template-columns: 1fr; gap: 36px; padding: 42px 20px; }
  .footer-colophon { justify-items: start; text-align: left; }
}

@media (max-width: 580px) {
  .scroll-stage { min-height: 600px; padding-top: 92px; }
  .scroll-stage::after { width: 118vw; height: 74vw; }
  .scroll-phrase { --shall-half: 0.76em; font-size: clamp(39px, 12.4vw, 62px); }
  .shall-lock { font-size: 1.55em; letter-spacing: -0.015em; }
  .source-lock { gap: 6px; }
  .source-lock strong { font-size: 15px; line-height: 1.3; }
  .source-lock .source-date { font-size: 10px; }
  .scroll-footer { min-height: 96px; gap: 14px; }
  .scroll-prompt { gap: 0; padding: 10px 16px; }
  .scroll-prompt #scroll-prompt-label { display: none; }
  .scroll-step { height: 23svh; }
  .closing { padding-top: 70px; }
  .closing-meta { margin-bottom: 12vh; }
}

@media (max-height: 780px) {
  /* Short windows: tighten the phrase so downward-growing quotes clear the source lockup */
  .scroll-phrase { font-size: clamp(40px, 6vw, 88px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
