/* delvedtoodeep.com
   The page is one shaft through the ground. site.js digs a seeded tunnel of game cells into a pixel canvas,
   the machine follows it as you scroll, and a dithered fog of war (the headlamp) only lights the rock near
   the machine. Without JS the page shows a straight shaft and dim walls; with reduced motion there is no
   fog, fade, typing, glint or dig animation, and the whole tunnel is shown at once.
   Pixel rules: every sprite and tile is image-rendering: pixelated at a whole-number scale (--px);
   Silkscreen only at 16 / 24 / 32 / 48 / 64 px. */

@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/Silkscreen-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --px: 4;                                   /* art scale: 1 game pixel = 4 css px */
  --cell: calc(var(--px) * 10px);            /* one game cell (the machine is one cell) */
  --tile: calc(var(--px) * 100px);           /* terrain tiles are 100x100 */
  --shaft: 120px;
  --sxm: 50%;                                /* shaft centre line */
  --wl: 2; --wr: 2;                          /* cells the tunnel may wander left / right of the centre (site.js) */
  --tpx: 2;                                  /* trees are drawn finer than the rest, so a smaller whole scale */
  --mY: min(58vh, 760px);                    /* where the machine sits in the viewport (its bottom edge) */
  --gap: clamp(96px, 13vw - 8px, 180px);     /* rock left visible between the shaft and the text */
  --bar: 0px;                                /* height of the bottom HUD bar (side layouts only) */

  --night: #0b0a09;
  --ink: #ece5d8;
  --muted: #bdb2a0;
  --hud: #f0a030;
  --title: #b86b1f;
  --frame: #d9951f;
  --warn: #f0644a;
  --panel: #15120f;
  --pixel: "Silkscreen", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --corner: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px),
    calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px),
    0 calc(100% - 4px), 0 4px, 4px 4px);
  color-scheme: dark;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

html, body { overflow-x: hidden; overflow-x: clip; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 18px/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
}

img { max-width: none; }
.px, .obj, .prop, .cloud, .machine img, .shaft, .stratum, .surface, .bedrock, .glint, .lava, .brand img { image-rendering: pixelated; }

a { color: #f6b24a; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #ffcf7a; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

h1, h2, h3, .hud, .btn, .hud-btn, .dig-hint, .tick, figcaption .depth, .tx-k, .tx-line, .warn, dt, .topnav a {
  font-family: var(--pixel);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}
h2 { font-size: 32px; line-height: 40px; color: var(--hud); margin: 0 0 16px; }
h3 { font-size: 24px; line-height: 32px; color: var(--hud); margin: 0 0 8px; }
* + h3 { margin-top: 24px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

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

.skip {
  position: absolute; left: 16px; top: -200px; z-index: 40;
  background: var(--hud); color: #1a1207; padding: 8px 16px; font-weight: 700;
}
.skip:focus { top: 16px; }

/* ---------- surface ---------- */
.surface {
  position: relative;
  min-height: max(var(--mY), 500px);
  background: url("/art/terrain/texture_sky.png") 0 0 / var(--tile) var(--tile);
}
.sky { position: absolute; inset: 0; }
.cloud { position: absolute; width: var(--tile); height: auto; opacity: .38; }
.cloud.c1 { left: 2%; top: 9%; }
.cloud.c2 { right: 3%; top: 34%; }
.cloud.c3 { left: 30%; top: 46%; opacity: .22; }
@media (prefers-reduced-motion: no-preference) {
  .cloud { animation: drift 120s steps(60) infinite alternate; }
  .cloud.c2 { animation-duration: 160s; animation-direction: alternate-reverse; }
}
@keyframes drift { to { transform: translateX(calc(var(--px) * 30px)); } }
.prop { position: absolute; bottom: 0; height: auto; }
.ruin { width: var(--tile); right: calc(50% + 300px); bottom: calc(var(--cell) * -1); }
.tree { width: calc(var(--tpx) * 60px); }
.t2 { right: calc(50% + 120px); }
.t1 { left: calc(50% + 140px); }
.t3 { left: calc(50% + 470px); }
.shed { width: calc(var(--px) * 20px); left: calc(50% + 620px); }

/* the small nav: only at the surface, never fixed */
.topnav {
  position: relative; z-index: 7;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: 1320px; margin: 0 auto; padding: 16px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand span { font: 16px/16px var(--pixel); text-transform: uppercase; }
.topnav ul { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.topnav a { font-size: 16px; line-height: 16px; }
.topnav ul a { color: #ddd3c4; text-decoration: none; padding: 4px 0; }
.topnav ul a:hover { color: var(--hud); }

.hero {
  position: relative; z-index: 6;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(8px, 4vh, 48px) 24px 0;
  text-align: center;
}
.hero::before { /* keeps the stars from crowding the text */
  content: ""; position: absolute; inset: 0 -40px -24px; z-index: -1;
  background: radial-gradient(closest-side, rgb(16 15 14 / .92), rgb(16 15 14 / .75) 70%, rgb(16 15 14 / 0));
}
.pitch, .meta { text-shadow: 0 2px 0 #000; }
.logo {
  font-size: 64px; line-height: 64px; margin: 0 0 24px;
  color: var(--hud);
  text-shadow: 4px 4px 0 var(--title), 8px 8px 0 #2a1606;
}
.logo-br { display: none; }
.pitch { font-size: 21px; line-height: 1.5; max-width: 36ch; margin: 0 auto 24px; }
.cta-row { margin: 0 0 12px; }
.meta { color: var(--muted); font-size: 16px; }

.btn {
  display: inline-block;
  font-size: 24px; line-height: 24px;
  padding: 16px 24px 20px;
  color: #1a1207; background: var(--hud);
  text-decoration: none;
  box-shadow: inset 0 -4px 0 var(--title);
  clip-path: var(--corner);
}
.btn:hover { background: #ffb64a; color: #1a1207; }
.btn:focus-visible { outline: 4px solid #1a1207; outline-offset: -10px; }

.dig-hint { margin: 16px 0 0; padding-bottom: 24px; font-size: 16px; line-height: 16px; color: var(--hud); }

/* ---------- the dug world (site.js) ---------- */
.terrain, .dug-wrap { position: absolute; z-index: 1; pointer-events: none; image-rendering: pixelated; }
.dug-wrap { overflow: hidden; will-change: transform; }
.dug-wrap canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; will-change: transform; }
.world .shaft, .world .geo, .world .lava { visibility: hidden; }
.world .machine { left: 0; top: 0; transform: translate3d(-200px, 0, 0); }

/* glints on geo deposits and lava pools, placed by site.js on the exact cells */
.glint { position: absolute; pointer-events: none; background-size: var(--tile) var(--tile); }
.glint.g-geo { z-index: 2; background-image: url("/art/terrain/texture_geodata.png"); filter: brightness(1.6) saturate(1.2); opacity: 0; }
.glint.g-lava { z-index: 5; }
.g-lava canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.g-lava .lb { filter: drop-shadow(0 0 14px rgb(255 80 16 / .5)); }
.g-lava .lf { filter: brightness(1.45); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .lamp .g-geo { animation: glint 3.2s steps(1) infinite; }
  .lamp .g-lava .lf { animation: glint 2.4s steps(1) infinite; animation-delay: var(--d, 0s); }
}
@keyframes glint { 0%, 70% { opacity: 0; } 75% { opacity: .9; } 85% { opacity: .4; } 90%, 100% { opacity: 0; } }

/* ---------- the shaft (no-JS fallback; site.js replaces it with the dug tunnel) ---------- */
main { position: relative; display: block; }
#main::after { /* darkness away from the shaft, like the game's fog at the edges of the screen */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, rgb(0 0 0 / .4), rgb(0 0 0 / .1) 26%, rgb(0 0 0 / 0) 40%, rgb(0 0 0 / 0) 60%,
    rgb(0 0 0 / .1) 74%, rgb(0 0 0 / .4));
}

.shaft {
  position: absolute; top: 0; bottom: 0; z-index: 1;
  left: calc(var(--sxm) - var(--shaft) / 2); width: var(--shaft);
  background:
    linear-gradient(rgb(4 3 2 / .6), rgb(4 3 2 / .6)),
    url("/art/terrain/texture_path.png") 0 0 / var(--tile) var(--tile);
  box-shadow: inset 8px 0 0 rgb(0 0 0 / .55), inset -8px 0 0 rgb(0 0 0 / .55),
    -4px 0 0 rgb(150 110 50 / .45), 4px 0 0 rgb(150 110 50 / .45);
}

.ticks { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.tick {
  position: absolute; left: calc(var(--sxm) + var(--cell) * 3.5 + 4px);
  font-size: 16px; line-height: 16px; color: var(--hud); opacity: .55;
  padding-left: 20px; margin-top: -8px; white-space: nowrap;
}
.tick::before { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 4px; background: currentColor; }

/* Strata. The game swaps the rock texture by depth band; the five textures share one average colour, so each
   band also gets its own hue (blended in "color" mode, so the texture keeps its pixels) and a little more
   darkness: brown topsoil, grey clay, rust, cold blue stone, then hot purple rock over the lava.
   --dl = darkness with the headlamp on, --ds = darkness without it (no JS / reduced motion).
   site.js reads --tint and --dl to shade the tunnel cells it paints the same way. */
.stratum {
  position: relative;
  --d: var(--ds);
  --tint: rgb(0 0 0 / 0);
  background:
    linear-gradient(rgb(5 4 4 / var(--d)), rgb(5 4 4 / var(--d))),
    linear-gradient(var(--tint), var(--tint)),
    var(--tex) 0 0 / var(--tile) var(--tile);
  background-blend-mode: normal, color, normal;
  padding: var(--cell) 0;
}
.lamp .stratum { --d: var(--dl); }
.s0 { --tex: url("/art/terrain/texture.png"); --dl: 0; --ds: .2; }
.s1 { --tex: url("/art/terrain/1000.png"); --dl: .1; --ds: .26; --tint: rgb(120 118 112 / .9); }
.s2 { --tex: url("/art/terrain/3000.png"); --dl: .16; --ds: .3; --tint: rgb(190 70 40 / .8); }
.s3 { --tex: url("/art/terrain/5000.png"); --dl: .2; --ds: .34; --tint: rgb(70 100 190 / .85); }
.s4 { --tex: url("/art/terrain/7000.png"); --dl: .24; --ds: .38; --tint: rgb(150 40 120 / .85); padding-bottom: calc(var(--cell) * 5); }
.s4::after { /* heat near the bottom of the world */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; z-index: 0;
  background: linear-gradient(rgb(140 30 0 / 0), rgb(140 30 0 / .3));
  pointer-events: none;
}
/* a band of hard rock between strata */
.stratum + .stratum::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(var(--cell) * 2);
  background:
    linear-gradient(rgb(5 4 4 / var(--d)), rgb(5 4 4 / var(--d))),
    url("/art/terrain/texture_tough_new.png") 0 0 / var(--tile) var(--tile);
  image-rendering: pixelated;
}

/* ---------- beats: one note pinned to the wall on the way down ---------- */
.beat {
  position: relative;
  display: grid;
  grid-template-columns: 1fr var(--shaft) 1fr;
  padding: 88px 0;
}
.beat > .panel, .beat > .note, .beat > .tx { grid-row: 1; width: min(440px, calc(100% - var(--gap) - 24px)); }
.beat.l > .panel, .beat.l > .note, .beat.l > .tx { grid-column: 1; justify-self: end; margin-right: var(--gap); }
.beat.r > .panel, .beat.r > .note, .beat.r > .tx { grid-column: 3; justify-self: start; margin-left: var(--gap); }
.beat > * { align-self: start; }
.beat.pair { padding-bottom: 48px; }
.beat.pair > .shot { grid-row: 1; width: min(520px, calc(100% - 128px)); }
.beat.pair > .shot:first-of-type { grid-column: 1; justify-self: end; margin-right: 104px; }
.beat.pair > .shot:last-of-type { grid-column: 3; justify-self: start; margin-left: 104px; margin-top: 176px; }
.beat.tx-beat { padding: 56px 0; }
/* notes on opposite walls overlap in height, so the eye zig-zags down the shaft */
.beat.l + .beat.r, .beat.r + .beat.l { margin-top: -136px; }
.beat.tx-beat + .beat.tx-beat { margin-top: -72px; }

.panel, .note, .tx, .shot, .warnpanel { position: relative; z-index: 6; }

/* things embedded in the rock: site.js digs a jagged cave pocket around each one */
.obj {
  position: absolute; z-index: 2;
  top: var(--y, 64px);
  width: calc(var(--w, 10) * var(--px) * 1px); height: auto;
}
.obj.ol { right: calc(50% + var(--shaft) / 2 + var(--x, 24px)); }
.obj.or { left: calc(50% + var(--shaft) / 2 + var(--x, 24px)); }
.geo {
  width: calc(var(--cell) * 4); height: calc(var(--cell) * 3);
  background: url("/art/terrain/texture_geodata.png") 0 0 / var(--tile) var(--tile);
  clip-path: polygon(var(--cell) 0, calc(var(--cell) * 3) 0, calc(var(--cell) * 3) var(--cell), 100% var(--cell),
    100% calc(var(--cell) * 2), calc(var(--cell) * 3) calc(var(--cell) * 2), calc(var(--cell) * 3) 100%,
    0 100%, 0 var(--cell), var(--cell) var(--cell));
}

/* panels: dark stone with the HUD's orange frame */
.panel {
  padding: 24px 28px 28px;
  border: 4px solid var(--frame);
  background: var(--panel);
  clip-path: var(--corner);
  isolation: isolate;
}
.panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("/art/terrain/texture_tough_new.png") 0 0 / var(--tile) var(--tile);
  filter: grayscale(1) brightness(.3);
  image-rendering: pixelated;
}
.note {
  padding: 24px 28px;
  background: rgb(8 7 6 / .9);
  clip-path: var(--corner);
}
.note p { color: var(--ink); }

.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 136px 1fr; gap: 16px; padding: 8px 0; border-top: 2px solid rgb(255 255 255 / .09); }
.facts div:first-child { border-top: 0; }
dt { font-size: 16px; line-height: 28px; color: var(--hud); }
dd { margin: 0; }

.warnpanel { border-color: #9a3a22; background: #070605; }
.warnpanel::before { display: none; }
.warn { list-style: none; margin: 8px 0 0; padding: 0; color: var(--warn); font-size: 24px; line-height: 40px; }

.quote blockquote { margin: 0 0 12px; font-family: var(--serif); font-size: 22px; line-height: 1.5; }
.cite { color: var(--muted); font-size: 16px; }
.links { margin: 16px 0 0; padding: 0; list-style: none; }
.links li { margin: 4px 0; }

/* the premise, typed like the game's orange text. The text is in the page from the start; typing only
   reveals it (the typed copy is an aria-hidden overlay), so screen readers and no-JS readers get every line. */
.tx {
  padding: 20px 24px 24px;
  background: #050403;
  border-left: 4px solid var(--hud);
  clip-path: var(--corner);
}
.tx-k { font-size: 16px; line-height: 24px; color: #d08a2c; margin: 0 0 8px; }
.tx-line { position: relative; font-size: 24px; line-height: 32px; color: var(--hud); margin: 0; }
.tx-line.typing .tx-src { color: transparent; }
.tx-ov { position: absolute; inset: 0; }
.tx-ov .off { color: transparent; }
.tx-ov .on::after {
  content: ""; display: inline-block; width: 16px; height: 24px; margin-right: -16px;
  background: var(--hud); vertical-align: -3px;
}

/* screenshots, captioned with the depth on the game's own HUD */
.shot { margin: 0; border: 4px solid var(--frame); background: #000; clip-path: var(--corner); }
.shot a { display: block; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { font-size: 16px; line-height: 24px; color: var(--ink); padding: 12px 16px 14px; display: flex; gap: 12px; align-items: baseline; }
.shot figcaption .depth { color: var(--hud); white-space: nowrap; min-width: 6ch; }

/* reveal: only with the headlamp on. Without JS or with reduced motion everything is just there. */
/* notes slide up a little when they arrive; the text itself is always fully readable */
.lamp .reveal { transition: transform .5s ease; }
.lamp .reveal:not(.on) { transform: translateY(12px); }

/* ---------- bottom of the world ---------- */
.bottom-lava { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--cell) * 4); z-index: 5; pointer-events: none; }
.lava { /* no-JS look; site.js paints the pools into the rock instead */
  position: absolute; bottom: 0;
  background: url("/art/terrain/texture_geodata.png") 0 0 / var(--tile) var(--tile);
  filter: hue-rotate(-24deg) saturate(1.8) brightness(1.05);
  box-shadow: inset 0 calc(var(--px) * 1px) 0 #2a0c04, 0 0 40px 8px rgb(255 80 16 / .3);
}
.lv1 { left: calc(var(--sxm) - var(--shaft) / 2 - var(--cell) * 5); width: calc(var(--cell) * 4); height: calc(var(--cell) * 2); }
.lv2 { left: calc(var(--sxm) + var(--shaft) / 2 + var(--cell)); width: calc(var(--cell) * 6); height: var(--cell); }
.lv3 { left: calc(var(--sxm) + var(--shaft) / 2 + var(--cell) * 9); width: calc(var(--cell) * 3); height: calc(var(--cell) * 2); }
.portal-end { position: absolute; bottom: calc(var(--cell) * 2); left: calc(var(--sxm) - var(--shaft) / 2 - var(--cell) * 9); width: var(--cell); }

.bedrock {
  position: relative; z-index: 6;
  min-height: calc(min(100vh, 1600px) - var(--mY) - var(--bar));
  background:
    linear-gradient(rgb(4 3 3 / .8), rgb(4 3 3 / .8)),
    url("/art/terrain/texture_tough_new.png") 0 0 / var(--tile) var(--tile);
  border-top: 8px solid #1d130c;
}
.foot-in { max-width: 760px; margin: 0 auto; padding: 56px 24px 40px; text-align: center; }
.bedrock h2 { font-size: 24px; line-height: 32px; }
.foot-links { list-style: none; margin: 24px 0 16px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.copy { color: var(--muted); font-size: 15px; }

/* ---------- fixed layers ---------- */
.fog { position: fixed; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; display: none; }
.lamp .fog { display: block; }
.fog canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; will-change: transform; }

.machine {
  position: fixed; z-index: 12; pointer-events: none;
  left: var(--sxm); top: var(--mY);
  width: var(--cell); height: var(--cell);
  transform: translate(-50%, -100%);
}
.machine img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.m-dig, .m-dust { opacity: 0; }
.m-dust { top: 60%; }
.m-side { opacity: 0; }
.m-side.sl { left: -70%; }
.m-side.sr { left: 70%; }
.machine[data-state="side"][data-dir="l"] .sl, .machine[data-state="side"][data-dir="r"] .sr { opacity: 1; }
.machine[data-state="dig"] .m-idle { opacity: 0; }
.machine[data-state="dig"] .m-dig { opacity: 1; }
.machine[data-dust="1"] .d1, .machine[data-dust="2"] .d2, .machine[data-dust="3"] .d3 { opacity: 1; }

/* The HUD: on desktop a small cluster at the bottom of the screen over the tunnel band, which no text ever
   enters; it steps aside when the footer arrives. Side layouts use a full-width bottom bar instead. */
.hudbar {
  position: fixed; z-index: 20; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: none; gap: 4px; align-items: stretch;
  transition: opacity .3s, visibility .3s;
}
.js .hudbar { display: flex; }
.js.floor .hudbar { opacity: 0; visibility: hidden; }
.hud {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 12px;
  background: var(--panel); border: 4px solid var(--frame); clip-path: var(--corner);
  font-size: 16px; line-height: 16px; white-space: nowrap;
}
.hud-k { color: var(--hud); }
.hud-v { color: var(--ink); min-width: 5ch; }
.hud-btns { display: flex; gap: 4px; }
.hud-btn {
  display: flex; align-items: center; white-space: nowrap;
  font-size: 16px; line-height: 16px; padding: 16px 12px;
  background: var(--panel); color: var(--hud); text-decoration: none;
  border: 4px solid var(--frame); clip-path: var(--corner);
}
.hud-btn:hover { color: #ffcf7a; }
.hud-btn:focus-visible { outline: 3px solid #fff; outline-offset: -9px; }

/* ---------- smaller desktops ---------- */
/* the HUD cluster must fit between the left and right notes: below 1440 px the two buttons stack */
@media (min-width: 1121px) and (max-width: 1439px) {
  .hud-btns { flex-direction: column; gap: 4px; }
  .hud-btn { justify-content: center; padding: 6px 12px 8px; }
}
@media (max-width: 1399px) {
  .tick { display: none; } /* the labels would run under the right-hand notes */
}
@media (max-width: 1360px) {
  .facts div { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 1240px) {
  .ruin, .t3 { display: none; }
}
@media (max-height: 700px) and (min-width: 1121px) {
  .logo { font-size: 48px; line-height: 48px; }
  .pitch { font-size: 18px; margin-bottom: 16px; }
}

/* ---------- side layouts (tablets and phones): the tunnel runs down the left edge, text in one column ---------- */
@media (max-width: 1120px) {
  :root { --px: 3; --shaft: 30px; --sxm: 75px; --wl: 2; --wr: 1; --tpx: 1; --mY: min(60vh, 640px);
    --tx: 200px; --col: 680px; --bar: 60px; }
  .js body { padding-bottom: var(--bar); }
  h2 { font-size: 24px; line-height: 32px; }

  .surface { min-height: max(var(--mY), 520px); padding-bottom: 136px; } /* room for the trees and the shed under the text */
  .topnav { padding: 16px 24px; justify-content: flex-end; max-width: none; }
  .topnav ul { gap: 8px 20px; justify-content: flex-end; }
  .brand { display: none; }
  .hero { padding: 24px 24px 0 var(--tx); text-align: left; max-width: calc(var(--tx) + var(--col)); margin: 0; }
  .hero::before { inset: -8px -24px -24px calc(var(--tx) - 32px); background: rgb(16 15 14 / .82); clip-path: var(--corner); }
  .pitch { margin: 0 0 24px; }
  .logo-br { display: inline; }
  .cloud.c1 { left: auto; right: -40px; top: 2%; }
  .cloud.c3 { display: none; }
  .ruin, .t2, .t3 { display: none; }
  .shed { left: auto; right: 16px; }
  .t1 { left: auto; right: 96px; }

  #main::after { background: linear-gradient(90deg, rgb(0 0 0 / 0), rgb(0 0 0 / 0) 30%, rgb(0 0 0 / .45)); }

  .beat { display: block; padding: 96px 24px 24px var(--tx); }
  .beat.l + .beat.r, .beat.r + .beat.l, .beat.tx-beat + .beat.tx-beat { margin-top: 0; }
  .beat > .panel, .beat > .note, .beat > .tx, .beat.pair > .shot,
  .beat.l > .panel, .beat.l > .note, .beat.l > .tx, .beat.r > .panel, .beat.r > .note, .beat.r > .tx,
  .beat.pair > .shot:first-of-type, .beat.pair > .shot:last-of-type { width: auto; max-width: var(--col); margin: 0; justify-self: stretch; }
  .beat.pair { padding-top: 48px; padding-bottom: 0; }
  .beat.pair:has(> .obj) { padding-top: 96px; }
  .beat.pair > .shot:last-of-type { margin: 40px 0 0; }
  .beat.tx-beat { padding: 40px 24px 0 var(--tx); }
  .beat.tx-beat .obj { display: none; }
  /* objects sit in the rock just above their note */
  .obj { top: auto; bottom: calc(100% - 88px); }
  /* taller objects (and their cave roof) need more rock above the note */
  .beat:has(> .obj[height="20"], > .obj[height="25"], > .obj[height="30"], > .obj[height="40"]) { padding-top: 192px; }
  .beat:has(> .obj[height="20"], > .obj[height="25"], > .obj[height="30"], > .obj[height="40"]) > .obj { bottom: calc(100% - 176px); }
  .obj.ol { right: auto; left: calc(var(--tx) + 16px); }
  .obj.or { left: auto; right: max(24px, calc(100% - var(--tx) - var(--col))); }
  .tick { display: none; }

  .lv1 { left: calc(var(--sxm) + var(--shaft) / 2 + var(--cell) * 3); width: calc(var(--cell) * 3); }
  .lv2 { left: calc(var(--sxm) + var(--shaft) / 2 + var(--cell) * 8); }
  .lv3 { left: calc(var(--sxm) + var(--shaft) / 2 + var(--cell) * 16); }
  .portal-end { left: auto; right: 24px; }

  .foot-in { padding: 48px 24px 40px var(--tx); text-align: left; max-width: none; }
  .foot-links { justify-content: flex-start; }

  .hudbar {
    left: 0; right: 0; bottom: 0; transform: none;
    height: var(--bar); padding: 0 16px 0 24px;
    justify-content: space-between; align-items: center;
    background: var(--panel); border-top: 4px solid var(--frame);
  }
  .js.floor .hudbar { opacity: 1; visibility: visible; }
  .hud { flex-direction: row; gap: 12px; min-width: 0; padding: 0; border: 0; background: none; clip-path: none; font-size: 16px; line-height: 16px; }
  .hud-btn { font-size: 16px; line-height: 16px; padding: 10px 16px 12px; border-width: 4px; }
}

/* phones */
@media (max-width: 600px) {
  :root { --sxm: 49px; --wl: 1; --wr: 0; --mY: min(62vh, 640px); --tx: 76px; }
  body { font-size: 17px; }
  h3 { font-size: 16px; line-height: 24px; }
  * + h3 { margin-top: 20px; }

  .surface { min-height: max(var(--mY), 480px); padding-bottom: 48px; }
  .topnav { display: none; }
  .hero { padding: 32px 16px 0 var(--tx); }
  .hero::before { inset: -8px -8px -16px -12px; }
  .logo { font-size: 48px; line-height: 48px; text-shadow: 3px 3px 0 var(--title), 6px 6px 0 #2a1606; }
  .pitch { font-size: 18px; margin: 0 0 20px; }
  .btn { font-size: 16px; line-height: 16px; padding: 14px 20px 18px; }
  .cloud.c2 { display: none; }

  .beat { padding: 96px 16px 24px var(--tx); }
  .beat.pair { padding-top: 48px; }
  .beat.pair:has(> .obj) { padding-top: 96px; }
  .beat.tx-beat { padding: 40px 16px 0 var(--tx); }
  .obj.or { right: 20px; }
  .panel, .note { padding: 20px; }
  .tx { padding: 16px 18px 20px; }
  .tx-line { font-size: 16px; line-height: 24px; }
  .tx-ov .on::after { width: 12px; height: 16px; margin-right: -12px; vertical-align: -2px; }
  .warn { font-size: 16px; line-height: 32px; }
  .quote blockquote { font-size: 19px; }
  .shot figcaption { flex-direction: column; gap: 0; }

  .lv1 { left: calc(var(--sxm) + var(--shaft) / 2 + var(--cell) * 2); }
  .lv2 { left: calc(var(--sxm) + var(--shaft) / 2 + var(--cell) * 7); width: calc(var(--cell) * 3); }
  .lv3 { display: none; }
  .portal-end { right: 16px; }

  .foot-in { padding: 40px 16px 32px var(--tx); }
  .foot-links { flex-direction: column; gap: 6px; }
  :root { --bar: 84px; }
  .hudbar { padding: 0 12px 0 16px; }
  .hud-btns { flex-direction: column; gap: 4px; }
  .hud-btn { justify-content: center; padding: 6px 12px 8px; border-width: 3px; }
}

/* site.js draws the band transitions itself (jagged, Voronoi-shaped): the straight CSS seam goes */
.painted .stratum + .stratum::before { display: none; }
