:root {
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: Outfit, "Segoe UI", "Avenir Next", sans-serif;
  --ink: #fffaf3;
  --shadow: 0 1px 10px rgba(16, 42, 64, 0.28);
  color-scheme: only light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #6eafdf;
  overflow-x: clip;
}

body {
  font-family: var(--sans);
  color: var(--ink);
}

#scroll-root { position: relative; }

#stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #6eafdf;
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.scene.is-ready { opacity: 1; transition: opacity 0.8s ease; }

.world-layer,
canvas,
.veil,
.vignette,
.grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#layer-sky { z-index: 1; }
#water { z-index: 2; }
#layer-reflect { z-index: 3; }
#layer-distance { z-index: 3; }
#layer-cliffs { z-index: 4; }
#layer-far { z-index: 5; }
#layer-seabed-far { z-index: 6; }
#layer-mid { z-index: 7; }
#layer-seabed-mid { z-index: 8; }
#layer-seabed-near { z-index: 9; }
#layer-near { z-index: 10; }
#fx { z-index: 11; }
#layer-boat { z-index: 12; }
.veil { z-index: 13; background: radial-gradient(ellipse at center, rgba(4, 10, 28, 0.15), rgba(3, 6, 18, 0.92)); opacity: 0; }
.vignette { z-index: 14; background: radial-gradient(ellipse at center, transparent 46%, rgba(2, 8, 18, 0.38) 100%); }
.grain {
  z-index: 15;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-size: 140px 140px;
}

.sprite-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sky-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background:
    radial-gradient(ellipse 48% 40% at 76% 92%, rgba(255, 225, 177, 0.62), transparent 66%),
    radial-gradient(ellipse 32% 24% at 14% 18%, rgba(255, 255, 255, 0.32), transparent 68%),
    linear-gradient(112deg, transparent 38%, rgba(255, 250, 224, 0.14) 55%, transparent 72%),
    linear-gradient(180deg, #4b98d0 0%, #72b3e1 20%, #a5d3ee 48%, #d4ebf5 75%, #edf7fa 100%);
}

.sun-anchor { position: absolute; left: 0; top: 0; }
.sun-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 246, 214, 0.95) 0%, rgba(255, 228, 176, 0.38) 26%, rgba(255, 255, 255, 0) 68%);
}
.sun-disk {
  position: absolute;
  left: 0;
  top: 0;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
}
.sun-disk svg { width: 100%; height: 100%; display: block; }

.moon-anchor { position: absolute; left: 0; top: 0; }
.moon-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(210, 226, 255, 0.3), rgba(160, 190, 235, 0.08) 38%, transparent 70%);
}
.moon-disk {
  position: absolute;
  width: 58px;
  height: 58px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 10px rgba(208, 225, 255, 0.28));
}
.moon-disk svg { width: 100%; height: 100%; display: block; overflow: visible; }

.star-field { position: absolute; left: 0; top: 0; width: 100%; }
.star-field i {
  position: absolute;
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 50%;
  background: rgba(245, 249, 255, var(--star-alpha));
  box-shadow: 0 0 4px rgba(220, 234, 255, 0.35);
}

.cloud {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 12px 18px rgba(68, 114, 146, 0.12));
}
.cloud svg { width: 100%; height: auto; display: block; }

.horizon-haze {
  position: absolute;
  left: 0;
  right: 0;
  height: 72px;
  background: linear-gradient(180deg, transparent, rgba(255, 248, 240, 0.28), transparent);
}

.coast {
  position: absolute;
  left: 0;
  top: 0;
  filter: saturate(0.94) drop-shadow(0 7px 8px rgba(35, 77, 82, 0.12));
}
.coast svg { width: 100%; height: 100%; display: block; }

.cliff { position: absolute; left: 0; top: 0; }
.cliff svg { width: 100%; height: 100%; display: block; }

.seabed {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.18) 7%, #000 22%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.18) 7%, #000 22%);
}
.seabed svg { width: 100%; height: 100%; display: block; }
.seabed-far { filter: blur(1.1px); }
.seabed-mid { filter: saturate(1.08); }
.seabed-near { filter: saturate(1.22) brightness(1.08); }

.boat-body,
.boat-reflect { position: absolute; left: 0; top: 0; will-change: transform; }
.boat-body svg,
.boat-reflect svg { width: 100%; height: 100%; display: block; overflow: visible; }
.boat-reflect {
  opacity: 0.3;
  filter: blur(1.1px);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 58%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 58%);
}

.actor {
  position: absolute;
  left: 0;
  top: 0;
  contain: layout style;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.actor svg { width: 100%; height: 100%; display: block; overflow: visible; }
.actor-chromis svg,
.actor-dart svg,
.actor-sardine svg,
.actor-amber svg,
.actor-grouper svg,
.actor-ember svg,
.actor-manta svg,
.actor-whale svg {
  filter: drop-shadow(0 2px 3px rgba(4, 18, 32, 0.22));
}
.actor-lantern svg { filter: drop-shadow(0 0 4px rgba(190, 240, 220, 0.45)); }
.actor-jelly.is-deep svg { filter: drop-shadow(0 0 7px rgba(150, 190, 230, 0.35)); }
.actor-angler svg { filter: drop-shadow(0 0 5px rgba(243, 220, 170, 0.28)); }
.actor-submarine svg { filter: drop-shadow(0 3px 6px rgba(4, 18, 32, 0.35)); }
.actor.is-bioluminescent svg {
  filter: drop-shadow(0 0 calc(3px + var(--bio-strength, 0) * 9px) rgba(164, 232, 225, calc(0.18 + var(--bio-strength, 0) * 0.68)));
}

.kelp-anchor { position: absolute; left: 0; top: 0; }
.kelp-sway { transform-origin: 50% 100%; }
.kelp-sway svg { width: 100%; height: 100%; display: block; }

.arm, .frond {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: sway 7.5s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-2.4deg); }
  50% { transform: rotate(3deg); }
}

.crab-wave {
  transform-box: fill-box;
  transform-origin: 12% 88%;
  animation: crab-hello 1.45s ease-in-out infinite;
}
@keyframes crab-hello {
  0%, 100% { transform: rotate(4deg); }
  38% { transform: rotate(-32deg); }
  54% { transform: rotate(-14deg); }
  74% { transform: rotate(-36deg); }
}

.hud {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: max(22px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) 0 max(28px, env(safe-area-inset-left));
  color: var(--ink);
  text-shadow: var(--shadow);
  pointer-events: none;
}
.hud a { pointer-events: auto; color: inherit; text-decoration: none; }

.logo {
  position: relative;
  display: block;
  line-height: 0;
}
.logo img {
  height: 44px;
  width: auto;
  display: block;
  transition: opacity 0.7s ease;
}
.logo-light {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}
.is-surface .logo-ink { opacity: 1; }
.is-surface .logo-light { opacity: 0; }
html:not(.is-surface) .logo-ink { opacity: 0; }
html:not(.is-surface) .logo-light { opacity: 1; }

#nav { display: flex; gap: 28px; }
#nav a {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0.78;
}
#nav a.is-active { opacity: 1; }
#nav a:hover { opacity: 1; }

.hero {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 15vh;
  transform: translateX(-50%);
  text-align: center;
  width: min(760px, 88vw);
  pointer-events: none;
  text-shadow: var(--shadow);
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(42px, 5.4vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: italic; font-weight: 500; }
.hero .kicker { margin-bottom: 14px; }
.hint {
  margin: 18px 0 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.88;
}
.chevron {
  display: block;
  width: 12px;
  height: 12px;
  margin: 14px auto 0;
  border-right: 1.5px solid rgba(255, 250, 243, 0.9);
  border-bottom: 1.5px solid rgba(255, 250, 243, 0.9);
  transform: rotate(45deg);
  animation: chev 1.8s ease-in-out infinite;
}
@keyframes chev {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(3px, 3px); }
}

.meter {
  position: absolute;
  z-index: 19;
  top: 18vh;
  bottom: 12vh;
  right: max(22px, env(safe-area-inset-right));
  width: 86px;
  pointer-events: none;
  text-shadow: var(--shadow);
}
.meter-track {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 6px;
  width: 1px;
  background: rgba(255, 250, 243, 0.62);
}
.meter-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fffaf3;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16), 0 1px 4px rgba(0, 0, 0, 0.25);
}
.meter-labels span {
  position: absolute;
  right: 16px;
  transform: translateY(-50%);
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.meter-readout {
  position: absolute;
  right: 16px;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  transform: translateY(-50%);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.captions {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}
.caption {
  position: absolute;
  width: min(440px, 40vw);
  color: #fffaf3;
  text-shadow: 0 1px 12px rgba(8, 24, 40, 0.28);
}
.caption.side-left { left: max(6vw, 28px); }
.caption.side-right { right: max(12vw, 120px); text-align: left; }
.caption.place-high { top: 22vh; }
.caption.place-mid { top: 36vh; }
.caption.place-low { top: auto; bottom: 14vh; }
.caption::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -38%;
  top: -54%;
  width: 176%;
  height: 220%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 42% 44%, rgba(5, 18, 34, 0.2) 0%, rgba(5, 18, 34, 0.1) 38%, transparent 72%);
  filter: blur(22px);
  opacity: var(--wash, 0);
  pointer-events: none;
}
.caption .rule {
  display: block;
  width: 42px;
  height: 1px;
  margin: 0 0 14px;
  background: currentColor;
  opacity: 0.45;
  transform: scaleX(0);
  transform-origin: left center;
}
.caption-head,
.caption-body,
.finale-head,
.finale-body { opacity: 0; }
.caption-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 3.2vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.caption-body { margin-top: 14px; max-width: 38em; }
.kicker {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.72;
}
.caption-text, .finale-text {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  max-width: 42em;
}
.caption-logos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px 28px;
  margin-top: 18px;
}
.caption-logos a { line-height: 0; }
.caption-logos img {
  height: 28px;
  width: auto;
  display: block;
  opacity: 0.92;
}
.caption-logos img.is-dcs { height: 44px; }
.caption-logos img.is-mark { height: 32px; }
.caption-lines {
  margin: 0;
  padding: 0;
  list-style: none;
}
.caption-lines li {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.45;
}
.caption-lines strong {
  display: block;
  margin-bottom: 2px;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0;
}
.tone-ink { color: #1a3c56; text-shadow: 0 1px 0 rgba(255, 250, 243, 0.35); }
.tone-ink::before {
  background: radial-gradient(ellipse at 40% 42%, rgba(255, 250, 243, 0.18), rgba(255, 250, 243, 0.07) 42%, transparent 72%);
}
.is-surface .hud,
.is-surface .meter { color: #1a3c56; text-shadow: 0 1px 0 rgba(255, 250, 243, 0.9), 0 0 14px rgba(255, 250, 243, 0.55); }
.is-surface .meter-track { background: rgba(26, 60, 86, 0.45); }
.is-surface .meter-knob { background: #1a3c56; box-shadow: 0 0 0 3px rgba(26, 60, 86, 0.12); }
.is-surface .chevron { border-color: #1a3c56; }
html.is-night.is-surface .hud,
html.is-night.is-surface .meter,
html.is-night.is-surface .hero { color: #fffaf3; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42); }
html.is-night.is-surface .logo-ink { opacity: 0; }
html.is-night.is-surface .logo-light { opacity: 1; }
html.is-night.is-surface .meter-track { background: rgba(255, 250, 243, 0.5); }
html.is-night.is-surface .meter-knob { background: #fffaf3; box-shadow: 0 0 0 3px rgba(255,255,255,0.14); }
html.is-night.is-surface .chevron { border-color: #fffaf3; }

.finale {
  position: absolute;
  z-index: 19;
  left: 50%;
  top: 14vh;
  width: min(640px, 86vw);
  transform: translateX(-50%);
  text-align: center;
  color: #fffaf3;
  pointer-events: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}
.finale::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -20%;
  width: 140%;
  height: 160%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 34%, rgba(8, 22, 40, 0.24), rgba(8, 22, 40, 0.08) 46%, transparent 74%);
  filter: blur(24px);
  opacity: var(--wash, 0);
  pointer-events: none;
}
.finale h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
}
.finale-body { margin-top: 16px; }
.finale-links { margin: 18px 0 0; }
.finale a {
  pointer-events: auto;
  color: inherit;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 250, 243, 0.7);
  padding-bottom: 3px;
}
.finale a:hover { border-bottom-color: transparent; }
.finale-note,
.finale-privacy {
  margin: 14px auto 0;
  max-width: 38em;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  opacity: 0.82;
}
.finale-privacy { font-size: 12px; opacity: 0.62; }

a:focus-visible {
  outline: 1px solid rgba(255, 250, 243, 0.9);
  outline-offset: 4px;
}

.noscript {
  position: fixed;
  left: 24px;
  bottom: 24px;
  margin: 0;
  color: #16324a;
  background: rgba(255, 250, 243, 0.9);
  padding: 10px 14px;
  max-width: 620px;
  line-height: 1.45;
}
.noscript h1 { margin: 0 0 8px; font-family: var(--serif); }
.noscript p { margin: 5px 0; }
.noscript a { color: inherit; }

.environment-debug {
  position: fixed;
  z-index: 100;
  left: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 7px;
  align-items: center;
  padding: 10px;
  color: #102b42;
  background: rgba(255, 250, 243, 0.94);
  border: 1px solid rgba(16, 43, 66, 0.18);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  font: 12px/1.2 var(--sans);
}
.environment-debug strong,
.environment-debug output { grid-column: 1 / -1; }
.environment-debug select,
.environment-debug input,
.environment-debug button { font: inherit; }
.environment-debug label { white-space: nowrap; }

::selection { background: rgba(255, 244, 220, 0.28); }

.is-phone .meter-labels { display: none; }
.is-phone #layer-cliffs { display: none; }
.is-phone .meter { right: 8px; width: 42px; top: 48vh; bottom: 8vh; }
.is-phone .hud {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.is-phone .hero { top: 24vh; width: calc(100% - 36px); }
.is-phone .hero h1 { font-size: 34px; }
.is-phone .hint { font-size: 12px; letter-spacing: 0.12em; }
.is-phone #nav { gap: 12px; flex-wrap: wrap; }
.is-phone #nav a { font-size: 12px; }
.is-phone .logo img { height: 32px; }
.is-phone .caption {
  left: 18px;
  right: auto;
  top: auto;
  bottom: 12vh;
  width: min(300px, 78vw);
}
.is-phone .caption-title { font-size: 30px; }
.is-phone .caption-text,
.is-phone .caption-lines li { font-size: 14px; }
.is-phone .caption-logos { gap: 14px 16px; }
.is-phone .caption-logos img { height: 22px; }
.is-phone .caption-logos img.is-dcs { height: 34px; }
.is-phone .caption-logos img.is-mark { height: 26px; }
.is-phone .finale { top: 20vh; width: min(320px, 88vw); }
.is-phone .finale h2 { font-size: 36px; }
.is-phone .sun-glow { width: 220px; height: 220px; }

@media (max-width: 720px) {
  .hud { padding-top: max(16px, env(safe-area-inset-top)); }
}

.reduce-motion .scene,
.reduce-motion .chevron,
.reduce-motion .arm,
.reduce-motion .frond,
.reduce-motion .crab-wave,
.reduce-motion .logo img { animation: none; transition: none; }
