/* ==========================================================================
   DCU Sub-Aqua Club
   The page is a single descent: the water darkens as you scroll, the dive
   console on the right tracks depth, and the page ends on the seabed.
   ========================================================================== */

:root {
  color-scheme: dark;

  --text: #eef7f6;
  --muted: #b6cdd1;
  --soft: #93b3ba;
  --line: rgb(214 240 240 / .16);
  --line-strong: rgb(214 240 240 / .3);
  --lume: #c6ffe4;
  --lume-dim: rgb(198 255 228 / .55);
  --mint: #a6f2d5;
  --mint-hover: #c6f8e8;
  --mint-ink: #0a2421;
  --signal: #ff6a45;
  --signal-ink: #1c0904;
  --abyss: #03070c;

  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 70rem;
  --dial: 380px; /* the gauge when opened */
  --dial-rest: .46; /* its size at rest, as a fraction of --dial */
  --side: 0px; /* room kept clear for the gauge on each side of the content */

  /* Set every frame by script.js from the current depth */
  --w1: #34a0ae;
  --w2: #1a7384;
  --w3: #0f4a5c;
  --sun: 1;
  --shade: .15;
  --torch: 0;
}

@media (min-width: 1180px) and (min-height: 600px) {
  :root {
    --dial: min(380px, 68vh);
    --side: calc(var(--dial) * var(--dial-rest) / 2 + 1.25rem);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--abyss);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--body);
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1, h2, h3, p, figure, dl, dd, ol, ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 650;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.5rem, 5.2vw, 4.6rem);
  font-stretch: 78%;
  line-height: .94;
  letter-spacing: -.012em;
}

h3 {
  font-size: 1.35rem;
  font-stretch: 85%;
  line-height: 1.1;
}

p {
  color: var(--muted);
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--lume);
  outline-offset: 4px;
  border-radius: 2px;
}

::selection {
  background: var(--signal);
  color: var(--signal-ink);
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: .75rem;
  left: .75rem;
  padding: .7rem 1rem;
  background: var(--lume);
  color: #04121b;
  font-weight: 650;
  clip-path: inset(50%);
}

.skip-link:focus {
  clip-path: none;
}

.icon {
  flex: none;
  width: 1em;
  height: 1em;
  transition: translate 200ms ease;
}

.wrap {
  width: min(100% - max(var(--gutter), var(--side)) * 2, var(--max));
  margin-inline: auto;
}

/* ==========================================================================
   The water column
   ========================================================================== */

.ocean {
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100lvh;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, var(--w1) 0%, var(--w2) 52%, var(--w3) 100%);
  contain: strict;
}

.ocean > * {
  position: absolute;
  inset: 0;
}

.ocean-sun {
  opacity: var(--sun);
  /* As you descend the rays lengthen and the bright end slides up out of
     view with the surface. */
  transform-origin: 50% 0;
  transform: translateY(calc(var(--surface, 0) * -14vh)) scaleY(calc(1 + var(--surface, 0) * .5));
}

.ocean > .ocean-surface {
  inset: 0 0 auto;
  height: min(36vh, 340px);
  opacity: var(--sun);
  translate: 0 calc(var(--surface, 0) * -100%);
  filter: blur(1.5px);
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
  mask-image: linear-gradient(#000 35%, transparent);
}

.surface-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ray {
  position: absolute;
  top: -12%;
  left: var(--x);
  width: var(--w);
  height: 125%;
  transform-origin: 50% 0;
  rotate: var(--r);
  filter: blur(16px);
  animation: ray-sway var(--d) ease-in-out infinite alternate;
}

/* A narrower, brighter core that flickers on its own, faster beat, as the
   waves overhead focus and spread the light. */
.ray::after {
  content: "";
  position: absolute;
  inset: 0 22%;
  background: linear-gradient(180deg, rgb(235 255 250 / .5), rgb(210 252 246 / .12) 36%, transparent 64%);
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
  animation: ray-flicker calc(var(--d) * .29) ease-in-out infinite alternate;
}

@keyframes ray-flicker {
  0% { opacity: .1; translate: -12% 0; }
  40% { opacity: .9; }
  70% { opacity: .35; }
  100% { opacity: 1; translate: 14% 0; }
}

.ray::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(214 255 247 / .34), rgb(200 250 244 / .1) 42%, transparent 78%);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
}

@keyframes ray-sway {
  from {
    rotate: calc(var(--r) - 3.5deg);
    scale: .8 1;
    opacity: .4;
  }

  50% {
    opacity: .85;
  }

  to {
    rotate: calc(var(--r) + 3.5deg);
    scale: 1.2 1.04;
    opacity: 1;
  }
}

.ocean-torch {
  opacity: var(--torch);
  background: radial-gradient(circle 26rem at var(--mx, 70%) var(--my, 40%), rgb(120 190 200 / .13), rgb(80 150 170 / .05) 45%, transparent 70%);
}

.ocean-shade {
  background:
    radial-gradient(ellipse 85% 75% at 45% 45%, transparent 40%, rgb(0 4 10 / var(--shade)) 100%);
}

.ocean-canvas {
  width: 100%;
  height: 100%;
}

/* Creatures: positioned by script.js, drawn as silhouettes.
   Each one is filled with a solid colour and faded as a whole (opacity on
   the element), so flippers and fins that overlap the body don't show up
   as darker patches. --mark is the lighter colour for shell plates, grooves
   and other markings. */

.creature {
  position: absolute;
  top: 0;
  left: 0;
  inset: 0 auto auto 0;
  visibility: hidden;
  will-change: transform;
}

.creature svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Clip shapes inherit visibility, and a hidden one clips everything away.
   Creatures start hidden until the script places them, so keep the clip
   shapes visible (they are never painted themselves). */
.creature clipPath * {
  visibility: visible;
}

.creature-turtle {
  width: clamp(110px, 12vw, 170px);
  color: rgb(4 42 52);
  opacity: .55;
  --mark: rgb(36 86 96);
}

.flipper {
  transform-box: fill-box;
  animation: flipper 3.2s ease-in-out infinite alternate;
}

/* Front flippers do the work in long strokes; the small rear ones steer. */
.flipper-a { transform-origin: 95% 95%; }
.flipper-b { transform-origin: 95% 5%; }
.flipper-c { transform-origin: 100% 70%; animation-duration: 1.6s; }
.flipper-d { transform-origin: 100% 30%; animation-duration: 1.6s; animation-direction: alternate-reverse; }

.flipper-a {
  --sweep: -18deg;
}

.flipper-b {
  --sweep: 18deg;
}

.flipper-c {
  --sweep: -8deg;
}

.flipper-d {
  --sweep: 8deg;
}

@keyframes flipper {
  from { rotate: calc(var(--sweep) * -.4); }
  to { rotate: var(--sweep); }
}

/* The head reaches forward on the power stroke and looks around a little. */
.turtle-head {
  transform-box: view-box;
  transform-origin: 168px 100px;
  animation: turtle-head 6.4s ease-in-out infinite;
}

@keyframes turtle-head {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(3px) rotate(-5deg); }
  50% { transform: translateX(1px) rotate(1deg); }
  75% { transform: translateX(4px) rotate(5deg); }
}

.creature-shark {
  width: clamp(300px, 36vw, 540px);
  aspect-ratio: 900 / 357;
  color: rgb(3 30 46);
  opacity: .5;
}

.creature-shark-far {
  width: clamp(180px, 20vw, 300px);
  color: rgb(4 34 52);
  opacity: .32;
  filter: blur(1.5px);
}

.shark-body {
  position: absolute;
  inset: 0;
  transform-origin: 30% 50%;
  animation: shark-swim 2.6s ease-in-out infinite alternate;
}

/* The silhouette is drawn twice: the body, and the tail from the caudal
   peduncle back, which beats from side to side (up and down on screen,
   since we see the shark side-on) a beat ahead of the body. */
.shark-front,
.shark-tail {
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("assets/ocean/shark.webp") center / contain no-repeat, linear-gradient(90deg, #000 79%, transparent 83%);
  -webkit-mask-composite: source-in;
  mask: url("assets/ocean/shark.webp") center / contain no-repeat intersect, linear-gradient(90deg, #000 79%, transparent 83%);
}

.shark-tail {
  -webkit-mask: url("assets/ocean/shark.webp") center / contain no-repeat, linear-gradient(90deg, transparent 77%, #000 81%);
  -webkit-mask-composite: source-in;
  mask: url("assets/ocean/shark.webp") center / contain no-repeat intersect, linear-gradient(90deg, transparent 77%, #000 81%);
  transform-origin: 80% 46%;
  animation: shark-tail 1.3s ease-in-out infinite alternate;
}

@keyframes shark-tail {
  from { transform: rotate(-7deg) scaleY(.94); }
  to { transform: rotate(7deg) scaleY(1.04); }
}

@keyframes shark-swim {
  from { transform: rotate(-1.2deg) skewY(.6deg); }
  to { transform: rotate(1.2deg) skewY(-.6deg); }
}

.creature-manta {
  width: clamp(170px, 17vw, 250px);
  color: rgb(3 22 40);
  opacity: .5;
  --mark: rgb(70 104 124);
}

/* Seen from above, a wingbeat shows as the wings foreshortening while their
   tips trail behind the body, so each wing is squashed and skewed about the
   body's centre line. The tail lags behind. */
.manta-wing {
  transform-box: view-box;
  transform-origin: 200px 180px;
  animation: manta-wing-top 5.2s cubic-bezier(.45, 0, .35, 1) infinite;
}

.manta-wing-bottom {
  animation-name: manta-wing-bottom;
}

.manta-tail {
  transform-box: view-box;
  transform-origin: 84px 180px;
  animation: manta-tail 5.2s ease-in-out -1.2s infinite;
}

@keyframes manta-wing-top {
  0%, 100% { transform: scaleY(1) skewX(0deg); }
  30% { transform: scaleY(1.03) skewX(-4deg); }
  65% { transform: scaleY(.62) skewX(10deg); }
}

@keyframes manta-wing-bottom {
  0%, 100% { transform: scaleY(1) skewX(0deg); }
  30% { transform: scaleY(1.03) skewX(4deg); }
  65% { transform: scaleY(.62) skewX(-10deg); }
}

@keyframes manta-tail {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.creature-whale {
  width: clamp(560px, 76vw, 1100px);
  color: rgb(2 18 36);
  opacity: .5;
  filter: blur(1.2px);
  --mark: rgb(34 66 86);
}

.creature-whale svg {
  animation: whale-glide 14s ease-in-out infinite alternate;
}

@keyframes whale-glide {
  from { transform: rotate(-1.4deg); }
  to { transform: rotate(1.6deg); }
}

/* Slow, heavy fluke strokes; the long flipper steers. */
.whale-fluke {
  transform-box: view-box;
  transform-origin: 192px 178px;
  animation: whale-fluke 7s ease-in-out infinite;
}

.whale-flipper {
  transform-box: view-box;
  transform-origin: 776px 216px;
  animation: whale-flipper 9s ease-in-out infinite alternate;
}

@keyframes whale-fluke {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(8deg); }
}

@keyframes whale-flipper {
  from { transform: rotate(-5deg); }
  to { transform: rotate(7deg); }
}

.creature-jelly {
  width: clamp(70px, 7vw, 108px);
  color: rgb(205 180 255 / .75);
  filter: drop-shadow(0 0 14px rgb(160 130 255 / .45));
}

.creature-jelly-small {
  width: clamp(44px, 4.4vw, 66px);
  color: rgb(170 230 255 / .6);
  filter: drop-shadow(0 0 10px rgb(120 210 255 / .4));
}

.jelly-bell {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: jelly-pulse 3.4s cubic-bezier(.45, 0, .2, 1) infinite;
}

.jelly-trail {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: jelly-trail 6.8s ease-in-out infinite alternate;
}

.creature-jelly-small .jelly-bell {
  animation-duration: 2.9s;
}

@keyframes jelly-pulse {
  0%, 100% { transform: scale(1, 1); }
  35% { transform: scale(.86, 1.08); }
}

@keyframes jelly-trail {
  from { transform: skewX(4deg) scaleY(1); }
  to { transform: skewX(-4deg) scaleY(.94); }
}

/* Each set of tentacles sways on its own beat, so they drift apart and
   back together instead of moving as one sheet. */
.strand {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: strand 5.2s ease-in-out infinite alternate;
}

.strand-arms {
  animation-duration: 3.9s;
  animation-delay: -1.4s;
}

.strand-core {
  animation-duration: 4.6s;
  animation-delay: -2.6s;
}

@keyframes strand {
  from { transform: skewX(-6deg) scaleY(1.03); }
  to { transform: skewX(7deg) scaleY(.95); }
}

.creature-angler {
  width: clamp(130px, 13vw, 190px);
  color: rgb(14 26 38);
  opacity: .92;
  --mark: rgb(34 52 66);
  --tooth: rgb(200 222 228 / .75);
  --eye: rgb(190 234 238 / .7);
}

.lure {
  position: absolute;
  top: 12%;
  left: 90.8%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  translate: -50% -50%;
  background: #e6fffb;
  box-shadow: 0 0 10px 4px rgb(150 255 236 / .75), 0 0 46px 18px rgb(80 220 210 / .28);
  animation: lure 4.2s ease-in-out infinite;
}

.angler-tail {
  transform-box: view-box;
  transform-origin: 48px 106px;
  animation: angler-tail 1.9s ease-in-out infinite alternate;
}

.angler-fin {
  transform-box: view-box;
  transform-origin: 137px 121px;
  animation: angler-fin 1.1s ease-in-out infinite alternate;
}

@keyframes angler-tail {
  from { transform: rotate(-9deg) scaleX(.94); }
  to { transform: rotate(8deg) scaleX(1.04); }
}

@keyframes angler-fin {
  from { transform: rotate(-14deg); }
  to { transform: rotate(16deg); }
}

@keyframes lure {
  0%, 100% { opacity: .55; scale: .85; }
  45% { opacity: 1; scale: 1.1; }
  55% { opacity: .9; scale: 1; }
}

/* ==========================================================================
   Dive console (desktop: a small gauge on the right edge that opens out
   into the section compass when you point at it or tab into it)
   ========================================================================== */

.console {
  position: fixed;
  z-index: 20;
}

.console-toggle {
  display: none;
}

.dial {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dial-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 12px 40px rgb(0 8 16 / .45));
}

.dial-glass {
  fill: rgb(3 13 21 / .66);
  pointer-events: auto;
}

.dial-rim {
  fill: none;
  stroke: rgb(198 255 228 / .32);
  stroke-width: 1;
}

.dial-band-edge {
  fill: none;
  stroke: rgb(198 255 228 / .14);
  stroke-width: 1;
}

.dial-window {
  fill: rgb(198 255 228 / .06);
  stroke: rgb(198 255 228 / .2);
  stroke-width: .8;
}

.dial-core {
  fill: rgb(1 7 12 / .82);
  stroke: rgb(198 255 228 / .22);
  stroke-width: 1;
}

.dial-index,
.dial-index-inner {
  fill: var(--signal);
}

.tick {
  stroke: rgb(198 255 228 / .38);
  stroke-width: 1;
}

.tick-mid {
  stroke: rgb(198 255 228 / .6);
}

.tick-major {
  stroke: rgb(198 255 228 / .92);
  stroke-width: 1.8;
}

.tick-limit {
  stroke: rgb(255 106 69 / .7);
}

.tick-limit.tick-major {
  stroke: var(--signal);
}

.dial-readout {
  position: absolute;
  top: 50%;
  right: calc(50% + .55rem);
  display: grid;
  justify-items: end;
  gap: .25rem;
  translate: 0 -50%;
  color: var(--lume);
  font-family: var(--mono);
  text-shadow: 0 0 14px rgb(150 255 210 / .35);
}

.readout-label,
.readout-meta {
  font-size: calc(var(--dial) * .022);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lume-dim);
}

.readout-value {
  display: flex;
  align-items: baseline;
  gap: .2rem;
  font-size: calc(var(--dial) * .064);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.readout-unit {
  font-size: .42em;
  color: var(--lume-dim);
}

.odometer {
  display: inline-flex;
  align-items: baseline;
}

.reel-window {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  line-height: 1;
}

.reel {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.reel > span {
  height: 1em;
}

.reel .blank {
  color: transparent;
  text-shadow: none;
}

/* The stops (section links) sit on the dial band and turn with the bezel */

.console-stops {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
}

.stops-title {
  display: none;
}

.stops {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.stops li {
  position: absolute;
  top: 0;
  left: 0;
  rotate: calc(var(--i) * -24deg);
}

.stops a {
  position: absolute;
  top: 0;
  right: calc(var(--dial) * .262);
  display: grid;
  gap: .1em;
  width: calc(var(--dial) * .19);
  padding-block: .25rem;
  translate: 0 -50%;
  color: rgb(226 244 242 / .6);
  line-height: 1;
  transition: color 250ms ease;
}

.stop-name {
  font: 650 calc(var(--dial) * .028) / 1 var(--display);
  font-stretch: 72%;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stop-depth {
  order: 2;
  font: 500 calc(var(--dial) * .021) / 1 var(--mono);
  letter-spacing: .06em;
  opacity: .72;
}

.stops a:hover,
.stops a:focus-visible {
  color: #fff;
}

.stops .is-active a {
  color: var(--lume);
  text-shadow: 0 0 16px rgb(150 255 210 / .4);
}

.stops .is-active .stop-depth {
  opacity: 1;
}

@media (min-width: 1180px) and (min-height: 600px) {
  .console {
    top: 50%;
    right: 0;
    width: var(--dial);
    aspect-ratio: 1;
    translate: 50% -50%;
    scale: var(--dial-rest);
    opacity: .8;
    pointer-events: none;
    transition: scale 450ms cubic-bezier(.2, .8, .2, 1) 220ms, opacity 300ms ease 220ms;
  }

  .console-stops,
  .readout-label,
  .readout-meta {
    opacity: 0;
    transition: opacity 200ms ease;
  }

  .stops a {
    pointer-events: none;
  }

  .dial-readout {
    scale: 1.6;
    transform-origin: 100% 50%;
    transition: scale 450ms cubic-bezier(.2, .8, .2, 1) 220ms;
  }

  .console:is(:hover, :focus-within, [data-open]) {
    scale: 1;
    opacity: 1;
    transition-delay: 0s;
  }

  .console:is(:hover, :focus-within, [data-open]) :is(.console-stops, .readout-label, .readout-meta) {
    opacity: 1;
    transition-delay: 160ms;
  }

  .console:is(:hover, :focus-within, [data-open]) .stops a {
    pointer-events: auto;
  }

  .console:is(:hover, :focus-within, [data-open]) .dial-readout {
    scale: 1;
    transition-delay: 0s;
  }
}

/* ==========================================================================
   Buttons and links
   ========================================================================== */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 3.1rem;
  padding: .6rem 1.35rem;
  border: 0;
  border-radius: 4px;
  background: var(--mint);
  color: var(--mint-ink);
  font: 650 .95rem/1.1 var(--body);
  letter-spacing: .01em;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  background: var(--mint-hover);
}

.button-small {
  min-height: 2.75rem;
  padding: .5rem 1rem;
  font-size: .88rem;
}

.button:hover .icon,
.text-link:hover .icon {
  translate: 3px 0;
}

.button-ghost {
  background: rgb(2 16 26 / .18);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgb(230 250 250 / .42);
}

.button-ghost:hover {
  background: rgb(230 250 250 / .08);
  box-shadow: inset 0 0 0 1px var(--lume);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;
  color: var(--lume);
  font-weight: 600;
  font-size: .98rem;
}

.text-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .3em;
}

.eyebrow {
  color: var(--lume);
  font: 500 .7rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ==========================================================================
   Hero (the first few metres)
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  text-shadow: 0 1px 24px rgb(0 40 52 / .35);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding-block: clamp(1.25rem, 3.5vh, 2.25rem) clamp(1.25rem, 3.5vh, 2rem);
}

.crest {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  justify-self: start;
}

.crest-mark {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  padding: .32rem;
  border-radius: 50%;
  background: #f3fbf9;
  box-shadow: 0 0 0 4px rgb(243 251 249 / .14), 0 10px 30px rgb(0 30 40 / .25);
}

.crest-name {
  display: grid;
  gap: .25rem;
  font: 700 1.08rem/1 var(--display);
  font-stretch: 82%;
  letter-spacing: .01em;
}

.crest-name small {
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgb(236 252 250 / .78);
}

.hero-content {
  align-self: center;
  max-width: 50rem;
  padding-block: clamp(2.5rem, 7vh, 5rem);
}

.hero h1 {
  font-size: clamp(3.5rem, 10vw, 9.5rem);
  font-weight: 780;
  font-stretch: 70%;
  line-height: .84;
  letter-spacing: -.005em;
  text-transform: uppercase;
}

.hero h1 em {
  display: block;
  margin-top: .06em;
  color: #cff9f0;
  font-style: italic;
  font-weight: 300;
  font-stretch: 88%;
  letter-spacing: -.025em;
  text-transform: none;
}

.hero-copy {
  max-width: 36ch;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  color: #e3f4f2;
  font-size: clamp(1.08rem, 1.45vw, 1.3rem);
  line-height: 1.5;
}

.hero .actions {
  margin-top: clamp(1.5rem, 3.5vh, 2.25rem);
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgb(236 252 250 / .22);
}

.hero-log {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem clamp(1.75rem, 4.5vw, 4rem);
}

.hero-log div {
  display: flex;
  flex-direction: column-reverse;
  gap: .35rem;
}

.hero-log dt {
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgb(236 252 250 / .74);
}

.hero-log dd {
  font: 700 clamp(1.3rem, 2.2vw, 1.75rem)/1 var(--display);
  font-stretch: 78%;
}

/* The diver is a photo of a club member, cut out of its background. The
   same image is stacked three times and masked so the legs and the raised
   forearm can move on their own: the legs kick from the hip and the hand
   waves from the elbow, while the whole diver drifts. Each moving part
   fades in over a band where the body underneath stays solid, so no gap
   opens at the joins. */
.hero-diver {
  position: absolute;
  z-index: 1;
  top: clamp(4.5rem, 13vh, 9rem);
  right: max(1vw, var(--side) - 2vw);
  width: clamp(300px, 40vw, 660px);
  aspect-ratio: 1141 / 937;
  pointer-events: none;
  filter: drop-shadow(0 24px 32px rgb(0 25 40 / .22));
  animation: diver-drift 11s ease-in-out infinite alternate;
}

/* Mirrored so the diver faces away from the headline. */
.diver-photo {
  position: absolute;
  inset: 0;
  scale: -1 1;
  filter: saturate(.85) brightness(.95);
}

.diver-part {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  -webkit-user-drag: none;
}

.diver-core {
  -webkit-mask-image:
    linear-gradient(135deg, #000 62.5%, transparent 64%),
    linear-gradient(47.8deg, #000 67.5%, transparent 68.5%),
    linear-gradient(180deg, transparent 38%, #000 40%);
  -webkit-mask-composite: source-in, source-over, source-over;
  mask-image:
    linear-gradient(135deg, #000 62.5%, transparent 64%),
    linear-gradient(47.8deg, #000 67.5%, transparent 68.5%),
    linear-gradient(180deg, transparent 38%, #000 40%);
  mask-composite: intersect, add, add;
}

.diver-legs {
  transform-origin: 55% 66%;
  -webkit-mask-image: linear-gradient(135deg, transparent 57%, #000 62%);
  mask-image: linear-gradient(135deg, transparent 57%, #000 62%);
  animation: diver-kick 2.8s ease-in-out infinite alternate;
}

/* The photo cuts off at the ankles, so the fins are drawn separately and
   hang past the photo's edge. They kick with the legs: the same rotation
   about the same hip point (55% 66% of the photo, given here in the fins
   image's own box). */
.diver-fins {
  left: 49.08%;
  top: 64.03%;
  width: 87.64%;
  height: 81.11%;
  transform-origin: 6.76% 2.42%;
  animation: diver-kick 2.8s ease-in-out infinite alternate;
}

.diver-arm {
  transform-origin: 47% 11%;
  -webkit-mask-image:
    linear-gradient(47.8deg, transparent 62%, #000 67%),
    linear-gradient(180deg, #000 40%, transparent 46%);
  -webkit-mask-composite: source-in, source-over;
  mask-image:
    linear-gradient(47.8deg, transparent 62%, #000 67%),
    linear-gradient(180deg, #000 40%, transparent 46%);
  mask-composite: intersect, add;
  animation: diver-wave 3.6s ease-in-out infinite alternate;
}

/* The regulator's exhaust, beside the diver's mouth. script.js releases
   his exhaled bubbles from here, in front of the photo, so they rise past
   his face instead of appearing from behind his head. */
.regulator {
  position: absolute;
  top: 38%;
  left: 87.6%;
  width: 0;
  height: 0;
}

.breath-bubble {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--d);
  height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  border: 1px solid rgb(235 250 255 / .7);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgb(255 255 255 / .95) 0 13%, rgb(220 245 255 / .2) 34%, rgb(200 240 255 / .06) 62%, transparent 72%);
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes diver-drift {
  from { translate: 0 0; rotate: -1.5deg; }
  to { translate: -14px 18px; rotate: 1.5deg; }
}

@keyframes diver-kick {
  from { rotate: -2.6deg; }
  to { rotate: 2.2deg; }
}

@keyframes diver-wave {
  from { rotate: -3deg; }
  to { rotate: 4deg; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  position: relative;
  padding-block: clamp(5rem, 13vh, 9.5rem);
}

.section-label {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: clamp(1.75rem, 4.5vh, 3rem);
  color: var(--soft);
  font: 500 .7rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.section-label::before {
  content: "";
  order: -1;
  width: .55rem;
  height: 1px;
  background: var(--lume);
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* Intro */

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.intro-lede {
  font-size: clamp(2.6rem, 5.8vw, 5.2rem);
}

.intro-copy {
  display: grid;
  gap: 1rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
}

.intro-copy p:first-child {
  color: var(--text);
}

/* Feature (diving, hockey) */

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.feature-reverse .photo {
  order: -1;
}

.feature-copy {
  display: grid;
  gap: 1.1rem;
  max-width: 36rem;
}

.feature-copy h2 {
  margin-bottom: .4rem;
}

.photo {
  position: relative;
  counter-increment: figure;
}

.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 30px 60px -30px rgb(0 10 20 / .7);
}

.photo::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
  pointer-events: none;
}

.photo figcaption {
  display: flex;
  gap: .75rem;
  margin-top: .85rem;
  color: var(--soft);
  font: 500 .68rem/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.photo figcaption::before {
  content: "Fig. " counter(figure, decimal-leading-zero);
  color: var(--lume);
  white-space: nowrap;
}

/* Photo carousels: a strip that snaps one photo at a time, with dots laid
   over the bottom of the photo to show and choose the current one. */
.gallery::after {
  display: none;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: 3px;
  box-shadow: 0 30px 60px -30px rgb(0 10 20 / .7), inset 0 0 0 1px rgb(255 255 255 / .12);
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track:focus-visible {
  outline: 2px solid var(--lume);
  outline-offset: 3px;
}

.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.gallery .gallery-slide img {
  display: block;
  aspect-ratio: var(--ratio, 4 / 3);
  border-radius: 0;
  box-shadow: none;
  -webkit-user-drag: none;
}

.gallery-dots {
  position: absolute;
  left: 50%;
  bottom: .7rem;
  translate: -50% 0;
  display: flex;
  gap: .15rem;
  padding: .2rem .35rem;
  border-radius: 999px;
  background: rgb(2 16 28 / .38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Each dot is a small mark inside a comfortable tap target. */
.gallery-dots button {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gallery-dots button::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: rgb(255 255 255 / .5);
  transition: background-color 200ms ease, scale 200ms ease;
}

.gallery-dots button:hover::before {
  background: rgb(255 255 255 / .85);
}

.gallery-dots button.is-current::before {
  background: var(--lume);
  scale: 1.3;
}

.gallery-dots button:focus-visible {
  outline: 2px solid var(--lume);
  outline-offset: -3px;
  border-radius: 50%;
}

.dive-plan {
  margin-block: .4rem .2rem;
  border-top: 1px solid var(--line);
  counter-reset: step;
}

.dive-plan li {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  column-gap: .5rem;
  padding-block: .95rem;
  border-bottom: 1px solid var(--line);
  counter-increment: step;
}

.dive-plan li::before {
  content: counter(step, decimal-leading-zero);
  grid-row: span 2;
  padding-top: .2rem;
  color: var(--lume);
  font: 500 .78rem/1.4 var(--mono);
}

.dive-plan strong {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 650;
  font-stretch: 88%;
}

.dive-plan span {
  color: var(--muted);
  font-size: .98rem;
}

/* Plan: calendar and dive map */

.plan h2 {
  margin-bottom: clamp(1.75rem, 4vh, 2.5rem);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  align-items: start;
}

/* Glassy blue panels, like the water around them. */
.resource-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(6 28 48 / .62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 40px 80px -40px rgb(0 6 14 / .8);
}

.resource-copy {
  position: relative;
  isolation: isolate;
  min-height: 15rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(80 170 230 / .12), transparent 60%),
    repeating-linear-gradient(120deg, rgb(170 220 255 / .035) 0 1px, transparent 1px 21px);
}

.map-card .resource-copy {
  background: #0b2a44;
}

.resource-art,
.map-card .resource-copy::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.resource-art {
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  /* The photo takes the panel's blue, keeping only its light and shade. */
  mix-blend-mode: luminosity;
  opacity: .75;
}

.map-card .resource-copy::after {
  content: "";
  z-index: -1;
  background: linear-gradient(90deg, rgb(7 30 52 / .96), rgb(7 30 52 / .78) 51%, rgb(7 30 52 / .3));
}

.resource-copy h3 {
  font-size: clamp(1.4rem, 2vw, 1.65rem);
}

.resource-copy p {
  max-width: 34ch;
  margin-block: .55rem 1.1rem;
  color: var(--muted);
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
}

.resource-icon {
  position: relative;
  display: block;
  width: 1.2rem;
  height: 1.1rem;
  margin: .15rem 0 1.1rem;
  border: 1.5px solid var(--lume);
}

.calendar-icon {
  border-radius: .19rem;
}

.calendar-icon::before {
  content: "";
  position: absolute;
  inset: .25rem 0 auto;
  border-top: 1.5px solid var(--lume);
}

.pin-icon {
  width: 1rem;
  height: 1rem;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
}

.pin-icon::before {
  content: "";
  position: absolute;
  inset: .23rem;
  border: 1px solid var(--lume);
  border-radius: 50%;
}

.embed iframe {
  display: block;
  width: 100%;
  height: clamp(24rem, 56vh, 32rem);
  border: 0;
  background: #e7f2ee;
}

/* Committee: an endless strip that drifts sideways on its own */

.crew-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: clamp(1.75rem, 4vh, 2.75rem);
}

.crew-nav {
  display: flex;
  gap: .6rem;
}

.crew-nav[hidden] {
  display: none;
}

.crew-step {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(2 16 26 / .18);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgb(230 250 250 / .42);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.crew-step:hover {
  background: rgb(230 250 250 / .08);
  box-shadow: inset 0 0 0 1px var(--lume);
}

.icon-flip {
  scale: -1 1;
}

.crew-reel {
  border-radius: 4px;
}

.crew-reel:has(.crew-track:focus-visible) {
  outline: 2px solid var(--lume);
  outline-offset: 6px;
}

.crew-track {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
}

.crew-track::-webkit-scrollbar {
  display: none;
}

.crew-track:focus-visible {
  outline: none;
}

.crew-track.is-draggable {
  cursor: grab;
}

.crew-track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.crew {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  /* Room above and before the photos for the stars, which stick out past
     the corner (the strip scrolls sideways, so anything outside it would be
     cut, and its edges fade out). */
  padding: 2.3rem 1.25rem 0 2.85rem;
}

.crew li {
  position: relative;
  flex: 0 0 clamp(9.5rem, 40vw, 12.5rem);
  min-width: 0;
}

/* Qualification stars, one to three, big and chunky, sitting on the
   top-left corner of each photo. They follow a gentle curve round the
   corner, each tipped at its own angle. */
.stars {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: flex;
  translate: -30% -44%;
  pointer-events: none;
}

.star {
  --tilt: -16deg;
  --lift: .55rem;
  width: clamp(2.97rem, 7.7vw, 3.96rem);
  height: clamp(2.97rem, 7.7vw, 3.96rem);
  margin-right: -1.05rem;
  translate: 0 var(--lift);
  rotate: var(--tilt);
  filter: drop-shadow(0 3px 2px rgb(60 25 0 / .45)) drop-shadow(0 0 10px rgb(255 190 40 / .35));
}

.star:nth-child(2) {
  --tilt: -3deg;
  --lift: 0rem;
}

.star:nth-child(3) {
  --tilt: 11deg;
  --lift: -.1rem;
}

.crew img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 3px;
  background: rgb(255 255 255 / .05);
  box-shadow: 0 0 0 1px var(--line);
  -webkit-user-drag: none;
}

.crew h3 {
  margin-top: .85rem;
  font-size: 1.12rem;
  font-stretch: 85%;
  overflow-wrap: anywhere;
}

.crew p {
  margin-top: .3rem;
  font-size: .88rem;
  line-height: 1.4;
}

/* FAQ */

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 1.75rem clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.faq-list details {
  border-top: 1px solid rgb(214 240 240 / .22);
}

.faq-list details:last-child {
  border-bottom: 1px solid rgb(214 240 240 / .22);
}

.faq-list summary {
  display: flex;
  align-items: flex-start;
  gap: .95rem;
  padding-block: 1.1rem;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::before {
  content: "";
  flex: none;
  width: .5rem;
  height: .6rem;
  margin-top: calc((1.45em - .6rem) / 2);
  background: var(--lume);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transition: rotate 200ms ease;
}

.faq-list details[open] summary::before {
  rotate: 90deg;
}

.faq-list summary:hover {
  color: var(--lume);
}

.faq-list details p {
  max-width: 58ch;
  padding: 0 0 1.3rem 1.45rem;
}

/* script.js animates the height while an answer opens or closes. */
.faq-list details.is-moving {
  overflow: hidden;
}

/* Join */

/* One compact panel: the club photo beside a heading and three buttons. */
.join-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  overflow: hidden;
  border: 1px solid rgb(140 200 240 / .22);
  border-radius: 10px;
  background:
    radial-gradient(90% 120% at 0% 0%, rgb(90 180 240 / .2), transparent 60%),
    linear-gradient(130deg, #164468, #0b2840 60%, #081d31);
  box-shadow: 0 50px 100px -50px rgb(0 0 0 / .8);
}

.join-panel img {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 16rem;
  object-fit: cover;
}

.join-body {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.75rem, 4vw, 3rem);
}

.join-copy {
  display: grid;
  gap: .75rem;
  max-width: 34rem;
}

.join-copy h2 {
  font-size: clamp(2rem, 3.4vw, 3rem);
}

.join-copy p:not(.eyebrow) {
  color: #cfe2ee;
}

.join-actions {
  gap: .75rem;
}

/* Narrower screens: photo becomes a short strip above the text. */
@media (max-width: 860px) {
  .join-panel { grid-template-columns: minmax(0, 1fr); }
  .join-panel img { grid-column: 1; grid-row: 1; height: 13rem; min-height: 0; }
  .join-body { grid-row: 2; }
}

/* On phones the three buttons stack at the same full width. */
@media (max-width: 560px) {
  .join-actions { display: grid; width: 100%; gap: .75rem; }
}

/* ==========================================================================
   Seabed (footer)
   ========================================================================== */

.seabed {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: max(46rem, 100svh);
  padding-top: clamp(4rem, 12vh, 8rem);
  overflow: hidden;
}

/* The scene is three SVG layers (distant ridges, the wreck, the reef in
   front) that drift apart slightly with the pointer and as the footer
   scrolls in. Over them a canvas dims the water a little (less towards the
   front) and lifts it back to full brightness in a soft pool wherever the
   pointer is, with silt sparkling in the light. On touch screens a tap moves
   the light; until then it drifts slowly over the wreck. */

.seabed-scene {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.seabed-layers {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: calc(max(100%, 1000px) + 4rem);
  aspect-ratio: 1200 / 460;
  translate: -50% 0;
}

.seabed-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
  translate: calc(var(--px, 0) * var(--shift)) calc(var(--py, 0) * var(--shift) * .35 + var(--rise, 0) * var(--lift));
  will-change: translate;
}

.seabed-far {
  --shift: -6px;
  --lift: 18px;
  filter: blur(1.2px);
}

.wreck {
  --shift: -14px;
  --lift: 40px;
  filter: brightness(.88);
}

.seabed-near {
  --shift: -28px;
  --lift: 70px;
}

.torch-light {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(transparent, #000 34%);
  mask-image: linear-gradient(transparent, #000 34%);
}

/* Distant ridges */
.far-strands {
  fill: none;
  stroke: #24443f;
  stroke-width: 4;
  stroke-linecap: round;
}

.far-rim {
  fill: none;
  stroke: rgb(170 210 205 / .12);
  stroke-width: 2;
  stroke-linecap: round;
}

/* The wreck */
.wreck-hull {
  fill: url(#hullShade);
}

.wreck-mast {
  fill: #2b3838;
}

.wreck-line {
  fill: none;
  stroke: #263334;
  stroke-width: 3;
  stroke-linecap: round;
}

.wreck-thin {
  stroke-width: 2;
}

.wreck-chain {
  stroke: #4b3a2e;
  stroke-width: 3;
}

.wreck-iron {
  fill: none;
  stroke: #4a3628;
  stroke-width: 4;
  stroke-linecap: round;
}

.wreck-rim {
  fill: none;
  stroke: rgb(200 225 215 / .32);
  stroke-width: 2;
  stroke-linecap: round;
}

.wreck-band {
  fill: #b9a77f;
  opacity: .55;
}

.wreck-soot {
  fill: #140c0a;
}

.wreck-window {
  fill: #050a0c;
}

.wreck-portholes circle {
  fill: #050a0c;
  stroke: #8a6a3e;
  stroke-width: 2;
}

.wreck-seam {
  fill: none;
  stroke: rgb(0 0 0 / .3);
  stroke-width: 1.4;
}

.wreck-rust {
  fill: #6e3a22;
  opacity: .55;
}

.wreck-hole {
  fill: #020506;
}

/* Easter egg: a moray living in the hull breach. Its eyes blink in the
   dark; pointing at the hole (or tapping it) makes it pop out. */
.egg-eyes {
  fill: #dcff9c;
  transform-box: view-box;
  transform-origin: 641px 291px;
  animation: egg-blink 5.5s infinite;
  transition: opacity 150ms ease;
}

.egg-eel {
  transform-box: view-box;
  transform-origin: 644px 299px;
  scale: .12;
  opacity: 0;
  transition: scale 260ms ease-in, opacity 200ms ease-in 60ms;
}

.wreck-egg.is-out .egg-eyes {
  opacity: 0;
}

.wreck-egg.is-out .egg-eel {
  scale: 1;
  opacity: 1;
  transition: scale 520ms cubic-bezier(.3, 1.55, .5, 1), opacity 120ms ease-out;
  animation: egg-sway 2.4s ease-in-out infinite alternate;
}

.egg-body {
  fill: none;
  stroke: #4c6631;
  stroke-width: 15;
  stroke-linecap: round;
}

.egg-fin {
  fill: none;
  stroke: #6f8c45;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.egg-head {
  fill: #58763a;
}

.egg-jaw {
  fill: none;
  stroke: #1f2c14;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.egg-teeth,
.egg-eye {
  fill: #f3f8dc;
}

.egg-spots {
  fill: #2c3d1c;
}

.egg-pupil {
  fill: #0b0f06;
}

@keyframes egg-blink {
  0%, 93%, 100% { scale: 1 1; }
  95% { scale: 1 .1; }
  97% { scale: 1 1; }
}

@keyframes egg-sway {
  from { rotate: -5deg; }
  to { rotate: 4deg; }
}

@media (prefers-reduced-motion: reduce) {
  .egg-eyes,
  .wreck-egg.is-out .egg-eel {
    animation: none;
  }
}

.wreck-bent {
  fill: none;
  stroke: #6a4a36;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.wreck-rail {
  fill: none;
  stroke: #3c4a49;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.wreck-barnacles {
  fill: #8a8f84;
  opacity: .5;
}

.sponge-mouth {
  fill: rgb(0 0 0 / .45);
}

.wreck-fan path,
.reef-fan path {
  opacity: .9;
}

.anemone-crown {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: anemone 4.5s ease-in-out infinite alternate;
  animation-delay: var(--a);
}

@keyframes anemone {
  from { transform: rotate(-3deg) scale(1, 1); }
  to { transform: rotate(3deg) scale(1.04, .96); }
}

/* The reef in front */
.sand-ripples {
  fill: none;
  stroke: rgb(220 210 170 / .14);
  stroke-width: 2;
  stroke-linecap: round;
}

.rock-rim {
  fill: none;
  stroke: rgb(200 220 200 / .16);
  stroke-width: 2;
  stroke-linecap: round;
}

.rock-crust {
  fill: #9a4a5a;
  opacity: .8;
}

.kelp-plant {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: kelp 7s ease-in-out infinite alternate;
  animation-delay: var(--k);
}

.kelp-stipe {
  fill: none;
  stroke: #4a5a2a;
  stroke-width: 3.5;
  stroke-linecap: round;
}

.kelp-leaf {
  fill: #5d6a2c;
}

@keyframes kelp {
  from { rotate: -4deg; }
  to { rotate: 5deg; }
}

.urchin {
  fill: #2a1830;
}

.urchin-spines {
  fill: none;
  stroke: #3d2446;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.starfish {
  fill: #d0662e;
  stroke: #e9884a;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.brain-coral {
  fill: #a88a52;
}

.brain-grooves {
  fill: none;
  stroke: #6e5530;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.shell {
  fill: #c9b89a;
}

.shell-ribs {
  fill: none;
  stroke: #8f7c5e;
  stroke-width: 1.2;
}

.seabed-inner {
  position: relative;
}

.seabed-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2.5rem 3rem;
}

.seabed-title {
  margin-bottom: 2rem;
  color: var(--text);
  font: 650 clamp(2.4rem, 5vw, 4.4rem)/.94 var(--display);
  font-stretch: 76%;
  text-wrap: balance;
}

.crest-small .crest-mark {
  width: 2.9rem;
  height: 2.9rem;
}

.crest-small .crest-name {
  font-size: 1rem;
}

.seabed-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1.75rem;
  color: var(--muted);
  font-weight: 550;
}

.seabed-links a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.75rem;
}

.seabed-links a:hover {
  color: var(--lume);
}

.seabed-links .link-logo {
  width: 1.2em;
  height: 1.2em;
}

.seabed-links .ascend {
  color: var(--lume);
}

/* ==========================================================================
   Compact console (tablets and phones)
   ========================================================================== */

@media (max-width: 1179.98px), (max-height: 599.98px) {
  .hero-foot {
    padding-right: 5rem;
  }

  .dial {
    display: none;
  }

  .console {
    right: 0;
    bottom: 0;
  }

  .console-toggle {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(2 10 17 / .78);
    box-shadow: inset 0 0 0 1px rgb(198 255 228 / .3), 0 12px 30px rgb(0 6 14 / .45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .console-toggle[aria-expanded="true"] {
    box-shadow: inset 0 0 0 1.5px var(--signal), 0 12px 30px rgb(0 6 14 / .45);
  }

  .mini-gauge {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
  }

  .mini-gauge svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .mini-depth {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: .1rem;
    color: var(--lume);
    font-family: var(--mono);
    text-shadow: 0 0 10px rgb(150 255 210 / .35);
  }

  .mini-depth b {
    font-size: 1.05rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .mini-depth small {
    font-size: .62rem;
    color: var(--lume-dim);
  }

  .mini-tick {
    stroke: rgb(198 255 228 / .4);
    stroke-width: 1;
  }

  .mini-tick.tick-major {
    stroke: rgb(198 255 228 / .9);
    stroke-width: 1.6;
  }

  .mini-index {
    fill: var(--signal);
  }

  .console-stops {
    position: fixed;
    top: auto;
    left: auto;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 4.75rem);
    width: min(19rem, calc(100vw - 2rem));
    height: auto;
    padding: 1.1rem 1.1rem .6rem;
    border-radius: 10px;
    background: rgb(3 11 18 / .97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: inset 0 0 0 1px rgb(198 255 228 / .22), 0 24px 60px rgb(0 4 10 / .6);
    visibility: hidden;
    opacity: 0;
    translate: 0 .75rem;
    transform-origin: 100% 100%;
    transition: opacity 200ms ease, translate 200ms ease, visibility 0s linear 200ms;
  }

  .console[data-open] .console-stops {
    visibility: visible;
    opacity: 1;
    translate: 0 0;
    transition: opacity 200ms ease, translate 200ms ease;
  }

  .stops-title {
    display: block;
    margin-bottom: .5rem;
    color: var(--soft);
    font: 500 .66rem/1 var(--mono);
    letter-spacing: .16em;
    text-transform: uppercase;
  }

  .stops {
    position: relative;
  }

  .stops::before {
    content: "";
    position: absolute;
    top: 1.4rem;
    bottom: 1.4rem;
    left: 3.35rem;
    width: 1px;
    background: var(--line-strong);
  }

  .stops li {
    position: relative;
    rotate: none;
  }

  .stops a {
    position: relative;
    right: auto;
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 1rem;
    align-items: center;
    width: auto;
    min-height: 2.9rem;
    translate: none;
    color: var(--muted);
  }

  .stops a::before {
    content: "";
    position: absolute;
    left: 3.35rem;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    translate: -50% -50%;
    background: #08151f;
    box-shadow: inset 0 0 0 1px var(--line-strong);
  }

  .stops .is-active a::before {
    background: var(--signal);
    box-shadow: 0 0 0 3px rgb(255 106 69 / .25);
  }

  .stop-depth {
    order: 0;
    font-size: .72rem;
    text-align: right;
    padding-right: .4rem;
  }

  .stop-name {
    padding-left: .6rem;
    font-size: 1.05rem;
    font-stretch: 85%;
    letter-spacing: .03em;
  }
}

/* ==========================================================================
   Layout breakpoints
   ========================================================================== */

@media (max-width: 960px) {
  .intro-grid,
  .feature-grid,
  .faq-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-reverse .photo {
    order: 0;
  }

  .feature-copy {
    max-width: none;
  }

}

@media (max-width: 720px) {
  body {
    font-size: 1rem;
  }

  .hero-diver {
    top: 7vh;
    right: -8vw;
    width: 66vw;
    opacity: .6;
  }

  .hero-content {
    padding-top: 22vh;
  }

  .hero-log {
    gap: 1rem 1.75rem;
  }

  .resource-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .crew {
    gap: .9rem;
  }

  .seabed {
    min-height: max(40rem, 100svh);
  }

  .seabed-grid {
    padding-bottom: 6rem;
  }
}

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

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