/* Deep End Creations: "The Descent". Scrolling is a dive; the water darkens zone by zone. */

/* Fonts are hosted with the site (Latin letters only; licenses in assets/fonts/OFL-*.txt), not loaded from Google,
   so visitors who haven't agreed to Analytics don't contact Google at all. */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/assets/fonts/geist-latin.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('/assets/fonts/geist-mono-latin.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/instrument-serif-latin.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('/assets/fonts/instrument-serif-italic-latin.woff2') format('woff2'); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #eaf4fb;
  --ink-2: rgba(222, 238, 250, 0.76);
  --ink-3: rgba(222, 238, 250, 0.52);
  --line: rgba(170, 220, 255, 0.14);
  --line-2: rgba(170, 220, 255, 0.26);
  --glow: #7ef4e4;
  --glow-rgb: 126, 244, 228;
  --coral: #ff8a6b;
  --surface: #021c32; /* the deep water on the right of the opening-screen image (make-hero's "rightHalf" reading) */
  --floor: #000308;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Times New Roman', serif;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;
  --gauge-w: 164px;
  --abyss-h: clamp(250px, 28vw, 330px); /* the seabed scene above the footer */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: rgba(var(--glow-rgb), 0.3) transparent; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  /* No-JS fallback. The script replaces this with stops measured from each zone. */
  background: linear-gradient(to bottom, var(--surface) 0, #02162a 22%, #031020 45%, #020b17 68%, #01060e 84%, var(--floor) 100%);
  background-color: var(--floor);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Film grain: softens gradient banding and gives the water some texture. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.07;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
em { font-style: italic; }
::selection { background: rgba(var(--glow-rgb), 0.3); color: #fff; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #04192c; font-weight: 600; text-decoration: none; transition: top 0.2s; }
.skip:focus { top: 12px; }

/* Content keeps clear of the depth gauge on the right: at narrower desktop widths the zones get right padding.
   The hero stays full-bleed. */
main { position: relative; }
.wrap { width: min(1080px, 100% - 2 * var(--gutter)); margin-inline: auto; }
@media (min-width: 1100px) {
  main > .zone, body > .seafloor { padding-right: max(0px, calc(1080px + 2 * var(--gauge-w) - 100vw)); }
}

#sea { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }

/* ---------- Type & buttons ---------- */
.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 5.8vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
.display em, .hero-title em, .svc-title em, .pl em {
  font-style: italic;
  background: linear-gradient(100deg, #bff9f1 0%, var(--glow) 45%, #8fc7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* The colour is only painted inside the box, and italic letters reach past it (the g's tail swings left), so
     widen the box all round; the negative margins keep the words where they were. */
  padding: 0.1em 0.06em 0.15em 0.16em;
  margin: -0.1em 0 -0.15em -0.16em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 500 15px/1 var(--sans);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.4s, transform 0.3s var(--ease);
}
.btn-light { background: #eef9ff; color: #04192c; }
.btn-light:hover { background: var(--glow); box-shadow: 0 0 36px rgba(var(--glow-rgb), 0.5); transform: translateY(-2px); }
.btn-ghost { color: var(--ink); border-color: var(--line-2); background: rgba(255, 255, 255, 0.04); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: rgba(var(--glow-rgb), 0.7); color: var(--glow); box-shadow: 0 0 24px rgba(var(--glow-rgb), 0.22); }
.btn:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 10px 0;
  background: none;
  border: 0;
  color: var(--ink);
  font: 500 15px/1.2 var(--sans);
  text-decoration: underline;
  text-decoration-color: rgba(var(--glow-rgb), 0.5);
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  transition: color 0.25s, text-decoration-color 0.25s;
}
.btn-text:hover { color: var(--glow); text-decoration-color: var(--glow); }
.btn-text .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.btn-text:hover .arrow { transform: translateY(3px); }
.seafloor .btn-text:hover .arrow { transform: translateY(-3px); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 6px 10px;
}

/* ---------- Header ---------- */
.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  transition: background-color 0.4s, border-color 0.4s, -webkit-backdrop-filter 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.top.is-scrolled, .menu-open .top {
  background: rgba(2, 10, 20, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
/* Jordan's logo (scripts/make-logo.mjs builds it from his original .ai). */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { width: auto; height: 46px; filter: drop-shadow(0 1px 10px rgba(0, 10, 30, 0.5)); transition: filter 0.4s; }
.brand:hover .brand-logo { filter: drop-shadow(0 0 10px rgba(var(--glow-rgb), 0.45)); }
/* Smaller on phones, so it stays clear of the depth readout and menu button. */
@media (max-width: 759px) { .brand-logo { height: 36px; } }
@media (max-width: 380px) { .brand-logo { height: 30px; } }
@media (max-width: 340px) { .brand-logo { height: 28px; } }

.top-right { display: flex; align-items: center; gap: 10px; }
.top-cta { min-height: 40px; padding: 0 18px; font-size: 14px; }

.menu-btn {
  display: none;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 6px 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(2, 10, 20, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
}
.depth-pill { font: 500 12.5px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--glow); min-width: 7ch; text-align: right; }
.menu-lines { position: relative; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.menu-lines span { position: absolute; left: 8px; right: 8px; height: 1.5px; background: var(--ink); border-radius: 2px; transition: transform 0.35s var(--ease), top 0.35s var(--ease); }
.menu-lines span:first-child { top: 11px; }
.menu-lines span:last-child { top: 16px; }
.menu-open .menu-lines span:first-child { top: 13.5px; transform: rotate(45deg); }
.menu-open .menu-lines span:last-child { top: 13.5px; transform: rotate(-45deg); }

/* ---------- Mobile / tablet menu ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(1, 8, 16, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0s 0.35s;
  overflow-y: auto;
}
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity 0.35s; }
.menu-inner { padding: calc(var(--header-h) + 28px) var(--gutter) 40px; display: grid; gap: 28px; }
.menu-list { list-style: none; display: grid; }
.menu-list a { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; transform: translateY(16px); opacity: 0; transition: transform 0.5s var(--ease), opacity 0.5s; }
.menu-open .menu-list a { transform: none; opacity: 1; }
.menu-list li:nth-child(2) a { transition-delay: 0.04s; }
.menu-list li:nth-child(3) a { transition-delay: 0.08s; }
.menu-list li:nth-child(4) a { transition-delay: 0.12s; }
.menu-list li:nth-child(5) a { transition-delay: 0.16s; }
.m-zone { font: 400 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--glow); }
.m-name { font: 400 clamp(2.3rem, 9vw, 3.2rem)/1.05 var(--serif); }
.menu-list a[aria-current] .m-name { font-style: italic; color: var(--glow); }
.menu-cta { justify-self: start; }

/* ---------- Depth gauge (desktop) ---------- */
.gauge {
  position: fixed;
  right: 16px;
  top: 50%;
  z-index: 40;
  width: calc(var(--gauge-w) - 22px);
  transform: translateY(-46%);
  display: none;
  padding: 16px 14px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(2, 10, 20, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.gauge-readout { display: grid; justify-items: end; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.gauge-label, .gauge-stats dt { font: 500 9.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.gauge-depth { font: 500 23px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -0.02em; }
.gauge-depth small { font-size: 11px; color: var(--glow); margin-left: 4px; letter-spacing: 0; }

.gauge-scale { position: relative; height: min(40vh, 360px); margin: 18px 0 16px; }
.gauge-line, .gauge-fill { position: absolute; top: 0; right: 40px; width: 1px; }
.gauge-line { bottom: 0; background: var(--line-2); }
.gauge-fill { height: calc(var(--g, 0) * 100%); background: linear-gradient(to bottom, rgba(var(--glow-rgb), 0.15), var(--glow)); box-shadow: 0 0 8px rgba(var(--glow-rgb), 0.7); }
.gauge-marker {
  position: absolute;
  right: 40px;
  top: calc(var(--g, 0) * 100%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--glow);
  transform: translate(50%, -50%);
  box-shadow: 0 0 0 4px rgba(var(--glow-rgb), 0.15), 0 0 16px 2px rgba(var(--glow-rgb), 0.8);
}
.gauge-tick { position: absolute; right: 0; top: calc(var(--p) * 100%); width: 34px; transform: translateY(-50%); font: 400 9px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.gauge-tick::before { content: ''; position: absolute; left: -10px; top: 50%; width: 7px; height: 1px; background: var(--line-2); }
.gauge-zones { list-style: none; }
.gauge-zones li { position: absolute; right: 54px; top: calc(var(--p) * 100%); transform: translateY(-50%); }
.gauge-zones a { display: grid; justify-items: end; gap: 3px; text-decoration: none; padding: 4px 0; white-space: nowrap; }
.g-zone { font: 400 9px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); transition: color 0.3s; }
.g-name { font: 500 13px/1 var(--sans); color: var(--ink-2); transition: color 0.3s, text-shadow 0.3s; }
.gauge-zones a:hover .g-name { color: var(--ink); }
.gauge-zones a[aria-current] .g-name { color: var(--glow); text-shadow: 0 0 12px rgba(var(--glow-rgb), 0.6); }
.gauge-zones a[aria-current] .g-zone { color: var(--ink-2); }
.gauge-stats { display: grid; gap: 7px; padding-top: 14px; border-top: 1px solid var(--line); }
.gauge-stats div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; white-space: nowrap; }
.gauge-stats dt { letter-spacing: 0.12em; }
.gauge-stats dd { font: 500 11px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }

@media (min-width: 1100px) {
  .gauge { display: block; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), visibility 0s; }
}
/* On smaller laptops the gauge would crowd the headline, so it switches on once the dive starts. */
@media (min-width: 1100px) and (max-width: 1379px) {
  .at-surface .gauge { opacity: 0; visibility: hidden; transform: translate(16px, -46%); transition: opacity 0.4s, transform 0.4s, visibility 0s 0.4s; }
  /* Until then, the menu button is the way around. */
  .at-surface .menu-btn, .menu-open .menu-btn { display: inline-flex; }
}
@media (max-width: 1099px) {
  .menu-btn { display: inline-flex; }
}
@media (max-width: 759px) {
  .top-cta { display: none; }
}
@media (min-width: 1100px) and (max-height: 640px) {
  .gauge-stats { display: none; }
  .gauge-scale { height: 38vh; }
}

/* ---------- Hero: the surface ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; }
.hero-photo { position: absolute; inset: -2% 0 0; z-index: -2; will-change: transform; }
/* The diver fills 14% to 40% across and 19% to 94% down the image; 40% keeps him left of the words when the
   sides get cropped (screens narrower than the image's 16:9). */
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 45%; }
.js .hero-photo img { animation: photo-in 2.8s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
@keyframes photo-in { from { transform: scale(1.14); filter: brightness(1.35) saturate(0.8); } to { transform: scale(1.04); filter: none; } }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* The bottom fade is listed first so it sits on top: the very bottom edge is exactly the water colour the next
     section starts with, so there's no seam. */
  background:
    linear-gradient(to bottom, rgba(2, 28, 50, 0) 58%, var(--surface) 99%),
    linear-gradient(to bottom, rgba(2, 10, 22, 0.5), rgba(2, 10, 22, 0) 22%),
    linear-gradient(90deg, rgba(3, 16, 32, 0) 34%, rgba(3, 16, 32, 0.5) 62%, rgba(3, 16, 32, 0.72) 100%);
}
/* Darkens the photo as you scroll away from the surface; fades out at the bottom for the same reason. */
.hero-shade::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, #020a16 55%, rgba(2, 10, 22, 0) 97%); opacity: var(--dim, 0); }
.hero-inner { height: 100%; display: grid; align-content: end; padding-bottom: clamp(72px, 13vh, 150px); }
/* On wide screens the words sit right of the diver (who is about 40% across the photo), so cap their width. */
.hero-copy { margin-left: auto; width: min(600px, 100%, 56vw - var(--gutter)); }
.kicker { display: inline-flex; align-items: center; gap: 10px; font: 500 11.5px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--glow); margin-bottom: 22px; }
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 12px var(--glow); animation: ping 2.6s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(var(--glow-rgb), 0.6); } 70%, 100% { box-shadow: 0 0 0 12px rgba(var(--glow-rgb), 0); } }
.hero-title { font: 400 clamp(3.4rem, 8.6vw, 8.4rem)/0.9 var(--serif); letter-spacing: -0.025em; text-shadow: 0 2px 40px rgba(0, 10, 30, 0.45); margin-bottom: 26px; }
.hero-title .line { display: block; }
.hero-title em { text-shadow: none; filter: drop-shadow(0 0 22px rgba(var(--glow-rgb), 0.35)); }
.hero-sub { font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-2); max-width: 44ch; margin-bottom: 30px; text-shadow: 0 1px 12px rgba(0, 10, 30, 0.6); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; }

.js .kicker, .js .hero-title .line, .js .hero-sub, .js .hero-ctas { animation: rise 1.5s var(--ease) both; }
.js .kicker { animation-delay: 0.2s; }
.js .hero-title .line { animation-delay: calc(0.35s + var(--i) * 0.16s); }
.js .hero-sub { animation-delay: 0.75s; }
.js .hero-ctas { animation-delay: 0.9s; }
@keyframes rise { from { opacity: 0; transform: translateY(36px); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }

.descend {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(28px, 5vh, 48px);
  display: flex;
  align-items: center;
  gap: 14px;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}
.descend-line { position: relative; width: 1px; height: 46px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.descend-line::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--glow); box-shadow: 0 0 6px var(--glow); animation: sink 2.2s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
@keyframes sink { to { top: 100%; } }

/* ---------- Zones ---------- */
.zone { position: relative; padding: clamp(110px, 15vw, 200px) 0; scroll-margin-top: 0; }
.zone-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font: 500 11.5px/1.2 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: clamp(36px, 5vw, 60px);
}
.zh-depth { color: var(--glow); font-variant-numeric: tabular-nums; }
.zh-rule { width: 48px; height: 1px; background: var(--line-2); }
.zh-name { color: var(--ink); }
.zh-fact { margin-left: auto; font: italic 400 17px/1.3 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink-3); }

.intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px 60px; align-items: end; margin-bottom: clamp(48px, 7vw, 88px); }
.intro p { color: var(--ink-2); max-width: 44ch; }

/* Reveal on scroll (only when the script runs). */
.js [data-reveal] { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-visible { opacity: 1; transform: none; filter: none; }

/* ---------- About: sunlight zone ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 100px); align-items: start; }
.about-copy .display { margin-bottom: 34px; }
.about-copy p { color: var(--ink-2); max-width: 58ch; margin-bottom: 18px; }
.about-copy p em { font-family: var(--serif); font-size: 1.2em; color: var(--ink); }
.divelog {
  position: relative;
  margin-top: clamp(0px, 8vw, 110px);
  padding: 24px 24px 20px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 30px 80px -40px rgba(0, 0, 0, 0.6);
}
.divelog::before, .divelog::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--glow); opacity: 0.7; }
.divelog::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.divelog::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.divelog-head { display: flex; justify-content: space-between; font: 500 11px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--glow); padding-bottom: 14px; border-bottom: 1px dashed var(--line-2); }
.divelog dl > div { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.divelog dt { flex: 1; display: flex; align-items: baseline; gap: 8px; font: 500 11px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.divelog dt::after { content: ''; flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line-2); transform: translateY(-3px); }
.divelog dd { font-size: 15px; text-align: right; color: var(--ink); }
.divelog-sign { display: flex; align-items: baseline; justify-content: space-between; margin-top: 16px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.sig { font: italic 400 30px/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); transform: rotate(-4deg); display: inline-block; text-shadow: 0 0 18px rgba(var(--glow-rgb), 0.35); }

/* ---------- Services: twilight zone ---------- */
.svc-list { list-style: none; border-top: 1px solid var(--line); }
.svc {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1.05fr) minmax(0, 1fr) 64px;
  gap: 14px 28px;
  align-items: center;
  padding: clamp(26px, 3.4vw, 40px) 0;
  border-bottom: 1px solid var(--line);
}
.svc::before {
  content: '';
  position: absolute;
  inset: 0 calc(-1 * min(24px, var(--gutter) - 4px));
  border-radius: 18px;
  background: radial-gradient(420px 140px at var(--mx, 50%) 50%, rgba(var(--glow-rgb), 0.09), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.svc::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--glow), transparent); transform: scaleX(0); transition: transform 0.7s var(--ease); }
.svc:hover::before { opacity: 1; }
.svc:hover::after { transform: scaleX(1); }
.svc-num { font: 500 12px/1 var(--mono); color: var(--ink-3); transition: color 0.3s; align-self: start; padding-top: 0.9em; }
.svc-title { font: 400 clamp(2.3rem, 4.6vw, 4rem)/1 var(--serif); letter-spacing: -0.01em; transition: transform 0.6s var(--ease), text-shadow 0.6s; }
.svc-body p { color: var(--ink-2); font-size: 16px; margin-bottom: 14px; }
.svc-icon { width: 54px; height: 54px; justify-self: end; fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s, filter 0.3s; }
.svc-icon * { stroke-dasharray: 1; stroke-dashoffset: 0; }
.svc:hover .svc-num { color: var(--glow); }
.svc:hover .svc-title { transform: translateX(10px); text-shadow: 0 0 30px rgba(var(--glow-rgb), 0.25); }
.svc:hover .svc-icon { stroke: var(--glow); filter: drop-shadow(0 0 6px rgba(var(--glow-rgb), 0.6)); }
.svc:hover .svc-icon * { animation: draw 1.1s var(--ease) both; }
.svc:hover .svc-icon *:nth-child(2) { animation-delay: 0.12s; }
.svc:hover .svc-icon *:nth-child(3) { animation-delay: 0.24s; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- Work: midnight zone ---------- */
.projects { list-style: none; display: grid; gap: clamp(90px, 12vw, 160px); }
.project { position: relative; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.project:nth-child(even) .shots { order: 2; }
.shots { position: relative; padding: 0 9% 7% 0; }
.frame { border: 1px solid rgba(255, 255, 255, 0.12); background: #0a1522; overflow: hidden; transition: box-shadow 0.7s var(--ease), transform 0.7s var(--ease), border-color 0.7s; }
.frame-desktop {
  border-radius: 14px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85), 0 0 80px -12px rgba(var(--glow-rgb), 0.16);
}
.frame-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: rgba(255, 255, 255, 0.06); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.frame-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.frame-bar span { margin-left: 10px; font: 400 10.5px/1 var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame-view { position: relative; container-type: inline-size; overflow: hidden; background: #f4f6f8; }
.frame-desktop .frame-view { aspect-ratio: 16 / 10; }
.frame-view img { width: 100%; height: auto; transition: transform 7s cubic-bezier(0.45, 0, 0.25, 1); }
.frame-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 23%;
  padding: 5px;
  border-radius: 22px;
  background: #050b14;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 50px -10px rgba(var(--glow-rgb), 0.18);
}
.frame-phone .frame-view { aspect-ratio: 9 / 19.5; border-radius: 17px; }
.frame-phone img { transition-duration: 6s; transition-delay: 0.3s; }
/* Hover (or, on touch screens, scrolling it into view) pans the screenshot down the page. */
.project:hover .frame-desktop img, .project.is-panning .frame-desktop img { transform: translateY(calc(-100% + 62.5cqw)); }
.project:hover .frame-phone img, .project.is-panning .frame-phone img { transform: translateY(calc(-100% + 216.6cqw)); }
.project:hover .frame-desktop { transform: translateY(-6px); border-color: rgba(var(--glow-rgb), 0.4); box-shadow: 0 50px 100px -30px rgba(0, 0, 0, 0.9), 0 0 120px -10px rgba(var(--glow-rgb), 0.38); }
.project:hover .frame-phone { transform: translateY(-14px); border-color: rgba(var(--glow-rgb), 0.45); }

.project-count { font: 500 13px/1 var(--mono); color: var(--glow); letter-spacing: 0.08em; }
.project-count small { color: var(--ink-3); font-size: 11px; margin-left: 3px; }
.project-info h3 { font: 400 clamp(2.1rem, 3.6vw, 3.1rem)/1.02 var(--serif); margin: 16px 0 14px; text-wrap: balance; }
.project-link { text-decoration: none; transition: color 0.3s, text-shadow 0.3s; }
.project-link::after { content: ''; position: absolute; inset: -12px; z-index: 1; border-radius: 22px; }
.project:hover .project-link { color: var(--glow); text-shadow: 0 0 24px rgba(var(--glow-rgb), 0.4); }
.project-info > p:not(.project-count):not(.project-visit) { color: var(--ink-2); margin-bottom: 18px; max-width: 36ch; }
.project-visit { margin-top: 22px; font: 500 11.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); display: inline-flex; gap: 8px; transition: color 0.3s; }
.project-visit span { display: inline-block; transition: transform 0.4s var(--ease); }
.project:hover .project-visit { color: var(--glow); }
.project:hover .project-visit span { transform: translate(3px, -3px); }

/* ---------- Process: the abyss ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 32px; padding-bottom: calc(3 * 64px); }
.step { position: relative; padding-top: 38px; transform: translateY(calc(var(--i) * 64px)); }
.js .step[data-reveal] { transform: translateY(calc(var(--i) * 64px + 28px)); }
.js .step[data-reveal].is-visible { transform: translateY(calc(var(--i) * 64px)); }
.step::before { content: ''; position: absolute; left: 0; top: 0; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--glow); background: #02101e; box-shadow: 0 0 14px rgba(var(--glow-rgb), 0.6); z-index: 1; }
.step-link { position: absolute; left: 6px; top: 6px; width: calc(100% + 32px); max-width: none; height: 64px; overflow: visible; fill: none; stroke: rgba(var(--glow-rgb), 0.55); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease) 0.5s; }
.step-link path { vector-effect: non-scaling-stroke; }
.step.is-visible .step-link { stroke-dashoffset: 0; }
html:not(.js) .step-link { stroke-dashoffset: 0; }
.step-n { display: block; font: 500 12px/1 var(--mono); color: var(--glow); margin-bottom: 14px; letter-spacing: 0.1em; }
.step h3 { font: 500 20px/1.2 var(--sans); margin-bottom: 10px; }
.step p { font-size: 15.5px; color: var(--ink-2); }

.promise { margin-top: clamp(110px, 15vw, 200px); text-align: center; }
.promise-lines { display: grid; font: 400 clamp(3.1rem, 9vw, 8rem)/0.98 var(--serif); letter-spacing: -0.02em; }
.pl { color: rgba(234, 244, 251, 0.12); transition: color 1s ease, text-shadow 1.2s ease; transition-delay: calc(var(--i) * 0.45s); }
.pl em { opacity: 0.25; transition: opacity 1s ease, filter 1.2s ease; transition-delay: calc(var(--i) * 0.45s); }
.promise.is-visible .pl, html:not(.js) .pl { color: var(--ink); text-shadow: 0 0 40px rgba(var(--glow-rgb), 0.25); }
.promise.is-visible .pl em, html:not(.js) .pl em { opacity: 1; filter: drop-shadow(0 0 18px rgba(var(--glow-rgb), 0.55)); }
.promise-note { max-width: 46ch; margin: 40px auto 0; color: var(--ink-2); font-size: 18px; }
.promise-sig { margin-top: 18px; font: italic 400 24px/1 var(--serif); color: var(--ink); }

/* ---------- Contact: the deep end ---------- */
.contact { padding-bottom: clamp(120px, 16vw, 220px); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.contact-title { font-size: clamp(3rem, 7vw, 6.4rem); margin-bottom: 28px; }
.contact-title em { animation: bioluminesce 5s ease-in-out infinite; }
@keyframes bioluminesce { 0%, 100% { filter: drop-shadow(0 0 10px rgba(var(--glow-rgb), 0.3)); } 50% { filter: drop-shadow(0 0 28px rgba(var(--glow-rgb), 0.75)); } }
.contact-copy > p { color: var(--ink-2); max-width: 44ch; margin-bottom: 34px; }
.contact-lines { list-style: none; border-top: 1px solid var(--line); max-width: 420px; }
.contact-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cl-label { font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.contact-lines a { text-decoration: none; color: var(--ink); transition: color 0.3s, text-shadow 0.3s; overflow-wrap: anywhere; }
.contact-lines a:hover { color: var(--glow); text-shadow: 0 0 14px rgba(var(--glow-rgb), 0.5); }

.contact-card {
  position: relative;
  padding: clamp(22px, 3vw, 36px);
  border-radius: 24px;
  border: 1px solid var(--line-2);
  background: rgba(4, 14, 28, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 0 0 1px rgba(var(--glow-rgb), 0.04), 0 50px 140px -40px rgba(var(--glow-rgb), 0.22);
}
#contact-form { display: grid; gap: 20px; }
.hp { display: none; }
.chips { border: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend, .field label { display: block; font: 500 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink-2); transition: all 0.25s; }
.chip span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink-3); transition: all 0.25s; }
.chip:hover span { border-color: rgba(var(--glow-rgb), 0.5); color: var(--ink); }
.chip input:checked + span { background: rgba(var(--glow-rgb), 0.12); border-color: var(--glow); color: var(--ink); box-shadow: 0 0 18px rgba(var(--glow-rgb), 0.2); }
.chip input:checked + span::before { background: var(--glow); border-color: var(--glow); box-shadow: 0 0 8px var(--glow); }
.chip input:focus-visible + span { outline: 2px solid var(--glow); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { margin-bottom: 9px; }
.field input, .field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
  outline: none;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { border-color: var(--glow); background: rgba(255, 255, 255, 0.06); box-shadow: 0 0 0 4px rgba(var(--glow-rgb), 0.12); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--coral); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-top: 4px; }
.form-status { font-size: 14px; color: var(--glow); }
.form-status.is-error { color: var(--coral); }
.sent { text-align: center; padding: clamp(30px, 5vw, 60px) 10px; }
.sent-kicker { font: 500 11px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--glow); margin-bottom: 18px; }
.sent-title { font: 400 clamp(2.6rem, 5vw, 4rem)/1 var(--serif); margin-bottom: 16px; outline: none; }
.sent-title em { color: var(--glow); text-shadow: 0 0 24px rgba(var(--glow-rgb), 0.6); }
.sent p { color: var(--ink-2); max-width: 34ch; margin: 0 auto 18px; }

/* ---------- Seafloor ---------- */
.seafloor { position: relative; background: #000206; color: var(--ink-3); }
.ridge { position: absolute; left: 0; bottom: 100%; width: 100%; height: clamp(40px, 7vw, 100px); fill: #000206; filter: drop-shadow(0 -1px 0 rgba(var(--glow-rgb), 0.22)); }
/* The seabed creatures: assets/abyss.js draws them, with their own seabed, on a canvas sitting on the footer.
   It adds .has-seabed once it runs; without it the page keeps the plain ridge. */
.abyss { display: none; }
.has-seabed .abyss { display: block; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: var(--abyss-h); pointer-events: none; }
.abyss canvas { display: block; width: 100%; height: 100%; }
.has-seabed .seafloor .ridge { display: none; }
.has-seabed .contact { padding-bottom: calc(var(--abyss-h) + clamp(24px, 4vw, 56px)); }
.seafloor-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; padding: 26px 0 calc(26px + env(safe-area-inset-bottom)); font: 400 12px/1.4 var(--mono); letter-spacing: 0.06em; }
.seafloor .btn-text { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--ink-2); }
.privacy { flex-basis: 100%; color: var(--ink-3); font-size: 11px; }
.privacy-toggle { background: none; border: 0; padding: 6px 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.privacy-toggle:hover { color: var(--glow); }
html:not(.js) .privacy-toggle { display: none; }

/* ---------- Analytics banner (only for visitors who must agree first) ---------- */
.consent {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 55;
  width: min(380px, 100% - 32px);
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: rgba(2, 12, 24, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 60px -24px rgba(var(--glow-rgb), 0.4);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.consent-title { font: 400 24px/1.1 var(--serif); color: var(--ink); margin-bottom: 6px; }
.consent-actions { display: flex; gap: 8px; margin-top: 14px; }
.consent .btn { min-height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1099px) {
  .intro { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 32px; padding-bottom: 0; }
  .step, .js .step[data-reveal].is-visible { transform: none; }
  .js .step[data-reveal] { transform: translateY(28px); }
  .step-link { display: none; }
}
@media (max-width: 859px) {
  .about-grid, .contact-grid, .project { grid-template-columns: 1fr; }
  .divelog { margin-top: 0; }
  .project:nth-child(even) .shots { order: 0; }
  .svc { grid-template-columns: 40px minmax(0, 1fr) 44px; gap: 12px 16px; }
  .svc-body { grid-column: 2 / -1; }
  .svc-icon { grid-row: 1; grid-column: 3; width: 40px; height: 40px; }
  .zh-fact { margin-left: 0; flex-basis: 100%; }
}
/* Square and tall screens: the diver goes in the top part of the screen and the words sit in open water below.
   site.js measures where the words start (--copy-top), and the image is sized so the diver (19% to 94% down the
   image) ends just above them. Without the script, a fixed guess is used. Slightly wider-than-square windows keep
   the side-by-side layout: this diver stands far enough left for the words to fit beside him, while this sizing
   would crop the image top and bottom there and push the helmet up into the header. */
@media (max-aspect-ratio: 1/1) {
  .hero-copy { width: min(600px, 100%); }
  .hero-photo {
    --room: calc(var(--copy-top, 55%) - var(--header-h) - 28px);
    /* Never so big that the diver (about 47% of the image's height wide) can't fit across the screen. */
    --img-h: min(clamp(40%, var(--room) / 0.75, 125%), 180vw);
    top: calc(var(--header-h) + 4px - var(--img-h) * 0.19);
    bottom: auto;
    height: var(--img-h);
    -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 99%);
    mask-image: linear-gradient(to bottom, #000 80%, transparent 99%);
  }
  /* A fallback: site.js sets the exact position that centres the diver for this screen. */
  .hero-photo img { object-position: 6% 50%; }
  .hero-shade { background: linear-gradient(to bottom, rgba(2, 10, 22, 0.55), rgba(2, 10, 22, 0) 18%); }
}
@media (max-width: 759px) {
  body { font-size: 16px; }
  .hero { min-height: 560px; }
  .hero-inner { padding-bottom: 76px; }
  .hero-title { font-size: clamp(2.9rem, 14vw, 4.6rem); }
  .descend { left: 50%; transform: translateX(-50%); bottom: 22px; }
  .steps { grid-template-columns: 1fr; gap: 0; border-left: 1px solid rgba(var(--glow-rgb), 0.3); margin-left: 5px; }
  .step { padding: 0 0 44px 28px; }
  .step:last-child { padding-bottom: 0; }
  .step::before { left: -6px; top: 2px; }
  .field-row { grid-template-columns: 1fr; }
  .shots { padding: 0 12% 9% 0; }
  .frame-phone { width: 27%; border-radius: 16px; padding: 4px; }
  .frame-phone .frame-view { border-radius: 12px; }
  .frame-bar { height: 24px; }
  .project-link::after { inset: -8px; }
}

/* ---------- Reduced motion: no drifting, no parallax, everything visible at once ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .js .step[data-reveal] { transform: translateY(calc(var(--i) * 64px)); }
  .step-link { stroke-dashoffset: 0; }
  .pl { color: var(--ink); }
  .pl em { opacity: 1; }
  .project:hover .frame-desktop img, .project.is-panning .frame-desktop img, .project:hover .frame-phone img, .project.is-panning .frame-phone img { transform: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 1099px) {
  .js .step[data-reveal] { transform: none; }
}
