:root {
  --black: #03070b;
  --paper: #f4f1e9;
  --paper-dim: rgba(244, 241, 233, 0.58);
  --hairline: rgba(154, 236, 240, 0.18);
  --glass: rgba(5, 13, 19, 0.64);
  --cyan: #12dce7;
  --cyan-soft: #98faff;
  --pink: #ff0a6c;
  --pink-soft: #ff6aa3;
  --green: #84df3f;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
}

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

html {
  background: var(--black);
  scrollbar-color: rgba(152, 250, 255, 0.2) transparent;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--paper);
  font-family: var(--mono);
  background: var(--black);
  cursor: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: pan-y;
}

body.native-cursor,
body.native-cursor * {
  cursor: auto;
}

body.native-cursor button,
body.native-cursor a {
  cursor: pointer;
}

::selection {
  color: #fff;
  background: rgba(255, 10, 108, 0.42);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--black);
  border-radius: 99px;
  background: rgba(152, 250, 255, 0.18);
}

button,
a {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--cyan-soft);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--paper);
  border: 1px solid var(--hairline);
  background: #07131b;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 180ms ease;
}

.skip-link:focus-visible {
  transform: none;
}

#field {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

#portrait-ghost {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(58vw, 720px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
  filter: saturate(1.08) contrast(1.06) brightness(0.94);
  mix-blend-mode: screen;
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.72) 0 30%, rgba(0, 0, 0, 0.22) 50%, transparent 68%);
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 1.4s ease, transform 1.8s cubic-bezier(0.2, 0.8, 0.25, 1);
  pointer-events: none;
}

body:not(.awake) #portrait-ghost {
  opacity: 0.07;
}

body.awake[data-chapter='0'] #portrait-ghost {
  opacity: 0.04;
  transform: translate(-50%, -50%) scale(1);
}

body.awake[data-chapter='4'] #portrait-ghost {
  opacity: 0.16;
  transform: translate(-50%, -50%) scale(1.04);
}

#progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--green));
  box-shadow: 0 0 16px rgba(255, 10, 108, 0.55);
  transform: scaleX(0);
  transform-origin: left center;
}

#cursor-orb {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 8px;
  height: 8px;
  border: 1px solid var(--cyan-soft);
  border-radius: 50%;
  background: rgba(244, 241, 233, 0.9);
  box-shadow: 0 0 10px 2px rgba(18, 220, 231, 0.82), 0 0 32px 10px rgba(255, 10, 108, 0.2);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 130ms ease, height 130ms ease, opacity 200ms ease;
  pointer-events: none;
}

body.pointer-active #cursor-orb {
  opacity: 1;
}

body.pointer-down #cursor-orb {
  width: 34px;
  height: 34px;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 2.5vw, 30px) clamp(18px, 3vw, 40px);
  pointer-events: none;
}

.wordmark {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: rgba(244, 241, 233, 0.68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-decoration: none;
  pointer-events: auto;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px 3px rgba(132, 223, 63, 0.68);
  animation: breathe 2.8s ease-in-out infinite;
}

.controls {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 7px 13px;
  color: rgba(244, 241, 233, 0.62);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

button.chip {
  appearance: none;
}

.chip:hover,
.chip:focus-visible,
.chip[aria-pressed='true'] {
  color: var(--cyan-soft);
  border-color: rgba(18, 220, 231, 0.46);
}

.x-chip:hover,
.x-chip:focus-visible {
  color: var(--pink-soft);
  border-color: rgba(255, 10, 108, 0.55);
}

.chip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.chip-icon {
  color: var(--paper);
  font-size: 11px;
}

.chapter-dots {
  position: fixed;
  top: 50%;
  right: clamp(10px, 2vw, 28px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 13px;
  transform: translateY(-50%);
}

.chapter-dots button {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  background: transparent;
}

.chapter-dots i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(244, 241, 233, 0.3);
  transition: transform 240ms cubic-bezier(0.2, 0.9, 0.3, 1.5), background 240ms ease, box-shadow 240ms ease;
}

.chapter-dots button:hover i,
.chapter-dots button:focus-visible i {
  background: var(--cyan-soft);
  transform: scale(1.6);
}

.chapter-dots button[aria-current='true'] i {
  background: var(--pink);
  box-shadow: 0 0 11px 3px rgba(255, 10, 108, 0.55);
  transform: scale(2);
}

.dot-label {
  position: absolute;
  top: 50%;
  right: 34px;
  color: var(--paper-dim);
  font-size: 9px;
  letter-spacing: 0.18em;
  opacity: 0;
  white-space: nowrap;
  transform: translate(7px, -50%);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.chapter-dots button:hover .dot-label,
.chapter-dots button:focus-visible .dot-label {
  opacity: 1;
  transform: translate(0, -50%);
}

#interaction-hint {
  position: fixed;
  bottom: clamp(16px, 2.4vw, 28px);
  left: clamp(18px, 3vw, 40px);
  z-index: 30;
  color: rgba(244, 241, 233, 0.35);
  font-size: 9px;
  letter-spacing: 0.2em;
  transition: opacity 500ms ease;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 10;
}

.chapter {
  position: relative;
  display: flex;
  min-height: 116vh;
  min-height: 116svh;
  align-items: center;
  padding: 0 clamp(24px, 6vw, 94px);
  pointer-events: none;
}

.chapter[data-side='right'] {
  justify-content: flex-end;
  text-align: right;
}

.chapter[data-side='right'] .readouts {
  justify-content: flex-end;
}

.chapter[data-side='center'] {
  justify-content: center;
  text-align: center;
}

.chapter[data-side='center'] .readouts {
  justify-content: center;
}

.panel {
  width: min(500px, 82vw);
  padding: 26px;
  opacity: 0.08;
  transform: translateY(28px) scale(0.98);
  transition: opacity 260ms ease-out, transform 300ms cubic-bezier(0.22, 0.8, 0.3, 1);
  will-change: opacity, transform;
}

.panel::before {
  position: absolute;
  inset: -40px;
  z-index: -1;
  content: '';
  background: radial-gradient(circle, rgba(3, 7, 11, 0.8), rgba(3, 7, 11, 0.45) 45%, transparent 72%);
  filter: blur(10px);
  pointer-events: none;
}

.kicker {
  margin-bottom: 18px;
  color: rgba(244, 241, 233, 0.58);
  font-size: 10px;
  letter-spacing: 0.38em;
}

.kicker b {
  color: var(--cyan-soft);
  font-weight: 400;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.94;
  text-wrap: balance;
  text-shadow: 3px 3px 0 rgba(255, 10, 108, 0.28), 0 0 64px rgba(3, 7, 11, 0.9);
}

h1 {
  font-size: clamp(54px, 7vw, 104px);
}

h2 {
  font-size: clamp(58px, 7.4vw, 112px);
}

.readouts {
  display: flex;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.readouts div {
  min-width: 72px;
}

.readouts dt {
  margin-bottom: 6px;
  color: rgba(244, 241, 233, 0.4);
  font-size: 8px;
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.readouts dd {
  color: rgba(152, 250, 255, 0.94);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 13px rgba(18, 220, 231, 0.4);
}

.final-panel {
  pointer-events: auto;
}

.final-copy {
  margin-top: 20px;
  color: var(--paper-dim);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.links {
  margin-top: 24px;
  font-size: 12px;
  letter-spacing: 0.11em;
}

.links a,
.reference-credit a,
.noscript-message a {
  color: var(--cyan-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(18, 220, 231, 0.42);
  transition: color 180ms ease, border-color 180ms ease;
}

.links a:hover,
.links a:focus-visible,
.reference-credit a:hover,
.reference-credit a:focus-visible {
  color: var(--pink-soft);
  border-color: var(--pink-soft);
}

.reference-credit {
  max-width: 560px;
  margin-top: 34px;
  color: rgba(244, 241, 233, 0.33);
  font-size: 8px;
  line-height: 1.8;
  letter-spacing: 0.08em;
}

#veil {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  color: var(--paper);
  text-align: center;
  background: rgba(3, 7, 11, 0.58);
  backdrop-filter: blur(15px) saturate(1.1);
  -webkit-backdrop-filter: blur(15px) saturate(1.1);
  transition: opacity 900ms ease, visibility 900ms ease, backdrop-filter 900ms ease;
}

#veil.gone {
  visibility: hidden;
  opacity: 0;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  pointer-events: none;
}

.veil-inner {
  width: min(780px, 92vw);
}

.veil-kicker {
  margin-bottom: 24px;
  color: rgba(244, 241, 233, 0.44);
  font-size: 9px;
  letter-spacing: 0.5em;
}

#veil-title {
  display: grid;
  justify-items: center;
  font-size: clamp(84px, 15vw, 194px);
  line-height: 0.72;
  animation: title-breathe 4.5s ease-in-out infinite;
}

#veil-title span:first-child {
  color: var(--paper);
}

#veil-title span:last-child {
  color: var(--pink);
  text-shadow: 5px 5px 0 rgba(18, 220, 231, 0.62), 0 0 60px rgba(255, 10, 108, 0.24);
}

.veil-sub {
  margin-top: 34px;
  color: rgba(244, 241, 233, 0.64);
  font-size: 10px;
  letter-spacing: 0.42em;
}

.wake-button {
  margin-top: 48px;
  padding: 10px 14px;
  color: var(--cyan-soft);
  border: 1px solid rgba(18, 220, 231, 0.18);
  background: rgba(3, 7, 11, 0.46);
  font-size: 9px;
  letter-spacing: 0.32em;
  animation: breathe 2.2s ease-in-out infinite;
}

.wake-button:hover,
.wake-button:focus-visible {
  color: var(--pink-soft);
  border-color: rgba(255, 10, 108, 0.5);
}

.veil-note {
  margin-top: 15px;
  color: rgba(244, 241, 233, 0.27);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.noscript-message {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--paper);
  text-align: center;
  background: var(--black);
  font-size: 11px;
  line-height: 2;
  letter-spacing: 0.14em;
}

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

@keyframes breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes title-breathe {
  0%, 100% { opacity: 0.86; transform: scale(0.99); }
  50% { opacity: 1; transform: scale(1.01); }
}

@media (pointer: coarse) {
  body,
  body * {
    cursor: auto;
  }

  #cursor-orb {
    display: none;
  }

  .chip {
    background: rgba(5, 13, 19, 0.9);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .panel {
    will-change: auto;
  }
}

@media (max-width: 720px) {
  .site-header {
    padding: 15px 14px;
  }

  .wordmark {
    font-size: 9px;
    letter-spacing: 0.2em;
  }

  .chip {
    min-height: 32px;
    padding: 7px 10px;
  }

  .chip-label {
    display: none;
  }

  .chapter-dots {
    right: 4px;
    gap: 8px;
  }

  .chapter-dots button {
    width: 26px;
    height: 26px;
  }

  .dot-label {
    display: none;
  }

  #interaction-hint {
    display: none;
  }

  #portrait-ghost {
    width: min(110vw, 620px);
  }

  .chapter {
    min-height: 112vh;
    min-height: 112svh;
    padding: 0 32px 0 20px;
  }

  .chapter[data-side='left'],
  .chapter[data-side='right'],
  .chapter[data-side='center'] {
    justify-content: center;
    text-align: center;
  }

  .chapter[data-side='left'] .readouts,
  .chapter[data-side='right'] .readouts,
  .chapter[data-side='center'] .readouts {
    justify-content: center;
  }

  .panel {
    width: min(100%, 430px);
    padding: 18px 8px;
  }

  .panel::before {
    inset: -24px;
    background: radial-gradient(circle, rgba(3, 7, 11, 0.88), rgba(3, 7, 11, 0.54) 55%, transparent 78%);
  }

  .kicker {
    font-size: 9px;
    letter-spacing: 0.28em;
  }

  h1,
  h2 {
    font-size: clamp(58px, 17vw, 86px);
  }

  .readouts {
    gap: 18px;
  }

  #veil-title {
    font-size: clamp(88px, 28vw, 132px);
  }

  .veil-sub {
    font-size: 8px;
    letter-spacing: 0.28em;
  }

  .veil-note {
    line-height: 1.6;
  }

  .reference-credit {
    margin-inline: auto;
  }
}

@media (max-width: 360px) {
  .wordmark {
    max-width: 138px;
    line-height: 1.4;
  }

  #veil-title {
    font-size: 82px;
  }

  .wake-button {
    margin-top: 38px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body,
  body * {
    cursor: auto;
  }

  #cursor-orb {
    display: none;
  }
}
