:root {
  /* Typography compliance: Inter body 400-600 weights; Space Grotesk secondary headings 600-700 weights for precise technical labels and angled panel headings. */
  --fog: #E6EEE9;
  --cyan: #5ED6C8;
  --violet: #6D7DAD;
  --abyss: #071826;
  --harbor: #0B3D4A;
  --gold: #C6A15B;
  --black: #02070B;
  --display: "Archivo Black", Impact, sans-serif;
  --heading: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fog);
  background: var(--black);
  font-family: var(--body);
  overflow-x: hidden;
}

.background-depth {
  position: fixed;
  inset: 0;
  z-index: -5;
  overflow: hidden;
  background: var(--black);
}

.water-gradient {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at 72% 16%, rgba(109, 125, 173, 0.52), transparent 28%),
    radial-gradient(circle at 22% 78%, rgba(94, 214, 200, 0.24), transparent 34%),
    linear-gradient(132deg, #02070B 3%, #071826 36%, #0B3D4A 68%, #02070B 100%);
  filter: saturate(1.15);
  animation: waterShift 18s ease-in-out infinite alternate;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(230, 238, 233, .48) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 64%, rgba(198, 161, 91, .36) 0 1px, transparent 1.7px),
    radial-gradient(circle at 48% 86%, rgba(94, 214, 200, .35) 0 1px, transparent 1.4px);
  background-size: 37px 41px, 59px 53px, 83px 79px;
  mix-blend-mode: screen;
  animation: grainDrift 1.6s steps(4) infinite;
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .86;
}

.wave-plane {
  position: absolute;
  inset: 0;
  width: 112%;
  height: 112%;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.1;
  opacity: .33;
  transform: rotate(-7deg) translate(-4%, 4%);
}

.wave-plane path {
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 9 16;
  animation: waveDraw 14s linear infinite;
}

.wave-plane-two {
  stroke: var(--violet);
  opacity: .22;
  transform: rotate(-15deg) translate(-6%, -2%);
}

.viewport, .chart-section {
  min-height: 100vh;
  position: relative;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.hero {
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  width: min(92vw, 1400px);
  transform: translate3d(-4vw, 5vh, 90px);
  z-index: 4;
}

.kicker, .plate-code, .annotation, .quiet-label, .ruler span, .seal, .section-mark {
  font-family: var(--body);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(230, 238, 233, .76);
}

.kicker {
  margin: 0 0 -1.1rem .45rem;
  color: var(--gold);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.5rem, 13vw, 13rem);
  letter-spacing: -.045em;
  line-height: .76;
  color: var(--fog);
  text-shadow: 0 24px 0 rgba(2, 7, 11, .58), 0 0 46px rgba(94, 214, 200, .26);
  filter: drop-shadow(-22px 16px 0 rgba(11, 61, 74, .55));
}

h1 span:last-child {
  display: block;
  margin-left: clamp(5rem, 18vw, 23rem);
  color: transparent;
  -webkit-text-stroke: 2px var(--fog);
  text-shadow: 0 0 38px rgba(109, 125, 173, .42);
}

.field-note {
  max-width: 500px;
  margin: 1.7rem 0 0 clamp(1rem, 27vw, 26rem);
  color: rgba(230, 238, 233, .76);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.55;
}

.hero-map {
  position: absolute;
  top: 8vh;
  right: 5vw;
  width: min(68vw, 980px);
  aspect-ratio: 1.6;
  border: 1px solid rgba(94, 214, 200, .38);
  background: linear-gradient(145deg, rgba(11, 61, 74, .34), rgba(2, 7, 11, .26));
  box-shadow: 0 42px 100px rgba(2, 7, 11, .72), inset 0 0 80px rgba(94, 214, 200, .08);
  transform: rotateX(60deg) rotateZ(-17deg) translateZ(-60px);
  transform-style: preserve-3d;
  opacity: .84;
}

.constellation-map { width: 100%; height: 100%; overflow: visible; }
.grid-lines path { stroke: var(--cyan); stroke-width: 2; fill: none; stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: connectDraw 5s ease forwards; }
.stars circle { fill: var(--fog); filter: drop-shadow(0 0 12px var(--cyan)); animation: pulseStar 3.4s ease-in-out infinite; }
.city-blocks rect { fill: rgba(198, 161, 91, .12); stroke: rgba(198, 161, 91, .56); transform-box: fill-box; transform-origin: center; transform: rotate(-12deg); }

.lighthouse-sweep {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(102deg, transparent 33%, rgba(94, 214, 200, .0) 42%, rgba(94, 214, 200, .28) 48%, rgba(230, 238, 233, .16) 50%, transparent 57%);
  mix-blend-mode: screen;
  transform: translateX(-90%);
  animation: lighthouse 7s ease-in-out infinite;
  pointer-events: none;
}

.ruler {
  position: absolute;
  top: 9vh;
  bottom: 9vh;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid rgba(198, 161, 91, .5);
}

.ruler-left { left: 2.2vw; }
.ruler-right { right: 2.2vw; transform: rotate(180deg); }
.ruler span { writing-mode: vertical-rl; color: rgba(198, 161, 91, .78); }

.seal {
  position: absolute;
  top: 4vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .7rem;
  z-index: 7;
}

.star-glyph {
  width: 28px;
  height: 28px;
  display: inline-block;
  border: 1px solid var(--gold);
  background:
    linear-gradient(45deg, transparent 43%, var(--gold) 44% 56%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, var(--gold) 44% 56%, transparent 57%);
  box-shadow: inset 0 0 0 8px rgba(2, 7, 11, .9), 0 0 22px rgba(198, 161, 91, .28);
}

.compass {
  position: fixed;
  right: 4vw;
  bottom: 5vh;
  width: 96px;
  height: 96px;
  z-index: 20;
  display: grid;
  place-items: center;
  color: var(--gold);
  font: 700 .68rem var(--heading);
  letter-spacing: .12em;
}

.compass-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(198, 161, 91, .6);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(7, 24, 38, .7), transparent 62%);
}

.compass-needle {
  position: absolute;
  width: 2px;
  height: 72px;
  background: linear-gradient(var(--cyan) 0 50%, rgba(230, 238, 233, .32) 50%);
  transform-origin: 50% 50%;
  transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}

.instrument-stack {
  position: relative;
  margin-top: -10vh;
}

.chart-section {
  display: flex;
  align-items: center;
  padding: 12vh clamp(1.2rem, 5vw, 6rem);
}

.chart-section::before {
  content: "";
  position: absolute;
  inset: 16vh 8vw auto auto;
  width: min(50vw, 620px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: rotate(-23deg);
  opacity: .5;
}

.section-mark {
  position: absolute;
  top: 19vh;
  left: 6vw;
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 6.8rem);
  letter-spacing: -.045em;
  color: rgba(230, 238, 233, .055);
  text-shadow: 0 0 1px rgba(94, 214, 200, .55);
}

.chart-plate, .final-slab {
  position: relative;
  width: min(760px, 88vw);
  padding: clamp(1.6rem, 5vw, 5rem);
  border: 1px solid rgba(94, 214, 200, .34);
  background:
    linear-gradient(135deg, rgba(230, 238, 233, .08), transparent 28%),
    linear-gradient(155deg, rgba(11, 61, 74, .84), rgba(2, 7, 11, .68));
  box-shadow: 0 50px 100px rgba(2, 7, 11, .78), inset 0 0 90px rgba(94, 214, 200, .07);
  transform: rotateX(12deg) rotateY(-9deg) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .35s ease, border-color .35s ease;
  opacity: 0;
  translate: 0 80px;
}

.chart-plate.is-visible, .final-slab.is-visible { opacity: 1; translate: 0 0; transition: opacity 1s ease, translate 1s ease, transform .35s ease; }
.chart-plate::after, .final-slab::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(230, 238, 233, .08);
  pointer-events: none;
}

.chart-plate h2, .final-slab h2 {
  margin: .6rem 0 1.1rem;
  font-family: var(--heading);
  font-size: clamp(2.3rem, 5vw, 5.6rem);
  line-height: .92;
  letter-spacing: -.055em;
  color: var(--fog);
}

.chart-plate p:not(.plate-code), .final-slab p:not(.plate-code) {
  max-width: 620px;
  color: rgba(230, 238, 233, .72);
  font-size: clamp(1rem, 1.45vw, 1.22rem);
  line-height: 1.7;
}

.plate-code { color: var(--cyan); }
.signal-section .chart-plate { margin-left: 9vw; }
.depth-section { justify-content: flex-end; }
.depth-section .large { width: min(920px, 90vw); transform: rotateX(10deg) rotateY(11deg); }
.bearing-section .split { display: grid; grid-template-columns: 1.05fr .85fr; gap: clamp(1rem, 4vw, 4rem); width: min(1050px, 92vw); margin-left: 13vw; }
.harbor-section { justify-content: center; min-height: 112vh; }
.final-slab { width: min(1000px, 92vw); text-align: left; transform: rotateX(13deg) rotateY(-5deg); }

.annotation {
  position: absolute;
  color: rgba(198, 161, 91, .78);
  border-top: 1px solid rgba(198, 161, 91, .44);
  padding-top: .7rem;
}

.annotation-a { right: 13vw; bottom: 22vh; }
.annotation-b { left: 9vw; bottom: 18vh; }

.depth-ridges {
  position: relative;
  height: 110px;
  margin-top: 2rem;
  overflow: hidden;
}

.depth-ridges span {
  position: absolute;
  left: -8%;
  width: 118%;
  height: 46px;
  border-top: 1px solid rgba(94, 214, 200, .56);
  border-radius: 50%;
  transform: rotate(-3deg);
}
.depth-ridges span:nth-child(1) { top: 8px; }
.depth-ridges span:nth-child(2) { top: 32px; border-color: rgba(109, 125, 173, .5); }
.depth-ridges span:nth-child(3) { top: 58px; }
.depth-ridges span:nth-child(4) { top: 84px; border-color: rgba(198, 161, 91, .42); }

.coastal-star-seal {
  position: absolute;
  right: 10vw;
  top: 18vh;
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--gold);
  font: 700 .78rem var(--heading);
  letter-spacing: .14em;
  transform: rotate(-8deg);
}

.quiet-label {
  display: inline-block;
  margin-top: 2rem;
  padding: .9rem 1.1rem;
  border: 1px solid rgba(198, 161, 91, .5);
  color: var(--gold);
  background: rgba(2, 7, 11, .35);
}

@keyframes waterShift { to { transform: scale(1.06) rotate(2deg); filter: hue-rotate(8deg) saturate(1.25); } }
@keyframes grainDrift { to { transform: translate(3%, -2%); } }
@keyframes waveDraw { to { stroke-dashoffset: -240; } }
@keyframes connectDraw { to { stroke-dashoffset: 0; } }
@keyframes pulseStar { 50% { opacity: .45; transform: scale(.82); } }
@keyframes lighthouse { 0%, 34% { transform: translateX(-90%); opacity: 0; } 48% { opacity: 1; } 70%, 100% { transform: translateX(90%); opacity: 0; } }

@media (max-width: 820px) {
  .hero-map { width: 100vw; right: -22vw; top: 15vh; }
  .field-note { margin-left: 1rem; }
  h1 span:last-child { margin-left: 18vw; }
  .ruler-right, .compass { display: none; }
  .chart-section { padding-inline: 1rem; }
  .signal-section .chart-plate, .bearing-section .split { margin-left: 0; }
  .bearing-section .split { grid-template-columns: 1fr; }
  .annotation, .coastal-star-seal { display: none; }
}
