/* ============================================================
   STILL POINT — a studio at the edge of the clock
   ============================================================ */

:root {
  --bg: #07090C;
  --surface: #0E141B;
  --glow: #D8E7EC;
  --accent: #7FB0C4;
  --amber: #C9A06B;
  --text: #E9EDF0;
  --muted: #5B6670;          /* decorative whispers only (aria-hidden chrome) */
  --muted-content: #76828D;  /* content-bearing muted text — clears 4.5:1 on bg */

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --ease-sky: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-hud: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: #1a2530 var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--bg); }

.serif { font-family: var(--serif); font-weight: 300; }
.mono  { font-family: var(--mono);  font-weight: 300; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

a { color: var(--accent); text-decoration: none; position: relative; }
a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.5s var(--ease-sky);
}
a:hover::after, a:focus-visible::after { transform: scaleX(1); }
a, button { transition: color 0.6s ease; }

button { background: none; border: none; color: inherit; cursor: pointer; font: inherit; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* ============================================================
   Preloader
   ============================================================ */

#preloader {
  position: fixed; inset: 0; z-index: 100;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
  transition: opacity 1.4s ease, visibility 1.4s;
}
#preloader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.pre-date {
  font-size: 11px; letter-spacing: 0.35em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pre-line {
  height: 1px; width: 0;
  background: linear-gradient(90deg, transparent, var(--glow) 20%, var(--glow) 80%, transparent);
  box-shadow: 0 0 24px 1px rgba(127, 176, 196, 0.55);
  transition: width 1.8s var(--ease-sky);
}
#preloader.is-grown .pre-line { width: min(72vw, 720px); }

.pre-begin {
  font-size: 11px; letter-spacing: 0.35em; color: var(--muted);
  padding: 14px 28px;
  opacity: 0;
  transition: opacity 1.2s ease, color 0.6s ease, letter-spacing 1.2s var(--ease-sky);
}
.pre-begin.is-shown { opacity: 1; }
.pre-begin:hover, .pre-begin:focus-visible { color: var(--glow); letter-spacing: 0.45em; }

/* ============================================================
   Sky
   ============================================================ */

#sky, #sky-fallback {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%; display: block;
}
#sky-fallback[hidden] { display: none; }
#sky-fallback-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.fallback-drift {
  position: absolute; inset: -20%;
  background: radial-gradient(60% 40% at 30% 60%, rgba(14, 20, 27, 0.9), transparent 70%),
              radial-gradient(50% 35% at 70% 50%, rgba(127, 176, 196, 0.05), transparent 70%);
  animation: drift 30s ease-in-out infinite alternate;
}
.fallback-drift-b { animation-duration: 44s; animation-delay: -15s; opacity: 0.6; }
@keyframes drift {
  from { transform: translate3d(-2%, 0, 0); opacity: 0.45; }
  to   { transform: translate3d(2%, 1%, 0);  opacity: 0.85; }
}

.fallback-seam {
  position: absolute; left: 0; right: 0; top: 47%;
  height: 1px; background: var(--glow);
  box-shadow: 0 0 80px 2px var(--accent), 0 0 18px 0 var(--glow);
  animation: seam-breathe 20s ease-in-out infinite;
}
@keyframes seam-breathe {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

/* ============================================================
   Grade: grain + vignette
   ============================================================ */

.vignette {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.35) 100%);
}

.grain {
  position: fixed; inset: -100px; z-index: 5; pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(3) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate3d(0, 0, 0); }
  33%  { transform: translate3d(-40px, 25px, 0); }
  66%  { transform: translate3d(30px, -35px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ============================================================
   Cursor light
   ============================================================ */

#cursor-light {
  position: fixed; z-index: 3; pointer-events: none;
  width: 400px; height: 400px; left: 0; top: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(127, 176, 196, 0.05), transparent 65%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
body.cursor-light-on #cursor-light { opacity: 1; }

/* ============================================================
   HUD whisper
   ============================================================ */

.hud {
  position: fixed; inset: 0; z-index: 6; pointer-events: none;
  font-size: 10px; letter-spacing: 0.18em; color: var(--muted);
  opacity: 0;
  transition: opacity 1s ease;
}
body.is-awake .hud { opacity: 1; }

.bracket {
  position: absolute; width: 14px; height: 14px; opacity: 0.3;
  border-color: var(--muted); border-style: solid; border-width: 0;
}
.bracket-tl { top: 16px; left: 16px; border-top-width: 1px; border-left-width: 1px; }
.bracket-tr { top: 16px; right: 16px; border-top-width: 1px; border-right-width: 1px; }
.bracket-bl { bottom: 16px; left: 16px; border-bottom-width: 1px; border-left-width: 1px; }
.bracket-br { bottom: 16px; right: 16px; border-bottom-width: 1px; border-right-width: 1px; }

.hud-okta { position: absolute; top: 22px; right: 40px; }
.hud-clocks {
  position: absolute; bottom: 22px; left: 40px;
  display: flex; flex-direction: column; gap: 4px;
  font-variant-numeric: tabular-nums;
}
.hud-dim { opacity: 0.55; }

.hud-okta, .hud-clocks {
  transform: translateY(8px); opacity: 0;
  transition: transform 0.5s var(--ease-hud), opacity 0.5s var(--ease-hud);
}
body.is-awake .hud-okta, body.is-awake .hud-clocks { transform: translateY(0); opacity: 1; }

.hud-idle {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: var(--muted); opacity: 0;
  transition: opacity 2.4s ease;
}
.hud-idle.is-shown { opacity: 0.7; }

/* ============================================================
   Sound toggle
   ============================================================ */

.sound-toggle {
  position: fixed; right: 32px; bottom: 18px; z-index: 7;
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.18em; color: var(--muted);
  padding: 8px;
  opacity: 0;
  transition: opacity 1s ease, color 0.6s ease;
}
body.is-awake .sound-toggle { opacity: 1; }
.sound-toggle:hover, .sound-toggle:focus-visible { color: var(--accent); }
#waveform { width: 40px; height: 12px; opacity: 0.8; }

/* ============================================================
   The scroll is the horizon
   ============================================================ */

#scroll-seam {
  position: fixed; left: 0; bottom: 0; z-index: 6;
  width: 100%; height: 1px;
  background: var(--glow);
  box-shadow: 0 0 14px 0 rgba(127, 176, 196, 0.6);
  opacity: 0.08;
  pointer-events: none;
  transition: opacity 0.4s linear;
}
#scroll-seam.is-handing-off {
  transition: opacity 0.9s var(--ease-sky), transform 0.9s var(--ease-sky), width 0.9s var(--ease-sky), left 0.9s var(--ease-sky), bottom 0.9s var(--ease-sky);
}
#scroll-seam.is-handing-off.is-locked {
  transition: opacity 0.9s var(--ease-sky);
}
#scroll-seam.seam-focus {
  box-shadow: 0 0 22px 1px rgba(216, 231, 236, 0.85);
}
#scroll-seam.amber-pulse { animation: amber-pulse 1.6s ease; }
@keyframes amber-pulse {
  30% { background: var(--amber); box-shadow: 0 0 28px 1px rgba(201, 160, 107, 0.8); }
}

/* ============================================================
   "held."
   ============================================================ */

#held-msg {
  position: fixed; left: 50%; top: 50%; z-index: 9;
  transform: translate(-50%, -50%);
  font-size: clamp(28px, 4vw, 52px); font-style: italic; color: var(--glow);
  opacity: 0; pointer-events: none;
  transition: opacity 1.8s ease;
}
#held-msg.is-shown { opacity: 0.9; }

/* ============================================================
   Sections — shared
   ============================================================ */

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

.section {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 18vh 8vw;
  position: relative;
}

.label {
  font-size: 11px; letter-spacing: 0.35em; color: var(--muted-content);
  margin-bottom: 4.5rem;
}

.body {
  max-width: 44ch; font-weight: 300; font-size: 1.02rem;
  line-height: 2; color: var(--text); opacity: 0.92;
}

.caption, .footnote { font-size: 10.5px; letter-spacing: 0.14em; color: var(--muted-content); line-height: 2.2; }

h2.serif {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  color: var(--glow); font-weight: 300; line-height: 1.25;
  max-width: 22ch; text-align: center;
  margin-bottom: 3.5rem;
}

/* Reveals — condensation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 2s var(--ease-sky), transform 2s var(--ease-sky);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

h2.serif.reveal {
  filter: blur(8px); letter-spacing: 0.4em;
  transition: opacity 2.4s var(--ease-sky), transform 2.4s var(--ease-sky),
              filter 2.4s var(--ease-sky), letter-spacing 2.4s var(--ease-sky);
  transition-delay: var(--reveal-delay, 0s);
}
h2.serif.reveal.is-visible { filter: blur(0); letter-spacing: 0.02em; }
h2.serif.reveal.is-settled { filter: none; }

/* ============================================================
   HERO — the slow sky
   ============================================================ */

.hero { text-align: center; user-select: none; }

.overline {
  font-size: 11px; letter-spacing: 0.35em; color: var(--muted-content);
  margin-bottom: 5vh;
}

.headline {
  font-weight: 300; color: var(--glow);
  display: flex; flex-direction: column; gap: 1.5vh;
}

.headline-line {
  display: block;
  opacity: 0; filter: blur(8px); letter-spacing: 0.4em;
  transition: opacity 2.6s var(--ease-sky), filter 2.6s var(--ease-sky), letter-spacing 2.6s var(--ease-sky);
}
.headline-1 { font-size: clamp(2.8rem, 8.5vw, 7.5rem); line-height: 1.1; }
.headline-2 { font-size: clamp(1.2rem, 2.6vw, 2.2rem); color: var(--text); opacity: 0; }

body.is-awake .headline-line { opacity: 1; filter: blur(0); letter-spacing: 0.12em; }
body.is-awake .headline-2 { transition-delay: 1.2s; opacity: 0.85; }
.headline-line.is-settled { filter: none; }

.hold-hint {
  position: absolute; bottom: 13vh; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.3em; color: var(--muted);
  white-space: nowrap;
  animation: hint-pulse 8s ease-in-out infinite;
  opacity: 0;
}
body.is-awake .hold-hint { opacity: 1; }
@keyframes hint-pulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.75; }
}

.scroll-cue {
  position: absolute; bottom: 5vh; left: 50%;
  width: 1px; height: 48px; transform: translateX(-50%);
  background: rgba(91, 102, 112, 0.3);
  overflow: hidden;
}
.scroll-cue span {
  display: block; width: 100%; height: 40%;
  background: var(--accent);
  animation: cue-fill 3.2s var(--ease-sky) infinite;
}
@keyframes cue-fill {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(250%); }
  100% { transform: translateY(250%); }
}

/* ============================================================
   01 / PAUSE — manifesto
   ============================================================ */

.manifesto { min-height: 130vh; min-height: 130svh; text-align: center; }

.manifesto-text {
  max-width: 28ch;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.9; color: var(--glow);
}

.manifesto-coda {
  margin-top: 22vh;
  font-size: 11px; letter-spacing: 0.3em; color: var(--muted-content);
}

/* ============================================================
   02 / CHRONOLOGY
   ============================================================ */

.chronology { display: block; padding: 0 8vw; min-height: 300vh; }

.chrono-sticky {
  position: sticky; top: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}

.chrono-strip {
  position: relative; width: 100%; max-width: 1100px;
  height: 120px; margin: 6vh 0;
  overflow: clip;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.chrono-line {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: rgba(127, 176, 196, 0.4);
  box-shadow: 0 0 12px 0 rgba(127, 176, 196, 0.25);
}

.chrono-track {
  position: absolute; inset: 0;
  will-change: transform;
  font-variant-numeric: tabular-nums;
}

.chrono-tick {
  position: absolute; top: 50%; width: 1px; height: 10px;
  transform: translateY(-50%);
  background: rgba(127, 176, 196, 0.5);
}
.chrono-tick.minor { height: 5px; background: rgba(127, 176, 196, 0.25); }

.chrono-year {
  position: absolute; top: calc(50% + 22px);
  transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--muted);
}

.chrono-here {
  position: absolute; left: 50%; top: 0; bottom: 0;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.chrono-here-tick {
  width: 1px; height: 22px;
  background: var(--amber);
  box-shadow: 0 0 12px 0 rgba(201, 160, 107, 0.8);
}
.chrono-here-label {
  position: absolute; top: calc(50% - 48px);
  font-size: 10px; letter-spacing: 0.3em; color: var(--amber);
  white-space: nowrap;
}

.chronology .body { max-width: 44ch; margin: 0 auto; text-align: center; }

/* ============================================================
   03 / MINDS
   ============================================================ */

.minds {
  flex-direction: row; gap: 6vw;
  justify-content: center; align-items: center;
  flex-wrap: wrap;
}

.minds-copy {
  max-width: 480px;
  display: flex; flex-direction: column; align-items: flex-start;
}
.minds-copy h2 { text-align: left; margin-bottom: 2.5rem; }
.minds-copy .label { margin-bottom: 3rem; }
.minds-copy .footnote { margin-top: 4rem; }

.orb-wrap { position: relative; width: min(34vw, 380px); aspect-ratio: 1; }
#orb { width: 100%; height: 100%; display: block; }

.orb-css {
  position: absolute; inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 48% 45%,
    rgba(216, 231, 236, 0.13), rgba(127, 176, 196, 0.06) 45%, transparent 70%);
  filter: blur(6px);
  animation: orb-breathe 12.5s ease-in-out infinite;
}
@keyframes orb-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}

.orb-thought {
  position: absolute; left: 50%; bottom: -2.5rem;
  transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.25em; color: var(--muted);
  opacity: 0.25; white-space: nowrap;
  transition: opacity 2s ease;
}
.orb-thought.is-fading { opacity: 0; }

/* ============================================================
   04 / VESSELS
   ============================================================ */

.vessels {
  flex-direction: row; gap: 4vw;
  justify-content: center; align-items: center;
  flex-wrap: wrap;
}

.vesper-wrap {
  height: 70vh; min-height: 380px;
  display: flex; align-items: flex-end;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
}
#vesper { height: 100%; width: auto; }

#vesper-path {
  stroke: rgba(127, 176, 196, 0.5);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}
#vesper-eye {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px rgba(127, 176, 196, 0.9));
  transition: fill 1.2s ease, r 1.2s ease;
}
#vesper-eye.is-blinking { animation: blink 0.12s linear; }
@keyframes blink {
  50% { opacity: 0.05; }
}
#vesper-eye.is-remembering {
  fill: var(--glow);
  filter: drop-shadow(0 0 14px rgba(216, 231, 236, 1));
}

.vessels-copy { max-width: 460px; }
.vessels-copy h2 { text-align: left; margin-bottom: 2.5rem; }
.vessels-copy .caption { margin-top: 3.5rem; }

/* ============================================================
   05 / SIGNAL
   ============================================================ */

.signal { min-height: 140vh; min-height: 140svh; text-align: center; justify-content: flex-end; padding-bottom: 0; }

.signal .label { margin-bottom: 3rem; }
.signal h2 { margin-bottom: 1rem; }

.signal-sub {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-style: italic;
  color: var(--text); opacity: 0.7;
  margin-bottom: 12vh;
}

#transmit-form {
  display: flex; flex-direction: column; gap: 1.8rem;
  width: min(560px, 86vw);
  margin-bottom: 4rem;
}
.signal-row { display: flex; align-items: flex-end; gap: 2rem; width: 100%; }

#signal-input, #signal-message {
  background: transparent; border: none;
  border-bottom: 1px solid rgba(216, 231, 236, 0.35);
  color: var(--glow);
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em;
  padding: 12px 2px;
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}
#signal-input { flex: 1; }
#signal-message { width: 100%; line-height: 1.7; resize: none; text-align: left; }
#signal-input::placeholder, #signal-message::placeholder { color: var(--muted-content); letter-spacing: 0.18em; }
#signal-input:focus, #signal-message:focus {
  outline: none;
  border-bottom-color: var(--glow);
  box-shadow: 0 12px 24px -16px rgba(127, 176, 196, 0.5);
}
#signal-input:focus-visible, #signal-message:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
}

.transmit {
  font-size: 11px; letter-spacing: 0.3em; color: var(--accent);
  padding: 12px 4px; position: relative;
}
.transmit::after {
  content: ""; position: absolute; left: 0; bottom: 8px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.5s var(--ease-sky);
}
.transmit:hover::after, .transmit:focus-visible::after { transform: scaleX(1); }

.amber { color: var(--amber); font-size: 11px; letter-spacing: 0.2em; }
#transmit-confirm { margin-bottom: 4rem; min-height: 1.6em; opacity: 0; transition: opacity 1.6s ease; }
#transmit-confirm.is-shown { opacity: 1; }

.signal-ghost {
  position: fixed; z-index: 8; pointer-events: none;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; color: var(--glow);
  transition: transform 3.5s var(--ease-sky), opacity 3.5s ease, filter 3.5s ease;
}

.footer {
  width: 100%; padding: 6vh 0 9vh;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 10.5px; letter-spacing: 0.18em; color: var(--muted-content);
}
.footer .mono { font-size: 10.5px; letter-spacing: 0.18em; }

.sound-footer { color: var(--muted-content); letter-spacing: 0.18em; font-size: 10.5px; }
.sound-footer:hover, .sound-footer:focus-visible { color: var(--accent); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .minds, .vessels { flex-direction: column; gap: 8vh; }
  .minds-copy h2, .vessels-copy h2 { text-align: center; }
  .minds-copy, .vessels-copy { align-items: center; text-align: center; }
  .orb-wrap { width: min(60vw, 300px); }
  .vesper-wrap { height: 52vh; min-height: 300px; }
  .hud-okta { right: 16px; top: 18px; }
  .hud-clocks { left: 16px; bottom: 18px; }
  .sound-toggle { right: 12px; bottom: 12px; }
  .bracket { display: none; }
  .hold-hint { bottom: 16vh; }
  .section { padding: 14vh 7vw; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

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

  .reveal, h2.serif.reveal, .headline-line {
    transition: opacity 0.4s ease !important;
    transform: none !important;
    filter: none !important;
    letter-spacing: 0.12em !important;
  }
  h2.serif.reveal { letter-spacing: 0.02em !important; }

  .grain, .fallback-drift { animation: none; }
  .scroll-cue span { animation: none; opacity: 0.4; }
  .hold-hint { display: none; }
  .signal-ghost { transition: opacity 1.2s ease; transform: none !important; filter: none !important; }
  .orb-css { animation: none; }
  .fallback-seam { animation: none; opacity: 0.9; }
  #cursor-light { display: none; }

  .chronology { min-height: 100vh; }
  .chrono-sticky { position: relative; }
}
