/* Scuba Nerd public site.
   World: a technical diver's wet notes held in black water. Slates carry the evidence;
   the water carries the words. Inter for words, Fira Code only for measured numbers. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Code";
  src: url("/assets/fonts/fira-code-latin-var.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Water, from the lit surface to the abyss */
  --surface-blue: #0b3a5c;
  --water: #052035;
  --deep: #030f19;
  --abyss: #010509;

  /* Words in the water */
  --text: #e8f5f8;
  --text-2: #aec2cb;
  --text-3: #8398a3;
  --line: rgba(158, 216, 223, 0.14);
  --line-2: rgba(232, 245, 248, 0.28);

  /* Brand, from the logo and favicon */
  --brand: #2470a5;
  --brand-hover: #1c5d8b;
  --glass: #9ed8df;

  /* The slate and its graphite */
  --slate: #e3edef;
  --slate-shade: #d2e0e3;
  --ink: #17222a;
  --ink-2: #394a54;
  --ink-3: #52636d;
  --rule: rgba(23, 34, 42, 0.11);
  --rule-2: rgba(23, 34, 42, 0.24);

  /* Limits: used only when a value crosses one */
  --caution: #e9b44c;
  --danger: #f07a68;
  --caution-ink: #7d5200;
  --danger-ink: #a3261a;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 64px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --slate-paper: radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 58%);
  --pencil: #39474f;
}

@media (max-width: 719px) {
  :root { --header-h: 56px; }
}

/* ---------- Base ---------- */

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--abyss);
  scroll-padding-top: calc(var(--header-h) + 8px);
  scrollbar-color: #28404f var(--abyss);
  scrollbar-gutter: stable;
}
html:not(.rm) { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background:
    linear-gradient(180deg, #04131f 0, #020a12 900px, var(--abyss) 2200px);
  background-color: var(--abyss);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

::selection { background: var(--brand); color: #fff; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--abyss); }
::-webkit-scrollbar-thumb { background: #22394a; border-radius: 8px; border: 3px solid var(--abyss); }

img, svg { display: block; max-width: 100%; }
a { color: var(--glass); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--glass);
  outline-offset: 3px;
}

sub {
  font-size: 0.7em;
  line-height: 0;
  vertical-align: -0.28em;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-variant-ligatures: none;
  letter-spacing: -0.01em;
}

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* Lines in the shared figure symbols. Plain class selectors so the rules reach <use> clones. */
.f-thin { stroke-width: 1; opacity: 0.55; }
.f-dash { stroke-dasharray: 4 4; }

.skip-link {
  position: fixed;
  left: 12px; top: 12px;
  z-index: 300;
  padding: 12px 16px;
  background: var(--slate);
  color: var(--ink);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus { transform: none; }
.skip-link:hover { color: var(--ink); }

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

/* ---------- Type ---------- */

.h2 {
  font-size: clamp(2rem, 1.2rem + 3.6vw, 4rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-transform: uppercase;
  text-wrap: balance;
  margin-bottom: 0.55em;
}
.h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.8em;
}
.lead {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--text);
  max-width: 34em;
  text-wrap: pretty;
}
.section p:not([class]) { color: var(--text-2); max-width: 62ch; text-wrap: pretty; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 48px;
  padding: 0 1.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 600 0.98rem/1 var(--font-sans);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.25s var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.75);
}
.btn--primary:hover { background: var(--brand-hover); color: #fff; }
.btn--ghost {
  background: rgba(1, 5, 9, 0.45);
  border-color: var(--line-2);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--glass); color: var(--text); }
.btn--sm { min-height: 44px; padding: 0 1.05rem; font-size: 0.92rem; }
.btn--lg { min-height: 58px; padding: 0 2rem; font-size: 1.06rem; border-radius: 12px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.icon-btn:hover { border-color: var(--glass); }
.icon-btn svg, .menu-btn svg, .view-toggle svg, .inline-arrow, .logbook__arrow svg, .menu__app svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn--ink { color: var(--ink); border-color: var(--rule-2); }
.icon-btn--ink:hover { border-color: var(--ink); background: rgba(23, 34, 42, 0.06); }
.icon-btn--ink:focus-visible { outline-color: var(--brand); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  /* Above the descent, so Open App is there from the first second after the splash. */
  z-index: 95;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--gutter);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(1, 5, 9, 0.78), rgba(1, 5, 9, 0));
  pointer-events: none;
  transition: background-color 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid::before {
  background: rgba(1, 5, 9, 0.9);
  border-bottom-color: var(--line);
}
.js:not(.seen):not(.deeplink):not(.rm) .site-header:not(.is-in) {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  flex: none;
}
.brand img { height: 40px; width: auto; }
.site-nav { position: relative; margin-left: auto; }
.site-nav ul { display: flex; list-style: none; gap: 2px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--text); }
.site-header__end { position: relative; display: flex; align-items: center; gap: 8px; }
.menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(1, 5, 9, 0.45);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
@media (max-width: 1079px) {
  .site-nav { display: none; }
  .menu-btn { display: inline-flex; }
  .site-header__end { margin-left: auto; }
}
@media (max-width: 719px) {
  .brand img { height: 34px; }
  .menu-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .menu-btn { padding: 0; justify-content: center; }
}

/* ---------- Splash ---------- */

.splash { display: none; }
.js .splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  background: var(--abyss);
  /* Failsafe: if the script never takes over, the splash still leaves. */
  animation: splash-failsafe 0.6s linear 7s forwards;
}
.js.deeplink .splash, .js.booted .splash.is-gone { display: none; }
.splash__logo {
  width: min(62vw, 360px);
  height: auto;
  animation: rise 1.1s var(--ease-out) 0.15s both;
}
.splash__line {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-2);
  animation: rise 1.1s var(--ease-out) 0.5s both;
}
.splash__progress {
  position: absolute;
  left: 50%;
  bottom: max(12vh, 64px);
  width: min(38vw, 200px);
  height: 1px;
  background: rgba(158, 216, 223, 0.16);
  transform: translateX(-50%);
  overflow: hidden;
}
.splash__progress span {
  display: block;
  height: 100%;
  background: var(--glass);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0.04));
  transition: transform 0.45s var(--ease-out);
}
.splash.is-out {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s var(--ease-out), visibility 0s linear 0.7s;
}
.rm .splash__logo, .rm .splash__line { animation-duration: 0.01s; animation-delay: 0s; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; } }

/* ---------- Intro: the descent ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  background: var(--abyss);
  --light: 1;
}
.intro[hidden] { display: none; }
.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #1c6c9c 0%, #0c3b5c 34%, #041726 70%, var(--abyss) 100%);
  opacity: var(--light);
}
.intro__light {
  position: absolute;
  inset: -20% -10% 20%;
  opacity: calc(var(--light) * 0.9);
  background:
    linear-gradient(102deg, transparent 38%, rgba(158, 216, 223, 0.13) 41%, transparent 47%),
    linear-gradient(97deg, transparent 52%, rgba(158, 216, 223, 0.09) 55%, transparent 60%),
    linear-gradient(106deg, transparent 22%, rgba(158, 216, 223, 0.07) 25%, transparent 30%);
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 90%);
  animation: sway 7s var(--ease-in-out) infinite alternate;
}
@keyframes sway { to { transform: translateX(4%) skewX(-2deg); } }
.intro__particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__gauge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(100% - 32px, 560px);
}
.intro__depth {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(4rem, 3rem + 7vw, 7.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--text);
}
.intro__depth .num { letter-spacing: -0.04em; }
.intro__depth .unit { font-size: 0.3em; color: var(--text-2); font-family: var(--font-sans); }
.intro__readout {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 8px 28px;
  font-size: 0.9rem;
}
.intro__readout div { display: grid; gap: 2px; justify-items: center; }
.intro__readout dt { color: var(--text-3); font-size: 0.78rem; }
.intro__readout dd { margin: 0; color: var(--text); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
@media (max-width: 479px) {
  .intro__readout { grid-template-columns: repeat(2, auto); }
}
.intro__skip {
  position: absolute;
  right: var(--gutter);
  bottom: calc(24px + env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(1, 5, 9, 0.4);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
.intro__skip:hover { border-color: var(--glass); }
.intro.is-out { opacity: 0; transition: opacity 0.8s var(--ease-out); pointer-events: none; }

/* ---------- Hero: the slate sphere ---------- */

.hero {
  position: relative;
  --dolly-range: 55svh;
  --card-w: 128px;
  height: calc(100svh + var(--dolly-range));
}
@media (max-width: 1279px) { .hero { --card-w: 122px; } }
@media (max-width: 699px) { .hero { --card-w: 88px; --dolly-range: 42svh; } }
.rm .hero { --dolly-range: 0px; }
.hero__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background:
    radial-gradient(90% 60% at 50% 42%, rgba(11, 58, 92, 0.34), rgba(11, 58, 92, 0) 70%),
    radial-gradient(60% 40% at 50% -10%, rgba(28, 108, 156, 0.35), rgba(28, 108, 156, 0) 70%);
}
.stage {
  position: absolute;
  inset: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.stage.is-dragging { cursor: grabbing; }
.scene {
  position: absolute;
  inset: 0;
  perspective: var(--persp, 1600px);
  perspective-origin: 50% 50%;
  transition: opacity 0.5s var(--ease-out);
}
.hero.is-dimmed .scene { opacity: 0.35; }
.world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.orbit {
  position: absolute;
  left: 0;
  top: 0;
  list-style: none;
  transform-style: preserve-3d;
}
.node {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card-w, 176px);
  transform-origin: 0 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.core {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  max-width: 94vw;
  transform-origin: 0 0;
  text-align: center;
  pointer-events: none;
  will-change: transform;
}
.core__title {
  font-size: var(--title-size, 7rem);
  font-weight: 300;
  line-height: 0.93;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 2px 30px rgba(1, 5, 9, 0.9), 0 1px 3px rgba(1, 5, 9, 0.7);
}
.core__title span { display: block; }
/* The tagline hangs below the title so the title itself sits on the world origin. */
.core__sub {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  white-space: nowrap;
  margin: 0.9em 0 0;
  font-size: var(--sub-size, 1rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--glass);
  text-shadow: 0 1px 12px rgba(1, 5, 9, 0.9);
}

/* Ruling is registered to the writing: each text block carries rules at its own line pitch,
   so the words sit on the lines the way they do on a wet-notes page. */
.slate__title, .gridview__list .slate__sub, .detail__lead, .detail__cols p {
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--lh) - 1px), var(--rule) calc(var(--lh) - 1px) var(--lh));
  line-height: var(--lh);
}
.slate__title { --lh: 17px; }
.gridview__list .slate__sub { --lh: 17px; }
.detail__lead { --lh: 28px; }
.detail__cols p { --lh: 25px; }
.slate__metric--word { font-family: var(--font-sans); letter-spacing: 0; }

/* Pencil marks: one graphite stroke, drawn by hand. */
.ring { position: relative; display: inline-block; margin: 0 0.55em 0 0.6em; }
.ring::after {
  content: "";
  position: absolute;
  inset: -0.52em -0.82em -0.5em -0.9em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M24 4.6C42 2.2 72 2.8 88 8.4s12.5 17.2-3.6 23.1S30 38.4 13 31.1 2.2 12.2 15.8 6.6 31 2.4 38 3' fill='none' stroke='%2339474f' stroke-width='1.5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  pointer-events: none;
}
.slate s {
  text-decoration: none;
  color: var(--ink-3);
  padding: 0 0.08em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 7.6C13 3.2 29 8.8 49 5.1S84 2.3 99 6.2' fill='none' stroke='%2339474f' stroke-width='1.8' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat 0 58% / 100% 0.72em;
}

/* The slate: one pale, torch-lit sheet of wet notes */
.slate {
  position: relative;
  color: var(--ink);
  background-color: var(--slate);
  background-image: var(--slate-paper);
  border-radius: 7px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
/* On the sphere a slate shows its face: figure, title, figure of merit. The grid and the
   detail carry the full text. */
.node .slate__sub { display: none; }
.node .slate__title { font-size: 0.8125rem; }
.node .slate__metric { font-size: 0.6875rem; }
.hero__pin::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: min(34svh, 260px);
  background: linear-gradient(180deg, rgba(1, 5, 9, 0), rgba(1, 5, 9, 0.82) 70%);
  pointer-events: none;
  z-index: 4;
}
.no-js .hero__pin::after { display: none; }
.node .slate { padding: 10px 10px 9px; }
.slate__fig {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.slate__title {
  margin: 7px 0 3px;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.slate__title .inline-arrow { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; stroke-width: 2; }
.slate__sub {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.38;
  color: var(--ink-2);
}
.slate__metric {
  display: inline-block;
  margin: 8px 0 0;
  padding-top: 5px;
  border-top: 1px solid var(--rule-2);
  font-size: 0.75rem;
  color: var(--ink);
}
.slate__open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.slate__open:focus-visible { outline: 2px solid var(--glass); outline-offset: 4px; }
.node.is-back .slate__open { pointer-events: none; }
.node.is-source { visibility: hidden; }

/* Hero controls, above the water */
.hero__hud {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  padding: 0 var(--gutter) calc(26px + env(safe-area-inset-bottom));
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}
.hero__hud > * { pointer-events: auto; }
.hero__lines {
  list-style: none;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-2);
}
.hero__cta { display: flex; gap: 12px; justify-content: center; }
.hero__tools {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.hero__hint { margin: 0; font-size: 0.82rem; color: var(--text-3); }
.view-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(1, 5, 9, 0.5);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
}
.view-toggle:hover { border-color: var(--glass); }
.view-toggle svg { width: 18px; height: 18px; }

.js:not(.seen):not(.deeplink):not(.rm) .hero:not(.is-in) .hero__hud,
.js:not(.seen):not(.deeplink):not(.rm) .hero:not(.is-in) .core { opacity: 0; }
.hero .core, .hero .hero__hud { transition: opacity 1s var(--ease-out); }

@media (max-width: 1099px) {
  .hero__lines { display: none; }
  .hero__hud { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
  .hero__tools { justify-self: center; flex-direction: row; align-items: center; gap: 16px; }
}
@media (max-width: 699px) {
  .hero__hud {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "primary primary" "explore tools";
    gap: 10px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .hero__cta { display: contents; }
  .hero__cta .btn--primary { grid-area: primary; justify-self: stretch; }
  .hero__cta .btn--ghost { grid-area: explore; min-height: 44px; padding: 0 10px; font-size: 0.88rem; font-weight: 500; }
  .hero__tools { grid-area: tools; justify-self: stretch; }
  .hero__tools .view-toggle { width: 100%; font-size: 0.88rem; padding: 0 10px; }
  .hero__hint { display: none; }
  .node .slate { padding: 7px 7px 6px; border-radius: 6px; }
  .node .slate__title { font-size: 0.71875rem; margin-top: 4px; --lh: 14px; }
  .node .slate__metric { font-size: 0.6875rem; margin-top: 4px; padding-top: 3px; letter-spacing: -0.02em; }
  .node .slate__fig { aspect-ratio: 2 / 1; stroke-width: 2; }
}

/* No script: the features as a plain list of slates */
.no-js .hero { height: auto; }
.no-js .hero__pin { position: static; height: auto; overflow: visible; padding: calc(var(--header-h) + 48px) var(--gutter) 48px; }
.no-js .stage, .no-js .scene, .no-js .world, .no-js .orbit, .no-js .core { position: static; transform: none; width: auto; height: auto; }
.no-js .core { max-width: none; margin-bottom: 40px; }
.no-js .core__title { font-size: clamp(3rem, 10vw, 6rem); }
.no-js .orbit { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.no-js .node { position: static; width: auto; }
.no-js .hero__hud { position: static; padding: 32px 0 0; }
.no-js .view-toggle, .no-js .hero__hint { display: none; }

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding-block: clamp(88px, 7rem + 4vw, 176px);
}
.section:focus { outline: none; }

.platform::before {
  content: "";
  position: absolute;
  inset: -140px 0 auto 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(1, 5, 9, 0), var(--abyss));
  pointer-events: none;
}
.platform { background: var(--abyss); }
.platform__lines {
  display: none;
  list-style: none;
  margin-bottom: 64px;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  font-weight: 300;
  line-height: 1.45;
  color: var(--text);
}
@media (max-width: 1099px) { .platform__lines { display: block; } }
/* Every two-part section grid shrinks with the viewport instead of growing to its content. */
.platform__grid, .wizard__grid, .bestmix__grid, .contingency__grid, .lost__cases,
.ccr__grid, .calc__grid, .logbook__grid, .plan__stage { grid-template-columns: minmax(0, 1fr); }
.slate--sheet { min-width: 0; }
.platform__grid { display: grid; gap: 56px; }
@media (min-width: 960px) {
  .platform__grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 80px; }
}
.aims {
  list-style: none;
  margin-top: 8px;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  color: var(--text);
}
.aims li { padding: 10px 0; border-top: 1px solid var(--line); }
.aims li:last-child { border-bottom: 1px solid var(--line); }

/* Sheets: slates inside the long page */
.slate--sheet { padding: 22px 24px 20px; margin: 0; }
.sheet-table caption { caption-side: top; }
.sheet__title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-align: left;
}
.sheet__sub { margin: 18px 0 6px; font-weight: 650; color: var(--ink); font-size: 0.95rem; }
.sheet__note, .sheet__prov {
  margin: 14px 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
}
.sheet-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.sheet-table th, .sheet-table td {
  padding: 8px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.sheet-table thead th {
  padding-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom-color: var(--rule-2);
}
.sheet-table tbody th { font-weight: 600; color: var(--ink); }
.sheet-table small { display: block; font-size: 0.78rem; font-weight: 400; color: var(--ink-3); }
.sheet-list { margin: 0; display: grid; }
.sheet-list div {
  display: grid;
  grid-template-columns: minmax(7.5em, 34%) 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}
.sheet-list dt { font-weight: 600; color: var(--ink); font-size: 0.9rem; }
.sheet-list dd { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(23, 34, 42, 0.08);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  vertical-align: 0.1em;
  white-space: nowrap;
}
.is-warn, .sheet-list .is-warn dd { color: var(--caution-ink); font-weight: 600; }
.is-danger { color: var(--danger-ink); }

.mark { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.mark--tick { width: 22px; height: 22px; stroke-width: 2.2; color: var(--ink); }
.modes td { width: 22%; }
.modes th[scope="row"] { font-size: 0.95rem; }

/* Planning: the scroll-driven profile */
.plan__head { margin-bottom: 40px; }
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-top: 28px;
  max-width: 900px;
}
.cluster li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.875rem;
}
.plan__scroll { position: relative; }
.plan.is-scrolly .plan__scroll { height: 250svh; }
.plan.is-scrolly .plan__sticky {
  position: sticky;
  top: var(--header-h);
  height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
}
.plan__stage { display: grid; gap: 28px; align-items: center; }
@media (min-width: 960px) {
  .plan__stage { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr); gap: 48px; }
}
.plan__figure { margin: 0; min-width: 0; }
.profile { width: 100%; height: auto; overflow: visible; }
.profile__grid path { stroke: rgba(158, 216, 223, 0.09); stroke-width: 1; fill: none; }
.profile__grid text { fill: var(--text-3); font: 11px var(--font-mono); text-anchor: end; }
.profile__grid text[y="298"] { text-anchor: middle; }
.profile__base { fill: none; stroke: rgba(232, 245, 248, 0.26); stroke-width: 1.4; stroke-dasharray: 3 5; }
.profile__done { fill: none; stroke: var(--glass); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.profile__switches path { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
.profile__now circle { fill: var(--glass); }
.profile__now .halo { fill: none; stroke: var(--glass); stroke-width: 1; opacity: 0.4; }
.plan__caption { margin-top: 18px; }
.plan__readout {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text);
}
.plan__readout [data-now="gas"] { color: var(--glass); }
.plan__notes { list-style: none; display: grid; gap: 4px; font-size: 0.9375rem; color: var(--text-2); }
.plan__notes b { color: var(--text); font-weight: 600; margin-right: 6px; }
.plan__notes a { white-space: nowrap; }
.plan.is-scrolly .plan__notes li { opacity: 0.32; transition: opacity 0.35s var(--ease-out); }
.plan.is-scrolly .plan__notes li.is-reached { opacity: 0.75; }
.plan.is-scrolly .plan__notes li.is-current { opacity: 1; }
@media (max-width: 959px) {
  .plan.is-scrolly .plan__notes li { display: none; }
  .plan.is-scrolly .plan__notes li.is-current { display: block; min-height: 3.2em; }
}
.runtime { font-size: 0.875rem; }
.runtime th, .runtime td { padding: 5px 6px; }
.runtime td.tick { width: 28px; padding: 3px 0 0; }
.runtime td.tick::before {
  content: "";
  display: block;
  width: 21px;
  height: 16px;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 15'%3E%3Cpath d='M1.2 9.6c1.6-.4 3.1 1 4.5 3.6.2.4.7.4.9 0C9.2 7.5 12.6 3.6 19 .9' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 15'%3E%3Cpath d='M1.2 9.6c1.6-.4 3.1 1 4.5 3.6.2.4.7.4.9 0C9.2 7.5 12.6 3.6 19 .9' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.4s var(--ease-out);
}
.runtime tr.is-done td.tick::before, .plan:not(.is-scrolly) .runtime td.tick::before { clip-path: inset(0 0 0 0); }
.runtime tr.is-current td { background: rgba(36, 112, 165, 0.12); font-weight: 600; }
@media (max-width: 959px) {
  .plan__slate { padding: 14px 14px 12px; }
  .plan__slate .sheet__prov { display: none; }
  .plan.is-scrolly .plan__slate .sheet__title { margin-bottom: 6px; }
  .runtime { font-size: 0.8125rem; }
  .runtime th, .runtime td { padding: 3px 6px; }
}

/* Smart Wizard */
.wizard__grid { display: grid; gap: 48px; }
@media (min-width: 960px) { .wizard__grid { grid-template-columns: 0.95fr 1.05fr; align-items: center; gap: 80px; } }
.wizard__copy .btn { margin-top: 12px; }
.steps { list-style: none; counter-reset: step; display: grid; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.2em minmax(7.5em, 34%) 1fr 22px;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-3);
}
.steps li::after {
  content: "";
  width: 21px;
  height: 16px;
  align-self: center;
}
.steps li.is-done::after {
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 15'%3E%3Cpath d='M1.2 9.6c1.6-.4 3.1 1 4.5 3.6.2.4.7.4.9 0C9.2 7.5 12.6 3.6 19 .9' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 15'%3E%3Cpath d='M1.2 9.6c1.6-.4 3.1 1 4.5 3.6.2.4.7.4.9 0C9.2 7.5 12.6 3.6 19 .9' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.steps__name { font-weight: 600; color: var(--ink); }
.steps__val { color: var(--ink-2); }
@media (max-width: 559px) {
  .steps li { grid-template-columns: 2.2em 1fr 22px; }
  .steps__val { grid-column: 2; font-size: 0.875rem; }
  .steps li::after { grid-column: 3; grid-row: 1; }
}

/* Best Mix */
.bestmix__head { margin-bottom: 44px; }
.bestmix__grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .bestmix__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 72px; align-items: center; } }
.inputs { margin: 0; display: grid; }
.inputs > div {
  display: grid;
  grid-template-columns: minmax(7em, 36%) 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}
.inputs dt { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.inputs dd { margin: 0; font-size: 0.9375rem; color: var(--ink); }
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.seg button, .seg label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.seg button:hover, .seg label:hover span { border-color: var(--ink); }
.seg button[aria-pressed="true"], .seg input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--slate);
}
.seg button:focus-visible, .seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.result { margin-top: 18px; display: grid; gap: 2px; }
.result__label { margin: 0; font-size: 0.8rem; color: var(--ink-3); font-weight: 600; }
.result__mix {
  position: relative;
  justify-self: start;
  margin: 0;
  padding: 10px 22px 10px 6px;
  font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem);
  line-height: 1;
  color: var(--ink);
}
.mark--ring {
  position: absolute;
  inset: -8px -14px -10px -18px;
  width: calc(100% + 32px);
  height: calc(100% + 18px);
  stroke-width: 1.6;
  color: var(--pencil);
  stroke-dasharray: 520;
  stroke-dashoffset: 0;
  overflow: visible;
}
.result.is-changing .mark--ring { animation: draw 0.9s var(--ease-out) both; }
@keyframes draw { from { stroke-dashoffset: 520; } to { stroke-dashoffset: 0; } }
.result__limit { margin: 6px 0 0; color: var(--ink-2); font-size: 0.9375rem; }
.result__limit b { color: var(--ink); }
.why__list { margin: 0; display: grid; }
.why__list div { padding: 16px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 8.5em 1fr; gap: 16px; }
.why__list div:last-child { border-bottom: 1px solid var(--line); }
.why__list dt { font-weight: 600; color: var(--text); }
.why__list dd { margin: 0; color: var(--text-2); }
.why__list .is-over { color: var(--caution); font-weight: 600; }
.why__list .is-hard { color: var(--danger); font-weight: 600; }
.why__list .is-limit { color: var(--glass); font-weight: 600; }
.why__prov { margin-top: 18px; font-size: 0.875rem; color: var(--text-3); }
@media (max-width: 559px) {
  .why__list div { grid-template-columns: 1fr; gap: 4px; }
  .inputs > div { grid-template-columns: 1fr; gap: 6px; }
}

/* Contingency */
.contingency__head { margin-bottom: 44px; }
.contingency__grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .contingency__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 32px; align-items: start; } }
.lost__table { font-size: 1rem; }
.lost__table thead th { font-size: 0.85rem; color: var(--ink-2); }
.lost__table td { font-size: 1rem; }
.lost__table tbody tr:first-child td { font-size: 1.35rem; color: var(--ink); padding-block: 12px; }
.lost__table caption .tag { margin-left: 8px; }
.lost__cases { display: grid; gap: 24px; }
.case__setup { margin: 0 0 10px; font-size: 0.875rem; color: var(--ink-2); }
.case__quote {
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid currentColor;
  font-size: 0.975rem;
  line-height: 1.5;
}
.contingency__foot { margin-top: 32px; color: var(--text-2); max-width: 70ch; font-size: 0.975rem; }
@media (max-width: 559px) {
  .lost { padding: 16px 14px 14px; }
  .lost__table { font-size: 0.875rem; }
  .lost__table th, .lost__table td { padding: 7px 4px; }
  .lost__table thead th { font-size: 0.75rem; }
  .lost__table tbody th { font-size: 0.8125rem; width: 22%; }
  .lost__table td { font-size: 0.8125rem; }
  .lost__table td.num { white-space: nowrap; }
  .lost__table tbody tr:first-child td { font-size: 0.95rem; }
  .lost__table caption .tag { display: table; margin: 6px 0 0; }
}

/* CCR */
.ccr__grid { display: grid; gap: 48px; }
@media (min-width: 960px) { .ccr__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: 80px; align-items: center; } }
.ccr__not { color: var(--text-3) !important; font-size: 0.95rem; }
.sheet-list .is-struck dt { font-weight: 600; }
.sheet-list .is-struck dd { color: var(--danger-ink); }

/* Calculators */
.calc__head { margin-bottom: 44px; }
.calc__grid { display: grid; gap: 24px; }
@media (min-width: 1024px) { .calc__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr); gap: 32px; align-items: start; } }
.formulas__table td.num { white-space: nowrap; font-size: 0.875rem; color: var(--ink); }
.formulas__table td:last-child { color: var(--ink-2); }
@media (max-width: 719px) {
  .formulas__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .formulas__table tr { display: grid; grid-template-columns: 1fr; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .formulas__table th, .formulas__table td { display: block; border: 0; padding: 1px 0; }
  .formulas__table td.num { white-space: normal; }
}
.dalton__controls { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field legend { font-weight: 600; font-size: 0.9rem; color: var(--ink); padding: 0; }
.field output { font-weight: 500; margin-left: 6px; color: var(--ink-2); }
.field input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--brand); cursor: pointer; }
.dalton__sum {
  display: grid;
  gap: 4px;
  margin: 18px 0 8px;
  padding: 14px 0;
  border-block: 1px solid var(--rule-2);
  font-size: 1rem;
  color: var(--ink-2);
}
.dalton__sum b { font-size: 1.6rem; font-weight: 500; color: var(--ink); }
.dalton__state { margin: 0; font-weight: 600; color: var(--ink); }
.dalton__state.is-over { color: var(--caution-ink); }
.dalton__state.is-hard { color: var(--danger-ink); }

/* Logbook */
.logbook__head { margin-bottom: 44px; }
.logbook__grid { display: grid; gap: 16px; align-items: center; }
@media (min-width: 960px) { .logbook__grid { grid-template-columns: minmax(0, 0.85fr) auto minmax(0, 1.15fr); gap: 24px; } }
.logbook__arrow {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 0.85rem;
}
.logbook__arrow svg { width: 28px; height: 28px; color: var(--glass); }
@media (max-width: 959px) { .logbook__arrow svg { transform: rotate(90deg); } }
.logsheet--log .sheet-list dd s { margin-right: 6px; }
.logsheet--log .pencil { color: var(--ink); font-weight: 600; }

/* Safety */
.claims { list-style: none; margin-top: 16px; }
.claims li { padding: clamp(22px, 3vw, 36px) 0; border-top: 1px solid var(--line); }
.claims li:last-child { border-bottom: 1px solid var(--line); }
.claim {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: clamp(1.4rem, 1rem + 1.7vw, 2.4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.028em;
  text-transform: uppercase;
  color: var(--text);
  text-wrap: balance;
}
.claim__fact { margin: 0; color: var(--text-2); max-width: 60ch; }
.responsibility { margin-top: clamp(56px, 8vw, 96px); display: grid; gap: 20px; }
@media (min-width: 960px) { .responsibility { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; } }
.resp-list { list-style: none; font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem); font-weight: 300; line-height: 1.55; color: var(--text); }

/* Final: surfacing */
.final {
  text-align: center;
  overflow: hidden;
  padding-block: clamp(140px, 10rem + 8vw, 260px);
  /* Still black water: a little light from the surface above, nothing more. */
  background:
    linear-gradient(101deg, transparent 40%, rgba(158, 216, 223, 0.05) 45%, transparent 51%),
    linear-gradient(95deg, transparent 54%, rgba(158, 216, 223, 0.035) 58%, transparent 63%),
    radial-gradient(55% 45% at 50% 0%, rgba(158, 216, 223, 0.1), rgba(158, 216, 223, 0) 70%),
    var(--abyss);
}
.final__inner { display: grid; justify-items: center; gap: 28px; }
.final__title {
  font-size: clamp(2.75rem, 1.5rem + 5.5vw, 6rem);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.final__sub {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--glass);
}

/* Footer */
.site-footer { background: var(--abyss); border-top: 1px solid var(--line); padding: 56px 0 calc(40px + env(safe-area-inset-bottom)); }
.footer__grid { display: grid; gap: 32px; }
@media (min-width: 900px) {
  .footer__grid { grid-template-columns: auto 1fr; grid-template-areas: "brand nav" "brand disclaimer" "copy copy"; column-gap: 64px; }
  .footer__brand { grid-area: brand; }
  .footer__nav { grid-area: nav; }
  .footer__disclaimer { grid-area: disclaimer; }
  .footer__copy { grid-area: copy; }
}
.footer__brand img { width: auto; height: 92px; }
.footer__nav ul { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; }
.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--text-2);
  text-decoration: none;
  border-radius: 8px;
}
.footer__nav a:hover { color: var(--text); }
.footer__nav .footer__app { color: var(--glass); font-weight: 600; padding-left: 0; }
.footer__disclaimer { margin: 0; max-width: 72ch; font-size: 0.95rem; line-height: 1.6; color: var(--text-2); }
.footer__copy { margin: 0; font-size: 0.875rem; color: var(--text-3); }

/* ---------- Dialogs ---------- */

dialog { color: inherit; }
dialog::backdrop { background: transparent; }

/* Full-screen menu */
.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--abyss);
  color: var(--text);
  overflow-y: auto;
}
.menu[open] { animation: fade 0.3s var(--ease-out); }
@keyframes fade { from { opacity: 0; } }
.menu__inner { min-height: 100%; display: flex; flex-direction: column; padding: 0 var(--gutter) calc(28px + env(safe-area-inset-bottom)); }
.menu__bar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.menu__bar img { height: 34px; width: auto; }
.menu__list { list-style: none; margin: 20px 0 28px; }
.menu__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(1.6rem, 1rem + 3vw, 2.6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-decoration: none;
}
.menu__list a:hover { color: var(--glass); }
.menu__app a {
  margin-top: 24px;
  padding: 0 22px;
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 500;
}
.menu__app a:hover { background: var(--brand-hover); color: #fff; }
.menu__app svg { width: 28px; height: 28px; }
.menu__note { margin: auto 0 0; color: var(--text-3); font-size: 0.9rem; }

/* All features: the same slates laid flat */
.gridview {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--abyss);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.gridview[open] { animation: fade 0.35s var(--ease-out); }
.gridview.is-closing { opacity: 0; transition: opacity 0.35s var(--ease-out); }
.gridview__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 10px var(--gutter);
  background: rgba(1, 5, 9, 0.94);
  border-bottom: 1px solid var(--line);
}
.gridview__title { font-size: clamp(1.3rem, 1rem + 1.4vw, 2rem); font-weight: 300; letter-spacing: -0.01em; text-transform: uppercase; }
.gridview__list {
  list-style: none;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px var(--gutter) calc(64px + env(safe-area-inset-bottom));
}
.gridview__list li { display: flex; }
.gridview__list .slate { width: 100%; padding: 14px 14px 12px; }
.gridview__list .slate.is-source { visibility: hidden; }
@media (max-width: 519px) {
  .gridview__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gridview__list .slate { padding: 10px 10px 9px; }
  .gridview__list .slate__sub { font-size: 0.75rem; }
  .view-toggle--back span { font-size: 0.85rem; }
}

/* Feature detail */
.detail {
  position: fixed;
  inset: 0;
  width: min(100% - 24px, 780px);
  max-width: none;
  max-height: calc(100% - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  color: var(--ink);
}
.detail::backdrop { background: rgba(1, 5, 9, 0.66); }
.detail__slate {
  --pad: clamp(18px, 3.5vw, 36px);
  position: relative;
  max-height: calc(100svh - 24px);
  overflow-y: auto;
  padding: var(--pad);
  border-radius: 10px;
  background-color: var(--slate);
  background-image: var(--slate-paper);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95);
  transform-origin: 0 0;
  overscroll-behavior: contain;
}
.detail__top { display: flex; justify-content: space-between; align-items: center; }
.detail__count { margin: 0; font-size: 0.85rem; color: var(--ink-3); }
.detail__fig {
  width: min(100%, 300px);
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 4px 0 14px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail__title {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}
.detail__title .inline-arrow { display: inline-block; width: 0.8em; height: 0.8em; vertical-align: -0.05em; stroke-width: 1.6; }
.detail__lead { margin: 0 0 22px; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink); max-width: 52ch; }
.detail__cols { display: grid; gap: 20px; }
@media (min-width: 640px) { .detail__cols { grid-template-columns: 1fr 1fr; gap: 32px; } }
.detail__cols h3 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 650; color: var(--ink); }
.detail__cols p { margin: 0; color: var(--ink-2); font-size: 0.975rem; }
.detail__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-2);
}
.detail__nav { display: flex; gap: 8px; }
@media (max-width: 639px) {
  /* On phones the action stays in reach while the text scrolls. */
  .detail__foot {
    position: sticky;
    bottom: calc(-1 * var(--pad));
    margin: 22px calc(-1 * var(--pad)) calc(-1 * var(--pad));
    padding: 12px var(--pad) calc(var(--pad) - 4px);
    background: var(--slate);
    box-shadow: 0 -12px 20px -16px rgba(23, 34, 42, 0.5);
  }
  .detail__fig { width: min(100%, 210px); margin-bottom: 8px; }
}
.detail .btn--primary:focus-visible { outline-color: var(--brand); }
.detail__inner-fade { transition: opacity 0.3s var(--ease-out); }

/* ---------- Custom cursor (fine pointers, inside the sphere) ---------- */

.cursor { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; display: none; }
.has-cursor .cursor.is-on { display: block; }
.cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; will-change: transform; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--glass); }
.cursor__ring {
  width: 72px; height: 72px;
  margin: -36px 0 0 -36px;
  display: grid;
  place-items: center;
}
.cursor__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(158, 216, 223, 0.65);
  border-radius: 50%;
  transform: scale(0.56);
  transition: transform 0.25s var(--ease-out), background-color 0.25s;
}
.cursor.is-label .cursor__ring::before { transform: none; background: rgba(1, 5, 9, 0.55); }
.cursor__label { position: relative; }
.cursor__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); opacity: 0; transition: opacity 0.2s; }
.cursor.is-label .cursor__label { opacity: 1; }
.has-cursor .stage, .has-cursor .stage * { cursor: none; }

/* ---------- Not found ---------- */

.lost-page { display: grid; min-height: 100svh; align-items: center; }
.lost-page__main { display: grid; gap: 24px; justify-items: start; padding-block: 64px; }
.lost-page__brand img { height: 96px; width: auto; }
.lost-page__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
