/* ==========================================================================
   Critical Angle — criticalangle.info
   Design: deep-water base, chart-paper contrast, hi-vis offshore yellow for
   actions, chart magenta for positions. Schola (TeX Gyre) for voice,
   Inter for data and interface.
   ========================================================================== */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: "Schola"; src: url("../fonts/schola-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Schola"; src: url("../fonts/schola-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Schola"; src: url("../fonts/schola-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --abyss: #06141e;
  --deep: #0b2232;
  --deep-2: #0f2a3d;
  --screen: #031019;
  --foam: #e8f0f1;
  --haze: #93abb7;
  --haze-2: #7e97a3;
  --rule: rgba(147, 171, 183, 0.22);
  --rule-strong: rgba(147, 171, 183, 0.4);
  --hivis: #f2c230;
  --hivis-ink: #0b2232;
  --magenta: #e06ab2;
  --paper: #f1f4f2;
  --paper-2: #e6ece9;
  --ink: #1b2a33;
  --ink-2: #4f6470;
  --ink-magenta: #a92c78;
  --graticule: #8aa0aa;

  /* data series: working location (validated, see README) */
  --s-aboard: #3987e5;
  --s-office: #199e70;
  --s-remote: #c98500;
  --s-aboard-l: #2a78d6;
  --s-office-l: #1baf7a;
  --s-remote-l: #eda100;

  --serif: "Schola", "TeX Gyre Schola", "Century Schoolbook", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.1875rem;
  --fs-lg: 1.5rem;
  --fs-xl: clamp(2rem, 1.35rem + 2.5vw, 3.25rem);
  --fs-hero: clamp(2.6rem, 1.3rem + 4.6vw, 5.4rem);

  --gutter: clamp(16px, 4.5vw, 56px);
  --maxw: 1240px;
  --header-h: 72px;
  --radius: 3px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); color-scheme: dark; }
body {
  margin: 0;
  background: var(--abyss);
  color: var(--foam);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--hivis); }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--hivis); color: var(--hivis-ink); }
:focus-visible { outline: 2px solid var(--hivis); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; }
table { border-collapse: collapse; }
sub { font-size: 0.6em; line-height: 0; vertical-align: -0.25em; }

.i18n-pending body { opacity: 0; animation: i18n-reveal 0s linear 1.2s forwards; }
@keyframes i18n-reveal { to { opacity: 1; } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--hivis); color: var(--hivis-ink); padding: 10px 14px; font-weight: 600; text-decoration: none; border-radius: var(--radius);
}
.skip:focus { top: 12px; color: var(--hivis-ink); }

.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.section { padding-block: clamp(72px, 9vw, 136px); position: relative; }
.section--deep { background: var(--deep); }

/* ---------- Type ---------- */
.h2 { font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.06; letter-spacing: -0.01em; text-wrap: balance; max-width: 22ch; }
.h3 { font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.15; }
.lead { font-size: var(--fs-md); line-height: 1.55; color: var(--foam); max-width: 58ch; }
.muted { color: var(--haze); }
.prose { max-width: 66ch; }
.prose p { color: #cbd8dd; }
.num { font-variant-numeric: tabular-nums slashed-zero; }
.section-head { display: grid; gap: 22px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head .lead { color: var(--haze); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.005em;
  text-decoration: none; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn--primary { background: var(--hivis); color: var(--hivis-ink); }
.btn--primary:hover { background: #ffd658; color: var(--hivis-ink); }
.btn--ghost { border-color: rgba(232, 240, 241, 0.45); color: var(--foam); background: rgba(6, 20, 30, 0.2); }
.btn--ghost:hover { border-color: var(--hivis); color: var(--hivis); }
.btn--sm { min-height: 40px; padding: 8px 16px; font-size: var(--fs-sm); }
.btn:active { transform: translateY(1px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid, .page-inner .site-header {
  background: rgba(6, 20, 30, 0.86);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border-bottom-color: var(--rule);
}
html:not(.js) .site-header { background: rgba(6, 20, 30, 0.9); border-bottom-color: var(--rule); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 28px; width: min(100% - 2 * var(--gutter), 1400px); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--foam); margin-right: auto; }
.brand:hover { color: var(--foam); }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; letter-spacing: 0.005em; line-height: 1; }
.nav__list { list-style: none; display: flex; gap: clamp(16px, 2.4vw, 34px); }
.nav__list a { text-decoration: none; font-size: 0.9375rem; font-weight: 500; color: var(--foam); padding: 6px 0; position: relative; }
.nav__list a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.nav__list a:hover::after, .nav__list a[aria-current="page"]::after { transform: scaleX(1); }
.nav__list a[aria-current="page"] { color: var(--hivis); }

.lang { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.lang__btn {
  border: 0; background: transparent; color: var(--haze); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
  padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: background-color 0.2s, color 0.2s;
}
.lang__btn[aria-pressed="true"] { background: var(--foam); color: var(--abyss); }
.lang__btn:hover:not([aria-pressed="true"]) { color: var(--foam); }

.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.menu-btn svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  :root { --header-h: 62px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__name { font-size: 1.15rem; }
  .menu-btn { display: inline-flex; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--abyss); box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45); border-bottom: 1px solid var(--rule); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity 0.25s, transform 0.25s, visibility 0.25s; }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav__list { flex-direction: column; gap: 0; padding: 8px var(--gutter) 20px; }
  .nav__list a { display: block; padding: 14px 0; font-size: 1.125rem; border-bottom: 1px solid var(--rule); }
  .nav__list a::after { display: none; }
  .site-header__inner { gap: 12px; }
  .site-header.menu-open { background: var(--abyss); }
}

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--abyss); }
.js .hero { height: 260vh; height: 260svh; }
.hero__stage { position: relative; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.js .hero__stage { position: sticky; top: 0; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s var(--ease); background: var(--abyss); }
.hero.is-ready .hero__canvas { opacity: 1; }
.hero__fallback { position: absolute; inset: 0; display: block; background: linear-gradient(180deg, #0d2033 0%, #2a3a5a 28%, #c47a4a 48.6%, #2c3346 48.6%, #10202e 70%, #07131c 100%); }
.hero__fallback svg { position: absolute; left: 0; right: 0; top: 48.6%; transform: translateY(-100%); width: 100%; height: auto; }
.js .hero:not(.is-static) .hero__fallback { display: none; }
.hero.is-static .hero__fallback { display: block; }
.hero.is-static .hero__canvas { display: none; }
.hero__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(6, 20, 30, 0.8) 0%, rgba(6, 20, 30, 0.4) 30%, rgba(6, 20, 30, 0) 58%),
    linear-gradient(to right, rgba(6, 20, 30, 0.5) 0%, rgba(6, 20, 30, 0.22) 38%, rgba(6, 20, 30, 0) 62%),
    linear-gradient(to bottom, rgba(6, 20, 30, 0.6) 0%, rgba(6, 20, 30, 0) 16%);
  opacity: var(--hero-copy, 1);
}
.hero__copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(56px, 10vh, 120px);
  max-width: 50rem; opacity: var(--hero-copy, 1); transform: translateY(var(--hero-shift, 0px));
  will-change: opacity, transform;
}
.hero__kicker { font-size: var(--fs-sm); font-weight: 500; color: var(--foam); opacity: 0.9; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.hero__kicker::before { content: ""; width: 28px; height: 1px; background: var(--hivis); }
.hero__title { font-family: var(--serif); font-weight: 700; font-size: var(--fs-hero); line-height: 0.98; letter-spacing: -0.015em; text-wrap: balance; max-width: 14ch; text-shadow: 0 2px 30px rgba(6, 20, 30, 0.35); }
.hero__lead { margin-top: 24px; font-size: var(--fs-md); line-height: 1.55; max-width: 48ch; text-wrap: pretty; color: #dbe6e9; text-shadow: 0 1px 16px rgba(6, 20, 30, 0.5); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.status { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; font-size: var(--fs-sm); color: #dbe6e9; }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: #45d483; box-shadow: 0 0 0 4px rgba(69, 212, 131, 0.18); }
.status[data-state="limited"] .status__dot { background: var(--hivis); box-shadow: 0 0 0 4px rgba(242, 194, 48, 0.2); }
.status[data-state="booked"] .status__dot { background: #ff6a5a; box-shadow: 0 0 0 4px rgba(255, 106, 90, 0.2); }

.hero__hud {
  position: absolute; right: var(--gutter); top: calc(var(--header-h) + 22px);
  opacity: var(--hero-hud, 1);
  background: rgba(3, 16, 25, 0.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 240, 241, 0.16); border-radius: var(--radius);
  padding: 12px 14px 10px; min-width: 250px;
}
.hud { display: grid; grid-template-columns: auto auto; gap: 6px 18px; font-size: 0.78rem; line-height: 1.35; }
.hud div { display: contents; }
.hud dt { color: var(--haze); }
.hud dd { color: var(--foam); font-variant-numeric: tabular-nums slashed-zero; text-align: right; white-space: nowrap; }
.hud__pos { grid-column: 1 / -1; text-align: left !important; color: var(--magenta) !important; font-weight: 500; letter-spacing: 0.01em; }
.hud-next {
  margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: transparent; border: 0; border-top: 1px solid rgba(232, 240, 241, 0.14); padding: 9px 0 0;
  color: var(--foam); font-size: 0.78rem; font-weight: 500; cursor: pointer;
}
.hud-next:hover { color: var(--hivis); }
.hud-next svg { width: 14px; height: 14px; }

.hero__cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.75rem; color: var(--foam); opacity: calc(var(--hero-copy, 1) * 0.8);
}
.hero__cue::after { content: ""; width: 1px; height: 34px; background: linear-gradient(var(--foam), transparent); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.hero__dive {
  position: absolute; left: 50%; bottom: clamp(36px, 9vh, 96px); width: min(100% - 2 * var(--gutter), 40rem);
  transform: translate(-50%, calc((1 - var(--hero-dive, 0)) * 24px));
  text-align: center; opacity: var(--hero-dive, 0); pointer-events: none;
}
.hero.is-under .hero__dive { pointer-events: auto; }
.dive__angle { font-family: var(--serif); font-style: normal; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.6rem); line-height: 1; color: var(--foam); margin-bottom: 16px; }
.dive__title { font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600; color: var(--hivis); margin-bottom: 10px; letter-spacing: 0.01em; }
.dive__text { font-size: var(--fs-md); line-height: 1.55; color: #d7e3e6; text-wrap: pretty; }
.hero__dive .dive__diagram { display: none; }

/* No WebGL, no JavaScript or reduced motion: still image hero, Snell's window explained below */
.js .snell { display: none; }
html:not(.js) .hero__dive, html:not(.js) .hero__cue, html:not(.js) .hero__hud { display: none; }
.js .hero.is-static, .reduced-motion .hero { height: auto; }
.js .hero.is-static .hero__stage, .reduced-motion .hero .hero__stage { position: relative; }
.hero.is-static .hero__dive, .reduced-motion .hero__dive, .hero.is-static .hero__cue, .reduced-motion .hero__cue { display: none; }
.js.no-webgl .snell, .js.reduced-motion .snell { display: block; }
.snell { background: var(--abyss); padding-block: clamp(64px, 9vw, 120px); }
.snell__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.snell .dive__angle { text-align: left; }
.snell .dive__text { color: #cbd8dd; }
@media (max-width: 860px) { .snell__grid { grid-template-columns: 1fr; } }

@media (max-width: 860px) {
  .hero__hud { left: var(--gutter); right: auto; top: calc(var(--header-h) + 14px); min-width: 0; padding: 9px 11px 8px; }
  .hud { font-size: 0.72rem; gap: 4px 14px; }
  .hero__copy { bottom: clamp(40px, 7vh, 80px); }
  .hero__lead { font-size: var(--fs-base); margin-top: 18px; }
  .hero__actions { margin-top: 24px; }
}
@media (max-width: 860px) {
  .hero__cue { display: none; }
}
@media (max-width: 520px) {
  .hud dt.hud__opt, .hud dd.hud__opt { display: none; }
  .hero__actions .btn { flex: 1 1 auto; }
}
@media (max-height: 620px) and (min-width: 861px) {
  .hero__hud { display: none; }
}

/* ---------- About / particulars ---------- */
.about { background: linear-gradient(180deg, var(--abyss) 0%, var(--deep) 100%); }
.about__grid { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.about__text .h2 { margin-bottom: 28px; }
.about__text p { color: #cbd8dd; max-width: 56ch; }
.porthole { position: relative; width: 100%; max-width: 300px; aspect-ratio: 1; }
.porthole__img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: cover; border-radius: 50%; filter: saturate(0.9) contrast(1.02); }
.porthole__ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.porthole figcaption { position: absolute; left: 0; right: 0; bottom: -34px; text-align: center; font-size: var(--fs-xs); color: var(--haze); }
.particulars { border-top: 2px solid var(--foam); padding-top: 18px; }
.particulars__title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.35rem; margin-bottom: 14px; }
.particulars__list { display: grid; }
.particulars__list > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); line-height: 1.45; }
.particulars__list dt { color: var(--haze); }
.particulars__list dd { color: var(--foam); }
@media (max-width: 1100px) {
  .about__grid { grid-template-columns: minmax(160px, 240px) minmax(0, 1fr); }
  .particulars { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .about__grid { grid-template-columns: 1fr; }
  .porthole { max-width: 220px; }
  .particulars__list > div { grid-template-columns: 8rem 1fr; }
}

/* ---------- Services story ---------- */
.services { background: var(--deep); }
.story { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.story__stage { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 14px; }
.story__diagram { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: #0a2131; }
.svy { width: 100%; height: auto; aspect-ratio: 960 / 520; }
.panel { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--screen); overflow: hidden; }
.panel__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--rule); font-size: 0.78rem; }
.panel__title { color: var(--foam); font-weight: 500; }
.panel__tag { color: var(--haze); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 1px 9px; font-size: 0.7rem; }
.panel__view { position: relative; aspect-ratio: 16 / 7.4; }
.panel__view > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel__view > [hidden] { display: none; }
.viz { width: 100%; height: 100%; }
.story__steps { list-style: none; counter-reset: step; }
.step { min-height: 76vh; display: flex; flex-direction: column; justify-content: center; padding-block: 8vh; opacity: 0.38; transition: opacity 0.5s var(--ease); }
.step.is-active { opacity: 1; }
.step:first-child { min-height: 64vh; padding-top: 2vh; justify-content: flex-start; }
.step:last-child { min-height: 70vh; }
.step__title { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem); line-height: 1.1; margin-bottom: 18px; display: flex; gap: 16px; align-items: baseline; }
.step__num { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--hivis); flex: none; width: 30px; height: 30px; border: 1px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; transform: translateY(-4px); font-variant-numeric: tabular-nums; }
.step p { color: #cbd8dd; max-width: 46ch; }
.facts { display: grid; gap: 0; margin-top: 22px; border-top: 1px solid var(--rule); max-width: 46ch; }
.facts > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); }
.facts dt { color: var(--haze); }
.step__visual { display: none; }

/* diagram parts */
.svy .part { transition: opacity 0.6s var(--ease); opacity: 0.32; }
.svy .part--always { opacity: 1; }
.svy .lbl { font-family: var(--sans); font-size: 15px; fill: var(--foam); opacity: 0; transition: opacity 0.5s var(--ease); }
.svy .lbl--sm { font-size: 13px; fill: var(--haze); }
.svy .fx { opacity: 0; transition: opacity 0.5s var(--ease); }
.svy .ping { opacity: 0; }
.svy[data-step="sbp"] .ping:first-child { opacity: 0.55; }
.svy[data-step="qc"] .part--vessel, .svy[data-step="qc"] .part--qc { opacity: 1; }
.svy[data-step="qc"] .part--mag, .svy[data-step="qc"] .part--sss, .svy[data-step="qc"] .part--sbp, .svy[data-step="qc"] .part--mbes { opacity: 0.75; }
.svy[data-step="mag"] .part--mag, .svy[data-step="mag"] .part--uxo, .svy[data-step="mag"] .part--tow { opacity: 1; }
.svy[data-step="sss"] .part--sss, .svy[data-step="sss"] .part--tow, .svy[data-step="sss"] .part--boulder { opacity: 1; }
.svy[data-step="sbp"] .part--sbp, .svy[data-step="sbp"] .part--geo, .svy[data-step="sbp"] .part--vessel { opacity: 1; }
.svy[data-step="mbes"] .part--mbes, .svy[data-step="mbes"] .part--seabed, .svy[data-step="mbes"] .part--vessel { opacity: 1; }
.svy[data-step="interp"] .part--geo, .svy[data-step="interp"] .part--asset, .svy[data-step="interp"] .part--seabed { opacity: 1; }
.svy[data-step="qc"] .lbl--qc, .svy[data-step="mag"] .lbl--mag, .svy[data-step="sss"] .lbl--sss, .svy[data-step="sbp"] .lbl--sbp,
.svy[data-step="mbes"] .lbl--mbes, .svy[data-step="interp"] .lbl--interp { opacity: 1; }
.svy[data-step="qc"] .fx--qc, .svy[data-step="mag"] .fx--mag, .svy[data-step="sss"] .fx--sss, .svy[data-step="sbp"] .fx--sbp,
.svy[data-step="mbes"] .fx--mbes, .svy[data-step="interp"] .fx--interp { opacity: 1; }

/* diagram animations (only for the active instrument) */
@media (prefers-reduced-motion: no-preference) {
  .svy .wave-line { animation: drift 9s linear infinite; }
  .svy[data-step="sbp"] .ping { animation: ping 2.4s var(--ease) infinite; transform-box: view-box; transform-origin: 560px 150px; }
  .svy[data-step="sbp"] .ping:nth-child(2) { animation-delay: 0.8s; }
  .svy[data-step="sbp"] .ping:nth-child(3) { animation-delay: 1.6s; }
  .svy[data-step="mag"] .fieldline { stroke-dasharray: 4 6; animation: flow 1.6s linear infinite; }
  .svy[data-step="sss"] .beam { animation: beam 1.8s ease-in-out infinite; }
  .svy[data-step="sss"] .beam--b { animation-delay: 0.9s; }
  .svy[data-step="mbes"] .swath-line { animation: swath 2.2s ease-in-out infinite; }
  .svy[data-step="qc"] .signal { animation: signal 2s var(--ease) infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  .svy[data-step="qc"] .signal:nth-child(2) { animation-delay: 0.5s; }
  .svy[data-step="qc"] .signal:nth-child(3) { animation-delay: 1s; }
}
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-120px); } }
@keyframes ping { 0% { transform: scale(0.15); opacity: 0; } 15% { opacity: 0.9; } 100% { transform: scale(1); opacity: 0; } }
@keyframes flow { to { stroke-dashoffset: -20; } }
@keyframes beam { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
@keyframes swath { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.85; } }
@keyframes signal { 0% { transform: scale(0.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* QC log panel */
.qclog { padding: 12px 16px; display: grid; grid-template-rows: auto 1fr auto; gap: 6px; font-size: 0.76rem; color: var(--foam); }
.qclog__head { display: flex; justify-content: space-between; color: var(--haze); }
.qclog__rows { list-style: none; display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; align-content: start; }
@media (max-width: 560px) { .qclog__rows { grid-template-columns: 1fr; } .qclog__rows li:nth-child(n+7) { display: none; } }
.qclog__rows li { display: grid; grid-template-columns: 1.1rem 1fr auto; gap: 6px; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(147, 171, 183, 0.12); opacity: 0.35; transition: opacity 0.4s; }
.qclog__rows li.is-done { opacity: 1; }
.qclog__rows .tick { width: 14px; height: 14px; color: #45d483; opacity: 0; transition: opacity 0.3s; }
.qclog__rows li.is-done .tick { opacity: 1; }
.qclog__rows .val { font-variant-numeric: tabular-nums slashed-zero; color: var(--haze); }
.qclog__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--haze); }
.qclog__accept { color: #45d483; font-weight: 600; opacity: 0; transition: opacity 0.4s; }
.qclog.is-accepted .qclog__accept { opacity: 1; }

@media (max-width: 1000px) {
  .story { grid-template-columns: 1fr; }
  .story__stage { position: relative; top: 0; }
  .story__stage .panel { display: none; }
  .step, .step:first-child, .step:last-child { min-height: 0; padding-block: 28px; opacity: 1; justify-content: flex-start; }
  .step__visual { display: block; margin-top: 22px; }
  .step__visual .panel { display: block; }
}

/* ---------- Remote ---------- */
.remote { background: linear-gradient(180deg, var(--deep) 0%, var(--abyss) 100%); }
.remote__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.remote__text .h2 { margin-bottom: 26px; }
.remote__text .lead { margin-bottom: 20px; }
.remote__text p { color: #cbd8dd; max-width: 54ch; }
.spec { margin-top: 32px; border-top: 1px solid var(--rule); max-width: 54ch; }
.spec > div { display: grid; grid-template-columns: 10rem 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); }
.spec dt { color: var(--haze); }
@media (max-width: 960px) { .remote__grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .spec > div, .facts > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Charts (shared) ---------- */
.chart { background: var(--deep-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(18px, 2.5vw, 28px); }
.chart__title { font-size: var(--fs-base); font-weight: 600; margin-bottom: 4px; }
.chart__sub { font-size: var(--fs-sm); color: var(--haze); margin-bottom: 16px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--fs-sm); color: var(--foam); margin-bottom: 14px; }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.swatch--aboard { background: var(--s-aboard); }
.swatch--office { background: var(--s-office); }
.swatch--remote { background: var(--s-remote); }
.chart svg text { font-family: var(--sans); }
.chart .axis text { fill: var(--haze); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: rgba(147, 171, 183, 0.16); stroke-width: 1; }
.chart .baseline { stroke: rgba(147, 171, 183, 0.5); stroke-width: 1; }
.chart .note text { fill: var(--haze); font-size: 12px; }
.chart .seg { cursor: default; transition: filter 0.15s; }
.chart .seg:hover, .chart .seg:focus { filter: brightness(1.25); outline: none; }
.chart .total { fill: var(--foam); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tip {
  position: fixed; z-index: 80; pointer-events: none; background: #04121b; color: var(--foam);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 8px 10px; font-size: 0.78rem; line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); max-width: 260px; opacity: 0; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s;
}
.tip.is-on { opacity: 1; transform: none; }
.tip strong { display: block; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tip .k { display: inline-block; width: 12px; height: 2px; vertical-align: middle; margin-right: 6px; }
.tableview { margin-top: 14px; font-size: var(--fs-sm); max-width: 100%; overflow-x: auto; }
.tableview summary { cursor: pointer; color: var(--haze); width: fit-content; }
.tableview summary:hover { color: var(--foam); }
.tableview table { width: 100%; margin-top: 10px; font-variant-numeric: tabular-nums; }
.tableview th, .tableview td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.tableview th:first-child, .tableview td:first-child { text-align: left; }
.tableview thead th { color: var(--haze); font-weight: 500; }

/* ---------- Track record teaser ---------- */
.record { background: var(--abyss); }
.record__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.record__text .h2 { margin-bottom: 24px; }
.record__text > p { color: #cbd8dd; max-width: 52ch; }
.manifest { list-style: none; margin: 28px 0 32px; max-width: 30rem; }
.manifest li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; font-size: var(--fs-base); }
.manifest li::after { content: ""; order: 2; flex: 1; border-bottom: 1px dotted var(--rule-strong); transform: translateY(-4px); }
.manifest .m-label { order: 1; color: var(--foam); }
.manifest .m-n { order: 3; font-family: var(--serif); font-weight: 700; font-size: 1.35rem; min-width: 1.6ch; text-align: right; }
.record__sheet { margin: 0; }
@media (max-width: 960px) { .record__grid { grid-template-columns: 1fr; } }

/* ---------- Plotting sheet ---------- */
.sheet { background: var(--paper); color: var(--ink); border-radius: 2px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(255, 255, 255, 0.04) inset; position: relative; }
.sheet svg { width: 100%; height: auto; }
.sheet .grat { stroke: var(--graticule); stroke-width: 0.6; }
.sheet .grat--minor { stroke: rgba(138, 160, 170, 0.35); stroke-width: 0.5; }
.sheet .neat { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.sheet .scale-a { fill: var(--ink); }
.sheet .scale-b { fill: var(--paper); stroke: var(--ink); stroke-width: 0.6; }
.sheet .glabel { font-family: var(--sans); font-size: 10px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.sheet .sea { font-family: var(--serif); font-style: italic; fill: #3d6b82; letter-spacing: 0.18em; }
.sheet .land { font-family: var(--serif); fill: #8a7d63; letter-spacing: 0.24em; font-variant: small-caps; font-size: 13px; }
.sheet .title-s { font-family: var(--serif); font-weight: 700; fill: var(--ink); }
.sheet .note-s { font-family: var(--sans); fill: var(--ink-2); font-size: 10.5px; }
.sheet .rose { stroke: var(--ink-magenta); fill: none; }
.sheet .rose-t { fill: var(--ink-magenta); font-family: var(--sans); font-size: 8px; }
.sheet .route { fill: none; stroke: var(--ink-magenta); stroke-width: 1.6; stroke-linecap: round; }
.sheet .route--pipe { stroke-dasharray: 7 3 1.5 3; }
.sheet .mk { cursor: pointer; }
.sheet .mk-hit { fill: transparent; }
.sheet .mk-ring { fill: var(--paper); }
.sheet .mk-label { font-family: var(--sans); font-size: 11px; fill: var(--ink); font-weight: 500; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.sheet .mk-leader { stroke: var(--ink-2); stroke-width: 0.7; }
.sheet .mk.is-dim { opacity: 0.18; }
.sheet .mk:focus { outline: none; }
.sheet .mk:focus .mk-ring, .sheet .mk:hover .mk-ring, .sheet .mk.is-hot .mk-ring { stroke: var(--ink); stroke-width: 1.5; }
.sheet .mk.is-hot .mk-label { font-weight: 600; }
.sheet--mini .mk-label { font-size: 13px; }
.sheet__caption { font-size: var(--fs-xs); color: var(--haze); margin-top: 12px; }

/* ---------- Toolkit ---------- */
.tools { width: 100%; font-size: var(--fs-base); }
.tools thead th { text-align: left; font-size: var(--fs-sm); font-weight: 500; color: var(--haze); padding: 10px 16px 10px 0; border-bottom: 1px solid var(--rule-strong); }
.tools tbody th { text-align: left; font-weight: 600; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tools td { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); color: #cbd8dd; }
.tools td:last-child { color: var(--foam); }
@media (max-width: 760px) {
  .tools thead { display: none; }
  .tools tr { display: grid; grid-template-columns: 1fr; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .tools tbody th, .tools td { border: 0; padding: 2px 0; white-space: normal; }
}

/* ---------- Contact ---------- */
.contact { background: var(--deep); }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.kilo { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.kilo svg { width: 66px; height: 44px; border-radius: 1px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }
.kilo figcaption { font-size: var(--fs-sm); color: var(--haze); max-width: 26ch; line-height: 1.4; }
.kilo figcaption b { color: var(--foam); font-weight: 600; }
.contact__intro .h2 { margin-bottom: 22px; }
.contact__intro > p { color: #cbd8dd; max-width: 48ch; }
.direct { margin-top: 30px; border-top: 1px solid var(--rule); max-width: 34rem; }
.direct > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.direct dt { color: var(--haze); font-size: var(--fs-sm); }
.direct dd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.direct a { font-weight: 500; }
.copy { border: 1px solid var(--rule-strong); background: transparent; border-radius: 999px; font-size: 0.75rem; padding: 3px 11px; cursor: pointer; color: var(--haze); }
.copy:hover { color: var(--foam); border-color: var(--foam); }
.copy.is-done { color: #45d483; border-color: #45d483; }
.contact__files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.composer { background: var(--deep-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(20px, 3vw, 36px); display: grid; gap: 18px; }
.composer__title { font-family: var(--serif); font-size: 1.5rem; }
.field { display: grid; gap: 7px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: var(--fs-sm); color: var(--haze); padding: 0; }
.field input[type="text"], .field input[type="email"], .field input:not([type]), .field textarea {
  width: 100%; background: var(--screen); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 11px 12px; color: var(--foam); font-size: var(--fs-base); line-height: 1.4;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--hivis); box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.2); }
.field input::placeholder, .field textarea::placeholder { color: #5f7884; }
.field--choices { display: flex; flex-wrap: wrap; gap: 8px; }
.field--choices legend { width: 100%; margin-bottom: 7px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 7px 14px; font-size: var(--fs-sm); cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s; user-select: none; }
.choice span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--haze); transition: background-color 0.15s, border-color 0.15s; }
.choice input:checked + span { background: rgba(242, 194, 48, 0.12); border-color: var(--hivis); color: var(--foam); }
.choice input:checked + span::before { background: var(--hivis); border-color: var(--hivis); }
.choice input:focus-visible + span { outline: 2px solid var(--hivis); outline-offset: 2px; }
.composer__note { font-size: var(--fs-xs); color: var(--haze); }
.composer .btn { justify-self: start; }
@media (max-width: 960px) { .contact__grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--abyss); border-top: 1px solid var(--rule); padding: 56px 0 36px; font-size: var(--fs-sm); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 32px 48px; align-items: start; }
.footer__brand { display: flex; gap: 14px; align-items: center; }
.footer__brand .brand__mark { width: 44px; height: 44px; }
.footer__brand p { margin: 2px 0 0; color: var(--haze); }
.footer__nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.footer__nav a { text-decoration: none; color: var(--foam); }
.footer__nav a:hover { color: var(--hivis); }
.hoist { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 26px 0; border-block: 1px solid var(--rule); margin-top: 8px; }
.hoist__flags { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.hoist__flags svg { width: 30px; height: 20px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.hoist__gap { width: 14px; }
.hoist p { margin: 0; color: var(--haze); font-size: var(--fs-xs); }
.hoist p i { font-family: var(--serif); font-size: 1rem; color: var(--foam); }
.footer__legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--haze); font-size: var(--fs-xs); }
.footer__legal a { color: var(--haze); }
.footer__legal a:hover { color: var(--hivis); }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Inner pages ---------- */
.page-head { padding: calc(var(--header-h) + clamp(56px, 9vw, 120px)) 0 clamp(40px, 6vw, 72px); background: var(--abyss); position: relative; overflow: hidden; }
.page-head__bg { position: absolute; inset: 0; opacity: 0.28; pointer-events: none; }
.page-head__bg canvas { width: 100%; height: 100%; }
.page-head::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--abyss) 18%, rgba(6, 20, 30, 0.6) 60%, rgba(6, 20, 30, 0.2)), linear-gradient(0deg, var(--abyss), rgba(6, 20, 30, 0) 50%); pointer-events: none; }
.page-head .wrap { position: relative; z-index: 1; }
.page-title { font-family: var(--serif); font-size: clamp(2.5rem, 1.5rem + 4vw, 4.75rem); line-height: 1; letter-spacing: -0.015em; max-width: 16ch; text-wrap: balance; margin-bottom: 26px; }
.page-head .lead { color: #cbd8dd; }
.crumb { font-size: var(--fs-sm); color: var(--haze); margin-bottom: 22px; display: flex; gap: 10px; }
.crumb a { color: var(--haze); }

/* Shared inner-page bits */
.section--flush { padding-top: 8px; }
.page-head--plain { padding-bottom: 24px; }
.page-head--plain::after, .page-head--chart::after { display: none; }
.cta-band { background: var(--deep); border-top: 1px solid var(--rule); }
.cta-band__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 48px; align-items: end; }
.cta-band__inner .h2 { grid-column: 1; }
.cta-band__inner p { grid-column: 1; color: #cbd8dd; max-width: 52ch; margin: 0; }
.cta-band__inner .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 760px) { .cta-band__inner { grid-template-columns: 1fr; } .cta-band__inner .btn { grid-column: 1; grid-row: auto; justify-self: start; } }

/* Projects page */
.filters { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: flex-start; padding: 20px 0; border-block: 1px solid var(--rule); margin-bottom: 28px; }
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 0; padding: 0; margin: 0; }
.filter-group legend { float: left; font-size: var(--fs-xs); color: var(--haze); margin-right: 6px; padding: 0; }
.chip { border: 1px solid var(--rule-strong); background: transparent; color: var(--foam); border-radius: 999px; padding: 6px 13px; font-size: var(--fs-sm); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background-color 0.15s, border-color 0.15s; }
.chip[aria-pressed="true"] { background: var(--foam); color: var(--abyss); border-color: var(--foam); }
.chip:hover:not([aria-pressed="true"]) { border-color: var(--foam); }
.chip .swatch { width: 10px; height: 10px; border-radius: 50%; }
.filters__count { margin-left: auto; align-self: center; font-size: var(--fs-sm); color: var(--haze); font-variant-numeric: tabular-nums; }
.sheet-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; align-items: start; }
.sheet-key { font-size: var(--fs-sm); display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 20px); }
.sheet-key h3 { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 8px; }
.sheet-key ul { list-style: none; display: grid; gap: 7px; }
.sheet-key li { display: flex; align-items: center; gap: 10px; color: #cbd8dd; }
.sheet-key svg { width: 22px; height: 22px; flex: none; }
.sheet-key p { color: var(--haze); font-size: var(--fs-xs); }
@media (max-width: 1020px) { .sheet-wrap { grid-template-columns: 1fr; } .sheet-key { position: static; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }

.log { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; border-top: 1px solid var(--rule); }
.entry { padding: 26px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 10px; align-content: start; scroll-margin-top: calc(var(--header-h) + 24px); transition: background-color 0.4s; }
.entry[hidden] { display: none; }
.entry.is-flash { background: rgba(242, 194, 48, 0.07); }
.entry__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: var(--fs-xs); color: var(--haze); font-variant-numeric: tabular-nums; }
.entry__where { display: inline-flex; align-items: center; gap: 7px; }
.entry__title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.15; }
.entry__title small { display: block; font-family: var(--sans); font-size: var(--fs-sm); color: var(--haze); font-weight: 400; margin-top: 6px; }
.entry p { color: #cbd8dd; font-size: 0.98rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 0.75rem; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 2px 9px; color: #cbd8dd; }
.tags li.t-sw { border-style: dashed; }
.entry__pin { justify-self: start; border: 0; background: none; padding: 0; color: var(--magenta); font-size: var(--fs-xs); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.entry__pin:hover { color: var(--hivis); }
@media (max-width: 860px) { .log { grid-template-columns: 1fr; } }

.gantt-wrap { margin-top: clamp(56px, 8vw, 96px); }
.gantt-wrap .h3 { margin-bottom: 6px; }
.gantt .seg { cursor: pointer; }
.gantt .seg.is-dim { opacity: 0.18; }
.log-wrap { margin-top: clamp(64px, 9vw, 110px); }
.log-wrap .h2 { margin-bottom: 10px; }
.log-intro { margin-bottom: 26px; font-size: var(--fs-sm); }
.gantt svg { width: 100%; height: auto; overflow: visible; }
.gantt .axis text { fill: var(--haze); font-size: 12px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.gantt .grid line { stroke: rgba(147, 171, 183, 0.16); stroke-width: 1; }
.gantt .baseline { stroke: rgba(147, 171, 183, 0.5); stroke-width: 1; }
.gantt text { font-family: var(--sans); }

/* Experience page */
.page-head__actions { margin-top: 30px; }
.col-title { margin-bottom: 18px; }
.units { list-style: none; display: grid; border-bottom: 1px solid var(--rule-strong); }
.unit { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 clamp(20px, 3.5vw, 48px); }
.unit__litho { position: relative; background-size: 24px 16px; border-inline: 1px solid rgba(232, 240, 241, 0.35); border-top: 1px solid rgba(232, 240, 241, 0.6); min-height: 120px; }
.unit--thick .unit__litho { min-height: 520px; }
.unit__year { position: absolute; top: 8px; left: 8px; background: var(--abyss); color: var(--foam); font-size: 0.75rem; font-weight: 600; padding: 1px 6px; border-radius: 2px; font-variant-numeric: tabular-nums; }
.unit__body { padding: 26px 0 36px; border-top: 1px solid var(--rule); }
.unit__when { font-size: var(--fs-sm); color: var(--haze); font-variant-numeric: tabular-nums; display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.unit__title { font-family: var(--serif); font-size: clamp(1.45rem, 1.2rem + 0.9vw, 2rem); line-height: 1.12; margin-bottom: 6px; }
.unit__org { color: var(--foam); font-weight: 500; margin-bottom: 14px; }
.unit__org .where { color: var(--haze); font-weight: 400; margin-left: 8px; }
.unit__body > p:not(.unit__when):not(.unit__org) { color: #cbd8dd; max-width: 64ch; }
.unit ul { margin: 14px 0 0; padding-left: 1.1em; color: #cbd8dd; max-width: 64ch; display: grid; gap: 6px; }
.unit ul li::marker { color: var(--hivis); }
.unit__more { margin-top: 16px; }
.lens { margin-top: 30px; padding: 18px 20px; border: 1px dashed var(--rule-strong); border-radius: 40px 4px 40px 4px; background: rgba(74, 77, 79, 0.18); max-width: 62ch; }
.lens__title { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 4px; }
.lens p:last-child { color: #cbd8dd; }
.litho { display: inline-block; width: 26px; height: 16px; border: 1px solid var(--rule-strong); background-size: 24px 16px; flex: none; }
.litho--sand { background-color: #8f7a4c; background-image: url("../img/litho-sand.svg"); }
.litho--silt { background-color: #7b7457; background-image: url("../img/litho-silt.svg"); }
.litho--shale { background-color: #4a4d4f; background-image: url("../img/litho-shale.svg"); }
.litho--chalk { background-color: #a9a790; background-image: url("../img/litho-chalk.svg"); }
.litho--mud { background-color: #3f5546; background-image: url("../img/litho-mud.svg"); }
.unit__litho.litho--sand, .unit__litho.litho--silt, .unit__litho.litho--shale, .unit__litho.litho--chalk, .unit__litho.litho--mud { width: auto; height: auto; display: block; border-bottom: 0; }
.legend-litho { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: var(--fs-sm); color: var(--haze); margin-bottom: 26px; }
.legend-litho li { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 720px) {
  .unit { grid-template-columns: 34px minmax(0, 1fr); gap: 0 16px; }
  .unit--thick .unit__litho { min-height: 0; }
  .unit__year { writing-mode: vertical-rl; transform: rotate(180deg); left: 7px; top: 8px; padding: 6px 1px; }
}
.traits-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.traits-grid .h2 { margin-bottom: 30px; }
.ports-title { margin-bottom: 16px; }
@media (max-width: 900px) { .traits-grid { grid-template-columns: 1fr; } }
.certs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cert { border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; display: grid; gap: 6px; align-content: start; background: rgba(15, 42, 61, 0.5); }
.cert__name { font-weight: 600; line-height: 1.35; }
.cert__by { font-size: var(--fs-sm); color: var(--haze); }
.cert__valid { font-size: var(--fs-sm); margin-top: 8px; font-variant-numeric: tabular-nums; }
.validity { height: 4px; background: rgba(147, 171, 183, 0.2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.validity span { display: block; height: 100%; background: #45d483; border-radius: 4px; width: var(--v, 0%); }
.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.traits h3 { font-size: var(--fs-sm); font-weight: 600; color: var(--haze); margin-bottom: 10px; }
.traits ul { list-style: none; display: grid; gap: 6px; }
.ports { font-family: var(--serif); font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.6rem); line-height: 1.45; max-width: 40ch; }
.ports em { font-style: italic; color: var(--haze); }

/* Legal */
.legal h2 { font-family: var(--serif); font-size: 1.6rem; margin: 48px 0 14px; }
.legal h2:first-child { margin-top: 0; }
.legal dl { display: grid; grid-template-columns: 13rem 1fr; gap: 0; border-top: 1px solid var(--rule); max-width: 46rem; }
.legal dl > div { display: contents; }
.legal dt, .legal dd { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.legal dt { color: var(--haze); padding-right: 16px; }
.todo { background: rgba(242, 194, 48, 0.14); color: var(--hivis); padding: 0 5px; border-radius: 2px; font-style: normal; }
@media (max-width: 640px) { .legal dl { grid-template-columns: 1fr; } .legal dt { border-bottom: 0; padding-bottom: 0; } }

/* 404 */
.lost { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: calc(var(--header-h) + 40px) var(--gutter) 60px; background: radial-gradient(ellipse at 50% 40%, var(--deep) 0%, var(--abyss) 70%); }
.lost__rose { width: min(220px, 50vw); margin: 0 auto 28px; }
@media (prefers-reduced-motion: no-preference) { .lost__needle { animation: hunt 6s ease-in-out infinite; transform-origin: 50% 50%; transform-box: view-box; } }
@keyframes hunt { 0%, 100% { transform: rotate(-28deg); } 30% { transform: rotate(34deg); } 55% { transform: rotate(-12deg); } 78% { transform: rotate(52deg); } }
.lost .page-title { margin-inline: auto; }
.lost p { color: #cbd8dd; max-width: 46ch; margin-inline: auto; }
.lost .hero__actions { justify-content: center; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Print */
@media print {
  .site-header, .hero__stage canvas, .hero__hud, .hero__cue, .composer, .filters, .hoist { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { height: auto; }
}
