/* Abyss Driller: page layout. The page is one dive: each section's water is the colour
   sampled from the game at that depth, from key-art navy down to abyss black and back to base. */

:root {
  --sea-surface: #001d3b;   /* key-art cavern navy */
  --sea-shallow: #01282d;   /* in-game light pool, teal-black */
  --sea-dark: #010407;      /* outside the light */
  --sea-frost: #0a2631;     /* Frozen Brine slate */
  --sea-base: #052f3b;      /* expedition results panel water */
  --warn: #e5603a;          /* in-game "DEPTH LIMIT EXCEEDED" text */
  --section-pad: clamp(56px, 5.6vw, 80px); /* one break between sections: 160 px at 1440, 112 px on phones */
  --display-s: clamp(28px, 2.8vw, 40px);   /* one size for every small display heading */
}

body { background: var(--sea-dark); }
main > section { position: relative; }
main > section > * { position: relative; z-index: 2; }

/* Section heads sit on the page grid; only the headline is capped. */
.loop__head, .fight__head, .tree__head, .zones__head { max-width: none; }
:is(.loop__head, .fight__head, .tree__head, .zones__head) > .display { max-width: 900px; }
/* Wide screens: the lede sits beside the headline, bottom-aligned with its last line, instead of
   leaving half the width empty. */
@media (min-width: 1200px) {
  .loop__head, .fight__head, .tree__head, .zones__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); column-gap: 56px; align-items: end; }
  :is(.loop__head, .fight__head, .tree__head, .zones__head) > .lede { margin-top: 0; }
}
.lede { margin-top: 20px; }
.display + .lede, .display + .body-copy { margin-top: 22px; }

/* One small display size: step titles, zone names, closing lines, studio name. */
.zone__name, .loop__again {
  font-stretch: 118%;
  font-weight: 800;
  font-size: var(--display-s);
  line-height: 1;
  text-transform: uppercase;
  color: var(--cream);
}

/* ---------------------------------------------------------------- header */
.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--sea-dark);
  background-origin: border-box; /* the transparent-state gradient must not tile into the 1px border */
  background-repeat: no-repeat;
  border-bottom: 1px solid rgb(29 102 112 / 0.5);
  transition: background-color 0.3s var(--ease-water), border-color 0.3s var(--ease-water), transform 0.3s var(--ease-water);
}
.js .top:not(.is-solid) { background-color: transparent; background-image: linear-gradient(180deg, rgb(1 4 7 / 0.72), rgb(1 4 7 / 0)); border-bottom-color: transparent; }
.js .top.is-solid { transition-property: border-color, transform; } /* solid at once, as the hero's words reach it; it fades back on the way up */
.top__in {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto; /* the studio's mark, the menu, the Steam button (the readout floats over the header) */
  align-items: center;
  gap: 28px;
  width: min(var(--max), 100% - 2 * var(--gutter));
  height: 100%;
  margin-inline: auto;
}
/* The studio's mark, on every page and always in view: the site is BaseMen Games'; the game is the page. */
.top__brand { display: block; line-height: 0; }
.top__brand img { width: 146px; height: auto; }
.top__menu { display: none; }
.top__logo { display: block; line-height: 0; transition: opacity 0.3s var(--ease-water), visibility 0.3s; }
.top__logo img { width: 124px; height: auto; }
/* The big logo is the hero's H1; the small one appears (and becomes focusable) once the hero has gone. */
.js .top:not(.is-solid) .top__logo { opacity: 0; visibility: hidden; pointer-events: none; }
.top__readout { justify-self: center; position: relative; }
.top__readout[hidden] { display: none; }
.top__readout.is-exceeded .readout__now { color: var(--warn); }
@media (min-width: 1280px) {
  /* Centred in the free space between the studio's mark (146 px) and the menu with the Steam button (614 px). */
  .top__readout { position: absolute; left: calc(50% - 234px); top: 50%; transform: translate(-50%, -50%); }
}
.top__warn {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--sea-dark);
  color: var(--warn);
  font: 700 12px/1.2 var(--font-hud);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.top__warn[hidden] { display: none; }
.top__nav { display: flex; gap: 26px; justify-self: end; }
.top__nav a {
  color: var(--text);
  text-decoration: none;
  font: 700 13px/1 var(--font-body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.top__nav a:hover { color: var(--info); }
/* Touch screens wide enough for the inline menu: finger-sized links (the look doesn't change). */
@media (min-width: 900px) and (pointer: coarse) { .top__nav a { padding-block: 14px; } }
/* Narrower than 1280 px the header has no room for it beside the studio's mark, the menu and the Steam button. */
@media (max-width: 1279px) { .top__readout { display: none !important; } }
@media (max-width: 899px) {
  :root { --header-h: 56px; }
  .top__in { grid-template-columns: auto 1fr auto; gap: 12px; }
  .top__nav { display: none; }
  .top__logo img { width: 104px; }
  .top__brand img { width: 120px; }
  .top__cta { justify-self: end; }
  /* Phones and tablets: the menu folds behind a button and drops down under the header, full width. */
  .top__in { position: static; }
  .js .top__menu:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    grid-column: 3;
    justify-self: end;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgb(40 201 241 / 0.4);
    background: rgb(1 16 21 / 0.6);
    color: var(--cream);
    font: 700 12px/1 var(--font-hud);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .top__menu-bars {
    width: 16px;
    height: 12px;
    background:
      linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
      linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  }
  .top__menu[aria-expanded="true"] .top__menu-bars { background: linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat; }
  .top__menu:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
  .js .top.is-menu { background-color: var(--sea-dark); background-image: none; border-bottom-color: rgb(29 102 112 / 0.5); }
  .top.is-menu .top__nav {
    display: flex;
    justify-self: stretch; /* full width (the inline menu's justify-self: end would shrink it to its links) */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px var(--gutter) 12px;
    background: var(--sea-dark);
    border-bottom: 1px solid rgb(29 102 112 / 0.5);
  }
  .top.is-menu .top__nav a { display: block; padding: 15px 0; font-size: 15px; border-bottom: 1px solid rgb(40 201 241 / 0.12); }
  .top.is-menu .top__nav a:last-child { border-bottom: 0; }
  /* Phones and tablets: the bottom dock is the persistent CTA, so the header carries only the studio's mark
     and the menu. Once the dock is up, the header slides away as the visitor scrolls on down the page (core.js
     sets head-away) and stays away, even where a Steam button in the page takes the dock's place, until they
     scroll up; it stays while its menu is open or keyboard focus is in it. */
  .js .top__cta { display: none; }
  .head-away .top:not(.is-menu):not(:has(:focus-visible)) { transform: translateY(-100%); }
}

/* ---------------------------------------------------------------- hero (0 m) */
.hero { background: var(--sea-surface); overflow: hidden; }
.hero__art { display: block; line-height: 0; z-index: 0 !important; } /* under its shade at every size (sections lift their children to level 2) */
.hero__art img { width: 100%; height: 100%; object-fit: cover; }
.hero__shade { position: absolute; z-index: 1 !important; pointer-events: none; }
.hero__title { line-height: 0; }
/* The studio presents its game, as on a title screen. The line takes no room (its negative margin cancels its
   own height) and is drawn just above the logo, so the hero under it stays exactly as it was. Phones skip it:
   the studio's mark is right above, in the header, and the poster has no room to spare. */
.hero__presents { margin: 0 0 -1.2em; transform: translateY(calc(-100% - 6px)); font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.16em; text-transform: uppercase; color: rgb(233 228 210 / 0.82); }
@media (max-width: 699px), (max-width: 1279px) and (orientation: portrait) { .hero__presents { display: none; } }
.hero__title img { width: 440px; max-width: 100%; height: auto; }
.hero__genre {
  margin-top: 22px;
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(19px, 1.55vw, 24px);
  line-height: 1.25;
  color: var(--cream);
  max-width: 26em;
}
.hero__pitch { margin-top: 10px; max-width: 33em; color: var(--text); font-size: 17px; line-height: 1.55; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.hero__actions .ghost { min-height: 48px; padding: 0 18px; font-size: 14px; }
.ghost__meta { font-weight: 500; opacity: 0.75; font-stretch: 100%; }
.hero__note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.hero__alt { display: none; }

/* Desktop, and landscape screens from 900 px (small windows, laptops zoomed in, phones held sideways):
   the art fills the hero; the text sits on the dark rock at the left.
   Height follows width so the sub stays right of the text and the ore wall stays in frame. */
@media (min-width: 1024px) and (orientation: landscape), (min-width: 1280px), (min-width: 900px) and (min-aspect-ratio: 4/3) {
  .hero { display: flex; flex-direction: column; min-height: clamp(560px, min(90svh, 52vw), 980px); }
  .hero__art { position: absolute; inset: 0; }
  .hero__art img { object-position: 57% 50%; }
  .hero__shade {
    inset: 0;
    background:
      linear-gradient(0deg, var(--sea-surface) 0%, rgb(0 29 59 / 0) 26%),
      linear-gradient(90deg, rgb(0 8 18 / 0.86) 0%, rgb(0 8 18 / 0.6) 28%, rgb(0 8 18 / 0) 52%),
      linear-gradient(180deg, rgb(1 4 7 / 0.55) 0%, rgb(1 4 7 / 0) 20%);
  }
  .hero__content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: calc(var(--header-h) + 24px) 40px;
  }
}
@media (min-width: 1024px) and (max-width: 1279px) and (orientation: landscape), (min-width: 900px) and (max-width: 1023px) and (min-aspect-ratio: 4/3) {
  .hero__title img { width: 380px; }
  .hero__genre, .hero__pitch { max-width: 40vw; }
  .hero .facts { max-width: 46vw; }
}
/* Narrower than desktop the art is cropped closer: a touch further left keeps the sub clear of the text. */
@media (min-width: 900px) and (max-width: 1023px) and (min-aspect-ratio: 4/3) { .hero__art img { object-position: 54% 50%; } }
/* Screens 700-1023 px wide held sideways but squarer than 4:3: the panorama sits above the text so nothing
   overlaps the sub; its foot fades into the page under the logo. (Held upright they get the poster, below.) */
@media (min-width: 700px) and (max-width: 899px) and (orientation: landscape), (min-width: 900px) and (max-width: 1023px) and (max-aspect-ratio: 1333/1000) and (orientation: landscape) {
  .hero__art { position: relative; aspect-ratio: 21 / 9; }
  .hero__art img { object-position: 56% 50%; }
  .hero__shade { inset: 0 0 auto 0; aspect-ratio: 21 / 9; background: linear-gradient(0deg, var(--sea-surface) 0%, rgb(0 29 59 / 0) 30%), linear-gradient(180deg, rgb(1 4 7 / 0.6) 0%, rgb(1 4 7 / 0) 24%); }
  .hero__content { margin-top: -40px; padding-bottom: 48px; }
  .hero__title img { width: 380px; }
}

/* HUD label/value fact pairs */
.facts { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 26px 0 0; padding-top: 16px; border-top: 1px solid rgb(40 201 241 / 0.22); }
.facts__pair { margin: 0; }
.facts__pair[hidden] { display: none; }
.facts__pair[data-pending] { visibility: hidden; }
.facts dt { font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--info); }
.facts dd { margin: 4px 0 0; font-weight: 600; font-size: 15px; color: var(--cream); font-variant-numeric: tabular-nums; }
.hero .facts { max-width: 560px; }

/* Phones, and tablets held upright: a game poster. The first screen is the key art, full bleed behind everything: the logo on the dark
   water at the top, the whole sub and its beam into the gold ore in the middle, and at the foot, over the
   art's own navy, the hook, the Steam button where the thumb is and the trailer. The pitch and the facts
   follow under the poster, and the sub breathes out a slow stream of bubbles (hero-words.js).
   Lengths come from the square crop (master x 1640-2880), drawn --art px square; in crop px the sub runs
   x 320-940 (propeller to drill tip), its top is y 531 (0.428 of the crop) and the lit ore ends near y 1080
   (0.871).
   --poster  the first screen (100svh: the screen with the browser's bars showing, so it never jumps).
   --art     as big as the screen's height allows with the ore ending just above the hook, and never so big
             that the window across the crop gets narrower than 870 crop px (142.5vw), which keeps the
             propeller and the ore in frame. The window ends at the crop's right edge while it is wide,
             otherwise it starts at crop x 250 (0.2016 of the crop), so the propeller keeps its margin.
   --logo-w  the logo, as wide as the water above the sub allows (0.4234 is its height over its width).
   --below   what sits under the hook, which is pinned to the poster's foot: the gap (16), the Steam button
             (56), a gap (6), the trailer link (44) and --foot. The Steam button so ends 84 px above the
             screen's foot, clear of the dock's 72 px, and the dock stays down while it shows. */
@media (max-width: 699px), (max-width: 1279px) and (orientation: portrait) {
  .hero {
    --poster: max(100svh, 470px);
    --foot: calc(34px + env(safe-area-inset-bottom, 0px));
    --below: calc(16px + 56px + 6px + 44px + var(--foot));
    --hook: 68px; /* the hook's three lines */
    /* The ore's end lands just above the hook; on short screens the art is capped by the room left for the
       sub above the hook (its keel is at 0.629 of the crop), so nothing ever sits on the sub. */
    --art: max(100vw, min(142.5vw, max((var(--poster) - var(--below) - var(--hook) - 10px) / 0.871, min(474px, (var(--poster) - var(--below) - var(--hook) - 8px) / 0.629))));
    /* Tall screens: the art can't grow any taller without losing the propeller or the ore, so it comes down
       to sit just above the hook instead of leaving a band of navy under it. */
    --top: max(0px, var(--poster) - var(--below) - var(--hook) - 10px - 0.871 * var(--art));
    --logo-w: min(300px, 78vw, (var(--top) + 0.428 * var(--art) - var(--header-h) - 36px) / 0.4234);
  }
  .hero__art { position: absolute; inset: var(--top) 0 auto 0; height: var(--art); overflow: hidden; }
  .hero__art img { width: var(--art); height: var(--art); max-width: none; margin-left: min(0px, max(100% - 0.904 * var(--art), -0.2016 * var(--art))); }
  /* The foot fades into the page; the top darkens under the header (and over the cave ceiling), and when the
     art has come down it also fades into the navy above it. */
  .hero__shade { inset: var(--top) 0 auto 0; height: var(--art); background: linear-gradient(0deg, var(--sea-surface) 0, rgb(0 29 59 / 0) 80px), linear-gradient(180deg, var(--sea-surface) 0, rgb(0 29 59 / 0) min(90px, 3 * var(--top))), linear-gradient(180deg, rgb(1 4 7 / 0.8) 0, rgb(1 4 7 / 0.35) 56px, rgb(1 4 7 / 0) 120px); }
  .hero__content { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--poster) auto auto auto; padding-bottom: 40px; }
  /* The poster's parts share its row: the logo hangs from the top (a little nearer the header than the
     sub), the hook and the buttons stand on the foot. */
  .hero__title { grid-area: 1 / 1; align-self: start; justify-self: center; margin-top: calc(var(--header-h) + 0.4 * (var(--top) + 0.428 * var(--art) - var(--header-h) - 0.4234 * var(--logo-w))); }
  .hero__title img { width: var(--logo-w); }
  /* Held above the buttons by an offset rather than a margin, so a reader's own paragraph spacing can't drop it
     onto them. */
  .hero__genre { position: relative; bottom: var(--below); grid-area: 1 / 1; align-self: end; justify-self: center; margin: 0; max-width: 22em; text-align: center; text-wrap: balance; font-size: 18px; }
  /* The scrim: the art's navy, rising behind the hook from the poster's foot and fading out just above its
     first line, however many lines it takes, so the ore glows right down to the words. */
  .hero__genre::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: calc(50% - 50vw);
    right: calc(50% - 50vw);
    top: -64px;
    bottom: calc(-1 * var(--below));
    background: linear-gradient(180deg, rgb(0 29 59 / 0) 0, rgb(0 29 59 / 0.22) 18px, rgb(0 29 59 / 0.55) 38px, rgb(0 29 59 / 0.8) 58px, rgb(0 29 59 / 0.9) 90px, var(--sea-surface) 150px);
    pointer-events: none;
  }
  .hero__actions { grid-area: 1 / 1; align-self: end; justify-self: center; display: grid; gap: 6px; width: min(100%, 440px); margin: 0 0 var(--foot); }
  .hero__actions .cta { width: 100%; }
  /* The trailer comes second: a link whose play key is the ghost button's chamfered keyline, shrunk to a
     square. */
  .hero__actions .ghost { justify-self: center; gap: 10px; min-height: 44px; padding: 0 6px 0 0; font-size: 13px; }
  .hero__actions .ghost::before, .hero__actions .ghost::after { --c: 4px; inset: auto; left: 0; top: calc(50% - 14px); width: 28px; height: 28px; }
  .hero__actions .ghost::after { left: 1px; top: calc(50% - 13px); width: 26px; height: 26px; }
  .hero__actions .ghost svg { width: 10px; height: 10px; margin: 0 9px; color: var(--info); }
  .hero__note { display: none; } /* the Steam button says enough here; the calendar link is in the closing section */
  .hero__pitch { grid-area: 3 / 1; margin-top: 14px; font-size: 16px; }
  .hero .facts { grid-area: 4 / 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 18px; margin-top: 20px; padding-top: 14px; }
  .hero .facts dd { font-size: 14px; text-wrap: pretty; }
  .hero .facts__pair--wide { display: none; }
  .hero__alt { display: inline; }
}
/* Tablets held upright (700-1279 px): the same poster, scaled for the bigger screen. The art is held to 112% of
   the width (the key art is 1240 px tall at most, so it stays sharp enough) and comes down to sit above the hook
   on tall screens; the logo is up to 440 px (the 880 px file at 2x); the hook is bigger; the words under the
   poster are centred. */
@media (min-width: 700px) and (max-width: 1279px) and (orientation: portrait) {
  .hero {
    --hook: 64px;
    --art: max(100vw, min(112vw, (var(--poster) - var(--below) - var(--hook) - 10px) / 0.871));
    --logo-w: min(440px, 56vw, (var(--top) + 0.428 * var(--art) - var(--header-h) - 36px) / 0.4234);
  }
  .hero__genre { font-size: 22px; max-width: 26em; }
  .hero__pitch { max-width: 36em; margin-inline: auto; text-align: center; font-size: 18px; }
  .hero .facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 48px; width: min(100%, 720px); margin-inline: auto; } /* evenly spaced, with or without the countdown */
}
/* 600-699 px wide (an iPad's Split View, a phone held sideways): the facts in one evenly spaced row too, with or
   without the countdown, left-aligned like the words above them (the three-column grid would strand the last). */
@media (min-width: 600px) and (max-width: 699px) { .hero .facts { display: flex; flex-wrap: wrap; gap: 12px 48px; } }
/* Narrower than 360 px the hook takes four lines: the art makes room for it rather than the poster growing. */
@media (max-width: 359px) { .hero { --hook: 90px; } }
/* ...and the facts take two rows there, so the platforms fit on one line. */
@media (max-width: 359px) { .hero .facts { grid-template-columns: auto minmax(0, 1fr); row-gap: 12px; } }
/* Short screens (an iPhone SE): the art is capped so the sub stays clear of the hook (the lit ore then sits
   behind the words), and the scrim starts nearer the words, so more of the beam shows above them. */
@media (max-width: 699px) and (max-height: 600px) { .hero__genre::before { top: -40px; } }
/* With the dock down nothing can hide under it, so keyboard focus never scrolls the page for it. */
@media (max-width: 699px) { html:not(.dock-on) { scroll-padding-bottom: 0; } }
/* A small phone held sideways: the whole crop across the screen, raised so the whole sub is on the first
   screen above the dock (its keel is at 0.629 of the crop), but never so far that the logo on the water above
   it gets narrower than 160 px (on the shortest screens the dock then covers the sub's keel); the poster is
   as tall as it needs to be (it scrolls; the dock carries the Steam button meanwhile). */
@media (max-width: 699px) and (min-aspect-ratio: 1/1) {
  .hero {
    --art: 100vw;
    --top: min(0px, max(100svh - 84px - env(safe-area-inset-bottom, 0px) - 0.629 * var(--art), var(--header-h) + 36px + 0.4234 * 160px - 0.428 * var(--art)));
    --poster: calc(0.871 * 100vw + 234px + env(safe-area-inset-bottom, 0px) + var(--top));
  }
}

/* ---------------------------------------------------------------- hero light (hero-light.js)
   The visitor steers the drill's light. Nothing is laid over the art: the script listens on the hero.
   The light's two layers are made on first use and hidden (display: none) once it is home, so the
   resting hero is the untouched art.
   .hl--delit  the painted cone's water with its light taken out (an image patch, normal blending)
   .hl--lit    the live beam, the motes it lights, the ore's glow and the glints (screen blending)
   Lengths are key-art pixels (the 3840 x 1240 master) times --u, the CSS px per art pixel; the light
   turns about the drill tip, art px (2566, 748). */
/* A mouse or pen is over the art the light answers to (only their hover sets .hl-aim, so this works on
   a tablet with a trackpad too): the spotlight's crosshair. */
.hero.hl-aim .hero__content, .hero.hl-aim .hero__art img { cursor: crosshair; }
.hero > .hl[hidden] { display: none; }
@media print { .hero > .hl { display: none !important; } }

.hero > .hl {
  --ax: 2566;
  --ay: 748;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  contain: layout paint style;
}
/* The art's own level: over it, under the shade and the text. */
.hero > .hl { z-index: 0; }
.hl--lit { mix-blend-mode: screen; }

.hl__stage { position: absolute; left: 0; top: 0; width: calc(3840 * var(--u)); height: calc(1240 * var(--u)); }
.hl__stage > *, .hl__arm > *, .hl__window > * { position: absolute; display: block; }

/* The patch sits exactly on the painted cone (art px 2396,560 to 3084,1144). */
.hl__patch { left: calc(2396 * var(--u)); top: calc(560 * var(--u)); width: calc(688 * var(--u)); height: calc(584 * var(--u)); max-width: none; opacity: 0; }

/* The arm turns about the drill tip. Everything on it is drawn pointing straight right and the script
   turns the arm, so steering is a transform: nothing is repainted while the light moves. */
.hl__arm { left: 0; top: 0; width: 100%; height: 100%; transform-origin: calc(var(--ax) * var(--u)) calc(var(--ay) * var(--u)); }
.hl--lit.is-live .hl__arm, .hl--lit.is-live .hl__motes, .hl--lit.is-live .hl__ore { will-change: transform; }

/* Boxes on the arm start 60 art px behind the tip, so the tip is at (60, half the height). */
.hl__cone, .hl__window { left: calc((var(--ax) - 60) * var(--u)); top: calc((var(--ay) - var(--h) / 2) * var(--u)); width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); --at: calc(60 * var(--u)) calc(var(--h) / 2 * var(--u)); }

/* The beam: the spotlight section's cone (a conic-gradient wedge, faded with distance by a radial mask),
   in the drill light's cyan: pale at the tip, deep teal where it dies out. */
.hl__cone {
  --w: 900;
  --h: 1040;
  background: radial-gradient(circle at var(--at), #d2f8ff 0, #86ebf9 calc(50 * var(--u)), #36cfec calc(150 * var(--u)), #10a5cb calc(320 * var(--u)), #067a9e calc(520 * var(--u)), #044f6c calc(800 * var(--u)));
  -webkit-mask-image:
    conic-gradient(from 60deg at var(--at), transparent 0deg, rgb(0 0 0 / 0.22) 6deg, rgb(0 0 0 / 0.68) 10deg, #000 14deg 46deg, rgb(0 0 0 / 0.68) 50deg, rgb(0 0 0 / 0.22) 54deg, transparent 60deg),
    radial-gradient(circle at var(--at), transparent calc(12 * var(--u)), #000 calc(46 * var(--u)), #000 calc(170 * var(--u)), rgb(0 0 0 / 0.7) calc(300 * var(--u)), rgb(0 0 0 / 0.4) calc(450 * var(--u)), rgb(0 0 0 / 0.15) calc(620 * var(--u)), transparent calc(800 * var(--u)));
  -webkit-mask-composite: source-in;
  mask-image:
    conic-gradient(from 60deg at var(--at), transparent 0deg, rgb(0 0 0 / 0.22) 6deg, rgb(0 0 0 / 0.68) 10deg, #000 14deg 46deg, rgb(0 0 0 / 0.68) 50deg, rgb(0 0 0 / 0.22) 54deg, transparent 60deg),
    radial-gradient(circle at var(--at), transparent calc(12 * var(--u)), #000 calc(46 * var(--u)), #000 calc(170 * var(--u)), rgb(0 0 0 / 0.7) calc(300 * var(--u)), rgb(0 0 0 / 0.4) calc(450 * var(--u)), rgb(0 0 0 / 0.15) calc(620 * var(--u)), transparent calc(800 * var(--u)));
  mask-composite: intersect;
  opacity: 0;
}

/* Windows: beam-shaped masks that turn with the arm. What they show is turned back by the same angle, so
   it stays put in the art and the light sweeps across it. */
.hl__window {
  -webkit-mask-image: conic-gradient(from calc(90deg - var(--wa)) at var(--at), transparent 0deg, rgb(0 0 0 / 0.5) calc(var(--wa) * 0.25), #000 calc(var(--wa) * 0.5) calc(var(--wa) * 1.5), rgb(0 0 0 / 0.5) calc(var(--wa) * 1.75), transparent calc(var(--wa) * 2)), var(--reach);
  -webkit-mask-composite: source-in;
  mask-image: conic-gradient(from calc(90deg - var(--wa)) at var(--at), transparent 0deg, rgb(0 0 0 / 0.5) calc(var(--wa) * 0.25), #000 calc(var(--wa) * 0.5) calc(var(--wa) * 1.5), rgb(0 0 0 / 0.5) calc(var(--wa) * 1.75), transparent calc(var(--wa) * 2)), var(--reach);
  mask-composite: intersect;
  opacity: 0;
}
/* Motes in the water, lit only inside the beam: a fixed field of pixel specks like the art's own. */
.hl__window--motes { --w: 900; --h: 1040; --wa: 30deg; --reach: radial-gradient(circle at var(--at), transparent calc(40 * var(--u)), #000 calc(110 * var(--u)), #000 calc(300 * var(--u)), rgb(0 0 0 / 0.55) calc(470 * var(--u)), transparent calc(700 * var(--u))); }
/* World box: art px 2500,0 900x1240. */
.hl__motes {
  left: calc((2560 - var(--ax)) * var(--u));
  top: calc((520 - var(--ay)) * var(--u));
  width: calc(900 * var(--u));
  height: calc(1240 * var(--u));
  transform-origin: calc((var(--ax) - 2500) * var(--u)) calc(var(--ay) * var(--u));
  background:
    url(/assets/img/hero-light/dust.png) 0 0 / calc(384 * var(--u)) repeat,
    url(/assets/img/hero-light/dust.png) calc(150 * var(--u)) calc(90 * var(--u)) / calc(268 * var(--u)) repeat;
  image-rendering: pixelated;
}
/* Ore catching the light: the ore's own glow, baked from the art (ore.webp), through a longer window so
   the whole ore wall can be reached. */
.hl__window--ore { --w: 1080; --h: 1300; --wa: 28deg; --reach: radial-gradient(circle at var(--at), transparent calc(110 * var(--u)), #000 calc(220 * var(--u)), #000 calc(740 * var(--u)), transparent calc(1010 * var(--u))); }
/* World box: art px 2200,0 1200x1240. */
.hl__ore {
  left: calc((2260 - var(--ax)) * var(--u));
  top: calc((650 - var(--ay)) * var(--u));
  width: calc(1200 * var(--u));
  height: calc(1240 * var(--u));
  max-width: none;
  transform-origin: calc((var(--ax) - 2200) * var(--u)) calc(var(--ay) * var(--u));
}

/* The lamp: a small glow at the drill tip while the light is being steered. */
.hl__lamp {
  left: calc((var(--ax) - 80) * var(--u)); top: calc((var(--ay) - 80) * var(--u)); width: calc(160 * var(--u)); height: calc(160 * var(--u));
  background: radial-gradient(closest-side, rgb(214 251 255 / 0.62), rgb(90 216 242 / 0.22) 45%, transparent);
  opacity: 0;
}

/* Glints: the four-point pixel star, on a crystal facet, one art pixel (--p, whole device pixels) per
   square. They pop in steps when the beam reaches their crystal and fade when it moves on. */
.hl__spark {
  left: calc(var(--x) * var(--u) - 3.5 * var(--p));
  top: calc(var(--y) * var(--u) - 3.5 * var(--p));
  width: calc(7 * var(--p));
  height: calc(7 * var(--p));
  background:
    linear-gradient(#fffaf0, #fffaf0) 50% 50% / var(--p) var(--p) no-repeat,
    linear-gradient(#ffe2a0, #ffe2a0) 50% 50% / var(--p) calc(5 * var(--p)) no-repeat,
    linear-gradient(#ffe2a0, #ffe2a0) 50% 50% / calc(5 * var(--p)) var(--p) no-repeat,
    linear-gradient(rgb(255 178 64 / 0.75), rgb(255 178 64 / 0.75)) 50% 50% / var(--p) calc(7 * var(--p)) no-repeat,
    linear-gradient(rgb(255 178 64 / 0.75), rgb(255 178 64 / 0.75)) 50% 50% / calc(7 * var(--p)) var(--p) no-repeat;
  opacity: 0;
  transform: scale(0.43);
  transition: opacity 0.42s cubic-bezier(0.3, 0.6, 0.2, 1), transform 0.42s steps(3, end);
}
.hl__spark.is-lit { opacity: 1; transform: none; animation: hl-pop 0.5s steps(4, end); transition-duration: 0.18s; }
@keyframes hl-pop { 0% { transform: scale(0.43); opacity: 0.4; } 45% { transform: scale(1.29); opacity: 1; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hl__spark, .hl__spark.is-lit { animation: none; transform: none; transition: opacity 0.3s linear; }
}
/* The red combat spotlight (lent to "your spotlight" by hero-words.js): the same beam in the fight's red. */
.hl--lit.is-red .hl__cone { background: radial-gradient(circle at var(--at), #ffe1d8 0, #ff9a7a calc(50 * var(--u)), #f0532e calc(150 * var(--u)), #c42a14 calc(320 * var(--u)), #861a0c calc(520 * var(--u)), #420c06 calc(800 * var(--u))); }
.hl--lit.is-red .hl__lamp { background: radial-gradient(closest-side, rgb(255 222 210 / 0.62), rgb(240 83 46 / 0.22) 45%, transparent); }
.hl--lit.is-red .hl__motes { filter: hue-rotate(180deg) saturate(1.4); }

/* ---------------------------------------------------------------- hero words (hero-words.js)
   The hero's words act out the game on hover. Nothing here applies at rest: the highlights exist only
   while a phrase answers, and the layers are made on first use and hidden (display: none) again after. */
/* The phrase's colour, in two steps. Custom highlights paint the glyphs only: nothing can move. */
::highlight(hw-light-1) { color: #b5e7f1; }
::highlight(hw-light-2) { color: #9fe8ff; } /* the drill light's pale tip */
::highlight(hw-ore-1) { color: #fde4a4; }
::highlight(hw-ore-2) { color: #ffc747; }   /* amber ore */
::highlight(hw-red-1) { color: #ffd6c8; }
::highlight(hw-red-2) { color: #ff9a7a; }   /* the combat spotlight */

.hero > .hw { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 3; overflow: hidden; pointer-events: none; -webkit-user-select: none; user-select: none; contain: layout paint style; }
.hero > .hw[hidden] { display: none; }
.hw > *, .hw i { position: absolute; display: block; }
.hw.is-off { opacity: 0; transition: opacity 0.22s linear; }

/* Bubbles from the sub's propeller, rising past the logo and the copy, as the trail in the key art does:
   a ring one art pixel (--p) thick with a highlight pixel. Over the shade but under the text, so the letters
   stay on top. */
.hero > .hw--bubbles { z-index: 1; }
.hw__bub { border-radius: 50%; background: rgb(40 120 190 / 0.16); box-shadow: inset 0 0 0 var(--p) rgb(70 182 236 / 0.85), 0 0 calc(2 * var(--p)) rgb(70 182 236 / 0.25); opacity: 0; }
.hw__bub::after { content: ""; position: absolute; right: 22%; top: 18%; width: var(--p); height: var(--p); background: #e8f8ff; }
.hw--bubbles.is-on .hw__bub { animation: hw-bub var(--t) cubic-bezier(0.3, 0.5, 0.4, 1) var(--d) both; }
@keyframes hw-bub {
  0% { opacity: 0; transform: translate(0, 0) scale(0.55); }
  10% { opacity: 1; }
  50% { transform: translate(calc(var(--dx) * 0.45 + var(--wx)), calc(var(--dy) * 0.5)) scale(0.9); }
  78% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.06); }
}

/* Glints in free space beside the words (never on a letter): the drill light's four-point star, one pixel
   step (--p) per square, popping in and closing again. */
.hw__star {
  width: calc(7 * var(--p));
  height: calc(7 * var(--p));
  background:
    linear-gradient(#fffaf0, #fffaf0) 50% 50% / var(--p) var(--p) no-repeat,
    linear-gradient(#ffe2a0, #ffe2a0) 50% 50% / var(--p) calc(5 * var(--p)) no-repeat,
    linear-gradient(#ffe2a0, #ffe2a0) 50% 50% / calc(5 * var(--p)) var(--p) no-repeat,
    linear-gradient(rgb(255 178 64 / 0.75), rgb(255 178 64 / 0.75)) 50% 50% / var(--p) calc(7 * var(--p)) no-repeat,
    linear-gradient(rgb(255 178 64 / 0.75), rgb(255 178 64 / 0.75)) 50% 50% / calc(7 * var(--p)) var(--p) no-repeat;
  opacity: 0;
  transform: scale(0.43);
}
.hw--text.is-on .hw__star { animation: hw-star 0.95s steps(6, end) both; }
@keyframes hw-star { 0% { opacity: 0; transform: scale(0.43); } 18% { opacity: 1; transform: scale(1.29); } 36% { opacity: 1; transform: none; } 72% { opacity: 1; transform: scale(0.86); } 100% { opacity: 0; transform: scale(0.43); } }

/* A node of the upgrade schematic, bought just after the words: the wire draws in from the line's end in
   pixel steps, the node pops in and lights up (framed square, orange corner bolts, as in the game). */
.hw__wire { height: 2px; background: #1dafe4; transform-origin: 0 50%; transform: scaleX(0); }
.hw__node {
  width: 9px;
  height: 9px;
  margin: -4px 0 0;
  background:
    linear-gradient(#e08a2e, #e08a2e) 0 0 / 1px 1px no-repeat,
    linear-gradient(#e08a2e, #e08a2e) 100% 0 / 1px 1px no-repeat,
    linear-gradient(#e08a2e, #e08a2e) 0 100% / 1px 1px no-repeat,
    linear-gradient(#e08a2e, #e08a2e) 100% 100% / 1px 1px no-repeat,
    linear-gradient(#5fe3dc, #5fe3dc) 50% 50% / 3px 3px no-repeat,
    #03173d;
  box-shadow: inset 0 0 0 1px #a7b6bc;
  transform: scale(0);
}
.hw--tree.is-on .hw__wire { animation: hw-wire 0.3s steps(6, end) 0.05s both; }
.hw--tree.is-on .hw__node { animation: hw-node 0.24s steps(3, end) 0.32s both, hw-lit 0.9s steps(4, end) 0.44s both; }
@keyframes hw-wire { to { transform: none; } }
@keyframes hw-node { 0% { transform: scale(0); } 60% { transform: scale(1.34); } 100% { transform: none; } }
@keyframes hw-lit { 0% { box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px rgb(0 240 255 / 0.6); } 100% { box-shadow: inset 0 0 0 1px #a7b6bc, 0 0 0 1px rgb(0 240 255 / 0); } }

/* The spiny fish (the game's own sprite) in the dark water ahead of the drill: it creeps in, the red
   spotlight catches it, it flinches and backs off into the dark. It sits over the de-lit water and under
   the beam, so the light's own glow is what shows it. */
.hero > .hw--fish { z-index: 0; overflow: visible; contain: layout style; } /* it backs off out of its own box (the hero clips) */
.hw__fish { inset: 0; background: url(/assets/img/hero-light/fish.webp) 0 0 / 100% 100% no-repeat; opacity: 0; transform: scaleX(-1); }
.hw--fish.is-on .hw__fish { animation: hw-fish 1.6s cubic-bezier(0.3, 0.1, 0.3, 1) both; }
@keyframes hw-fish {
  0% { opacity: 0; transform: scaleX(-1) translateX(-12%); filter: brightness(1); }
  26% { opacity: 1; transform: scaleX(-1) translateX(0); filter: brightness(1.7); }
  34% { opacity: 1; transform: scaleX(-1) translate(4%, -3%) rotate(-5deg); filter: brightness(1.9); }
  44% { opacity: 1; transform: scaleX(-1); filter: brightness(1.5); }
  100% { opacity: 0; transform: scaleX(-1) translate(-55%, -22%); filter: brightness(1); }
}

/* "dive deeper": the depth readout dives past its limit and warns. Painted over the reading (descent.js
   keeps owning the text), in the same box, font and alignment. */
.top__readout.hw-dive .readout__now { position: relative; color: transparent; }
.top__readout.hw-dive .readout__now::after { content: attr(data-hw); position: absolute; inset: 0; color: var(--text); }
.top__readout.hw-dive.hw-over .readout__now::after { color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  .hw--tree.is-on .hw__wire, .hw--tree.is-on .hw__node { animation: hw-fade 0.24s linear both; transform: none; }
  .hw--fish.is-on .hw__fish { animation: hw-fish-calm 1.6s linear both; animation-duration: 1.6s !important; } /* a fade only: it must outlast base.css's reduced-motion rule, or the fish never shows */
  @keyframes hw-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes hw-fish-calm { 0% { opacity: 0; } 25% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
}
@media print { .hero > .hw { display: none !important; } }

/* ---------------------------------------------------------------- clip box: a clip and its caption bar */
.clipbox { margin: 0; }
.clipbar { display: flex; align-items: center; gap: 12px; min-height: 42px; padding-top: 6px; }
/* Captions carry the HUD capitals in their text, so metres stay a lowercase "m" (never "M"). */
.clipbar__cap { flex: 1; min-width: 0; font: 700 12px/1.3 var(--font-hud); letter-spacing: 0.04em; color: var(--info); font-variant-numeric: tabular-nums; text-wrap: balance; }

/* ---------------------------------------------------------------- the loop: chapter console
   Without JS: four chapters stacked, each with its own clip. With JS: the list becomes the chapter
   rail and one stage plays the active chapter. Chapters advance on their own (each bar fills as its
   clip plays) until the visitor holds one; hover previews on desktop. */
.loop {
  padding-block: var(--section-pad);
  background: linear-gradient(180deg, #01223a 0%, var(--sea-shallow) 100%);
}
.console { margin-top: clamp(36px, 5vw, 64px); }

/* Hold to drill: the real 14 m capture with the game's mining readout drawn live over it. */
.drill { max-width: 560px; margin: 32px 0 0; }
/* Held upright (tablets, Split View, a narrowed window): the toy runs the full width, as the clips under it do
   (no empty column beside it). */
@media (max-width: 1279px) and (orientation: portrait) { .drill { max-width: none; } }
/* Windows under 1000 px held sideways and 500 px tall or more: the toy grows with the height there is, up to the
   full width, so it lines up with the clips under it and still fits, with its buttons, between the header (56 px)
   and the Steam dock (63 px under 900 px). */
@media (max-width: 999px) and (min-height: 500px) and (orientation: landscape) { .drill { max-width: max(560px, min(100%, (100vh - 180px) * 16 / 9)); max-width: max(560px, min(100%, (100svh - 180px) * 16 / 9)); } }
@media (min-width: 1200px) {
  .loop__head--drill { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); align-items: center; }
  .loop__head--drill .drill { margin: 0; }
}
.drill__screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #01282d; box-shadow: 0 0 0 1px rgb(40 201 241 / 0.28); -webkit-user-select: none; user-select: none; }
.drill__screen picture, .drill__screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
.drill.is-drilling .drill__screen picture { animation: drill-shake 90ms steps(2) infinite; }
@keyframes drill-shake { 0% { transform: translate(0.7px, 0); } 50% { transform: translate(-0.7px, 0.5px); } 100% { transform: translate(0.3px, -0.5px); } }
.drill__cargo { position: absolute; left: 3.2%; top: 5%; display: flex; align-items: center; gap: 7px; margin: 0; font: 700 13px/1 var(--font-hud); color: #f2f6f7; font-variant-numeric: tabular-nums; }
.drill__cargo svg { width: 18px; height: 16px; fill: #c79958; }
.drill__cargo span { font-weight: 600; color: #a7b1b4; }
.drill__hud { position: absolute; inset: auto 0 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 24px 4% 11px; background: linear-gradient(180deg, rgb(1 4 7 / 0), rgb(1 4 7 / 0.8) 55%); font: 700 12px/1.25 var(--font-hud); letter-spacing: 0.03em; text-transform: uppercase; transition: opacity 0.3s var(--ease-water), visibility 0.3s; }
/* As in the game, the mining readout goes when the vein is gone; at base the results card takes its place. */
.drill.is-empty .drill__hud, .drill.is-results .drill__hud { opacity: 0; visibility: hidden; }
.drill__what { margin: 0; font-size: 13px; color: #b8f0ff; }
.drill__stats { grid-column: 1; display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 4px 0 0; font-size: 11px; }
.drill__value { color: #ffc747; }
.drill__hard { color: #60dbff; }
.drill__left { color: #d1edf5; }
.drill__left b { font-weight: 700; }
/* The percentage sits on the MINING line, as in the game's readout. */
.drill__pct { grid-column: 2; grid-row: 1; align-self: end; margin: 0; min-width: 3.2em; text-align: right; font: 800 18px/1 var(--font-hud); color: #58ffad; font-variant-numeric: tabular-nums; }
/* The vein greys out a third at a time as it is mined (the capture itself never changes). */
/* Clipped to the crystal's own outline (traced from the capture): only the crystal greys, tips included, and the water stays as it is. */
.drill__vein {
  position: absolute;
  left: 27.05%;
  top: 40.84%;
  width: 15.53%;
  height: 18.73%;
  opacity: calc(var(--spent, 0) * 0.92);
  -webkit-backdrop-filter: grayscale(1) brightness(0.58);
  backdrop-filter: grayscale(1) brightness(0.58);
  clip-path: polygon(1.5% 36.7%, 5.4% 18%, 9.3% 12.9%, 13.2% 10.1%, 17.1% 7.2%, 21% 5.8%, 24.9% 7.2%, 28.8% 10.8%, 32.7% 8.6%, 36.6% 5.8%, 40.5% 5%, 44.4% 2.9%, 48.3% 0.7%, 52.2% 0.7%, 56.1% 5%, 60% 9.4%, 63.9% 16.5%, 67.8% 29.5%, 79.5% 29.5%, 83.4% 34.5%, 87.3% 40.3%, 91.2% 46%, 95.1% 51.8%, 99.5% 60.1%, 98.5% 68.3%, 95.1% 71.9%, 91.2% 76.3%, 87.3% 79.9%, 75.6% 79.9%, 71.7% 78.4%, 67.8% 92.1%, 63.9% 96.4%, 60% 99.3%, 52.2% 98.6%, 44.4% 95.7%, 36.6% 92.8%, 28.8% 89.2%, 21% 86.3%, 17.1% 84.2%, 13.2% 78.4%, 9.3% 66.2%, 5.4% 61.9%, 0.5% 49.3%);
  transition: opacity 0.5s var(--ease-water);
  pointer-events: none;
}
.drill__fx { position: absolute; inset: 0; pointer-events: none; }
.drill__shard { position: absolute; left: 41%; top: 49%; width: 4px; height: 4px; background: #9ff3f0; animation: drill-shard 520ms var(--ease-water) forwards; }
@keyframes drill-shard { to { transform: translate(var(--dx), var(--dy)) rotate(45deg); opacity: 0; } }
.drill__pop { position: absolute; left: 31%; top: 30%; font: 800 15px/1 var(--font-hud); color: #ffc747; text-shadow: 0 1px 0 rgb(0 0 0 / 0.6); animation: drill-pop 900ms var(--ease-water) forwards; }
@keyframes drill-pop { 0% { transform: translateY(4px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-22px); opacity: 0; } }
/* TO BASE shows the haul in the format of the game's results screen. */
/* A .panel, so the keyline runs along the chamfers too; one line wide, so it never wraps on phones. */
.drill__results { --c: 6px; --panel-fill: #0b3a48; --panel-line: rgb(40 201 241 / 0.5); position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: max-content; min-width: 60%; max-width: calc(100% - 16px); padding: 14px 18px 13px; text-align: center; filter: drop-shadow(0 10px 24px rgb(0 0 0 / 0.5)); }
.drill__results[hidden] { display: none; }
.drill__results-t { margin: 0; font: 800 14px/1 var(--font-body); letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; color: #e6f1f2; }
.drill__results-row { display: flex; justify-content: center; align-items: baseline; gap: 12px; margin: 10px 0 0; font: 700 13px/1 var(--font-body); text-transform: uppercase; white-space: nowrap; color: #e6f1f2; }
.drill__results-row b { font-size: 16px; color: var(--info); }
.drill__results-row i { font-style: normal; font-weight: 800; color: var(--value); }
.drill__controls { display: flex; gap: 8px; margin-top: 10px; }
.drill__controls[hidden] { display: none; }
.drill__hold {
  --c: 5px;
  position: relative;
  isolation: isolate;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  background: none;
  color: var(--cream);
  font: 800 14px/1 var(--font-body);
  font-stretch: 112%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.drill__hold::before, .drill__hold::after { content: ""; position: absolute; z-index: -2; clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c)); transition: background-color 0.18s var(--ease-water); }
.drill__hold::before { inset: 0; background: rgb(88 255 173 / 0.55); }
.drill__hold::after { inset: 1px; background: rgb(1 16 21 / 0.86); }
.drill__hold:not([aria-disabled="true"]):hover::after { background: rgb(5 51 64 / 0.92); }
.drill__bar { --c: 4.6px; position: absolute; inset: 1px; z-index: -1; overflow: hidden; clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c)); }
.drill__bar i { position: absolute; inset: 0; background: rgb(88 255 173 / 0.26); transform: scaleX(0); transform-origin: 0 50%; }
.drill.is-drilling .drill__hold::after { background: rgb(4 40 40 / 0.95); }
.drill__hold:focus-visible { outline: 2px solid #58ffad; outline-offset: 3px; }
.drill__hold[aria-disabled="true"] { cursor: default; color: var(--muted); }
.drill__hold[aria-disabled="true"]::before { background: rgb(255 255 255 / 0.18); }
/* TO BASE is the in-game brick (.viewer__btn--brick, so its keyline follows the cut). It waits, dimmed, until there is cargo. */
.drill__base { min-height: 48px; padding: 0 18px; font-weight: 800; letter-spacing: 0.05em; }
.drill__base:focus-visible { outline-color: var(--cream); }
/* Three pulses once the vein is empty, then it stays lit (nothing blinks for more than about 4 s). */
.drill.is-empty .drill__base { --fl: #9c3f35; }
.drill.is-empty .drill__base::after { animation: drill-base 1.3s ease-in-out 3; }
@keyframes drill-base { 50% { background: #b04a3f; } }
.drill__cap { flex-wrap: wrap; row-gap: 2px; }
.drill__cap .clipbar__cap { flex: none; }
.drill__note { flex: 1 1 100%; font-size: 12px; line-height: 1.4; color: var(--muted); }
@media (max-width: 420px) { .drill__stats { font-size: 10px; gap: 1px 9px; } .drill__what { font-size: 12px; } .drill__pct { font-size: 16px; } .drill__results { padding-inline: 14px; } }
@media (prefers-reduced-motion: reduce) { .drill.is-drilling .drill__screen picture, .drill.is-empty .drill__base::after { animation: none; } }
.console__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 48px; }
.chapter { position: relative; }
.chapter__head { margin: 0; font: inherit; }
.chapter__tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 16px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
/* The focus ring is a frame drawn by the title itself: its top and bottom inside the title's padding (clear of
   the chapter text just below and of the video's fade above), its sides just outside (clear of the number). */
.chapter__tab { position: relative; }
.chapter__tab:focus-visible { outline: none; }
.chapter__tab:focus-visible::after { content: ""; position: absolute; inset: 0 -6px 4px; border: 2px solid var(--info); pointer-events: none; }
.chapter__n { font: 700 14px/1 var(--font-hud); letter-spacing: 0.06em; color: var(--info); font-variant-numeric: tabular-nums; }
.chapter__name { font-stretch: 118%; font-weight: 800; font-size: var(--display-s); line-height: 1; text-transform: uppercase; color: var(--cream); }
.chapter__meta { font: 700 12px/1 var(--font-hud); letter-spacing: 0.05em; color: var(--muted); font-variant-numeric: tabular-nums; }
.chapter__body { margin-top: 14px; }
.chapter__body .body-copy { font-size: 17px; }
.chapter__body strong { color: var(--cream); font-weight: 700; }
.chapter__clip { margin-top: 18px; }
.chapter__clip .clip, .console__screen { aspect-ratio: 1170 / 658; }
.console__screen { box-shadow: 0 0 0 1px rgb(40 201 241 / 0.28); }
.chapter__prog, .console__stage { display: none; }
.facts--inline { margin-top: 16px; padding-top: 12px; }
.console__hint { font: 700 11px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.console__screen { transition: box-shadow 0.2s var(--ease-water); }
.js .console__screen { cursor: zoom-in; }
@media (hover: hover) { .js .console__screen:hover { box-shadow: 0 0 0 1px var(--info); } }
/* Theatre: the same player, moved into a dialog at the clips' native width. */
#clip-dialog { width: min(1170px, 100vw - 32px); }
.theatre__screen { aspect-ratio: 1170 / 658; max-height: calc(100dvh - 120px); }
#clip-dialog .viewer__cap { text-transform: none; }
#clip-dialog .viewer__bar .cta { margin-left: 4px; }
/* Phones: the caption, then Previous | Next | Pause, then Steam | Close. */
@media (max-width: 699px) {
  #clip-dialog { width: 100vw; max-height: 100dvh; }
  #clip-dialog .viewer__bar { padding-inline: 12px; }
  #clip-dialog .viewer__bar [data-prev], #clip-dialog .viewer__bar [data-next] { flex: 1 1 0; }
  #clip-dialog .viewer__bar .cta { flex: 1; margin-left: 0; }
}
.loop__end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; margin-top: clamp(40px, 4.5vw, 64px); padding-top: 28px; border-top: 1px solid rgb(40 201 241 / 0.16); }
.loop__go { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.loop__facts { margin: 0; padding: 0; border: 0; }
@media (min-width: 1000px) { .js .loop__end { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; } .js .loop__go { justify-content: flex-end; } }
@media (max-width: 699px) { .loop__go { width: 100%; } .loop__go .cta { width: 100%; } }

/* The playlist (with JS). Every chapter is a card: a still from its clip, its depth, and what it is doing
   now (Play, Up next, Now showing). A click or a tap anywhere on a card plays it on the stage; nothing
   happens on hover alone. Only the playing card opens to show its text, so the whole playlist stays in
   view beside the clip (under it on phones and tablets). Its bar fills until the next card's turn. */
.chapter__thumb, .chapter__state { display: none; }
.js .console { display: grid; gap: 22px; }
.js .console__stage { display: block; }
.js .chapter__clip { display: none; }
.js .console__list { gap: 10px; }
/* The tour reflows the chapters every few seconds, and the list grows when the first one opens: the browser must not
   hold the page still by anything in the loop (it would follow a chapter as it moves, or the loop's own top, and drag
   the section below, being read, up or down with it); it holds by the section below instead. */
.js .loop { overflow-anchor: none; }
.js .chapter {
  border: 1px solid rgb(40 201 241 / 0.18);
  background: rgb(1 16 21 / 0.45);
  cursor: pointer;
  transition: border-color 0.2s var(--ease-water), background-color 0.2s var(--ease-water);
}
/* The hover looks only where the pointer hovers: on a touch screen a tapped card would stay lit after the tour moves on. */
@media (hover: hover) { .js .chapter:hover { border-color: rgb(40 201 241 / 0.55); background: rgb(3 34 43 / 0.65); } }
.js .chapter.is-active { border-color: rgb(40 201 241 / 0.8); background: rgb(40 201 241 / 0.08); }
.js .chapter__tab {
  grid-template-columns: 112px auto minmax(0, 1fr) auto;
  grid-template-areas: "thumb n meta state" "thumb name name name";
  align-items: center;
  align-content: center;
  gap: 8px 12px;
  padding: 12px 14px 12px 12px;
}
.js .chapter__tab:focus-visible::after { inset: -1px; }
.js .chapter__n { grid-area: n; }
.js .chapter__meta { grid-area: meta; grid-column: auto; }
.js .chapter__name { grid-area: name; font-size: clamp(18px, 1.55vw, 23px); line-height: 1.05; color: var(--text); transition: color 0.2s var(--ease-water); }
.js .chapter.is-active .chapter__name { color: var(--cream); }
@media (hover: hover) { .js .chapter:hover .chapter__name { color: var(--cream); } }
.js .chapter__state { grid-area: state; display: block; font: 700 11px/1 var(--font-hud); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.js .chapter__state::before { content: "Play"; }
.js .chapter.is-next .chapter__state::before { content: "Up next"; }
.js .chapter.is-active .chapter__state::before { content: "Now showing"; }
.js .chapter.is-next .chapter__state, .js .chapter.is-active .chapter__state { color: var(--info); }
@media (hover: hover) { .js .chapter:hover .chapter__state { color: var(--info); } }
/* The still: the middle of the clip's first frame, where the sub is, with a play button on it (the playing
   card shows level bars instead). */
.js .chapter__thumb { grid-area: thumb; display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #01080b; box-shadow: 0 0 0 1px rgb(40 201 241 / 0.3); }
.js .chapter__thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(2.1); opacity: 0.85; transition: opacity 0.2s var(--ease-water); }
.js .chapter.is-active .chapter__thumb img { opacity: 1; }
@media (hover: hover) { .js .chapter:hover .chapter__thumb img { opacity: 1; } }
/* Each still zooms in on where its frame's action is (the sub mining, the fight, the sub in the fog, the
   first nodes of the schematic). */
.js .chapter:nth-child(1) .chapter__thumb img { transform-origin: 17% 38%; }
.js .chapter:nth-child(2) .chapter__thumb img { transform-origin: 52% 44%; }
.js .chapter:nth-child(4) .chapter__thumb img { transform-origin: 58% 56%; }
.js .chapter__thumb::before, .js .chapter__thumb::after { content: ""; position: absolute; left: 50%; top: 50%; }
.js .chapter__thumb::after { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: rgb(1 10 14 / 0.6); box-shadow: inset 0 0 0 1.5px rgb(40 201 241 / 0.9); transition: background-color 0.2s var(--ease-water), transform 0.2s var(--ease-water); }
.js .chapter__thumb::before { z-index: 1; margin: -5px 0 0 -3px; border-left: 9px solid var(--cream); border-block: 5px solid transparent; }
@media (hover: hover) {
  .js .chapter:hover .chapter__thumb::after { background: var(--info); transform: scale(1.1); }
  .js .chapter:hover .chapter__thumb::before { border-left-color: #01141a; }
}
.js .chapter.is-active .chapter__thumb::after { background: rgb(1 10 14 / 0.65); transform: none; }
.js .chapter.is-active .chapter__thumb::before {
  width: 13px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 0;
  background:
    linear-gradient(var(--info), var(--info)) 0 100% / 3px 7px no-repeat,
    linear-gradient(var(--info), var(--info)) 5px 100% / 3px 12px no-repeat,
    linear-gradient(var(--info), var(--info)) 10px 100% / 3px 9px no-repeat;
}
/* The text opens under the playing card's title and closes on the others. */
.js .chapter__body { display: grid; grid-template-rows: 0fr; margin: 0; transition: grid-template-rows 0.35s var(--ease-water); }
.js .chapter.is-active .chapter__body { grid-template-rows: 1fr; }
.js .chapter__more { min-height: 0; overflow: hidden; padding-inline: 16px; }
.js .chapter__more::after { content: ""; display: block; height: 16px; } /* the space under the text, inside what folds */
.js .chapter__body .body-copy { margin-top: 2px; font-size: 16px; color: var(--text); }
/* The bar fills until the next card's turn (segmented like the in-game HULL and ENERGY bars). */
.js .chapter__prog {
  display: block;
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--info) calc(var(--p, 0) * 100%), rgb(255 255 255 / 0.12) 0);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 18px, transparent 18px 21px);
  mask: repeating-linear-gradient(90deg, #000 0 18px, transparent 18px 21px);
  opacity: 0;
  transition: opacity 0.2s var(--ease-water);
}
.js .chapter.is-active .chapter__prog { opacity: 1; }
@media (max-width: 480px) {
  .js .chapter__tab { grid-template-columns: 92px auto minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px 12px 10px 10px; }
  .js .chapter__name { font-size: 17px; }
}
@media (min-width: 1000px) {
  .js .console { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
  .js .console__stage { position: sticky; top: calc(var(--header-h) + 28px); }
}
/* The chapter's fact moves under the clip as a HUD line, so the playing card stays short; the list keeps it
   for screen readers only. */
.console__facts { display: none; }
.js .chapter .facts--inline { position: absolute; 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; }
.js .console__facts { display: block; margin-top: 4px; padding: 12px 16px; background: rgb(1 16 21 / 0.55); box-shadow: inset 0 0 0 1px rgb(40 201 241 / 0.22); }
.console__facts .facts { display: flex; align-items: baseline; gap: 6px 18px; margin: 0; padding: 0; border: 0; }
.console__facts .facts__pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.console__facts dd { margin: 0; color: var(--value); font-weight: 700; }
/* Phones and tablets: the clip on top, the playlist under it (tap a card and its clip plays just above). */
@media (max-width: 999px) {
  .loop { background: linear-gradient(180deg, #01223a 0, var(--sea-shallow) 520px); }
  .js .console__stage { order: -1; }
  /* The whole clip fits on the screen, even on a phone held sideways. */
  .js .console__screen { width: min(100%, 150vh); width: min(100%, 150svh); margin-inline: auto; }
  .console__hint { display: none; }
}
/* Phones and tablets held upright (under 1000 px): an accordion. The clip opens inside the chapter you tap, under its
   title (core.js moves the stage there), and every closed chapter carries a Play button. No tour here, so nothing
   moves while you read. */
@media (max-width: 999px), (max-width: 1279px) and (orientation: portrait) {
  .js .is-accordion .console__list { gap: 16px; }
  .js .console.is-accordion { grid-template-columns: minmax(0, 1fr); } /* one column also from 1000 px */
  .js .is-accordion .chapter .console__stage { position: static; }
  .js .is-accordion .console__hint { display: none; }
  .js .is-accordion .chapter { border-color: rgb(40 201 241 / 0.34); }
  .js .is-accordion .chapter:not(.is-active):active { border-color: var(--info); background: rgb(3 34 43 / 0.85); }
  .js .is-accordion .chapter .console__stage { margin: 0 14px; }
  .js .is-accordion .chapter__body { transition: none; }
  .js .is-accordion .chapter__more { padding-inline: 16px; }
  .js .is-accordion .chapter.is-active .chapter__more { padding-top: 12px; }
  .js .is-accordion .chapter__prog { display: none; }
  .js .is-accordion .chapter:not(.is-active) .chapter__state { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px 8px 10px; border: 1px solid rgb(40 201 241 / 0.75); background: rgb(40 201 241 / 0.1); color: var(--info); }
  .js .is-accordion .chapter:not(.is-active) .chapter__state::before { content: "Play clip"; }
  .js .is-accordion .chapter:not(.is-active) .chapter__state::after { content: ""; order: -1; width: 0; height: 0; border-left: 7px solid currentColor; border-block: 4.5px solid transparent; }
}
/* Narrow phones: the depth goes under the title, so it never runs under the Play button. */
@media (max-width: 399px) {
  .js .is-accordion .chapter__tab { grid-template-areas: "thumb n . state" "thumb name name name" "thumb meta meta meta"; }
  .js .is-accordion .chapter__meta { grid-area: meta; }
}

/* ---------------------------------------------------------------- the spotlight */
.fight {
  padding-block: var(--section-pad);
  background: linear-gradient(180deg, var(--sea-shallow) 0%, var(--sea-dark) 26%, var(--sea-dark) 100%);
}
.fight__head { margin-bottom: clamp(36px, 5vw, 64px); }
.fight__stage { margin-block: 0; }
/* Short laptop windows: the spotlight picture is held to the height under the header (as the schematic is), so it
   is seen whole with its hint; the heading and the lede keep its width, the lede under the heading where the
   column is too narrow for both. */
@media (min-width: 1000px) and (orientation: landscape) {
  .fight__head, .fight__stage { width: min(var(--max), 100% - 2 * var(--gutter), (100vh - var(--header-h) - 56px) * 16 / 9); width: min(var(--max), 100% - 2 * var(--gutter), (100svh - var(--header-h) - 56px) * 16 / 9); }
}
/* The same column as the trailer above and the schematic below (one edge for all three). Up to 860 px tall it is too
   narrow for a heading beside its lede (Safari sets the heading about 1% wider than Chrome, hence the margin), so
   the lede goes under it, here and at the schematic alike (pinned, in-page zoom or still). */
@media (min-width: 1200px) and (max-height: 860px) and (orientation: landscape) {
  .fight__head, .tree .tree__head { display: block; }
  .fight__head > .lede, .tree .tree__head > .lede { margin-top: 22px; }
}
/* 1200-1279 px wide at any height: this heading beside its lede would take three lines (the schematic's fits in two). */
@media (min-width: 1200px) and (max-width: 1279px) {
  .fight__head { display: block; }
  .fight__head > .lede { margin-top: 22px; }
}
.beam {
  --ox: 39%;
  --oy: 34%;
  --a: 137deg;
  --spread: 15deg;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06);
  touch-action: pan-y;
}
.beam:focus-visible { outline: 2px solid var(--info); outline-offset: 4px; }
.beam img { width: 100%; height: 100%; object-fit: cover; }
.beam__dark, .beam__cone { position: absolute; inset: 0; pointer-events: none; }
/* Dark everywhere except: the HUD band at the top, the sub's own light, and inside the (finite) cone. */
.beam__dark {
  background: rgb(0 0 0 / 0.6);
  -webkit-mask-image:
    linear-gradient(transparent 0 9%, #000 9%),
    radial-gradient(circle at var(--ox) var(--oy), transparent 0 6%, #000 15%),
    conic-gradient(from calc(var(--a) - var(--spread)) at var(--ox) var(--oy), transparent 0deg calc(var(--spread) * 2 - 2deg), #000 calc(var(--spread) * 2 + 2deg) 360deg),
    radial-gradient(circle at var(--ox) var(--oy), transparent 0 46%, #000 70%);
  -webkit-mask-composite: source-in, source-in, source-over, source-over;
  mask-image:
    linear-gradient(transparent 0 9%, #000 9%),
    radial-gradient(circle at var(--ox) var(--oy), transparent 0 6%, #000 15%),
    conic-gradient(from calc(var(--a) - var(--spread)) at var(--ox) var(--oy), transparent 0deg calc(var(--spread) * 2 - 2deg), #000 calc(var(--spread) * 2 + 2deg) 360deg),
    radial-gradient(circle at var(--ox) var(--oy), transparent 0 46%, #000 70%);
  mask-composite: intersect, intersect, add, add;
}
.beam__cone {
  background: conic-gradient(from calc(var(--a) - var(--spread)) at var(--ox) var(--oy), rgb(196 20 31 / 0.34) 0deg calc(var(--spread) * 2), transparent calc(var(--spread) * 2));
  -webkit-mask-image: radial-gradient(circle at var(--ox) var(--oy), #000 0 40%, transparent 68%);
  mask-image: radial-gradient(circle at var(--ox) var(--oy), #000 0 40%, transparent 68%);
}
.beam__hint { position: absolute; left: 50%; bottom: calc(6.8% + 6px); transform: translateX(-50%); margin: 0; padding: 6px 12px; background: rgb(1 4 7 / 0.8); color: var(--info); font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; display: none; }
.js .beam__hint { display: block; }
.js .beam__hint[hidden] { display: none; }
.js .beam.is-aimed .beam__hint { opacity: 0; transition: opacity 0.4s var(--ease-water); }
@media (max-width: 699px) { .js .beam__hint { display: none; } }
@media (hover: hover) and (pointer: fine) { .js .beam { cursor: crosshair; } }
.fight__cap { margin: 0; }
/* The touch tag drops under the depth caption when both don't fit on one line (the caption never splits). */
.fight__bar { display: flex; flex-wrap: wrap; row-gap: 6px; }
.fight__bar .clipbar__cap { flex: 1 0 auto; }
.fight__aim { flex: none; padding: 6px 10px; font: 700 11px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); box-shadow: inset 0 0 0 1px rgb(40 201 241 / 0.35); }
.fight__aim[hidden] { display: none; }
.fight__aim:not([hidden]) { display: grid; justify-items: center; }
.fight__aim > span { grid-area: 1 / 1; }
.fight__aim > span + span, .fight__aim.is-on > span:first-child { visibility: hidden; }
.fight__aim.is-on > span + span { visibility: visible; }
.fight__aim.is-on { color: var(--value); box-shadow: inset 0 0 0 1px rgb(255 207 38 / 0.55); }
.fight__note { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 70ch; }
/* The creature's bar sits exactly over the cyan bar in the screenshot (a 3 px dark track covers its
   edges). Unlit it is the game's cyan; lit it turns the game's red-orange and drains. */
.beam__hp { position: absolute; z-index: 2; left: calc(55.911% - 3px); top: calc(22.639% - 3px); width: calc(8.594% + 6px); height: calc(1.111% + 6px); background: #02060a; pointer-events: none; }
.beam__hp[hidden] { display: none; }
.beam__hp i { position: absolute; inset: 3px; background: #00caed; transform-origin: 0 50%; }
.beam__hp.is-lit i { background: #ef3400; }
/* Empty: the whole bar flashes (the fill is at zero width by then, so the flash is on the bar itself). */
.beam__hp.is-empty { animation: hp-flash 0.5s steps(1) 2; }
.beam__hp.is-refill i { background: #00caed; transition: transform 0.7s var(--ease-water); }
@keyframes hp-flash { 0% { background: #fff4e0; } 50% { background: #ef3400; } }
/* Kept just above the screenshot's own bottom bar at every width, on one line where it fits. */
.beam__msg { position: absolute; z-index: 2; left: 50%; bottom: calc(6.8% + 6px); width: max-content; max-width: 90%; margin: 0; padding: 7px 14px; transform: translate(-50%, 6px); background: rgb(1 4 7 / 0.86); box-shadow: inset 0 0 0 1px rgb(239 52 0 / 0.6); color: var(--cream); font: 700 13px/1.25 var(--font-hud); letter-spacing: 0.04em; text-transform: uppercase; text-align: center; opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease-water), transform 0.25s var(--ease-water), visibility 0.25s; }
.beam.is-msg .beam__msg { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.beam.is-msg .beam__hint { opacity: 0; }
@media (max-width: 699px) { .beam__msg { padding: 6px 10px; font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .beam__hp.is-empty { animation: none; background: #fff4e0; } .beam__msg { transition: none; } }


.bar__track { display: block; }

/* ---------------------------------------------------------------- the schematic */
.tree {
  padding-block: var(--section-pad);
  background: linear-gradient(180deg, var(--sea-dark) 0%, var(--schematic) 30%, var(--blueprint) 100%);
}
.tree__head { margin-bottom: clamp(32px, 4vw, 56px); }
.tree__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--blueprint);
  box-shadow: 0 0 0 1px rgb(114 207 211 / 0.35);
}
.tree__frame img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50.4% 54.4%; will-change: transform; }
.tree__foot { margin-top: 20px; }

/* The HUD ladder: the same four readouts from four captures, drawn as proportional bars. */
.ladder { margin-top: clamp(28px, 4vw, 48px); }
.ladder__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ladder__cap { caption-side: top; text-align: left; padding-bottom: 14px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.ladder__title { display: block; margin-bottom: 8px; font-stretch: 118%; font-weight: 800; font-size: var(--display-s); line-height: 1; text-transform: uppercase; color: var(--cream); }
.ladder th, .ladder td { padding: 12px 18px 12px 0; text-align: left; vertical-align: middle; border-top: 1px solid rgb(114 207 211 / 0.18); }
.ladder thead th { padding-block: 0 8px; border-top: 0; font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--info); }
.ladder tbody th { width: 8ch; white-space: nowrap; font: 700 18px/1 var(--font-body); color: var(--cream); }
.ladder td:last-child, .ladder th:last-child { padding-right: 0; }
.lad { --seg: var(--energy); --r: 1; display: grid; grid-template-columns: 5ch minmax(0, 1fr); align-items: center; gap: 12px; font: 700 15px/1 var(--font-body); color: var(--cream); }
.lad::after {
  content: "";
  width: max(2px, calc(var(--r) * 100%));
  height: 8px;
  background: var(--seg);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px);
  mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px);
}
.lad--cargo { --seg: var(--value); }
.lad--hull { --seg: var(--hull); }
.lad--8 { --r: 0.421; } .lad--11 { --r: 0.579; } .lad--13 { --r: 0.684; } .lad--19 { --r: 1; }
.lad--h100 { --r: 0.0588; } .lad--h165 { --r: 0.0971; } .lad--h210 { --r: 0.1235; } .lad--h1700 { --r: 1; }
.lad--e100 { --r: 0.1786; } .lad--e150 { --r: 0.2679; } .lad--e200 { --r: 0.3571; } .lad--e560 { --r: 1; }
/* Refit: the ladder as something to play with. The in-game top HUD (cargo, depth limit, HULL and
   ENERGY) steps through the four real tiers; the table stays for screen readers and no-JS. */
.refit__head { margin-bottom: 18px; }
.refit__sub { color: var(--muted); font-size: 15px; }
.refit__ui[hidden] { display: none; }
/* With JS the HUD shows the data; the table stays readable by screen readers inside a 1px clipping box
   (a table never shrinks below its content, so it must not be the clipped element itself). */
.refit.is-live .refit__sr { position: absolute; 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; }
.refit__hud { --panel-fill: #010f2b; --panel-line: rgb(114 207 211 / 0.4); display: grid; gap: 22px 36px; align-items: center; padding: 24px 26px; }
.refit__hud > * { position: relative; }
@media (min-width: 700px) { .refit__hud { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.7fr); } }
.refit__label { display: block; font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--info); }
.refit__cargo b { display: block; margin-top: 6px; font: 800 28px/1 var(--font-body); color: var(--value); font-variant-numeric: tabular-nums; }
.refit__slots { display: flex; flex-wrap: wrap; gap: 3px; max-width: 230px; margin-top: 10px; }
.refit__slots i { width: 9px; height: 9px; background: var(--value); }
.refit__readout { justify-self: start; }
.refit__readout .readout__limit { font-size: clamp(28px, 3vw, 38px); font-variant-numeric: tabular-nums; }
.refit__bars { display: grid; gap: 14px; }
.refit .bar__head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 7px; font: 700 13px/1 var(--font-hud); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text); }
.refit .bar__v { color: var(--cream); font-size: 15px; letter-spacing: 0; }
.refit__bars .bar__v { font-variant-numeric: tabular-nums; }
.refit__track { display: block; height: 8px; background: rgb(255 255 255 / 0.08); }
.refit__track i {
  display: block;
  width: max(6px, calc(var(--r, 0.06) * 100%));
  height: 100%;
  background: var(--seg);
  transition: width 0.7s var(--ease-water);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 17px);
  mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 17px);
}
.refit__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; }
.refit__tiers, .refit__actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 699px) {
  .refit__controls { display: grid; justify-content: normal; gap: 10px; }
  .refit__tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .refit__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .refit__tier, .refit__go, .refit__actions .viewer__btn { min-height: 48px; }
}
.refit__tier { --kl: rgb(114 207 211 / 0.4); --fl: rgb(1 16 21 / 0.7); color: var(--text); font: 700 13px/1 var(--font-hud); letter-spacing: 0.04em; text-transform: none; font-variant-numeric: tabular-nums; } /* metres stay a lowercase "m" */
.refit__tier:hover { --kl: var(--info); color: var(--cream); }
.refit__tier[aria-pressed="true"] { --kl: var(--info); --fl: var(--panel-2); color: var(--cream); }
.refit__tier:focus-visible, .refit__go:focus-visible { outline: 2px solid var(--info); outline-offset: 3px; }
/* REFIT is an in-game style action: the TO BASE brick (.viewer__btn--brick, keyline along the cut), not the Steam CTA. */
.refit__go { padding: 0 20px; font-weight: 800; letter-spacing: 0.05em; }
@media (max-width: 699px) {
  .ladder th, .ladder td { padding-right: 10px; }
  .lad { grid-template-columns: 1fr; gap: 6px; }
  .ladder tbody th { font-size: 16px; width: 6ch; }
}
.tree__hint { display: none; margin: 10px auto 0; font: 700 12px/1.3 var(--font-hud); letter-spacing: 0.04em; text-transform: uppercase; color: var(--info); }
.facts--row { border-top-color: rgb(114 207 211 / 0.28); }
@media (max-width: 699px) {
  .tree__view { width: 100%; overflow-x: auto; scrollbar-width: thin; }
  .tree__frame { width: 220vw; max-width: none; aspect-ratio: 16 / 9; }
  .tree__hint { display: block; }
}
/* Desktop with motion, in windows the 16:9 frame can fill (4:3 or wider, up to 1100 px tall; descent.js sets
   .tree-pin): a short pinned zoom-out from the root node to the full tree. The frame is held to the height under
   the header, and the heading, the refit and the facts under it take the same width, so the section is one
   centred column. Taller or squarer windows get the in-page zoom below instead (no empty band under a pinned frame). */
.descent.tree-pin .tree { --tree-w: min(var(--max), 100% - 2 * var(--gutter), (100vh - var(--header-h) - 56px) * 16 / 9); }
.descent.tree-pin .tree__pin { height: 190vh; }
.descent.tree-pin .tree__view { position: sticky; top: calc(var(--header-h) + 24px); }
.descent.tree-pin .tree__frame { width: min(100%, (100vh - var(--header-h) - 56px) * 16 / 9); margin-inline: auto; }
.descent.tree-pin :is(.tree__head, .refit, .tree__foot) { width: var(--tree-w); }
/* (Under 840 px tall the lede goes under the heading: see the spotlight's rule, which covers both.) Without the zoom
   (reduced motion, Save-Data) the still schematic gets the same centred column, held to the height under the
   header, so it lines up with the spotlight above it and is seen whole. */
@media (min-width: 1000px) and (orientation: landscape) {
  html:not(.descent) .tree:not(.tree-zoom) { --tree-w: min(var(--max), 100% - 2 * var(--gutter), (100vh - var(--header-h) - 56px) * 16 / 9); }
  html:not(.descent) .tree:not(.tree-zoom) :is(.tree__head, .refit, .tree__foot) { width: var(--tree-w); }
  html:not(.descent) .tree:not(.tree-zoom) .tree__frame { width: min(100%, (100vh - var(--header-h) - 56px) * 16 / 9); margin-inline: auto; }
}
/* Phones, tablets and touch screens, with motion: the same zoom-out from the root node to the whole tree, in the
   page's own flow: the frame scrolls with the page (nothing is pinned) and the picture in it pulls back as the
   frame rises up the screen (core.js sets .tree-zoom; the side-scroller above stays for reduced motion and
   Save-Data). Phones run it edge to edge. */
.tree-zoom .tree__view { overflow: visible; }
.tree-zoom .tree__frame { width: 100%; max-width: none; }
.tree-zoom .tree__hint { display: none; }
/* Short wide touch screens (and mouse windows 1000-1023 px wide): the same centred column as the trailer and the
   spotlight, the frame held to the height under the header. */
@media (min-width: 1000px) and (orientation: landscape) {
  .tree.tree-zoom { --tree-w: min(var(--max), 100% - 2 * var(--gutter), (100vh - var(--header-h) - 56px) * 16 / 9); --tree-w: min(var(--max), 100% - 2 * var(--gutter), (100svh - var(--header-h) - 56px) * 16 / 9); }
  .tree.tree-zoom :is(.tree__head, .refit, .tree__foot) { width: var(--tree-w); }
  .tree.tree-zoom .tree__frame { width: min(100%, (100vh - var(--header-h) - 56px) * 16 / 9); width: min(100%, (100svh - var(--header-h) - 56px) * 16 / 9); margin-inline: auto; }
}

/* ---------------------------------------------------------------- the zones */
.zones {
  padding-block: var(--section-pad);
  background: linear-gradient(180deg, var(--blueprint) 0%, var(--sea-frost) 16%, #071a26 52%, var(--sea-dark) 100%);
}
.zones__grid { display: grid; gap: 64px; margin-top: clamp(40px, 6vw, 80px); }
.zone__clip .clip { aspect-ratio: 16 / 9; }
.zone__name { margin-top: 18px; }
.zone__warn, .zone__fact { margin-top: 12px; font: 700 13px/1.3 var(--font-hud); letter-spacing: 0.04em; }
.zone__warn { text-transform: uppercase; }
.zone__warn { color: var(--warn); }
.zone__fact { color: var(--info); }
.zone .body-copy { margin-top: 12px; }
.zone--frost .zone__name { color: #d8f1f6; }
@media (min-width: 900px) {
  .zones__grid { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
}

/* ---------------------------------------------------------------- the log (screenshots) */
.log { padding-block: var(--section-pad); background: var(--sea-dark); }
.log__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 40px; }
.log__head .body-copy { max-width: 30em; }
.log__nav { display: flex; gap: 8px; }
.log__nav[hidden] { display: none; }
.log__strip {
  --inset: max(var(--gutter), (100vw - var(--max)) / 2);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(560px, 84vw);
  gap: 20px;
  margin: 36px 0 0;
  padding: 0 var(--inset) 18px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--inset);
  scrollbar-width: thin;
  scrollbar-color: var(--hud-rule) transparent;
}
.shot { scroll-snap-align: start; }
.shot a { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.07); }
.shot a:hover, .shot a:focus-visible { box-shadow: 0 0 0 1px var(--info); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot__depth { margin-top: 14px; font: 700 20px/1 var(--font-hud); color: var(--info); font-variant-numeric: tabular-nums; }
.shot__cap { margin-top: 6px; font-size: 15px; color: var(--muted); }
/* Pinned (with JS, on screens 1000 px wide held sideways or 1280 px wide, 640 to 1100 px tall, motion allowed):
   the section holds still while scrolling down carries the captures sideways, first to last, and then the page
   scrolls on. The section is a screen tall plus the strip's run (--pin-run, set by core.js). The captures take
   the height there is (up to 880 px wide), so the heading and the strip fill the screen instead of floating in
   empty black, and shrink on shorter screens so they still fit; bigger captures move faster than the scroll
   (core.js), so each still takes about the same scroll and the hold is no longer. */
.log.is-pinned { height: calc(100vh + var(--pin-run, 0px)); height: calc(100svh + var(--pin-run, 0px)); padding-block: 0; }
.log.is-pinned .log__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-h);
  overflow: hidden;
  overflow: clip; /* never scrolled by keyboard focus: the page's scroll moves the strip */
  touch-action: pan-y pinch-zoom; /* a sideways swipe moves the captures (core.js); up and down scroll the page */
}
.log.is-pinned .log__pin.is-zoomed { touch-action: auto; } /* pinch-zoomed in: a sideways drag pans the zoomed view (core.js) */
.log.is-pinned .log__strip {
  overflow: visible;
  scroll-snap-type: none;
  grid-auto-columns: min(880px, 84vw, (100vh - var(--header-h) - 370px) * 16 / 9);
  grid-auto-columns: min(880px, 84vw, (100svh - var(--header-h) - 370px) * 16 / 9);
  will-change: transform;
}
/* Phones and tablets (under 1000 px): a dive down the page. The captures run one under another in depth order,
   one column on phones and two on tablets, and slide in from the side as they rise into view (core.js; not under
   reduced motion). Nothing is pinned. Wider touch screens where the strip is not pinned get a progress line, a
   count and "Swipe for more". */
.log__track { display: none; }
@media (max-width: 999px), (max-width: 1279px) and (orientation: portrait) {
  .log { overflow-x: hidden; overflow-x: clip; }
  .log__nav { display: none; } /* nothing to step through sideways */
  .log__strip { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); gap: 34px; margin-top: 30px; padding: 0 var(--inset); overflow: visible; scroll-snap-type: none; }
  .shot { scroll-snap-align: none; will-change: transform; }
  .shot__depth { margin-top: 12px; }
}
@media (min-width: 700px) and (max-width: 999px), (min-width: 700px) and (max-width: 1279px) and (orientation: portrait) {
  .log__strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 24px; }
  .shot:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 12px); } /* the ninth, centred under the pairs */
}
@media (min-width: 1000px) and (pointer: coarse) and (orientation: landscape), (min-width: 1280px) and (pointer: coarse) { .js .log:not(.is-pinned) .log__track { display: flex; align-items: center; gap: 14px; margin-top: 14px; } }
.log__bar { position: relative; flex: 1; height: 3px; overflow: hidden; background: rgb(255 255 255 / 0.12); }
.log__bar i { position: absolute; inset: 0; background: var(--info); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.log__count { font: 700 12px/1 var(--font-hud); letter-spacing: 0.06em; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log__swipe { font: 700 12px/1 var(--font-hud); letter-spacing: 0.06em; text-transform: uppercase; color: var(--info); white-space: nowrap; }
.log__track.is-end .log__swipe { visibility: hidden; } /* at the last capture there is nothing more to swipe to */

/* ---------------------------------------------------------------- the trailer */
.trailer { padding-block: clamp(36px, 5vw, 72px) var(--section-pad); background: linear-gradient(180deg, var(--sea-surface) 0%, #01223a 100%); }
.trailer__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 26px; }
.trailer__player { position: relative; }
.trailer__player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08); }
/* One designed play button over the picture; the light shade keeps the picture's own depth readout
   from competing with the header's. */
.trailer__shade { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 70% at 50% 50%, rgb(1 4 7 / 0.18), rgb(1 4 7 / 0.55)); pointer-events: none; }
.trailer__shade[hidden], .trailer__play[hidden] { display: none; }
.js .trailer__player video:not([controls]) { cursor: pointer; }
.trailer__play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-height: 64px; padding: 0 30px; font-size: 16px; gap: 14px; white-space: nowrap; }
.trailer__play svg { width: 16px; height: 16px; transition: transform 0.18s var(--ease-water); }
.trailer__play:hover svg { transform: scale(1.15); }
.trailer__play::after { background: rgb(1 16 21 / 0.82); }
@media (max-width: 599px) { .trailer__play { min-height: 52px; padding: 0 20px; font-size: 14px; } }
@media (max-width: 359px) { .trailer__play { padding: 0 14px; gap: 10px; } }
.trailer__foot { display: grid; gap: 20px 48px; margin-top: 18px; }
@media (min-width: 1000px) { .trailer__foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.trailer__desc { font-size: 15px; }
.trailer__after { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
/* "Watch on YouTube": the secondary button, same height as the Steam button beside it; the arrow says it leaves the site. */
.trailer__yt { padding-inline: 20px 18px; }
.trailer__yt .trailer__yt-out { width: 10px; height: 10px; opacity: 0.7; transition: transform 0.18s var(--ease-water), opacity 0.18s; }
.trailer__yt:hover .trailer__yt-out, .trailer__yt:focus-visible .trailer__yt-out { transform: translate(2px, -2px); opacity: 1; }
@media (max-width: 699px) { .trailer__after > a { flex: 1 1 100%; justify-content: center; } }
/* Short laptop windows: the player is held to the height under the header (as the schematic is), so the whole
   video and its controls are in view together; the heading and the text under it keep its width. */
@media (min-width: 1000px) and (orientation: landscape) {
  .trailer > .wrap { width: min(var(--max), 100% - 2 * var(--gutter), (100vh - var(--header-h) - 56px) * 16 / 9); width: min(var(--max), 100% - 2 * var(--gutter), (100svh - var(--header-h) - 56px) * 16 / 9); }
}
/* Windows under 670 px tall: that column leaves too little room beside the buttons, so the words go above them. */
@media (min-width: 1000px) and (orientation: landscape) and (max-height: 670px) { .trailer__foot { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- back at base: results */
.results {
  padding-block: var(--section-pad);
  background: linear-gradient(180deg, var(--sea-dark) 0%, #03202a 32%, var(--sea-base) 62%, #031d26 100%);
}
.results__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; } /* one flexible column: never wider than the screen */
@media (min-width: 1000px) {
  .results__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); grid-template-areas: "panel lead" "panel more"; gap: 0 72px; }
  .results__panel { grid-area: panel; align-self: center; }
  .results__lead { grid-area: lead; align-self: end; }
  .results__more { grid-area: more; align-self: start; }
}
/* 1000-1199 px: a little more room for the panel, so every item's name stays on one line. */
@media (min-width: 1000px) and (max-width: 1199px) { .results__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 48px; } }
@media (min-width: 700px) and (max-width: 999px) { .results__more .facts--stack { grid-template-columns: 1fr 1fr; } }
.results__panel { --panel-fill: #0b3a48; --panel-line: rgb(40 201 241 / 0.45); --c: 8px; padding: 30px clamp(16px, 2.4vw, 30px) 22px; }
.results__panel > * { position: relative; }
.results__title { text-align: center; font-weight: 800; font-stretch: 100%; font-size: clamp(24px, 2.4vw, 34px); letter-spacing: 0.01em; text-transform: uppercase; color: #e6f1f2; }
.results__items { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 560px) { .results__items { grid-template-columns: 1fr 1fr; } }
.item {
  --c: 6px;
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 6px;
  align-items: center;
  padding: 14px 14px 12px 12px;
  background: var(--panel-0);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}
.item::before { content: ""; position: absolute; left: var(--c); right: var(--c); top: 0; height: 4px; background: var(--info); }
.item__icon { grid-row: 1 / span 2; line-height: 0; }
.item__icon img { width: 58px; height: auto; }
.item__name { grid-column: 2 / span 2; font: 700 14px/1.15 var(--font-body); letter-spacing: 0.02em; text-transform: uppercase; color: #e6f1f2; }
.item__qty { font: 800 20px/1 var(--font-body); color: var(--info); font-variant-numeric: tabular-nums; }
.item__cr { justify-self: end; font: 800 16px/1 var(--font-body); color: var(--value); font-variant-numeric: tabular-nums; }
.results__cores { display: grid; gap: 8px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.results__cores p {
  --c: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #021a22;
  font: 800 13px/1.2 var(--font-body);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--info);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% 50%, calc(100% - var(--c)) 100%, var(--c) 100%, 0 50%);
}
.results__cores img { width: 28px; height: 28px; }
.results__total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 10px;
  padding: 16px 20px;
  background: #032833;
  box-shadow: inset 0 0 0 1px rgb(40 201 241 / 0.3);
  font: 800 clamp(17px, 1.6vw, 22px)/1 var(--font-body);
  text-transform: uppercase;
  color: #e6f1f2;
}
.results__total b { margin-left: 12px; font-variant-numeric: tabular-nums; }
.results__earned { color: var(--info); }
.results__earned b { color: var(--value); }
.results__cta { margin-top: 24px; min-height: 60px; font-size: 17px; }
.results__src { margin-top: 12px; text-align: center; font-size: 12px; color: var(--muted); }
.results__more .facts { margin-top: 30px; }
.facts--stack { display: grid; gap: 14px; }
.facts--stack dd { font-size: 17px; font-weight: 500; }
.facts--stack dd, .facts--row dd, .facts--inline dd { text-wrap: balance; }
.results__alt { margin-top: 26px; font-size: 15px; color: var(--muted); }

/* ---------------------------------------------------------------- FAQ + press */
.faq { padding-block: var(--section-pad); background: #031d26; }
.faq__grid { display: grid; gap: 28px 64px; }
@media (min-width: 900px) { .faq__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; } }
.faq__side { display: grid; gap: 32px; align-content: start; }
@media (min-width: 900px) and (min-height: 600px) { .faq__side { position: sticky; top: calc(var(--header-h) + 32px); } } /* pinned only where it fits on screen */
.faq__ask { --panel-fill: #042a36; --panel-line: rgb(40 201 241 / 0.3); padding: 22px 24px 24px; max-width: 420px; }
.faq__ask > * { position: relative; }
.faq__ask-t { font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--info); }
.faq__ask .body-copy { margin-top: 8px; color: var(--text); }
.faq__ask-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; font-size: 15px; }
@media (max-width: 899px) { .faq__side { display: contents; } .faq__ask { order: 2; margin-top: 8px; max-width: none; } }
@media (min-width: 700px) and (max-width: 899px) { .dock { justify-content: center; gap: 24px; } .dock .cta { flex: 0 1 420px; } }
.faq__list details { border-top: 1px solid rgb(40 201 241 / 0.16); }
.faq__list details:last-child { border-bottom: 1px solid rgb(40 201 241 / 0.16); }
.faq__list summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 18px;
  color: var(--cream);
}
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after { content: "+"; content: "+" / ""; flex: none; font-weight: 500; color: var(--info); transition: transform 0.2s var(--ease-water); }
.faq__list details[open] summary::after { transform: rotate(45deg); }
.faq__list summary:hover { color: var(--info); }
.faq__list details p { padding: 0 0 22px; color: var(--muted); max-width: 62ch; }

/* ---------------------------------------------------------------- footer: back at base
   The studio's sign-off. On top, the page drawn as the dive it is (each stop links to its section,
   depth on a square-root scale so the shallow stops don't bunch up); then BaseMen Games; then legal. */
.foot { position: relative; padding-block: clamp(48px, 6vw, 80px) 32px; background: var(--sea-surface); border-top: 1px solid rgb(40 201 241 / 0.45); } /* back at the surface: the hero's navy, under a 1px waterline */
.foot > .wrap { position: relative; z-index: 2; }

.route__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; }
.route__t { color: var(--info); }
.route__max { color: var(--muted); }
.route__max b { color: var(--warn); font-weight: 700; text-transform: none; } /* metres stay a lowercase "m" */
.route__chart { position: relative; margin-top: 22px; }
.route__line { position: absolute; left: 0; top: 0; width: 100%; height: 100px; overflow: visible; }
.route__line polyline { fill: none; stroke: var(--info); stroke-opacity: 0.5; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.route__stops { position: relative; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.route__stops a { position: relative; display: grid; grid-template-rows: 100px auto auto; justify-items: center; padding-bottom: 4px; text-align: center; color: var(--muted); text-decoration: none; }
.route__stops i { position: absolute; left: 50%; top: var(--y, 4px); width: 11px; height: 11px; background: var(--sea-surface); box-shadow: inset 0 0 0 2px var(--info); transform: translate(-50%, -50%); transition: background-color 0.18s var(--ease-water), transform 0.18s var(--ease-water); }
.route__stops b { grid-row: 2; margin-top: 16px; font: 700 13px/1 var(--font-hud); color: var(--info); font-variant-numeric: tabular-nums; }
.route__stops span { grid-row: 3; margin-top: 6px; font: 700 12px/1.25 var(--font-hud); letter-spacing: 0.04em; text-transform: uppercase; text-wrap: balance; transition: color 0.18s var(--ease-water); }
.route__stops a:hover span, .route__stops a:focus-visible span { color: var(--cream); }
.route__stops a:hover i, .route__stops a:focus-visible i { background: var(--value); box-shadow: none; transform: translate(-50%, -50%) scale(1.25); }
.route__stops a:focus-visible { outline: 2px solid var(--info); outline-offset: 4px; }
.route__s7 b { color: var(--warn); }
.route__s9 i { background: var(--info); }
.route__s1 { --y: 4px; } .route__s2 { --y: 18.8px; } .route__s3 { --y: 21.7px; } .route__s4 { --y: 31.3px; } .route__s5 { --y: 42.7px; }
.route__s6 { --y: 55.5px; } .route__s7 { --y: 96px; } .route__s8 { --y: 72.4px; } .route__s9 { --y: 4px; }
@media (max-width: 799px) {
  .route__line { display: none; }
  .route__stops { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .route__stops a { display: block; padding: 10px 10px 11px; text-align: left; background: rgb(40 201 241 / 0.04); box-shadow: inset 0 0 0 1px rgb(40 201 241 / 0.14); }
  .route__stops i { display: none; }
  .route__stops b, .route__stops span { display: block; margin: 0; }
  .route__stops span { margin-top: 5px; font-size: 11px; }
}

.studio { display: grid; gap: 36px 56px; margin-top: clamp(44px, 6vw, 72px); padding-top: clamp(36px, 5vw, 56px); border-top: 1px solid rgb(40 201 241 / 0.16); }
/* Two by two on wide screens: the studio and its contact on top, the game and the channels beneath them. */
@media (min-width: 700px) {
  .studio { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "id id" "contact follow" "game follow"; }
  .studio__cols { display: contents; }
  .studio__id { grid-area: id; }
  .studio__contact { grid-area: contact; }
  .studio__cols > div:first-child { grid-area: game; }
  .studio__cols > div:last-child { grid-area: follow; }
}
@media (min-width: 1100px) {
  .studio { grid-template-areas: "id contact" "game follow"; row-gap: 48px; }
  .studio__cols > div { padding-top: 28px; border-top: 1px solid rgb(40 201 241 / 0.12); }
}
.studio__id { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 32px; }
.studio__mark { flex: none; line-height: 0; }
.studio__mark img { width: 128px; height: 128px; }
.studio__intro { flex: 1 1 320px; min-width: 0; }
.studio__kicker { font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--info); }
/* The studio's own casing (BaseMen, with GAMES small and spaced), as on its logo and its old site. */
.studio__name { margin-top: 10px; font-stretch: 118%; font-weight: 800; font-size: clamp(44px, 6vw, 84px); line-height: 0.9; letter-spacing: -0.01em; color: var(--cream); }
.studio__name span { display: block; margin-top: 12px; font: 700 clamp(13px, 1.1vw, 15px)/1 var(--font-hud); letter-spacing: 0.42em; text-transform: uppercase; color: var(--info); }
.studio__line { margin-top: 18px; max-width: 36em; color: var(--text); }
.studio__h { font: 700 12px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--info); }
.studio__list { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.studio__list a { color: var(--text); font-size: 15px; text-decoration: none; }
.studio__list a:hover { color: var(--cream); text-decoration: underline; text-underline-offset: 0.25em; }
/* Channels with their real handles, so a phone visitor can search for them inside each app. */
.studio__handles a { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 12px; align-items: baseline; overflow-wrap: anywhere; }
.studio__handles span { font: 700 11px/1.2 var(--font-hud); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.studio__handles a:hover span { color: var(--info); }
.studio__mail { display: block; margin-top: 14px; font-weight: 700; font-size: 18px; color: var(--cream); text-decoration: none; overflow-wrap: anywhere; }
.studio__mail:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.studio__contact .copy { margin-top: 14px; }
.studio__press { display: block; margin-top: 16px; color: var(--text); font-size: 15px; }
.studio__press:hover { color: var(--cream); }
.studio__more { display: inline-block; margin-top: 12px; color: var(--info); font: 700 13px/1.2 var(--font-hud); letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; }
.studio__more::after { content: " \2192"; }
@media (hover: hover) { .studio__more:hover { color: var(--cream); } }
@media (max-width: 699px) { .studio__cols { display: grid; gap: 32px; } }
@media (max-width: 559px) { .studio__mark img { width: 88px; height: 88px; } }

.foot__bar { display: grid; gap: 16px 28px; align-items: center; margin-top: clamp(40px, 5vw, 64px); padding-top: 24px; border-top: 1px solid rgb(40 201 241 / 0.12); }
@media (min-width: 900px) { .foot__bar { grid-template-columns: auto minmax(0, 1fr); } .foot__legal { justify-self: end; text-align: right; } }
.foot__tobase {
  --c: 3px;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--to-base);
  color: var(--cream);
  font: 800 13px/1 var(--font-body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.18);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}
.foot__tobase:hover { background: #85392f; }
.foot__tobase:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; clip-path: none; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.foot__nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
.foot__nav a:hover { color: var(--cream); text-decoration: underline; }
.foot__legal { font-size: 12px; color: var(--muted); max-width: 72ch; }
@media (max-width: 899px) { .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* dock content */
.dock__meta { margin: 0; display: grid; gap: 2px; font: 700 12px/1.1 var(--font-hud); letter-spacing: 0.04em; text-transform: uppercase; }
.dock__date { color: var(--cream); font-size: 15px; }
.dock__where { color: var(--info); }
@media (max-width: 359px) { .dock__meta { display: none; } }

/* Keyboard focus never ends up hidden under the dock (WCAG 2.4.11). */
@media (max-width: 899px) { html { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 900px) { html { scroll-padding-bottom: 16px; } } /* nor is a focus ring cut off at the window's foot */

/* viewers */
.viewer__cap { flex: 1; text-align: center; text-transform: none; }
#trailer-dialog .viewer__bar .cta { margin-left: auto; }
@media (max-width: 699px) {
  .viewer__bar { flex-wrap: wrap; gap: 8px; }
  .viewer__cap { order: -1; flex: 1 0 100%; text-align: left; }
  #trailer-dialog .viewer__label { display: none; }
  #trailer-dialog .viewer__bar .cta { flex: 1; margin-left: 0; }
  #lightbox .viewer__btn { padding-inline: 10px; white-space: nowrap; }
}
/* Screenshot viewer on phones held upright (however short): Previous | Next, then Download | Close (Close
   takes the whole row when there is no download). Held sideways, the buttons stay on one row, so they all fit. */
@media (max-width: 699px) and (orientation: portrait) {
  #lightbox .viewer__bar { display: grid; grid-template-columns: 1fr 1fr; }
  #lightbox .viewer__cap { grid-column: 1 / -1; }
  #lightbox .viewer__bar:not(:has(.viewer__btn--dl:not([hidden]))) .viewer__btn--close { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- marine snow */
.snow { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; display: none; }
.descent .snow { display: block; }

/* ---------------------------------------------------------------- legal pages */
.legal-head, .legal-foot { max-width: 760px; }
.legal h1 { line-height: 1.08; }
@media (max-width: 340px) { .legal h1 { font-size: min(28px, (100vw - 32px) / 10.2); } } /* "DATENSCHUTZ-" fits inside the gutters, down to 280 px */

/* ---------------------------------------------------------------- line breaks on phones */
@media (max-width: 699px) { .display, .chapter__name, .zone__name, .loop__again, .ladder__title, .faq__list summary { text-wrap: balance; } }
@media (max-width: 420px) { .chapter__tab { grid-template-columns: auto minmax(0, 1fr); } .chapter__meta { grid-column: 2; } }
@media (max-width: 380px) { .display--l { font-size: 34px; } }

/* ---------------------------------------------------------------- phones and tablets: fit and balance */
/* The narrowest phones (folding phones' cover screens, 280 px): the Steam buttons and the big headings fit,
   so nothing is cut off and the page never pans sideways. */
@media (max-width: 339px) {
  .results__panel { padding-inline: 12px; }
  .results__panel .cta { padding-inline: 12px; font-size: 14px; letter-spacing: 0.02em; }
}
@media (max-width: 299px) {
  .dock .cta { padding-inline: 12px; }
  .display--l { font-size: 30px; }
}
/* Tablets held sideways (1000-1199 px): the drill sits beside its headline, as on wider screens, instead of
   under it with half the width empty. */
@media (min-width: 1000px) and (max-width: 1199px) and (orientation: landscape) {
  .loop__head--drill { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); column-gap: 48px; align-items: center; }
  .loop__head--drill .drill { margin: 0; }
}
/* Phones held sideways (short screens up to 999 px wide): about 300 px is in view between the top and the
   Steam dock. Both toys fit in it whole (the drill with its buttons, the spotlight picture with the
   creature's bar), so nothing you are using sits off screen or under the dock. */
@media (max-width: 999px) and (max-height: 499px) {
  .drill { max-width: min(560px, (100vh - 166px) * 16 / 9); max-width: min(560px, (100svh - 166px) * 16 / 9); }
  .fight__stage { max-width: calc((100vh - 96px) * 16 / 9); max-width: calc((100svh - 96px) * 16 / 9); margin-left: var(--gutter); }
}
/* ...and the chapter console sits beside its chapters with the clip pinned, as on desktop, so a tap on any
   chapter shows its clip (stacked, the clip would be scrolled away above the chapter you tap). */
@media (min-width: 600px) and (max-width: 999px) and (max-height: 499px) {
  .js .console { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 28px; align-items: start; }
  .js .console__stage { order: 0; position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 12px); }
  .js .console__screen { width: 100%; }
  /* The chapter column is narrow: each chapter's depth goes under its title, clear of the Now showing mark. */
  .chapter__tab { grid-template-columns: auto minmax(0, 1fr); }
  .chapter__meta { grid-column: 2; }
  .js .chapter__tab { grid-template-areas: "thumb n . state" "thumb name name name" "thumb meta meta meta"; }
  .js .chapter__meta { grid-area: meta; }
}
@media (min-width: 600px) and (max-width: 899px) and (max-height: 499px) {
  /* While the header is away the clip rides at the top of the screen; it moves back down with the header. */
  .js .console__stage { transition: top 0.3s var(--ease-water); }
  .js.head-away:not(:has(.top.is-menu, .top :focus-visible)) .console__stage { top: calc(env(safe-area-inset-top, 0px) + 12px); }
}
/* Touch screens: small text links get a finger-sized hit area (the look doesn't change). */
@media (pointer: coarse) {
  .studio__list a, .studio__press, .foot__nav a, .faq__ask .textlink { position: relative; }
  .studio__list a::after, .studio__press::after, .foot__nav a::after, .faq__ask .textlink::after { content: ""; position: absolute; inset: -8px -6px; }
  .studio__handles a::after { inset: -5px -6px; }
  .foot__nav a::after { inset: -11px -8px; }
}

/* ---------------------------------------------------------------- phones: room to breathe (home page)
   Below the hero, which stays exactly as it is: wider side margins, a little more pause between sections, calmer
   headings (one step smaller at every level) and roomier text, so each screen holds less and reads more
   easily. */
@media (max-width: 699px) {
  .home { --gutter: clamp(16px, 5.7vw, 24px); --display-s: 24px; }
  .home .hero { --gutter: clamp(16px, 4vw, 56px); }
  .home main > section:not(.hero) { --section-pad: 64px; } /* 128 px between sections (112 before, 184 felt too far apart) */
  .home .display--l { font-size: 32px; line-height: 1.02; }
  .home .display--m { font-size: 27px; line-height: 1.05; }
  .home .display + .lede, .home .display + .body-copy { margin-top: 26px; }
  .home .lede { font-size: 17px; line-height: 1.6; }
  .home .body-copy { font-size: 16px; line-height: 1.7; }
  .js .home .chapter__tab { padding: 14px 16px 14px 14px; }
}
@media (max-width: 380px) { .home .display--l { font-size: 30px; } .home .display--m { font-size: 26px; } }
/* Tablets (700-999 px) get the same rhythm, scaled up: a little more pause between sections, 16 px body text and
   roomier chapter cards. */
@media (min-width: 700px) and (max-width: 999px), (min-width: 700px) and (max-width: 1279px) and (orientation: portrait) {
  .home main > section:not(.hero) { --section-pad: 72px; }
  .home .body-copy { font-size: 16px; line-height: 1.7; }
  .js .home .chapter__tab { padding: 14px 16px 14px 14px; }
}
/* ...and less on each screen, on phones and tablets (under 1000 px). Below the hero the Steam dock (or, from 900 px,
   the header) carries the Steam button, so the sections drop
   their own (the results panel keeps its); the notes that explain the page's own toys, the refit's extra
   buttons and its sub-line, the second list of facts (the FAQ answers them; the calendar link stays), the
   trailer's long description (the player keeps it as its description) and the footer's dive route go; the
   dock is a little slimmer. */
@media (max-width: 999px), (max-width: 1279px) and (orientation: portrait) {
  .home :is(.hero__note, .trailer__desc, .trailer__after .cta, .drill__note, .loop__end, .fight__note, .refit__sub, .refit__actions, .tree__foot, .results__src, .results__more .facts--stack, .foot .route) { display: none; }
  .home .dock { padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .home .dock .cta { min-height: 46px; }
  .home .foot .studio { margin-top: 0; padding-top: 0; border-top: 0; } /* no gap or line where the dive route was */
}
@media (max-width: 299px) { .home .display--l { font-size: 28px; } }

/* ---------------------------------------------------------------- forced colours
   Windows High Contrast drops backgrounds, so the drawn keylines vanish: real borders instead (the hero and
   the header are left exactly as they are). The selected depth tier is filled with the system highlight, so
   the outline stays the focus ring on every tier. (Last in the file, so it beats the buttons' border: 0.) */
@media (forced-colors: active) {
  .viewer__btn, .ghost:not(.hero .ghost, .top .ghost), .cta:not(.hero .cta, .top .cta), .clip__toggle, .drill__hold, .foot__tobase { border: 1px solid ButtonText; }
  /* Its colours are all set here (system colours), so it opts out of the forced palette: otherwise the text
     backplate would hide its label. */
  .refit__tier[aria-pressed="true"] { forced-color-adjust: none; border-color: Highlight; background-color: Highlight; color: HighlightText; }
  .refit__tier[aria-pressed="true"]::before, .refit__tier[aria-pressed="true"]::after { background-color: Highlight; }
  .refit__tier[aria-pressed="true"]:focus-visible { outline-color: CanvasText; }
  /* The drill light is drawn with gradients, which forced colours remove: the art stays as painted. */
  .hero > .hl, .hero > .hw { display: none !important; }
  /* The studio's mark is drawn for a dark ground (its name is cream): it keeps a dark plate of its own. */
  .top__brand img, .pk-head__brand img, .legal-home img { forced-color-adjust: none; background: #151413; }
  /* The menu button's three bars are gradients too: drawn with borders instead (open, the middle one only). */
  .top__menu-bars { position: relative; box-sizing: border-box; border-block: 2px solid; background: none; }
  .top__menu-bars::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 1px); border-top: 2px solid; }
  .top__menu[aria-expanded="true"] .top__menu-bars { border-block-width: 0; }
  /* The page you are on is marked by colour alone, which forced colours replace: underlined instead. */
  .top__nav a[aria-current="page"], .pk-head__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }
}
