@font-face {
  font-family: 'DotGothic16';
  src: url('../public/font/dotgothic16/DotGothic16-Latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'DotGothic16';
  src: url('../public/font/dotgothic16/DotGothic16-Kana.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+3040-30FF;
}

@font-face {
  font-family: 'Commit Mono';
  src: url('../public/font/commit-mono/CommitMono-Regular.otf') format('opentype');
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../public/font/ibm-plex-sans/IBMPlexSans.woff2') format('woff2');
  font-weight: 100 700;
  font-display: swap;
}

@font-face {
  font-family: 'Unscii 16';
  src: url('../public/font/unscii/unscii-16.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Unscii 16 Capital I';
  src: url('../public/font/unscii/unscii-16.woff') format('woff');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0049;
}

:root {
  color-scheme: dark;
  --background: #090f0e;
  --panel: #101916;
  --line: #2c4239;
  --text: #edf4ec;
  --muted: #a7bab1;
  --mint: #91f9c6;
  --mono: 'Commit Mono', ui-monospace, monospace;
  --reading: 'IBM Plex Sans', system-ui, sans-serif;
  --display: 'DotGothic16', var(--mono);
  --header-height: 74px;
}

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

html { scroll-padding-top: var(--header-height); }

body {
  margin: 0;
  isolation: isolate;
  background-color: var(--background);
  background-image: radial-gradient(circle, #29423a 0.7px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text);
  font: 1rem/1.6 var(--mono);
}

h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
select { font: inherit; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }

.shell {
  width: min(1200px, calc(100% - 6rem));
  margin-inline: auto;
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 4;
  height: 2px;
  background: var(--mint);
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: var(--background);
}

.header-inner {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.brand { justify-self: start; }
.brand img { display: block; object-fit: contain; }
.site-nav, .header-actions, .hero-actions {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-nav {
  gap: clamp(1rem, 3vw, 3rem);
  color: var(--muted);
  font-size: 0.84rem;
}

.site-nav a:hover, .site-footer a:hover { color: var(--mint); }
.header-actions { justify-self: end; gap: 0.9rem; }

.header-actions select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  max-width: 4rem;
  padding: 0.38rem;
  font-size: 0.78rem;
}

.button, .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  min-height: 44px;
  font-size: 0.9rem;
}

.button {
  min-height: 50px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--mint);
  color: var(--mint);
  background: var(--background);
}

.button-small { min-height: 38px; padding: 0.36rem 0.7rem; font-size: 0.78rem; }
.button:hover { background: var(--panel); }
.button-primary { color: #09130e; background: var(--mint); font-weight: 700; }
.button-primary:hover { background: #bcffdb; }
.text-link:hover { color: var(--mint); }
.text-link span:last-child { color: var(--mint); }
.hero {
  --stage-height: max(480px, calc(100svh - var(--header-height)));
  display: grid;
  isolation: isolate;
}

.eyebrow {
  color: var(--accent, var(--mint));
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.terminal-mark { margin-right: 0.65rem; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
}

h1 {
  margin-top: 0.5rem;
  font-size: clamp(3.25rem, 5.9vw, 5.75rem);
  letter-spacing: 0.018em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

h1 em { font-style: normal; color: var(--mint); }

.story-chapters, .scene { grid-area: 1 / 1; }

.story-chapters {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.story-layout {
  min-height: var(--stage-height);
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) minmax(0, 15rem);
  grid-template-rows: auto 1fr auto;
  column-gap: 1rem;
  padding-block: clamp(1.5rem, 5svh, 3.5rem) clamp(5.75rem, 13svh, 8rem);
}

.hero-heading {
  grid-column: 1 / -1;
  text-align: center;
  text-shadow: 0 4px 16px #090f0e;
}

.hero-intro {
  grid-area: 3 / 1;
  align-self: end;
  color: var(--text);
  font-size: clamp(0.88rem, 1.12vw, 1.05rem);
  text-shadow: 0 1px 8px var(--background);
}

.hero-actions {
  grid-area: 3 / 3;
  display: grid;
  justify-items: end;
  align-self: end;
  gap: 0.2rem;
  text-align: right;
}

.hero-actions a, .chapter-copy a { pointer-events: auto; }
.hero-actions .text-link { text-shadow: 0 1px 6px var(--background); }

[data-scene='water'] { --accent: #82e7ff; }
[data-scene='energy'] { --accent: #ffd284; }
[data-scene='digital'] { --accent: #c5b4ff; }

.chapter-copy {
  grid-area: 3 / 1;
  text-shadow: 0 1px 14px var(--background);
  border-top: 1px solid var(--accent);
  padding-top: 0.9rem;
}

.chapter-right .chapter-copy { grid-column: 3; }
.chapter-copy h2 { margin-block: 0.45rem 0.65rem; font-size: clamp(2rem, 2.65vw, 2.7rem); }
.chapter-copy p:not(.eyebrow) { color: var(--text); font-size: 0.9rem; }
.chapter-action {
  margin-top: 0.85rem;
  border-color: var(--accent);
  background: var(--accent);
  color: #090f0e;
  text-shadow: none;
}

.chapter-action:hover { background: var(--text); }

.scene {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: var(--stage-height);
  min-width: 0;
  pointer-events: none;
}

.scene-image {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 52%, #2d60492c, transparent 68%);
}

.scene-image::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(0deg, #090f0e 0%, #090f0e90 13%, transparent 43%),
    linear-gradient(180deg, #090f0ec0, transparent 29%),
    linear-gradient(90deg, #060b13a8, transparent 26% 74%, #060b13a8);
  pointer-events: none;
}

.world-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.world-canvas[hidden], .scene-cinema[hidden] { display: none; }

.scene-cinema, .scene-cinema > * {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.scene-cinema > * { object-fit: cover; }
.scene-cinema video, .cinema-outdoors { visibility: hidden; }
.scene-cinema[data-film='travel'] .cinema-travel,
.scene-cinema[data-film='finale'] .cinema-finale,
.scene-cinema[data-weather] .cinema-outdoors { visibility: visible; }

.film-loading {
  position: fixed;
  z-index: 3;
  inset-block-end: calc(3.25rem + env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--mint);
  background: #081620f2;
  box-shadow: 2px 2px 0 #03080b;
  color: var(--mint);
  font: 400 clamp(0.95rem, 2vw, 1.15rem)/1.1 'VT323', var(--display);
  white-space: nowrap;
}

.film-loading[hidden] { display: none; }
[data-film-preloading] .scroll-cue { visibility: hidden; }
html[data-film-preloading] { overflow: hidden; }

.film-loading-signal {
  width: 12px;
  height: 8px;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 4px);
}

@media (prefers-reduced-motion: no-preference) {
  .film-loading-signal { animation: film-loading-pulse 0.85s ease-in-out infinite alternate; }
}

@keyframes film-loading-pulse {
  to { opacity: 0.35; }
}

.scene-cinema .cinema-galaxy {
  display: none;
  container-type: size;
  overflow: hidden;
  background: #02040b url('../public/img/preview-8bit/galassia-stelle.webp') center / cover;
}

.scene-cinema[data-film='galaxy'] .cinema-galaxy,
.scene-cinema[data-film='finale'][data-orbit] .cinema-galaxy { display: block; }

.scene-cinema[data-film='finale'][data-orbit] .cinema-galaxy {
  clip-path: var(--galaxy-aperture, inset(50%));
}

.galaxy-plane {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(96cqw, 170.667cqh);
  aspect-ratio: 1;
  translate: -50% -50%;
  rotate: -33deg;
  transform: scaleY(0.47);
  mix-blend-mode: screen;
}

.galaxy-disc {
  width: 100%;
  height: 100%;
  background: url('../public/img/preview-8bit/galassia-disco.webp') center / contain no-repeat;
}

.galaxy-plane { animation: galaxy-tilt 14s ease-in-out infinite; }
.galaxy-disc { animation: galaxy-spin 18s linear infinite; }
.cinema-galaxy--steady .galaxy-plane { animation: none; }
.cinema-galaxy--steady .galaxy-disc { animation-duration: 22s; }
:root[data-motion='paused'] :is(.galaxy-plane, .galaxy-disc) { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='playing']) :is(.galaxy-plane, .galaxy-disc) { animation-play-state: paused; }
}

@keyframes galaxy-spin { to { rotate: 1turn; } }
@keyframes galaxy-tilt {
  25% { rotate: -51deg; }
  75% { rotate: -15deg; }
}

.scene-controls {
  position: absolute;
  inset: auto 0 clamp(1rem, 3svh, 2rem);
  z-index: 3;
  width: fit-content;
  max-width: calc(100% - 2rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #0d1713f5;
  pointer-events: auto;
}

.simulation {
  color: var(--muted);
  padding-inline: 0.8rem;
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.motion-toggle {
  min-width: 44px;
  align-self: stretch;
  border: 0;
  border-inline-start: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.motion-toggle:hover { color: var(--mint); }
.motion-icon {
  display: inline-block;
  width: 9px;
  height: 11px;
  border-inline: 3px solid currentColor;
  vertical-align: middle;
}

.motion-toggle[data-paused] .motion-icon {
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left: 9px solid currentColor;
  border-right: 0;
}

.scene-options {
  display: flex;
}

.scene-options a {
  display: grid;
  align-content: center;
  text-align: center;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border-inline-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.scene-options a:hover { color: var(--accent, var(--mint)); }
.scene-options a[aria-current] {
  color: var(--accent, var(--mint));
  background: #1a2b22;
  box-shadow: inset 0 -2px var(--accent, var(--mint));
}

.scene-options a:focus-visible, .motion-toggle:focus-visible { outline-offset: -3px; }

.story-ending {
  padding-block-start: clamp(20rem, 78svh, 39rem);
}

.ending-links {
  display: grid;
  align-self: end;
  justify-items: start;
  gap: 0.35rem;
  text-shadow: 0 2px 8px var(--background);
}

.ending-links a { pointer-events: auto; }
.ending-services { grid-area: 3 / 1; }
.ending-company { grid-area: 3 / 3; justify-items: end; text-align: right; }

.scene[data-scene='finale'] .scene-controls {
  inset-block: clamp(0.65rem, 3svh, 2rem) auto;
}

.scene[data-galaxy] .scene-image { background: #02040b; }
.hero:not(.hero--clean) .scene[data-galaxy] .scene-image::after {
  background: linear-gradient(0deg, #02040bc0, transparent 23%, transparent 85%, #02040b9c);
}

.hero--clean .scene[data-galaxy] .scene-image::after { opacity: 0; }

.hero--clean .scene-image::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(0deg, #02040bc0, transparent 23%, transparent 85%, #02040b9c);
  opacity: 0;
}

.hero--clean .scene[data-galaxy] .scene-image::before { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion='paused']) .hero--clean .scene-image::before,
  :root:not([data-motion='paused']) .hero--clean .scene-image::after {
    transition: opacity 180ms linear;
  }
}

.detail-page { min-height: calc(100svh - var(--header-height)); padding-block: clamp(3rem, 10svh, 7rem); }
.detail-header { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.detail-layout { display: grid; gap: clamp(1.5rem, 5vw, 5rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; }
.detail-page h1 { margin-block: 0.5rem 1rem; font-size: clamp(2.1rem, 4.8vw, 4.25rem); overflow-wrap: anywhere; }
.detail-page p:not(.eyebrow) { color: var(--muted); max-width: 58ch; }
.detail-page p + p { margin-top: 0.85rem; }
.detail-image { width: 100%; height: auto; border: 1px solid var(--line); }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; margin-top: 1.5rem; }

@media (max-width: 1020px) {
  .shell { width: calc(100% - 3rem); }
  .story-layout { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) minmax(0, 11rem); }
}

@media (max-width: 740px) {
  :root { --header-height: 96px; }
  .shell { width: calc(100% - 2rem); }
  .header-inner {
    grid-template-columns: 1fr auto;
    padding-block: 0.65rem 0.5rem;
    gap: 0.3rem 0.55rem;
  }
  .site-nav { grid-row: 2; grid-column: 1 / -1; }
  .site-nav a { display: grid; align-items: center; min-height: 32px; }

  .story-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    padding-block: 1.3rem clamp(4.75rem, 12svh, 6rem);
    text-align: center;
  }

  .hero-heading { grid-column: 1; }
  h1 { font-size: clamp(2.3rem, 9.1vw, 3.7rem); }
  .hero-intro { grid-area: 3 / 1; max-width: 38ch; margin-inline: auto; }
  .hero-actions {
    grid-area: 4 / 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.75rem;
    margin-top: 0.8rem;
    text-align: inherit;
  }

  .hero-actions .button, .hero-actions .text-link { font-size: 0.82rem; }
  .hero-actions .button { min-height: 44px; }

  .chapter-copy, .chapter-right .chapter-copy {
    grid-area: 3 / 1;
    max-width: 28rem;
    justify-self: center;
  }

  .scene-cinema {
    inset-block: 15% auto;
    height: 54%;
    mask-image: linear-gradient(0deg, transparent, #000 14% 90%, transparent);
  }

  .simulation { display: none; }
  .scene-options {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.37fr) minmax(0, 0.77fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.95fr);
  }
  .scene-options a { padding-inline: 0.24rem; min-width: 0; font-size: clamp(0.62rem, 2.8vw, 0.72rem); }
  .scene-options a:first-child { border-inline-start: 0; padding-inline: 0.13rem; }

  .story-ending .story-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: max(clamp(2rem, 8svh, 4rem), env(safe-area-inset-bottom));
  }
  .ending-services { grid-area: 3 / 1; }
  .ending-company { grid-area: 3 / 2; }
  .ending-links { gap: 0; }
  .ending-links a { font-size: 0.8rem; }
  .scene[data-scene='finale'] .scene-cinema { inset-block: 19% auto; height: min(49%, 75vw); }
  .detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 740px) and (max-height: 680px) {
  .story-layout { padding-block: 0.75rem 3.9rem; }
  .hero-intro { font-size: 0.8rem; }
  .hero-actions { margin-top: 0.3rem; }
}

@media (max-height: 565px) {
  .site-header, .scene { top: 0; }
  .site-header { position: relative; }
  html { scroll-padding-top: 0; }
  .hero { --stage-height: max(380px, 100svh); }
  .story-layout { padding-block: 0.7rem 3.9rem; }
  h1 { font-size: clamp(2rem, 6vw, 3.8rem); }
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion='paused']) { scroll-behavior: smooth; }

  :root:not([data-motion='paused']) .hero:has(.scene[data-galaxy]) .ending-links:not(.ending-orbit) a {
    animation: float-around-galaxy 5.8s ease-in-out infinite alternate;
  }

  :root:not([data-motion='paused']) .hero:has(.scene[data-galaxy]) .ending-links:not(.ending-orbit) a:nth-child(2) {
    animation-delay: -1.9s;
  }

  :root:not([data-motion='paused']) .hero:has(.scene[data-galaxy]) .ending-links:not(.ending-orbit) a:nth-child(3) {
    animation-delay: -3.7s;
  }

  :root:not([data-motion='paused']) .hero:has(.scene[data-galaxy]) .ending-company a {
    animation-direction: alternate-reverse;
  }

  :root:not([data-motion='paused']) .hero:has(.scene[data-galaxy]) .ending-links:not(.ending-orbit) a:is(:hover, :focus-visible) {
    animation-play-state: paused;
  }
}

@keyframes float-around-galaxy {
  from { transform: translate3d(-3px, 3px, 0); }
  to { transform: translate3d(3px, -5px, 0); }
}


.soundtrack-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding-inline: 0.72rem;
  border: 1px solid var(--mint);
  background: var(--background);
  color: var(--mint);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
}

.soundtrack-toggle:hover:not(:disabled) { background: var(--panel); }
.soundtrack-toggle[aria-pressed='true'] { background: var(--mint); color: #09130e; }
.soundtrack-toggle:disabled { color: var(--muted); border-color: var(--line); cursor: default; }
.soundtrack-toggle[aria-pressed='true'] .audio-mute { display: none; }

@media (max-width: 740px) {
  .soundtrack-toggle { min-height: 36px; margin-inline-start: auto; padding-inline: 0.55rem; }
}

@font-face {
  font-family: 'VT323';
  src: url('../public/font/vt323/VT323-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

.hero-copy--frontier h1 {
  font-family: 'Unscii 16 Capital I', var(--display);
  letter-spacing: 0.003em;
  max-width: 27ch;
  margin-inline: auto;
  font-size: clamp(2.5rem, 4.45vw, 4.5rem);
}

.story-window {
  --window-accent: var(--accent, var(--mint));
  display: block;
  align-self: end;
  text-align: start;
  padding: 2px;
  border: 1px solid color-mix(in srgb, var(--window-accent) 53%, #192735);
  background: #07121bb5;
  box-shadow: 2px 3px 0 #02070dc9, inset 0 0 0 1px #b8dce724;
}

.chapter-copy.story-window { padding-top: 2px; }
.hero-actions.story-window { justify-items: stretch; }

.hero-copy--frontier .hero-intro {
  grid-area: 2 / 1;
  align-self: start;
  margin-top: clamp(0.65rem, 3svh, 2rem);
}

.scroll-guide {
  position: absolute;
  inset-block-start: calc(var(--stage-height) - 5rem - env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
}

.scroll-cue {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  color: var(--text);
  font: 400 1.13rem/1 'VT323', var(--display);
  text-shadow: 0 1px 3px #030809, 0 0 8px #030809;
  white-space: nowrap;
}

.scroll-cue::after {
  content: '';
  width: 19px;
  height: 10px;
  color: var(--mint);
  background: currentColor;
  clip-path: polygon(
    0 0, 16% 0, 16% 25%, 33% 25%, 33% 50%, 67% 50%,
    67% 25%, 84% 25%, 84% 0, 100% 0, 100% 50%,
    84% 50%, 84% 75%, 67% 75%, 67% 100%, 33% 100%,
    33% 75%, 16% 75%, 16% 50%, 0 50%
  );
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion='paused']) .scroll-cue::after {
    animation: scroll-cue-pulse 1.1s ease-in-out infinite alternate;
  }
}

@keyframes scroll-cue-pulse {
  to { opacity: 0.55; }
}

.story-window-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 29px;
  padding: 0.28rem 0.55rem;
  border-bottom: 1px solid var(--window-accent);
  color: var(--window-accent);
  background: repeating-linear-gradient(0deg, #101e2b80 0 3px, #b2d3ed14 3px 4px);
}

.story-window-bar, .chapter-copy .story-window-bar h2 {
  margin: 0;
  font: 400 clamp(1.13rem, 1.65vw, 1.45rem)/1.02 'VT323', var(--display);
}

.story-window-bar::before {
  content: '';
  flex: 0 0 8px;
  height: 8px;
  border: 1px solid currentColor;
  box-shadow: inset 0 0 0 2px #0a171e;
  background: currentColor;
}

.story-window-body { padding: clamp(0.45rem, 1.3vw, 0.8rem); }
.story-window-body p, .chapter-copy .story-window-body p:not(.eyebrow) {
  color: var(--text);
  font: 400 clamp(0.93rem, 1.12vw, 1.02rem)/1.38 var(--reading);
  text-shadow: 0 1px 4px #020a12;
}

.story-window-body p + p { margin-top: 0.48rem; }
.story-window-body p a {
  color: var(--window-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.story-window-body p a:hover { color: var(--text); }

.story-window-body .eyebrow {
  color: var(--window-accent);
  font: 400 0.63rem/1.43 var(--mono);
}

.story-window-body .suite-link {
  min-height: 36px;
  margin-top: 0.6rem;
  margin-inline-end: 0.15rem;
  padding-inline: 0.4rem;
  font-size: 0.75rem;
}

@media (max-width: 740px) {
  .film-loading {
    inset-block-end: calc(2.875rem + env(safe-area-inset-bottom));
    padding-block: 0.15rem;
    line-height: 1;
  }

  .hero--clean .hero-copy--frontier {
    grid-template-rows: auto auto 1fr auto auto;
    padding-block-end: calc(3.25rem + env(safe-area-inset-bottom));
  }
  .hero-copy--frontier h1 { font-size: clamp(1.45rem, 6.4vw, 2.65rem); }
  .hero-copy--frontier .hero-intro { margin-top: 0.65rem; }
  .hero-copy--frontier .hero-actions { margin-top: 0.35rem; }
  .hero-copy--frontier .scroll-guide {
    position: relative;
    inset: auto;
    grid-area: 5 / 1;
    justify-self: center;
    margin-block-start: 0.45rem;
    translate: none;
  }
}

@media (max-width: 740px) and (max-height: 680px) {
  .hero-copy--frontier .story-window-body { padding: 0.35rem 0.42rem; }
  .hero-copy--frontier .story-window-body p { font-size: 0.875rem; line-height: 1.28; }
}

@media (max-width: 360px) {
  .hero--clean .hero-copy.hero-copy--frontier { padding-block-start: max(4rem, calc(env(safe-area-inset-top) + 3.5rem)); }
  .hero-copy--frontier .story-window-body p { font-size: 0.82rem; line-height: 1.27; }
  .hero-copy--frontier .hero-intro { margin-block-start: 0.46rem; }
  .hero-copy--frontier .scroll-cue {
    grid-auto-flow: column;
    align-items: center;
    font-size: 1rem;
  }
  .hero-copy--frontier .scroll-guide { margin-block-start: 0.35rem; }
  .scroll-cue::after { width: 14px; height: 8px; }
}

.header-inner--clean { grid-template-columns: minmax(0, 1fr) auto; }

.header-inner--clean .motion-toggle {
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  align-self: center;
}

.hero--clean .story-ending .story-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding-block: 0 calc(max(2rem, env(safe-area-inset-bottom)) + 2.75rem);
}

.site-policies {
  position: fixed;
  z-index: 3;
  right: max(1rem, env(safe-area-inset-right));
  bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: clamp(0.6rem, 3vw, 1.3rem);
  width: max-content;
  max-width: calc(100% - 2rem);
  color: #b7c0d7;
  font: 400 0.75rem/1.3 var(--reading);
  text-shadow: 0 1px 4px #03060f, 0 0 7px #03060f;
  pointer-events: none;
}

.site-policies a {
  display: grid;
  place-items: center;
  min-height: 44px;
  pointer-events: auto;
}

.site-policies a:hover { color: var(--text); text-decoration: underline; }

@media (max-width: 360px) {
  .site-policies { flex-wrap: nowrap; column-gap: 0.5rem; font-size: 0.68rem; }
  .site-policies a { min-width: 0; text-align: center; }
}

body:has(.hero--clean .scene[data-scene='finale']:not([data-ending-pending])) .site-policies {
  right: 50%;
  translate: 50% 0;
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion='paused']) .site-policies { transition: right 350ms ease, translate 350ms ease; }
}

.ending-orbit {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 1fr auto 1.35fr auto 1.5fr auto 0.45fr;
  align-self: stretch;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.ending-orbit a {
  --starlight: #c6c8ff;
  display: grid;
  place-items: center;
  min-height: 60px;
  min-width: min(100%, 7rem);
  max-width: 100%;
  padding: 0.15rem 0.35rem;
  color: #f1f2ff;
  font: 400 clamp(1.13rem, 2.3vw, 1.55rem)/1 'VT323', var(--display);
  text-decoration: none;
}

.ending-orbit a[data-window='services'] { --starlight: #8bd7ff; }
.ending-orbit a[data-window='references'] { --starlight: #e5a8fa; }
.ending-orbit a[data-window='contact'] { --starlight: #8df2d1; }

.ending-orbit a > span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.42rem;
  text-shadow: 0 0 0.75em var(--starlight), 0 2px 3px #030512;
}

.orbit-planet {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--starlight) 72%, transparent);
  border-radius: 50%;
  transform: rotate(-24deg);
  background: radial-gradient(circle, #fff 0 2px, var(--starlight) 2.4px 3.7px, transparent 6px);
  filter: drop-shadow(0 0 4px var(--starlight));
}

.orbit-planet::after {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f9faff;
  box-shadow: 0 0 4px 1px var(--starlight);
  offset-path: ellipse(50% 50% at 50% 50%);
  offset-distance: 12%;
}

.ending-orbit a > span::after {
  content: '';
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--starlight), transparent);
  opacity: 0.5;
}

.ending-orbit a:is(:hover, :focus-visible) > span { color: var(--starlight); }
.ending-orbit a:is(:hover, :focus-visible) > span::after { opacity: 1; }

.ending-orbit [data-window='nis2'] { grid-area: 2 / 2; }
.ending-orbit [data-window='services'] { grid-area: 4 / 1; justify-self: start; }
.ending-orbit [data-window='references'] { grid-area: 4 / 3; justify-self: end; }
.ending-orbit [data-window='contact'] { grid-area: 6 / 2; }

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion='paused']) .hero--clean:has(.scene[data-galaxy]) .ending-orbit a > span {
    animation: float-around-galaxy 5.8s ease-in-out infinite alternate;
  }
  :root:not([data-motion='paused']) .ending-orbit a:nth-child(2) > span { animation-delay: -1.9s; }
  :root:not([data-motion='paused']) .ending-orbit a:nth-child(3) > span { animation-delay: -3.7s; }
  :root:not([data-motion='paused']) .ending-orbit a:nth-child(4) > span { animation-delay: -2.8s; }
  :root:not([data-motion='paused']) .ending-orbit a:is(:hover, :focus-visible) > span { animation-play-state: paused; }
  :root:not([data-motion='paused']) .hero--clean:has(.scene[data-galaxy]) .orbit-planet::after {
    animation: orbit-satellite var(--orbit-duration, 5.4s) linear infinite;
  }
  .ending-orbit [data-window='services'] { --orbit-duration: 4.6s; }
  .ending-orbit [data-window='references'] { --orbit-duration: 6s; }
  .ending-orbit [data-window='contact'] { --orbit-duration: 5s; }
}

@keyframes orbit-satellite {
  from { offset-distance: 12%; }
  to { offset-distance: 112%; }
}

.hero--clean:has(.scene[data-ending-pending]) .ending-orbit { visibility: hidden; }

@media (max-width: 740px) {
  .header-inner--clean { min-height: 64px; gap: 0.45rem; }
  .header-inner--clean .brand img { width: clamp(76px, 26vw, 104px); height: auto; }
  .header-inner--clean .header-actions { gap: clamp(0.2rem, 1.7vw, 0.55rem); }
  .header-inner--clean .soundtrack-toggle { margin-inline-start: 0; }
  .hero--clean .story-ending .story-layout { padding-bottom: calc(max(0.75rem, env(safe-area-inset-bottom)) + 2.75rem); }
  .ending-orbit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 0.9fr auto 2fr auto 0.52fr auto 0.3fr;
    row-gap: 0;
  }
  .ending-orbit [data-window='nis2'] { grid-area: 2 / 1 / 3 / -1; }
  .ending-orbit [data-window='services'] { grid-area: 4 / 1; }
  .ending-orbit [data-window='references'] { grid-area: 4 / 2; }
  .ending-orbit [data-window='contact'] { grid-area: 6 / 1 / 7 / -1; }
}

.suite-link {
  display: inline-grid;
  place-content: center;
  min-height: 40px;
  margin-block-start: 0.25rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--accent, var(--mint));
  background: #09151bed;
  color: var(--accent, var(--mint));
  text-decoration: none;
}

.suite-link:hover { background: #203739; }

html:has(.workbench-window[open]) { overflow: hidden; }

.workbench-window {
  box-sizing: border-box;
  width: min(38rem, calc(100% - 2rem));
  max-height: min(40rem, calc(100dvh - 2rem));
  padding: 4px;
  border: 2px solid #638e9a;
  background: #11242b;
  color: var(--text);
  box-shadow: 4px 4px 0 #02080d, -2px -2px 0 #182e35, 0 18px 70px #000b;
  font-family: var(--mono);
}

.workbench-window[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.workbench-window::backdrop { background: #040912ad; }

.workbench-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 4px 4px 4px 0.8rem;
  border-top: 2px solid #78abae;
  border-bottom: 3px solid #070e19;
  background: repeating-linear-gradient(0deg, #24414c 0 3px, #294a56 3px 4px);
}

.workbench-bar h2 {
  margin: 0;
  font: 400 clamp(1.4rem, 5vw, 2rem)/1 'VT323', var(--display);
  color: #daf5ec;
  overflow-wrap: anywhere;
}

.workbench-bar:has(.workbench-back:not([hidden])) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding-inline-start: 4px;
}

.workbench-close, .workbench-back {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  background: #13303a;
  color: #daf5ec;
  border: 2px solid;
  border-color: #9dc3c7 #07151e #07151e #9dc3c7;
  cursor: pointer;
}

.workbench-back[hidden] { display: none; }
.workbench-close:hover, .workbench-back:hover { background: #345a65; }

.workbench-content {
  min-height: 4rem;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(0.9rem, 4vw, 1.55rem);
  background: #0b151f;
  border: 2px solid;
  border-color: #050b13 #395966 #395966 #050b13;
  font: 400 1.02rem/1.5 var(--reading);
}

.workbench-content h3 {
  margin: 1rem 0 0.25rem;
  color: var(--mint);
  font: 400 1.3rem/1.14 'VT323', var(--display);
}
.workbench-content ul { padding-inline-start: 1.25rem; list-style-type: square; }
.workbench-content li { margin-block: 0.43rem; }
.workbench-content p + p { margin-top: 0.85rem; }
.workbench-content .suite-workflow { margin-block: 0.65rem 1.1rem; padding-inline-start: 1.55rem; }
.workbench-content .suite-workflow li::marker { color: var(--mint); }
.suite-acknowledgement a { color: var(--mint); text-decoration: underline; }

.workbench-content .workbench-projects {
  padding: 0;
  list-style: none;
}

.workbench-projects li {
  margin: 0;
  padding: 0.6rem 0;
  border-bottom: 1px solid #395966;
}

.workbench-projects a {
  display: block;
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.workbench-projects a:hover { color: var(--text); }
.workbench-projects p { margin-top: 0.3rem; }

.workbench-project-detail p a { color: var(--mint); text-decoration: underline; }
.workbench-project-detail figure { margin: 1rem 0 0; }
.workbench-project-detail :is(img, video) { display: block; width: 100%; max-height: 50dvh; object-fit: contain; background: #050b13; }
.workbench-project-detail figcaption { margin-top: 0.35rem; color: var(--muted); font-size: 0.85rem; }

.workbench-contacts { margin: 0; }
.workbench-contacts dt { color: var(--mint); }
.workbench-contacts dd { margin: 0 0 0.8em; overflow-wrap: anywhere; }
.workbench-contacts dd:last-child { margin-bottom: 0; }
.workbench-contacts a { color: inherit; }

.policy-paper {
  max-width: 52rem;
  padding-block: clamp(1.45rem, 6vw, 4.4rem);
}

.policy-paper h1 {
  margin: 0;
  font: 400 clamp(1.6rem, 5vw, 2.4rem)/1 'VT323', var(--display);
}

.policy-content {
  padding: clamp(0.8rem, 4vw, 2.25rem);
  overflow-wrap: anywhere;
  font: 400 1rem/1.6 var(--reading);
}

.policy-content h2 {
  margin: 1.5rem 0 0.35rem;
  color: var(--mint);
  font: 400 1.4rem/1.15 'VT323', var(--display);
}

.policy-content :is(ul, table), .policy-content p + p { margin-block-start: 0.55rem; }
.policy-content ul { padding-inline-start: 1.2rem; }
.policy-content li { margin-block: 0.15rem; }
.policy-content table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.policy-content :is(th, td) { padding: 0.35rem; border-bottom: 1px solid var(--line); text-align: start; }
.policy-date { color: var(--muted); font-size: 0.86rem; }

.site-header--overlay {
  position: fixed;
  inset: 0 0 auto;
  z-index: 4;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.site-header--overlay .header-inner--clean {
  width: auto;
  margin-inline: 0;
  min-height: 0;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
}

.site-header--overlay .brand img {
  filter: drop-shadow(0 2px 6px #03080b);
}

.site-header--overlay :is(button, a.brand, .header-social, .header-language) { pointer-events: auto; }

.header-social, .header-language summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: #090f0ecc;
  color: var(--text);
}

.header-social:hover, .header-language:is(:hover, [open]) summary {
  border-color: var(--mint);
  color: var(--mint);
}

.header-language {
  position: relative;
  font: 400 0.9rem/1 'Unscii 16', var(--mono);
}

.header-language summary { list-style: none; cursor: pointer; }
.header-language summary::-webkit-details-marker { display: none; }

.header-language-code::after {
  display: inline-block;
  margin-inline-start: 0.22rem;
  width: 7px;
  height: 4px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: currentColor;
  content: '';
}

.header-language[open] .header-language-code::after { transform: rotate(180deg); }

.header-language-options {
  position: absolute;
  inset-block-start: calc(100% + 0.4rem);
  inset-inline-end: 0;
  display: grid;
  width: 11rem;
  max-height: calc(100dvh - 5.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.25rem;
  border: 1px solid #395966;
  border-top-color: var(--mint);
  background: #0b151f;
  box-shadow: 3px 3px 0 #02070d, inset 0 0 0 1px #b8dce724;
}

.header-language-options .lang-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 400 0.94rem/1.2 var(--reading);
  text-align: start;
  cursor: pointer;
}

.header-language-options .lang-option::before {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid #55776c;
  content: '';
}

.header-language-options .lang-option:is(:hover, :focus-visible, .active) {
  background: #17332c;
  color: var(--mint);
}

.header-language-options .lang-option:focus-visible { outline-offset: -2px; }
.header-language-options .lang-option.active::before {
  border-color: currentColor;
  background: currentColor;
}

.site-header--overlay .soundtrack-toggle {
  min-height: 44px;
  background: #090f0ecc;
}

.site-header--overlay .soundtrack-toggle[aria-pressed='true'] {
  background: #132b27ec;
  color: var(--mint);
}

@media (max-width: 370px) {
  .site-header--overlay .soundtrack-toggle { width: 44px; justify-content: center; padding-inline: 0; gap: 0.15rem; }
  .site-header--overlay .soundtrack-wave { display: none; }
}

.site-header--overlay .motion-toggle--assistive:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
}

.site-header--overlay .motion-toggle--assistive:focus {
  position: absolute;
  top: calc(max(1rem, env(safe-area-inset-top)) + 3.2rem);
  right: max(1rem, env(safe-area-inset-right));
  background: var(--background);
}

.soundtrack-wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.soundtrack-wave i { width: 2px; height: 100%; background: currentColor; transform: scaleY(0.25); opacity: 0.48; }
.soundtrack-wave i:nth-child(2), .soundtrack-wave i:nth-child(4) { transform: scaleY(0.42); }
.soundtrack-wave i:nth-child(3) { transform: scaleY(0.59); }
.soundtrack-toggle[aria-pressed='true'] .soundtrack-wave i { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .soundtrack-toggle[aria-pressed='true'] .soundtrack-wave i { animation: soundtrack-signal 670ms ease-in-out infinite alternate; }
  .soundtrack-toggle[aria-pressed='true'] .soundtrack-wave i:nth-child(2) { animation-delay: -360ms; }
  .soundtrack-toggle[aria-pressed='true'] .soundtrack-wave i:nth-child(3) { animation-delay: -120ms; }
  .soundtrack-toggle[aria-pressed='true'] .soundtrack-wave i:nth-child(4) { animation-delay: -495ms; }
  .soundtrack-toggle[aria-pressed='true'] .soundtrack-wave i:nth-child(5) { animation-delay: -230ms; }
}
@keyframes soundtrack-signal {
  from { transform: scaleY(0.24); }
  to { transform: scaleY(0.86); }
}

.hero--clean { --stage-height: 100vh; --stage-height: 100dvh; --header-height: 0px; }
.hero--clean .scene { top: 0; }
.hero--clean .scene[data-scene] .scene-cinema { inset: 0; height: 100%; mask-image: none; }
.hero--clean .hero-copy { position: relative; padding-top: clamp(4.3rem, 10svh, 6.5rem); }

@media (prefers-reduced-motion: no-preference) {
  .hero--clean .story-step:not(.story-ending) { min-height: 190svh; }
  .hero--clean .story-step:not(.story-ending) > .story-layout { position: sticky; top: 0; }
  .hero--clean .story-ending { padding-block-start: clamp(38rem, 148svh, 75rem); }
}

@media (prefers-reduced-motion: no-preference) and (pointer: coarse) {
  .hero--clean .story-step:not(.story-ending) { min-height: 215svh; }
  .hero--clean .story-ending { padding-block-start: clamp(43rem, 167svh, 85rem); }
}

.vlan-rail {
  position: fixed;
  z-index: 2;
  top: calc(max(1rem, env(safe-area-inset-top)) + 3.4rem);
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left));
  display: grid;
  width: max-content;
  grid-template-rows: repeat(4, 1fr);
  align-items: center;
  pointer-events: none;
  text-shadow: 0 1px 8px #030a10, 0 0 4px #030a10;
}

.vlan-rail a {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 44px;
  padding-inline-start: 2.25rem;
  pointer-events: auto;
  color: var(--accent, var(--mint));
  font-size: 0.76rem;
  line-height: 1.25;
}

.vlan-cable {
  position: absolute;
  inset: 0 auto 0 0;
  width: 36px;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

.vlan-rail a:hover { color: var(--text); }

.vlan-sector { color: var(--text); font-size: 0.65rem; opacity: 0.76; }

body:has(.hero--clean .scene[data-scene='finale']) .vlan-rail { visibility: hidden; }

@media (min-width: 741px) {
  .hero--clean :is(.hero-copy, .story-chapter .story-layout) {
    width: min(1200px, calc(100% - 13rem));
  }
}

@media (max-width: 740px) {
  .hero--clean .hero-copy { padding-top: max(4.45rem, calc(env(safe-area-inset-top) + 3.75rem)); }
  .hero--clean .cinema-galaxy--steady .galaxy-plane { width: min(max(96cqw, 170.667cqh), 123cqw); }
  .vlan-rail { left: max(0.25rem, env(safe-area-inset-left)); }
  .hero--clean :is(.hero-intro, .hero-actions, .chapter-copy) { margin-inline-start: max(3.65rem, calc(env(safe-area-inset-left) + 3.4rem)); }
  .vlan-rail a { font-size: 0.62rem; padding-inline-start: 2.06rem; }
  .vlan-sector { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
}

@media (orientation: landscape) and (max-height: 480px) and (pointer: coarse) {
  .film-loading {
    left: 38%;
    inset-block-end: calc(0.5rem + env(safe-area-inset-bottom));
  }

  .hero--clean .hero-copy {
    width: auto;
    margin-inline: max(5.8rem, calc(env(safe-area-inset-left) + 5.1rem)) max(1rem, env(safe-area-inset-right));
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.45fr) minmax(0, 1.5fr);
    grid-template-rows: auto 1fr;
    padding-block: max(3.35rem, calc(env(safe-area-inset-top) + 2.7rem)) max(0.65rem, env(safe-area-inset-bottom));
  }

  .hero-copy--frontier .hero-heading { grid-column: 1 / -1; }
  .hero-copy--frontier h1 { font-size: clamp(1.4rem, 3.6vw, 2.1rem); }
  .hero--clean .hero-copy--frontier :is(.hero-intro, .hero-actions) { align-self: center; margin: 0; }
  .hero-copy--frontier .hero-actions { grid-area: 2 / 3; }
  .hero-copy--frontier .story-window-body { padding: 0.4rem 0.55rem; }
  .hero-copy--frontier .story-window-body p { font-size: 0.86rem; line-height: 1.32; }
  .hero-copy--frontier .scroll-guide {
    position: absolute;
    grid-area: auto;
    left: 38%;
    inset-block-start: calc(var(--stage-height) - 1.3rem - env(safe-area-inset-bottom));
    margin: 0;
    translate: -50% 0;
  }
  .scroll-cue span { position: absolute; clip-path: inset(50%); }
  .vlan-sector { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
}
