@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/instrument-serif-400.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/instrument-serif-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("./assets/fonts/dm-mono-300.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/dm-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/fonts/dm-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("./assets/fonts/manrope-400-600.woff2") format("woff2");
}

@charset "UTF-8";

:root {
  --paper: #f2e7d3;
  --paper-solid: #f4ecde;
  --ink: #17231f;
  --ui: #17231f;
  --muted: rgba(23, 35, 31, 0.62);
  --line: rgba(23, 35, 31, 0.22);
  --panel: rgba(247, 239, 225, 0.82);
  --panel-strong: rgba(248, 242, 231, 0.96);
  --track: rgba(23, 35, 31, 0.23);
  --accent: #ee5b3f;
  --teal: #276b62;
  --focus: #ed5b3f;
  --deck-shadow: 0 28px 70px rgba(31, 44, 38, 0.18), 0 3px 12px rgba(31, 44, 38, 0.08);
  --serif: "Instrument Serif", "Iowan Old Style", "Baskerville", Georgia, serif;
  --mono: "DM Mono", "SFMono-Regular", "Cascadia Mono", "Liberation Mono", monospace;
  --sans: "Manrope", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

body.mood-dusk {
  --ui: #f4e9d6;
  --muted: rgba(244, 233, 214, 0.64);
  --line: rgba(244, 233, 214, 0.24);
  --panel: rgba(15, 27, 32, 0.68);
  --panel-strong: rgba(17, 29, 33, 0.95);
  --track: rgba(244, 233, 214, 0.22);
  --accent: #ff8064;
  --teal: #8bc1b8;
  --focus: #ffad8f;
  --deck-shadow: 0 28px 70px rgba(5, 13, 17, 0.34), 0 3px 12px rgba(5, 13, 17, 0.2);
}

body.mood-night {
  --ui: #eee4d3;
  --muted: rgba(238, 228, 211, 0.57);
  --line: rgba(238, 228, 211, 0.21);
  --panel: rgba(7, 17, 22, 0.69);
  --panel-strong: rgba(8, 19, 24, 0.95);
  --track: rgba(238, 228, 211, 0.2);
  --accent: #ff7659;
  --teal: #86bdb3;
  --focus: #ffab89;
  --deck-shadow: 0 28px 70px rgba(0, 5, 8, 0.48), 0 3px 12px rgba(0, 5, 8, 0.28);
}

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

html {
  height: 100%;
  background: #e9dbc5;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #e9dbc5;
  color: var(--ui);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: color 0.9s ease;
}

body::selection {
  background: var(--accent);
  color: #fff5e8;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#world {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: linear-gradient(180deg, #8ab7be, #ffd0a1 60%, #1e555b);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 46%, rgba(6, 15, 14, 0.13) 100%),
    linear-gradient(180deg, rgba(8, 16, 15, 0.08) 0%, transparent 22%, transparent 76%, rgba(8, 16, 15, 0.12) 100%);
  transition: opacity 0.8s ease;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.052;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.68'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: soft-light;
}

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, width 0.2s ease, height 0.2s ease;
  mix-blend-mode: difference;
  will-change: transform;
}

body.cursor-visible .cursor-ring {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Loader and fallback
-------------------------------------------------------------------------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #17231f;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 250, 237, 0.78), transparent 44%),
    #efe3cd;
  transition: opacity 0.9s cubic-bezier(0.22, 0.8, 0.2, 1), visibility 0.9s;
}

.is-ready #loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  width: min(340px, 82vw);
  text-align: center;
}

.loader-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
  color: #17231f;
}

.loader-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.loader-kicker,
.loader-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
}

.loader-kicker {
  color: rgba(23, 35, 31, 0.48);
}

.loader-title {
  margin: 12px 0 26px;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 8vw, 4.3rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.94;
}

.loader-title em {
  color: #24675f;
  font-style: italic;
}

.loader-track {
  position: relative;
  width: 100%;
  height: 1px;
  overflow: hidden;
  background: rgba(23, 35, 31, 0.16);
}

.loader-track span {
  position: absolute;
  top: 0;
  left: -50%;
  width: 48%;
  height: 100%;
  background: #ed5b3f;
  animation: loader-sweep 1.35s cubic-bezier(0.55, 0.1, 0.4, 0.9) infinite;
}

.loader-meta {
  margin-top: 14px;
  color: rgba(23, 35, 31, 0.45);
  font-size: 8px;
  letter-spacing: 0.16em;
}

@keyframes loader-sweep {
  0% { left: -50%; }
  100% { left: 102%; }
}

.has-error #loader {
  display: none;
}

#webgl-fallback {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #17231f;
  background: #efe3cd;
}

#webgl-fallback[hidden] {
  display: none;
}

#webgl-fallback > div {
  width: min(520px, 100%);
}

.fallback-kicker {
  margin: 0 0 18px;
  color: rgba(23, 35, 31, 0.55);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

#webgl-fallback h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.9;
}

#webgl-fallback h1 em {
  color: #24675f;
  font-style: italic;
}

#webgl-fallback p {
  max-width: 42ch;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.fallback-detail {
  margin-top: 16px !important;
  color: rgba(23, 35, 31, 0.48);
  font-family: var(--mono);
  font-size: 9px !important;
  line-height: 1.6 !important;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #17231f;
  background: #efe3cd;
  font-family: var(--serif);
  font-size: 28px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Chrome
-------------------------------------------------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 20px;
  padding: max(22px, env(safe-area-inset-top)) clamp(18px, 2.5vw, 38px) 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s cubic-bezier(0.22, 0.8, 0.2, 1) 0.08s;
}

.is-ready .topbar {
  opacity: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
  pointer-events: auto;
}

.brand-mark {
  display: block;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  color: var(--ui);
  filter: drop-shadow(0 1px 8px rgba(255, 246, 230, 0.12));
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-copy strong {
  color: var(--ui);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-copy span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.mood-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 4px 24px rgba(17, 29, 25, 0.08);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  pointer-events: auto;
  transition: background 0.8s ease, border-color 0.8s ease;
}

.mood-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
}

.mood-btn:hover {
  color: var(--ui);
}

.mood-btn[aria-pressed="true"] {
  color: var(--ui);
  background: rgba(255, 255, 255, 0.18);
}

body.mood-golden .mood-btn[aria-pressed="true"] {
  background: rgba(23, 35, 31, 0.08);
}

.mood-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.dot-golden { background: #f0b35f; }
.dot-dusk { background: #dd846f; }
.dot-night { background: #456b7c; }

.mood-num {
  opacity: 0.42;
  font-size: 7px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 14px;
  pointer-events: auto;
}

.live-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-meta > i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: live-pulse 2.8s ease-in-out infinite;
}

.meta-sep {
  opacity: 0.4;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.78); }
}

.info-btn {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ui);
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.info-btn span {
  margin-top: 1px;
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  line-height: 1;
}

.info-btn:hover {
  border-color: var(--ui);
  color: var(--paper);
  background: var(--ui);
}

/* --------------------------------------------------------------------------
   Camera rail
-------------------------------------------------------------------------- */
.camera-rail {
  position: fixed;
  top: 50%;
  right: clamp(16px, 2.3vw, 34px);
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 1s ease 0.32s;
}

.is-ready .camera-rail {
  opacity: 1;
}

.rail-title {
  margin: 0 0 11px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.2em;
  line-height: 1;
  text-align: right;
  text-transform: uppercase;
}

.camera-rail button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 25px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  transition: color 0.25s ease;
}

.camera-rail button::after {
  content: "";
  width: 15px;
  height: 1px;
  margin-left: 2px;
  background: var(--line);
  transition: width 0.3s ease, background 0.3s ease;
}

.camera-rail button:hover,
.camera-rail button[aria-pressed="true"] {
  color: var(--ui);
}

.camera-rail button[aria-pressed="true"]::after {
  width: 31px;
  background: var(--accent);
}

.view-index {
  opacity: 0.38;
  font-size: 7px;
}

/* --------------------------------------------------------------------------
   Hero copy
-------------------------------------------------------------------------- */
.hero-copy {
  position: fixed;
  bottom: clamp(22px, 3.6vh, 46px);
  left: clamp(18px, 2.5vw, 40px);
  z-index: 10;
  max-width: 58vw;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 1.15s cubic-bezier(0.22, 0.8, 0.2, 1) 0.18s, transform 1.15s cubic-bezier(0.22, 0.8, 0.2, 1) 0.18s;
}

.is-ready .hero-copy {
  opacity: 1;
  transform: translateY(0);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 13px 4px;
  color: var(--ui);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow i {
  display: block;
  width: 26px;
  height: 1px;
  background: var(--accent);
}

.hero-copy h1 {
  margin: 0;
  color: var(--ui);
  font-family: var(--serif);
  font-size: clamp(4.9rem, 10.2vw, 10.2rem);
  font-weight: 400;
  letter-spacing: -0.038em;
  line-height: 0.7;
  text-transform: uppercase;
}

.hero-copy h1 span,
.hero-copy h1 em {
  display: block;
}

.hero-copy h1 em {
  margin-left: 0.16em;
  font-size: 0.73em;
  font-style: italic;
  letter-spacing: -0.035em;
  line-height: 0.92;
  text-transform: none;
}

.hero-copy h1 em::after {
  content: ".";
  color: var(--accent);
  font-style: normal;
}

.tagline {
  width: max-content;
  margin: 17px 0 0 5px;
  padding: 8px 10px 7px;
  border: 1px solid var(--line);
  color: var(--ui);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
  line-height: 1.8;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* --------------------------------------------------------------------------
   Control deck
-------------------------------------------------------------------------- */
.control-deck {
  position: fixed;
  right: clamp(16px, 2.2vw, 30px);
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 13;
  width: 332px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ui);
  background: var(--panel);
  box-shadow: var(--deck-shadow);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  opacity: 0;
  pointer-events: auto;
  transform: translateY(16px);
  transition:
    opacity 1s cubic-bezier(0.22, 0.8, 0.2, 1) 0.28s,
    transform 1s cubic-bezier(0.22, 0.8, 0.2, 1) 0.28s,
    background 0.8s ease,
    border-color 0.8s ease;
}

.is-ready .control-deck {
  opacity: 1;
  transform: translateY(0);
}

.deck-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.deck-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.19em;
  line-height: 1;
  text-transform: uppercase;
}

.speed-readout {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  color: var(--ui);
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.075em;
  line-height: 1;
}

.speed-unit {
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.telemetry {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-align: right;
  text-transform: uppercase;
}

.telemetry b {
  color: var(--ui);
  font-weight: 500;
}

.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 20px;
  margin: 13px 0 3px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  --fill: 53.333%;
}

.speed-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--accent) 0,
    var(--accent) var(--fill),
    var(--track) var(--fill),
    var(--track) 100%
  );
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border: 2px solid var(--panel-strong);
  border-radius: 50%;
  background: var(--ui);
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.2s ease;
}

.speed-slider::-moz-range-track {
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--track);
}

.speed-slider::-moz-range-progress {
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.speed-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--panel-strong);
  border-radius: 50%;
  background: var(--ui);
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.2s ease;
}

.speed-slider:focus-visible {
  outline: none;
}

.speed-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 2px var(--focus);
}

.speed-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 2px var(--focus);
}

.speed-slider:hover::-webkit-slider-thumb {
  transform: scale(1.16);
}

.speed-slider:hover::-moz-range-thumb {
  transform: scale(1.16);
}

.speed-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.deck-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.deck-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  height: 34px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ui);
  background: transparent;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.deck-actions button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-actions svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.deck-actions button:hover {
  border-color: var(--ui);
  color: var(--paper);
  background: var(--ui);
}

body.mood-dusk .deck-actions button:hover,
body.mood-night .deck-actions button:hover {
  color: var(--paper-solid);
  background: var(--ui);
}

#soundBtn .sound-wave {
  opacity: 0.28;
  transition: opacity 0.25s ease;
}

body.sound-on #soundBtn {
  border-color: var(--accent);
  color: var(--accent);
}

body.sound-on #soundBtn .sound-wave {
  opacity: 1;
}

body.sound-on #soundBtn:hover {
  color: var(--paper);
  background: var(--accent);
}

#bellBtn.is-ringing svg {
  transform-origin: 50% 13%;
  animation: bell-shake 0.62s ease-in-out;
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-13deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(4deg); }
}

/* --------------------------------------------------------------------------
   Hint, toast, clean view
-------------------------------------------------------------------------- */
.hint {
  position: fixed;
  bottom: max(31px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 1s ease 0.5s, transform 1s ease 0.5s;
}

.is-ready .hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mouse-mark {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 15px;
  border: 1px solid currentColor;
  border-radius: 6px;
  opacity: 0.8;
}

.mouse-mark i {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 1px;
  height: 3px;
  background: currentColor;
  transform: translateX(-50%);
}

.hint-sep {
  opacity: 0.5;
}

.exit-clean {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: 20px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ui);
  background: var(--panel);
  box-shadow: var(--deck-shadow);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

.exit-clean span {
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 7px;
  opacity: 0.65;
}

.clean-view .ui-layer {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.35s ease !important;
}

.clean-view .exit-clean {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.toast {
  position: fixed;
  bottom: max(31px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 75;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(246, 237, 223, 0.18);
  border-radius: 999px;
  color: #f5ecdc;
  background: rgba(12, 23, 20, 0.94);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.is-flashing::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 74;
  pointer-events: none;
  background: #f7edda;
  animation: frame-flash 0.28s ease-out both;
}

@keyframes frame-flash {
  0% { opacity: 0; }
  20% { opacity: 0.54; }
  100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   About dialog
-------------------------------------------------------------------------- */
.about-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(86dvh, 760px);
  padding: 34px 38px 28px;
  overflow: auto;
  border: 1px solid rgba(23, 35, 31, 0.26);
  border-radius: 3px;
  color: #17231f;
  background: #f3e9d7;
  box-shadow: 0 40px 110px rgba(6, 14, 15, 0.4);
}

.about-dialog::backdrop {
  background: rgba(6, 14, 15, 0.6);
  backdrop-filter: blur(8px) saturate(0.8);
  -webkit-backdrop-filter: blur(8px) saturate(0.8);
}

.about-dialog[open] {
  animation: dialog-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid rgba(23, 35, 31, 0.24);
  border-radius: 50%;
  color: #17231f;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.dialog-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.dialog-close:hover {
  color: #f3e9d7;
  background: #17231f;
}

.about-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 36px;
}

.about-kicker {
  margin: 0;
  color: rgba(23, 35, 31, 0.52);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.about-sun {
  display: block;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(23, 35, 31, 0.28);
  border-radius: 50%;
  background: #ee684b;
  box-shadow: inset 0 0 0 7px #f3e9d7, inset 0 0 0 8px rgba(23, 35, 31, 0.15);
}

.about-dialog h2 {
  margin: 20px 0 25px;
  font-family: var(--serif);
  font-size: clamp(2.7rem, 5.5vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.9;
}

.about-dialog h2 em {
  color: #24675f;
  font-style: italic;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(190px, 0.8fr);
  gap: 38px;
  padding-top: 22px;
  border-top: 1px solid rgba(23, 35, 31, 0.2);
}

.about-main p {
  margin: 0 0 14px;
  color: rgba(23, 35, 31, 0.74);
  font-size: 12px;
  line-height: 1.75;
}

.about-main p:first-child {
  color: #17231f;
  font-size: 14px;
  line-height: 1.65;
}

.about-cn {
  margin-top: 20px !important;
  padding-left: 12px;
  border-left: 2px solid #ee5b3f;
  font-family: var(--serif);
  font-size: 15px !important;
  line-height: 1.5 !important;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: #17231f;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(23, 35, 31, 0.38);
  padding-bottom: 4px;
}

.source-link span {
  color: #ee5b3f;
  font-size: 11px;
}

.about-controls ul {
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.about-controls li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted rgba(23, 35, 31, 0.2);
  color: rgba(23, 35, 31, 0.7);
  font-size: 10px;
}

.about-controls kbd {
  min-width: 30px;
  padding: 3px 6px;
  border: 1px solid rgba(23, 35, 31, 0.23);
  border-radius: 4px;
  color: #17231f;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  text-align: center;
  background: rgba(255, 255, 255, 0.22);
}

.about-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid rgba(23, 35, 31, 0.2);
  color: rgba(23, 35, 31, 0.46);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Responsive
-------------------------------------------------------------------------- */
@media (max-width: 1120px) {
  .hint {
    display: none;
  }

  .live-meta {
    display: none;
  }

  .toast {
    bottom: max(28px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 920px) {
  .hero-copy {
    max-width: 54vw;
  }

  .hero-copy h1 {
    font-size: clamp(4.5rem, 10.4vw, 7.2rem);
  }

  .control-deck {
    width: 308px;
  }

  .camera-rail {
    right: 18px;
  }

  .about-grid {
    gap: 26px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: max(14px, env(safe-area-inset-top)) 15px 0;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-copy {
    gap: 2px;
  }

  .brand-copy strong {
    font-size: 9px;
  }

  .brand-copy span {
    display: none;
  }

  .top-actions {
    gap: 8px;
  }

  .info-btn {
    width: 32px;
    height: 32px;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .mood-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    margin-top: 2px;
  }

  .mood-btn {
    min-height: 28px;
    padding: 0 9px;
    font-size: 7.5px;
  }

  .camera-rail {
    top: 116px;
    right: 13px;
    flex-direction: row;
    align-items: center;
    gap: 1px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: none;
    transition: opacity 0.8s ease 0.3s;
  }

  .rail-title,
  .view-index {
    display: none;
  }

  .camera-rail button {
    min-height: 27px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 7px;
    letter-spacing: 0.08em;
  }

  .camera-rail button::after {
    display: none;
  }

  .camera-rail button[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.14);
  }

  body.mood-golden .camera-rail button[aria-pressed="true"] {
    background: rgba(23, 35, 31, 0.08);
  }

  .hero-copy {
    right: 16px;
    bottom: 196px;
    left: 16px;
    max-width: none;
  }

  .hero-copy h1,
  .eyebrow {
    color: #f7eddc;
    text-shadow: 0 2px 24px rgba(8, 18, 16, 0.26);
  }

  .eyebrow {
    display: none;
  }

  .hero-copy h1 {
    font-size: clamp(3.45rem, 18.2vw, 6.7rem);
    line-height: 0.73;
  }

  .hero-copy h1 em {
    margin-left: 0.14em;
    font-size: 0.72em;
  }

  .tagline {
    display: none;
  }

  .control-deck {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    padding: 13px 14px 12px;
    border-radius: 14px;
  }

  .speed-readout {
    font-size: 31px;
  }

  .telemetry {
    font-size: 6.5px;
  }

  .speed-slider {
    margin-top: 11px;
  }

  .deck-actions {
    margin-top: 11px;
    padding-top: 10px;
  }

  .deck-actions button {
    height: 32px;
    font-size: 7px;
  }

  .exit-clean {
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
  }

  .toast {
    bottom: 202px;
    font-size: 7.5px;
  }

  .about-dialog {
    padding: 27px 22px 22px;
    max-height: 88dvh;
  }

  .about-dialog h2 {
    margin: 15px 0 20px;
    font-size: clamp(2.2rem, 10vw, 3.1rem);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .about-main p:first-child {
    font-size: 13px;
  }

  .about-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .mood-btn {
    gap: 5px;
    padding: 0 7px;
    letter-spacing: 0.07em;
  }

  .mood-num {
    display: none;
  }

  .hero-copy {
    bottom: 190px;
  }

  .hero-copy h1 {
    font-size: 17.8vw;
  }

  .speed-readout {
    font-size: 28px;
  }

  .deck-actions {
    gap: 4px;
  }

  .deck-actions button {
    gap: 3px;
    padding: 0 3px;
    font-size: 6.7px;
    letter-spacing: 0.035em;
  }

  .deck-actions svg {
    width: 12px;
    height: 12px;
  }

  .camera-rail {
    top: 110px;
  }

  .about-masthead {
    padding-right: 31px;
  }
}

@media (max-height: 650px) and (min-width: 761px) {
  .hero-copy {
    bottom: 24px;
  }

  .hero-copy h1 {
    font-size: clamp(4rem, 8.2vw, 6.3rem);
  }

  .tagline {
    display: none;
  }

  .control-deck {
    bottom: 16px;
  }

  .hint {
    display: none;
  }
}

@media (max-width: 760px) and (max-height: 700px) {
  .hero-copy {
    bottom: 178px;
  }

  .hero-copy h1 {
    font-size: 15.8vw;
  }

  .eyebrow {
    display: none;
  }

  .control-deck {
    padding-top: 11px;
  }

  .camera-rail {
    top: 108px;
  }
}

body.view-close .hero-copy {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.view-close .hint {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .loader-track span {
    left: 0;
    width: 100%;
  }

  .hint,
  .topbar,
  .camera-rail,
  .hero-copy,
  .control-deck {
    opacity: 1;
    transform: none;
  }

  .control-deck {
    transform: none;
  }

  .hint {
    transform: translateX(-50%);
  }
}
