/* Wormery landing page.
   Colours come from the game (assets/manifest.ron ui.* tokens).
   The page is one long dig: night sky, grass line, then soil layers that darken as you scroll.
   site.js paints the pixel soil; without it each layer falls back to a flat colour. */

@font-face { font-family: "Fredoka"; src: url(assets/fonts/Fredoka-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(assets/fonts/Nunito-SemiBold.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(assets/fonts/Nunito-ExtraBold.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --text: #f7ebdf;
  --dim: #d1bcae;
  --faint: #a99487;
  --accent: #f6be6c;
  --accent-hi: #ffd791;
  --accent-dim: #a0703f;
  --link: #ffd5a0;
  --panel: #28191d;
  --panel-rim: #946c48;
  --inset: #1d1115;
  --inset-rim: #45302f;
  --button: #3f282d;
  --teal: #78d6be;
  --ink: #160c0a;
  --px: 4px;                 /* one art pixel */
  --gutter: 16px;
  --wrap: 1104px;
  --display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #0a060a;
  color: var(--text);
  font: 600 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg { image-rendering: pixelated; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #fff0d8; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
b { font-weight: 800; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 50; padding: 10px 16px; background: var(--accent); color: #2a1a10; font-weight: 800; border-radius: 999px; }
.skip-link:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; position: relative; z-index: 1; }
.wrap--narrow { --wrap: 800px; }

/* ---------- The pixel panel: a 9-slice frame with notched corners ---------- */
.panel {
  background: var(--panel);
  background-clip: padding-box;
  border: 12px solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath fill='%23160c0a' d='M1 0h5v7H1zM0 1h7v5H0z'/%3E%3Cpath fill='%23946c48' d='M2 1h3v5H2zM1 2h5v3H1z'/%3E%3Cpath fill='%2328191d' d='M3 2h1v3H3zM2 3h3v1H2z'/%3E%3C/svg%3E") 3 / 12px stretch;
  filter: drop-shadow(0 8px 0 rgba(8, 4, 6, .42));
}
.panel--stone {
  --panel: #1e1a1f;
  border-image-source: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' shape-rendering='crispEdges'%3E%3Cpath fill='%23070507' d='M1 0h5v7H1zM0 1h7v5H0z'/%3E%3Cpath fill='%235f5860' d='M2 1h3v5H2zM1 2h5v3H1z'/%3E%3Cpath fill='%231e1a1f' d='M3 2h1v3H3zM2 3h3v1H2z'/%3E%3C/svg%3E");
}

/* ---------- Buttons and the sign-up form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 24px;
  font: 800 17px/1.2 var(--body); text-decoration: none; text-align: center;
  border: 0; border-radius: 999px; cursor: pointer;
}
.btn--primary { background: var(--accent); color: #2a1a10; box-shadow: 0 4px 0 var(--accent-dim), 0 4px 0 4px rgba(22, 12, 10, .0); }
.btn--primary:hover { background: var(--accent-hi); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-dim); }
.btn--steam { min-height: 44px; padding: 8px 20px; font-size: 16px; background: var(--button); color: var(--text); box-shadow: inset 0 0 0 2px #6b4a4f; }
.btn--steam[aria-disabled="true"] { background: rgba(29, 17, 21, .72); color: var(--dim); box-shadow: inset 0 0 0 2px var(--inset-rim); cursor: default; }
.btn--steam:not([aria-disabled="true"]):hover { background: #5b3b42; color: #fff; }

.signup-form { width: min(560px, 100%); margin-inline: auto; }
.signup-row { display: flex; flex-direction: column; gap: 12px; }
.signup-row input {
  flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 10px 20px;
  font: 600 17px/1.2 var(--body); color: var(--text);
  background: var(--inset); border: 2px solid #6b4a3a; border-radius: 999px;
}
.signup-row input::placeholder { color: var(--faint); opacity: 1; }
.signup-row input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); border-radius: 999px; }
.signup-note { margin-top: 12px; color: var(--dim); font-size: 16px; text-align: center; }
.signup-note.is-soon::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--accent); vertical-align: 1px; }
.signup-note.is-nudge { color: var(--accent-hi); }
.steam-line { margin-top: 16px; text-align: center; }

/* ---------- Depth meter ---------- */
.depth {
  position: fixed; z-index: 30; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 10px;
  background: rgba(27, 16, 19, .92); box-shadow: inset 0 0 0 2px var(--inset-rim), 0 4px 0 rgba(8, 4, 6, .4);
  pointer-events: none; line-height: 1.15;
}
.no-js .depth, .no-js .sound { display: none; }
.depth-read { display: flex; align-items: baseline; gap: 8px; }
.depth-num { font: 600 18px/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; min-width: 3.1em; text-align: right; }
.depth-layer { font-size: 13px; font-weight: 800; color: var(--dim); white-space: nowrap; }
/* the rail: on phones a slim strip in the right-hand gutter, on wide screens part of the ruler box */
.depth-rail { position: fixed; right: 1px; top: 50%; width: 14px; height: 120px; margin-top: -60px; box-shadow: 0 0 0 1px #0b0708; }

/* ---------- Sound switch ---------- */
.sound {
  position: fixed; z-index: 30; left: 8px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; cursor: pointer;
  color: var(--faint); background: rgba(27, 16, 19, .92); box-shadow: inset 0 0 0 2px var(--inset-rim), 0 4px 0 rgba(8, 4, 6, .4);
}
.sound svg { width: 22px; height: 18px; }
.sound:hover { color: var(--text); }
.sound[aria-pressed="true"] { color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent-dim), 0 4px 0 rgba(8, 4, 6, .4); }
.sound[aria-pressed="true"] .sound-off, .sound[aria-pressed="false"] .sound-on { display: none; }

/* ---------- 0. The night sky ---------- */
.sky { position: relative; background: #121027; padding: 96px 0 88px; overflow: hidden; }
.sky-canvas, .soil { position: absolute; left: 0; width: 100%; pointer-events: none; z-index: 0; }
.sky-canvas { top: 0; height: 100%; }
.sky-inner { text-align: center; }
.sky-link {
  position: absolute; right: 0; top: -78px;
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px;
  font-weight: 800; font-size: 16px; color: var(--text); text-decoration: none;
  background: rgba(12, 10, 26, .6); border-radius: 999px; box-shadow: inset 0 0 0 2px #3c3466;
}
.sky-link:hover { background: #241c44; color: #fff; }
.logo { width: min(541px, 100%); margin: 0 auto; }
.logo img { width: 100%; filter: drop-shadow(0 6px 0 rgba(7, 6, 15, .6)); }
.pitch {
  font: 600 23px/1.24 var(--display); letter-spacing: .005em;
  max-width: 23em; margin: 22px auto 0; text-wrap: balance;
  text-shadow: 0 2px 0 #07060f, 0 0 18px #0c0a1a;
}
.star { position: absolute; z-index: 0; width: var(--px); height: var(--px); background: #fffaf0; animation: twinkle 3.6s steps(1, end) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 40% { opacity: .25; } 55% { opacity: .7; } }

/* ---------- Soil layers ---------- */
.layer { position: relative; --edge: 56px; padding: 88px 0 112px; overflow-x: clip; }
.soil { top: calc(-1 * var(--edge)); height: calc(100% + var(--edge)); }
.layer--litter  { background: #4c2614; --edge: 64px; padding-top: 20px; padding-bottom: 104px; }
.layer--topsoil { background: #3d2012; }
.layer--rootbed { background: #2c170e; }
.layer--stone   { background: #1e161a; }
.layer--deep    { background: #150c10; }
.layer--bedrock { background: #0c080b; padding-bottom: 0; }

.glyph { position: absolute; z-index: 1; width: 36px; height: 36px; opacity: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%2378d6be' d='M1 0h7v1H1zM0 1h1v8H0zM8 1h1v7H8zM2 2h5v1H2zM2 3h1v4H2zM6 3h1v3H6zM4 4h1v2H4zM5 5h1v1H5zM2 7h7v1H2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.glyph.is-lit { opacity: .5; }
.drift { position: absolute; z-index: 1; width: 4px; height: 4px; pointer-events: none; opacity: 0; display: none; }
.drift i { display: block; width: 4px; height: 4px; background: #c69a62; }
.drift--spore i { background: #54d4ff; }
.crumb { position: absolute; z-index: 1; width: 4px; height: 4px; pointer-events: none; animation: crumb-fall .72s steps(9, end) both; }
@keyframes crumb-fall { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(36px); opacity: 0; } }

.depths { position: relative; }
.dark { display: none; }

.section-head { text-align: center; margin-bottom: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.eyebrow--teal { color: var(--teal); }
.spiral { width: 18px; height: 18px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6' shape-rendering='crispEdges'%3E%3Cpath fill='%23f6be6c' d='M0 0h6v1H0zM5 1h1v5H5zM1 5h4v1H1zM1 2h1v3H1zM2 2h2v1H2zM3 3h1v1H3z'/%3E%3C/svg%3E") center / contain no-repeat; }
.eyebrow--teal .spiral { filter: hue-rotate(125deg) saturate(.8); }
h2 { font: 600 clamp(32px, 4.4vw, 50px)/1.1 var(--display); margin-top: 10px; text-shadow: 0 3px 0 rgba(10, 6, 10, .55); }
h3 { font: 600 22px/1.2 var(--display); }
.section-intro { max-width: 36em; margin: 16px auto 0; color: var(--dim); font-size: 17px; text-wrap: pretty; text-shadow: 0 1px 0 rgba(10, 6, 10, .5); }

/* ---------- 1. Just under the grass: the first sign-up ---------- */
.hero { text-align: center; }
.signup-form--hero { margin-top: 28px; }
.lede { max-width: 34em; margin: 36px auto 0; font-size: 18px; color: var(--text); text-wrap: pretty; text-shadow: 0 1px 0 rgba(10, 6, 10, .55); }
.dig-cue { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 36px; padding: 8px 16px; font: 600 18px/1 var(--display); color: var(--accent); text-decoration: none; }
.dig-cue i { width: 20px; height: 12px; background: currentColor; clip-path: polygon(0 0, 20% 0, 20% 33.3%, 40% 33.3%, 40% 66.6%, 60% 66.6%, 60% 33.3%, 80% 33.3%, 80% 0, 100% 0, 100% 33.3%, 80% 33.3%, 80% 66.6%, 60% 66.6%, 60% 100%, 40% 100%, 40% 66.6%, 20% 66.6%, 20% 33.3%, 0 33.3%); animation: dig 1.2s steps(2, end) infinite; }
@keyframes dig { 0% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------- 2. Meet the worms ---------- */
/* Text cards. A card gains a picture (.has-shot) when its game capture exists. */
.worm-grid { display: grid; gap: 16px; }
.worm-card { position: relative; padding: 22px 16px 16px; }
.worm-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--c); box-shadow: 0 4px 0 rgba(8, 4, 6, .35); }
.worm-text h3 { font-size: 24px; }
.worm-text p { margin-top: 6px; color: var(--dim); }
.worm-pic { display: block; aspect-ratio: 4 / 3; margin: -6px -8px 16px; overflow: hidden; background: #150b0c; box-shadow: 0 0 0 4px var(--ink); }
.worm-pic img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 3. Family ---------- */
.family-shots { display: grid; gap: 32px; margin-bottom: 48px; }
.family-trio { display: grid; gap: 32px; }
.family-shots figcaption { text-align: center; }
.blend-list { display: grid; gap: 20px; }
.blend-list li { min-width: 0; padding: 18px 18px 20px; }
.blend-list h3 { font-size: 23px; }
.blend-list h3 + p { margin-top: 6px; color: var(--dim); }
.blend { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font: 600 22px/1 var(--display); color: var(--accent); }
.blend i { position: relative; width: 28px; height: 28px; margin: 4px; background: var(--c); box-shadow: 0 0 0 4px var(--ink), inset 0 4px 0 rgba(255, 255, 255, .22), inset 0 -4px 0 rgba(8, 4, 6, .22); }
.blend i.glow::after { content: ""; position: absolute; left: 8px; top: 16px; width: 4px; height: 4px; background: #54d4ff; box-shadow: 8px -8px 0 #54d4ff; }

/* ---------- The colony band (hidden until its capture exists) ---------- */
.pano-slot { position: relative; z-index: 1; }
.pano { --pano-h: 400px; position: relative; z-index: 1; }
.pano-lead { position: relative; z-index: 1; margin: 88px var(--gutter) 32px; text-align: center; font: 600 22px/1.3 var(--display); color: var(--text); text-shadow: 0 2px 0 rgba(10, 6, 10, .55); }
.pano.is-pinned { height: calc(var(--pano-h) + var(--pan, 0px)); }
.pano.is-pinned .pano-pin { position: sticky; top: max(0px, calc(50vh - var(--pano-h) / 2)); }
.pano-view {
  height: var(--pano-h); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
  background: #150b0c;
  box-shadow: 0 -4px 0 var(--ink), 0 -8px 0 #7a4a22, 0 -12px 0 var(--ink), 0 4px 0 var(--ink), 0 8px 0 #7a4a22, 0 12px 0 var(--ink), 0 30px 60px rgba(8, 4, 6, .5);
}
.pano-view::-webkit-scrollbar { display: none; }
.pano-strip { position: relative; width: max-content; height: 100%; margin-inline: auto; }
.pano-strip img { height: var(--pano-h); width: auto; max-width: none; }
.pano-cap {
  position: absolute; left: calc(var(--x) * 100%); bottom: 10px; width: max-content; max-width: 236px; transform: translateX(-50%);
  padding: 6px 12px; text-align: center; font-size: 16px; line-height: 1.35; color: var(--text);
  background: rgba(21, 11, 12, .86); border-radius: 8px; box-shadow: inset 0 0 0 2px #6b4a3a;
}
.pano-cap b { color: var(--accent); }
.js .pano-cap { opacity: 0; }
.js .pano-cap.is-on { opacity: 1; }

/* ---------- 4. Ruins ---------- */
.shot figcaption { margin-top: 16px; color: var(--dim); text-wrap: pretty; }
.shot figcaption b { color: var(--text); font: 600 20px/1.3 var(--display); margin-right: 6px; }
.shot-frame { position: relative; overflow: hidden; background: #0c0a0e; box-shadow: 0 0 0 4px #070507, 0 0 0 8px #4b464e, 0 0 0 12px #070507; margin: 12px; }
.shot-frame img { width: 100%; height: 100%; object-fit: cover; }
.shot--hall .shot-frame { height: 200px; animation: glow-teal 4.2s ease-in-out infinite alternate; }
.shot--hall img { filter: brightness(1.35) saturate(1.15); }
.shot--egg .shot-frame { aspect-ratio: 472 / 362; animation: glow-warm 3.4s ease-in-out infinite alternate; }
.shot--folk .shot-frame { height: 230px; animation: glow-warm 3.8s ease-in-out infinite alternate; }
.shot--folk q, .shot--folk .who { display: block; }
.shot--folk q { margin-top: 8px; font: 600 19px/1.4 var(--display); color: var(--accent-hi); quotes: "\201C" "\201D"; }
.shot--folk .who { margin-top: 6px; font-size: 16px; color: var(--faint); }
.ruin-pair { display: grid; gap: 48px; margin-top: 48px; }
@keyframes glow-teal { from { box-shadow: 0 0 0 4px #070507, 0 0 0 8px #4b464e, 0 0 0 12px #070507, 0 0 28px 10px rgba(84, 212, 190, .08); } to { box-shadow: 0 0 0 4px #070507, 0 0 0 8px #4b464e, 0 0 0 12px #070507, 0 0 56px 18px rgba(84, 212, 190, .26); } }
@keyframes glow-warm { from { box-shadow: 0 0 0 4px #070507, 0 0 0 8px #4b464e, 0 0 0 12px #070507, 0 0 28px 10px rgba(255, 211, 107, .07); } to { box-shadow: 0 0 0 4px #070507, 0 0 0 8px #4b464e, 0 0 0 12px #070507, 0 0 60px 18px rgba(255, 211, 107, .24); } }

/* ---------- 5. Devlog ---------- */
.log { display: grid; gap: 22px; }
.log-entry { display: grid; grid-template-columns: 68px 1fr; gap: 16px; align-items: start; padding: 12px 12px 14px; }
.log-entry time { display: block; text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); line-height: 1.3; }
.log-entry time b { display: block; font: 600 40px/1 var(--display); color: var(--accent); }
.log-body p { margin-top: 4px; color: var(--dim); }

/* ---------- 6. Bottom ---------- */
.signup-big { position: relative; padding: 44px 12px 28px; text-align: center; margin-top: 40px; }
.signup-glow { position: relative; }
.signup-glow::before { content: ""; position: absolute; inset: -90px -30%; background: radial-gradient(closest-side, rgba(255, 166, 60, .28), rgba(255, 166, 60, .09) 55%, transparent); pointer-events: none; }
.signup-big h2 { margin-top: 0; }
.signup-pitch { max-width: 30em; margin: 14px auto 24px; color: var(--dim); font-size: 17px; }
.faq { margin-top: 72px; }
.faq-title { font-size: 28px; text-align: center; margin: 0 0 24px; }
.faq dl { display: grid; gap: 24px 40px; }
.faq dt { font: 600 20px/1.3 var(--display); color: var(--text); }
.faq dd { margin-top: 4px; color: var(--dim); }
.foot { position: relative; z-index: 1; margin-top: 88px; padding: 40px 0 96px; text-align: center; color: var(--faint); }
.foot-end { font: 600 20px/1.3 var(--display); color: var(--dim); }
.spiral--big { display: block; width: 36px; height: 36px; margin: 0 auto 16px; opacity: .8; }
.foot-up { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-weight: 800; }
.foot-small { margin-top: 20px; font-size: 16px; }

/* ---------- Wider screens ---------- */
@media (min-width: 480px) {
  .signup-row { flex-direction: row; }
}
@media (min-width: 700px) {
  :root { --gutter: 32px; }
  body { font-size: 17px; }
  .sky { padding: 124px 0 100px; }
  .sky-link { top: -104px; }
  .logo { width: 541px; }
  .pitch { margin-top: 28px; }
  .pitch { font-size: clamp(28px, 2.9vw, 40px); line-height: 1.2; }
  .layer { padding: 112px 0 136px; }
  .layer--litter { padding-top: 24px; padding-bottom: 120px; }
  .layer--bedrock { padding-bottom: 0; }
  .worm-grid { grid-template-columns: repeat(2, 1fr); }
  .pano-lead { margin-top: 112px; font-size: 26px; }
  .pano-cap { max-width: 280px; bottom: 28px; }
  .family-trio { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .blend-list { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .shot--hall .shot-frame { height: auto; aspect-ratio: 1080 / 324; }
  .shot--folk .shot-frame { height: auto; aspect-ratio: 1120 / 450; }
  .log-entry { grid-template-columns: 96px 1fr; gap: 20px; padding: 16px 20px 18px 12px; }
  .signup-big { padding: 52px 40px 36px; }
  .signup-note { margin-inline: -80px; }
  .faq dl { grid-template-columns: repeat(2, 1fr); }
  .depth { right: 16px; }
}
@media (min-width: 1000px) {
  .worm-grid { grid-template-columns: repeat(3, 1fr); }
  .ruin-pair { grid-template-columns: 472fr 902fr; gap: 32px; align-items: start; }
  .ruin-pair .shot-frame { margin-inline: 12px; }
}
@media (min-width: 1100px) {
  :root { --gutter: 88px; }
  .worm-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .worm-grid { align-items: start; padding-bottom: 36px; }
  .worm-card:nth-child(even) { margin-top: 36px; }

  /* the meter becomes a ruler on the side */
  .depth { right: 6px; bottom: auto; top: 50%; transform: translateY(-50%); flex-direction: column; align-items: center; gap: 12px; padding: 12px 4px 16px; width: 76px; }
  .depth-read { flex-direction: column; align-items: center; gap: 4px; }
  .depth-num { font-size: 22px; min-width: 0; text-align: center; }
  .depth-layer { font-size: 12px; }
  .depth-rail { position: static; width: 28px; height: 192px; margin: 0; box-shadow: 0 0 0 4px #0b0708; }
}
@media (min-width: 1280px) {
  .sky { padding: 132px 0 108px; }
  .sky-link { top: -112px; }
  .logo { width: 1082px; }
  .pitch { margin-top: 36px; }
}

/* ---------- Things that move (all of it stops in calm mode, below) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .is-off *:not(.soil--roots) { animation-play-state: paused !important; }

  /* roots: a slow sway, hanging from the top */
  .soil--roots { transform-origin: 50% 0; will-change: transform; animation: root-sway 9s step-end infinite; }
  @supports (animation-timeline: view()) {
    /* and a gentle parallax against the soil, in 4 px steps, driven by the scroll itself */
    .soil--roots { animation: root-sway 9s step-end infinite, root-drift 1s steps(4, jump-none) both; animation-timeline: auto, view(); }
  }

  .js .drift { display: block; animation: drift-up var(--t, 22s) steps(22, end) var(--d, 0s) infinite; }
  .js .drift i { animation: drift-side calc(var(--t, 22s) * .37) steps(4, end) var(--d, 0s) infinite alternate; }
  .js .drift--spore { animation-name: spore-up; }

  .glyph.is-lit { animation: glyph-pulse 1.5s steps(5, end) 3 alternate both; }

  /* the dark of the deep with the lantern's stepped light */
  .js .dark { display: block; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent 40px, #000 520px); mask-image: linear-gradient(to bottom, transparent 40px, #000 520px); }
  .dark-light { position: sticky; top: 0; height: 100vh; height: 100lvh;
    background: radial-gradient(circle at var(--lx, 50%) var(--ly, 40%),
      rgba(255, 176, 84, .12) 0 72px, rgba(255, 176, 84, .07) 72px 120px, rgba(255, 176, 84, .025) 120px 172px,
      rgba(7, 4, 9, .2) 172px 228px, rgba(7, 4, 9, .36) 228px 288px, rgba(7, 4, 9, .5) 288px); }
}
@keyframes root-sway { 0%, 100% { transform: skewX(0deg); } 25% { transform: skewX(.14deg); } 75% { transform: skewX(-.14deg); } }
@keyframes root-drift { from { translate: 0 8px; } to { translate: 0 -8px; } }
@keyframes drift-up { 0% { transform: translateY(0); opacity: 0; } 9% { opacity: .5; } 82% { opacity: .5; } 100% { transform: translateY(-88px); opacity: 0; } }
@keyframes spore-up { 0% { transform: translateY(0); opacity: 0; } 9% { opacity: .65; } 45% { opacity: .3; } 82% { opacity: .65; } 100% { transform: translateY(-88px); opacity: 0; } }
@keyframes drift-side { from { transform: translateX(0); } to { transform: translateX(var(--sx, 16px)); } }
@keyframes glyph-pulse { from { opacity: .3; } to { opacity: 1; } }

/* ---------- Calm mode ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
