:root {
  /* typography compliance: Space Mono**font in Bold; IBM Plex Mono**font in Medium or SemiBold; Roboto Mono**font in Black for blocky professional instrumentation. */
  --kelp: #243238;
  --glass: #7FA7A0;
  --cream: #E7D8B6;
  --coral: #C75B4A;
  --mustard: #D6A64A;
  --lavender: #9B86A8;
  --navy: #101B2A;
  --display: "Space Mono", monospace;
  --hud: "IBM Plex Mono", monospace;
  --body: "Noto Sans JP", sans-serif;
  --numeral: "Roboto Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-snap-type: y mandatory;
  background: var(--navy);
}

body {
  margin: 0;
  color: var(--cream);
  font-family: var(--body);
  background: var(--kelp);
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: .28;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(231,216,182,.18) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(16,27,42,.22) 0 1px, transparent 1px),
    linear-gradient(90deg, rgba(199,91,74,.04), rgba(127,167,160,.04));
  background-size: 11px 11px, 17px 17px, 100% 100%;
  mix-blend-mode: overlay;
}

.transmission-stack { width: 100%; }

.plate {
  min-height: 100vh;
  position: relative;
  scroll-snap-align: start;
  overflow: hidden;
  padding: clamp(28px, 5vw, 72px);
  border-bottom: 8px solid var(--navy);
  display: grid;
  align-items: center;
}

.plate::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(127,167,160,.42);
  clip-path: polygon(0 0, 34% 0, 34% 10px, 66% 10px, 66% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.tide-axis {
  position: fixed;
  left: 43vw;
  top: 0;
  width: 78px;
  height: 100vh;
  z-index: 20;
  pointer-events: none;
  opacity: .8;
}

.tide-axis::before {
  content: "";
  position: absolute;
  left: 36px;
  top: 0;
  bottom: 0;
  border-left: 2px solid rgba(127,167,160,.55);
  box-shadow: 12px 0 0 rgba(214,166,74,.22), -15px 0 0 rgba(199,91,74,.18);
}

.tide-axis span {
  position: absolute;
  left: 22px;
  width: 30px;
  height: 2px;
  background: var(--mustard);
  box-shadow: 0 0 16px rgba(214,166,74,.55);
}

.tide-axis span:nth-child(1) { top: 18%; }
.tide-axis span:nth-child(2) { top: 50%; }
.tide-axis span:nth-child(3) { top: 82%; }

.hero { background: radial-gradient(circle at 43% 48%, rgba(127,167,160,.18), transparent 34%), linear-gradient(135deg, var(--navy), var(--kelp) 72%); }
.archive { background: linear-gradient(100deg, var(--cream) 0 48%, var(--kelp) 48% 100%); color: var(--navy); }
.flip-scene { background: linear-gradient(160deg, var(--kelp), var(--navy)); }
.deep-hud { background: radial-gradient(circle at 35% 50%, rgba(127,167,160,.18), transparent 40%), var(--navy); }
.closing { background: linear-gradient(180deg, var(--navy), #182431 65%, var(--kelp)); place-items: center; text-align: center; }

.hud-orbit {
  position: absolute;
  left: calc(43vw - 260px);
  top: 50%;
  width: 520px;
  height: 520px;
  margin-top: -260px;
  border: 2px solid rgba(127,167,160,.44);
  border-radius: 50%;
  animation: rotateSweep 24s linear infinite;
}

.hud-orbit::before, .hud-orbit::after, .hud-orbit i {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(127,167,160,.32);
}

.hud-orbit::before { inset: 64px; }
.hud-orbit::after { inset: 138px; border-color: rgba(214,166,74,.35); }
.hud-orbit i:nth-child(1) { inset: -12px; border-top-color: var(--coral); clip-path: inset(0 0 50% 0); }
.hud-orbit i:nth-child(2) { inset: 205px; background: rgba(127,167,160,.18); }
.hud-orbit i:nth-child(3) { inset: 20px; border-style: dashed; }

.poster-wordmark, h1 {
  font-family: var(--display);
  font-weight: 700;
  line-height: .82;
  letter-spacing: -.08em;
  text-transform: lowercase;
}

.poster-wordmark {
  position: relative;
  z-index: 3;
  font-size: clamp(72px, 15vw, 218px);
  max-width: 10ch;
  color: var(--cream);
  text-shadow: -9px 8px 0 var(--coral), 10px -8px 0 var(--mustard), 18px 12px 0 rgba(155,134,168,.45);
  animation: register 4.5s ease-in-out infinite;
}

.poster-wordmark::after, h1::after {
  content: attr(data-text);
  position: absolute;
  left: .055em;
  top: .055em;
  color: transparent;
  -webkit-text-stroke: 1px var(--glass);
  opacity: .75;
}

h1 {
  position: relative;
  margin: 12px 0 22px;
  font-size: clamp(54px, 10vw, 150px);
  color: currentColor;
}

h1::after { content: attr(data-shadow); }

.signal-kicker, .section-stamp, .coordinates, .final-readout, .paper-tag b, .card-code, .flip-card i {
  font-family: var(--hud);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 600;
}

.signal-kicker { z-index: 4; max-width: 520px; color: var(--glass); font-size: 13px; }

.paper-tag {
  z-index: 5;
  width: min(390px, 70vw);
  padding: 18px;
  background: var(--cream);
  color: var(--navy);
  border: 3px solid var(--navy);
  box-shadow: 10px 10px 0 var(--coral);
  transform: rotate(-2deg);
}

.paper-tag span { display: block; margin-top: 8px; line-height: 1.55; }

.plate-number {
  position: absolute;
  right: 5vw;
  top: 5vw;
  font-family: var(--numeral);
  font-size: clamp(82px, 16vw, 220px);
  color: rgba(127,167,160,.12);
}

.bubble {
  position: absolute;
  border-radius: 50%;
  display: grid;
  place-items: center;
  width: 148px;
  height: 116px;
  font-family: var(--hud);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy);
  border: 3px solid var(--navy);
  animation: floaty 6s ease-in-out infinite;
}

.bubble-coral { right: 10vw; bottom: 18vh; background: var(--coral); }
.bubble-mustard { right: 23vw; top: 18vh; background: var(--mustard); animation-delay: -2s; }

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(127,167,160,.55);
  box-shadow: 0 0 18px var(--glass);
  animation: scan 5s linear infinite;
}

.section-copy { max-width: 560px; z-index: 4; }
.section-copy p, .quiet-card p { font-size: clamp(17px, 2vw, 23px); line-height: 1.65; }
.section-stamp { color: var(--coral); font-size: 13px; }

.artifact-board {
  position: absolute;
  right: 5vw;
  top: 13vh;
  width: min(620px, 52vw);
  min-height: 70vh;
}

.artifact {
  position: absolute;
  display: grid;
  gap: 8px;
  width: 260px;
  padding: 18px;
  background: var(--cream);
  border: 3px solid var(--navy);
  box-shadow: 12px 12px 0 rgba(16,27,42,.35);
}

.artifact .icon { font-size: 52px; color: var(--coral); }
.artifact b { font-family: var(--display); font-size: 24px; }
.artifact em { font-style: normal; font-family: var(--hud); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--kelp); }
.scrap-a { left: 0; top: 0; transform: rotate(-3deg); }
.scrap-b { right: 0; top: 12%; transform: rotate(4deg); }
.scrap-c { left: 12%; bottom: 10%; transform: rotate(2deg); }
.scrap-d { right: 8%; bottom: 0; transform: rotate(-5deg); }

.wave-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -26px;
  height: 140px;
  background: radial-gradient(60px 48px at 40px 0, transparent 98%, var(--glass) 100%) 0 0/120px 100%;
  opacity: .75;
  animation: tideRise 4s ease-in-out infinite;
}

.flip-scene { align-content: center; }
.flip-grid { display: grid; grid-template-columns: repeat(3, minmax(210px, 1fr)); gap: 28px; z-index: 5; perspective: 1200px; }
.flip-card { height: 360px; padding: 0; border: 0; background: transparent; cursor: pointer; perspective: 1200px; color: inherit; }
.card-inner { position: relative; display: block; height: 100%; transform-style: preserve-3d; transition: transform .72s cubic-bezier(.2,.8,.2,1); }
.flip-card:hover .card-inner, .flip-card.is-flipped .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: grid;
  align-content: space-between;
  padding: 24px;
  text-align: left;
  border: 3px solid var(--cream);
  box-shadow: 12px 12px 0 rgba(199,91,74,.72);
}
.front { background: radial-gradient(circle at 20% 25%, rgba(199,91,74,.24), transparent 22%), var(--cream); color: var(--navy); }
.back { transform: rotateY(180deg); background: var(--navy); color: var(--cream); border-color: var(--glass); box-shadow: 12px 12px 0 rgba(214,166,74,.65); }
.card-face strong { font-family: var(--display); font-size: clamp(38px, 5vw, 68px); line-height: .9; text-transform: lowercase; }
.card-face small { font-family: var(--body); font-size: 16px; line-height: 1.5; }
.back i { color: var(--mustard); }

.deep-hud { grid-template-columns: 1fr 1fr; gap: 4vw; }
.sonar-panel { width: min(560px, 82vw); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--glass); position: relative; justify-self: center; animation: rotateSweep 30s linear infinite reverse; }
.sonar-panel::before, .sonar-panel::after { content: ""; position: absolute; border-radius: 50%; border: 1px dashed rgba(127,167,160,.42); }
.sonar-panel::before { inset: 18%; }
.sonar-panel::after { inset: 34%; border-color: rgba(214,166,74,.44); }
.sonar-core { position: absolute; inset: 46%; border-radius: 50%; background: var(--coral); box-shadow: 0 0 36px var(--coral); }
.waveform { position: absolute; left: 12%; right: 12%; bottom: 18%; display: flex; align-items: end; gap: 10px; height: 95px; }
.waveform i { flex: 1; background: var(--glass); animation: bars 1.8s ease-in-out infinite; }
.waveform i:nth-child(2n) { background: var(--mustard); animation-delay: -.4s; }
.waveform i:nth-child(3n) { background: var(--lavender); animation-delay: -.8s; }
.depth-meter { position: absolute; left: 8vw; top: 12vh; bottom: 12vh; width: 46px; border-left: 2px solid var(--cream); }
.depth-meter span { display: block; height: 20%; border-top: 2px solid var(--cream); }
.right-copy { justify-self: end; }
.coordinates { position: absolute; right: 6vw; bottom: 6vh; color: var(--glass); }

.quiet-card { width: min(900px, 88vw); z-index: 4; }
.quiet-card h1 { color: var(--cream); text-shadow: -8px 7px 0 var(--coral), 8px -6px 0 var(--mustard); }
.buoy-light { position: absolute; bottom: 20vh; width: 18px; height: 18px; border-radius: 50%; background: var(--mustard); box-shadow: 0 0 24px 8px var(--mustard), 0 0 120px 45px rgba(214,166,74,.22); animation: pulse 2.8s ease-in-out infinite; }
.final-readout { position: absolute; bottom: 7vh; color: var(--glass); }

.is-visible .section-copy, .is-visible .flip-grid, .is-visible .quiet-card { animation: slideIn .8s ease both; }

@keyframes rotateSweep { to { transform: rotate(360deg); } }
@keyframes register { 0%, 100% { text-shadow: -9px 8px 0 var(--coral), 10px -8px 0 var(--mustard), 18px 12px 0 rgba(155,134,168,.45); } 50% { text-shadow: -3px 3px 0 var(--coral), 4px -3px 0 var(--mustard), 8px 5px 0 rgba(155,134,168,.45); } }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-16px) rotate(3deg); } }
@keyframes scan { from { top: -5%; } to { top: 105%; } }
@keyframes tideRise { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes bars { 0%,100% { height: 24%; } 50% { height: 96%; } }
@keyframes pulse { 0%,100% { opacity: .65; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .tide-axis { left: 24px; opacity: .45; }
  .plate { padding: 72px 24px; }
  .artifact-board { position: relative; right: auto; top: auto; width: 100%; min-height: 640px; margin-top: 24px; }
  .flip-grid { grid-template-columns: 1fr; }
  .deep-hud { grid-template-columns: 1fr; }
  .right-copy { justify-self: start; }
  .bubble { display: none; }
  .hud-orbit { left: 4vw; width: 400px; height: 400px; margin-top: -200px; }
}
