:root {
  color-scheme: dark;
  --ink: #06132b;
  --blueprint: #2388e8;
  --white: #f7f1ef;
  --pink: #ff4fa2;
  --coral: #ff776e;
  --peach: #ffb687;
  --yellow: #ffd85a;
  --progress: 0;
  --loaded: 0;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
}

button,
a {
  color: inherit;
  font: inherit;
}

button { border: 0; }

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--yellow);
  outline-offset: 5px;
}

.experience { height: 1450vh; }

.stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}

.film,
.mobile-mark,
.stage__veil,
.stage__grain {
  position: absolute;
  inset: 0;
}

.film {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateZ(0);
  transition: opacity 500ms ease;
  background: var(--ink);
  image-rendering: auto;
  will-change: contents;
}

.mobile-mark {
  z-index: 4;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: #f4a6c6;
  transform-origin: 58% 52%;
  will-change: transform, opacity;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.stage__veil {
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(3 9 23 / 0.48), transparent 23%, transparent 70%, rgb(3 9 23 / 0.68)),
    radial-gradient(circle at center, transparent 48%, rgb(0 5 20 / 0.28) 100%);
}

.stage__grain {
  z-index: 6;
  pointer-events: none;
  opacity: 0.1;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.hud,
.spatial-copy,
.timeline,
.scroll-cue,
.finale,
.event-note {
  position: absolute;
  z-index: 10;
}

.hud {
  left: clamp(20px, 3vw, 52px);
  right: clamp(20px, 3vw, 52px);
  display: grid;
  align-items: center;
  gap: 20px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hud p { margin: 0; }

.hud--top {
  top: 24px;
  grid-template-columns: 1fr auto 1fr;
}

.hud--top p:nth-child(2) { opacity: 0.62; }

.skip {
  justify-self: end;
  padding: 8px 0;
  cursor: pointer;
  background: transparent;
  border-bottom: 1px solid rgb(255 255 255 / 0.35);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hud--bottom {
  bottom: 24px;
  grid-template-columns: 44px minmax(80px, 220px) 1fr;
}

.hud--bottom p:last-child {
  justify-self: end;
  opacity: 0.62;
}

.progress-track {
  height: 1px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.25);
}

.progress-track span {
  display: block;
  width: calc(var(--progress) * 100%);
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
}

.spatial-copy {
  --label-x: 50%;
  --label-y: 78%;
  --label-width: min(620px, 48vw);
  --plate-rx: 9deg;
  --plate-rz: 0deg;
  --plate-scale: 1;
  --plate-rise: 0px;
  --spatial-presence: 1;
  --light-sweep: 50%;
  left: var(--label-x);
  top: var(--label-y);
  width: var(--label-width);
  perspective: 1200px;
  opacity: var(--spatial-presence);
  filter: drop-shadow(0 16px 22px rgb(0 3 18 / 0.58));
  transform: translate(-50%, -50%);
  transition: opacity 120ms linear;
}

.spatial-copy.is-concealed {
  opacity: 0 !important;
  pointer-events: none;
}

.spatial-copy__surface {
  position: relative;
  overflow: hidden;
  padding: 12px clamp(22px, 2.6vw, 38px) 16px;
  color: #f8f4ef;
  text-align: center;
  background:
    linear-gradient(180deg, rgb(11 35 67 / 0.36), rgb(2 8 25 / 0.8)),
    linear-gradient(90deg, rgb(255 79 162 / 0.1), transparent 34%, rgb(255 216 90 / 0.09));
  border: 1px solid rgb(87 188 255 / 0.44);
  border-bottom-color: rgb(255 163 119 / 0.72);
  clip-path: polygon(3.2% 0, 96.8% 0, 100% 100%, 0 100%);
  box-shadow:
    inset 0 1px 0 rgb(202 235 255 / 0.2),
    inset 0 -12px 24px rgb(255 77 153 / 0.08),
    0 0 34px rgb(34 136 232 / 0.12);
  text-shadow: 0 2px 14px rgb(0 4 18 / 0.98), 0 0 9px rgb(43 145 255 / 0.2);
  transform: perspective(1100px) translate3d(0, var(--plate-rise), 0) rotateX(var(--plate-rx)) rotateZ(var(--plate-rz)) scale(var(--plate-scale));
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

.spatial-copy__surface::before,
.spatial-copy__surface::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.spatial-copy__surface::before {
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgb(84 178 255 / 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgb(84 178 255 / 0.15) 1px, transparent 1px);
  background-size: 34px 18px;
  mix-blend-mode: screen;
  mask-image: linear-gradient(180deg, rgb(0 0 0 / 0.75), transparent 92%);
}

.spatial-copy__surface::after {
  top: -55%;
  bottom: -55%;
  left: var(--light-sweep);
  width: 20%;
  opacity: 0.42;
  background: linear-gradient(90deg, transparent, rgb(255 182 135 / 0.28), rgb(255 79 162 / 0.18), transparent);
  filter: blur(10px);
  transform: skewX(-18deg);
}

.spatial-copy__pin {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 3px);
  width: 1px;
  height: 42px;
  opacity: calc(0.45 + var(--spatial-presence) * 0.55);
  background: linear-gradient(transparent, rgb(79 174 255 / 0.92));
  box-shadow: 0 0 8px rgb(35 136 232 / 0.42);
}

.spatial-copy__pin::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid rgb(255 190 143 / 0.92);
  border-radius: 50%;
  background: rgb(255 216 90 / 0.16);
  box-shadow: 0 0 14px var(--coral), inset 0 0 5px rgb(255 216 90 / 0.65);
}

.spatial-copy__index,
.spatial-copy__medium {
  margin: 0;
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.78;
}

.spatial-copy__index {
  margin-bottom: 5px;
  color: #b8e0ff;
  text-shadow: 0 0 12px rgb(35 136 232 / 0.6);
}

.spatial-copy__medium {
  margin-top: 8px;
  color: #a9d9ff;
}

.spatial-copy__title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3vw, 46px);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.035em;
  line-height: 1;
  color: transparent;
  background: linear-gradient(90deg, #fff5ef 8%, #ffb687 46%, #ffd85a 68%, #ff8cb8 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 10px rgb(255 101 132 / 0.22));
}

.spatial-copy__copy {
  max-width: 470px;
  margin: 7px auto 0;
  font-size: clamp(10px, 0.84vw, 13px);
  line-height: 1.45;
  letter-spacing: 0.025em;
  text-wrap: balance;
  opacity: 0.92;
}

.spatial-copy[data-placement="side-left"],
.spatial-copy[data-placement="side-right"],
.spatial-copy[data-placement="threshold"] {
  --label-width: min(390px, 30vw);
}

.spatial-copy[data-placement="side-left"] .spatial-copy__surface,
.spatial-copy[data-placement="side-right"] .spatial-copy__surface,
.spatial-copy[data-placement="threshold"] .spatial-copy__surface {
  text-align: left;
  clip-path: polygon(0 0, 96% 3%, 100% 100%, 3% 96%);
  transform: perspective(1000px) translate3d(0, var(--plate-rise), 0) rotateY(var(--label-tilt, 5deg)) rotateZ(var(--plate-rz));
}

.spatial-copy[data-placement="side-left"] .spatial-copy__copy,
.spatial-copy[data-placement="side-right"] .spatial-copy__copy,
.spatial-copy[data-placement="threshold"] .spatial-copy__copy {
  margin-left: 0;
}

.spatial-copy[data-placement="side-left"] .spatial-copy__pin,
.spatial-copy[data-placement="side-right"] .spatial-copy__pin,
.spatial-copy[data-placement="threshold"] .spatial-copy__pin {
  left: 18px;
}

.spatial-copy[data-placement^="overlay-"] {
  --label-width: min(420px, 32vw);
  top: auto;
  bottom: clamp(72px, 10vh, 112px);
  width: var(--label-width);
  perspective: none;
  filter: drop-shadow(0 18px 34px rgb(0 3 18 / 0.54));
}

.spatial-copy[data-placement="overlay-left"] {
  left: clamp(34px, 5vw, 82px);
  transform: none;
}

.spatial-copy[data-placement="overlay-right"] {
  right: clamp(48px, 7vw, 112px);
  left: auto;
  transform: none;
}

.spatial-copy[data-placement="overlay-center"] {
  left: 50%;
  transform: translateX(-50%);
}

.spatial-copy[data-placement^="overlay-"] .spatial-copy__surface {
  overflow: visible;
  padding: 16px 20px 18px;
  text-align: left;
  background:
    linear-gradient(90deg, rgb(3 11 31 / 0.88), rgb(3 11 31 / 0.6) 76%, rgb(3 11 31 / 0.08)),
    linear-gradient(120deg, rgb(255 84 155 / 0.08), transparent 56%);
  border: 0;
  border-top: 1px solid rgb(122 201 255 / 0.72);
  border-bottom: 1px solid rgb(255 159 120 / 0.32);
  clip-path: none;
  box-shadow: 0 12px 30px rgb(0 3 18 / 0.24), inset 18px 0 30px rgb(20 83 148 / 0.08);
  backdrop-filter: blur(7px);
  transform: translate3d(0, var(--plate-rise), 0) scale(var(--plate-scale));
  transform-origin: 0 100%;
}

.spatial-copy[data-placement^="overlay-"] .spatial-copy__surface::before {
  display: none;
}

.spatial-copy[data-placement^="overlay-"] .spatial-copy__surface::after {
  top: -1px;
  right: auto;
  bottom: auto;
  left: 0;
  width: 38%;
  height: 1px;
  opacity: 0.9;
  background: linear-gradient(90deg, var(--pink), var(--yellow), transparent);
  filter: none;
  transform: none;
}

.spatial-copy[data-placement^="overlay-"] .spatial-copy__pin {
  display: none;
}

.spatial-copy[data-placement^="overlay-"] .spatial-copy__copy {
  margin-left: 0;
}

.timeline {
  top: 50%;
  right: clamp(18px, 2vw, 34px);
  display: grid;
  gap: 9px;
  transform: translateY(-50%);
}

.timeline button {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 56px;
  height: 12px;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.timeline button::after {
  content: "";
  width: 14px;
  height: 1px;
  background: rgb(255 255 255 / 0.38);
  transition: width 250ms ease, background 250ms ease;
}

.timeline button:hover::after,
.timeline button.is-active::after {
  width: 38px;
  background: var(--white);
}

.timeline button span {
  position: absolute;
  right: 48px;
  width: max-content;
  opacity: 0;
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 180ms ease;
}

.timeline button:hover span,
.timeline button:focus-visible span,
.timeline button.is-active span { opacity: 0.72; }

.scroll-cue {
  left: 50%;
  bottom: 72px;
  display: grid;
  place-items: center;
  gap: 9px;
  transform: translateX(-50%);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: opacity 250ms ease;
}

.scroll-cue i {
  width: 1px;
  height: 25px;
  background: currentColor;
  animation: cue 1.8s ease-in-out infinite;
}

@keyframes cue {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.35; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
}

.finale {
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: clamp(14px, 3vw, 50px);
  padding: 0 clamp(40px, 9vw, 150px) 12vh;
  perspective: 1200px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.finale.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: none;
}

.finale__choice {
  --panel-turn: 0deg;
  position: relative;
  display: grid;
  align-content: end;
  gap: 6px;
  min-height: 23vh;
  overflow: hidden;
  padding: clamp(20px, 2.5vw, 34px);
  text-decoration: none;
  background:
    linear-gradient(180deg, rgb(14 43 79 / 0.3), rgb(3 11 31 / 0.86)),
    linear-gradient(115deg, rgb(255 79 162 / 0.08), transparent 48%, rgb(255 216 90 / 0.08));
  border: 1px solid rgb(102 190 255 / 0.4);
  border-bottom-color: rgb(255 166 118 / 0.72);
  clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 34px rgb(35 136 232 / 0.08), 0 20px 40px rgb(0 4 20 / 0.34);
  transform: perspective(1000px) rotateX(6deg) rotateY(var(--panel-turn));
  transform-origin: 50% 100%;
  transition: transform 320ms ease, border-color 320ms ease, background 320ms ease, box-shadow 320ms ease;
}

.finale__choice:first-child { --panel-turn: 2.5deg; }
.finale__choice:nth-child(2) { --panel-turn: -2.5deg; }

.finale__choice::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgb(80 174 255 / 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgb(80 174 255 / 0.12) 1px, transparent 1px),
    radial-gradient(circle at 50% 110%, rgb(255 91 148 / 0.35), transparent 50%);
  background-size: 34px 18px, 34px 18px, 100% 100%;
  mix-blend-mode: screen;
}

.finale__choice > * {
  position: relative;
  z-index: 1;
}

.finale__choice:hover,
.finale__choice:focus-visible {
  transform: perspective(1000px) translateY(-7px) rotateX(4deg) rotateY(var(--panel-turn));
  border-color: rgb(255 216 90 / 0.9);
  background:
    linear-gradient(180deg, rgb(28 68 104 / 0.42), rgb(5 17 42 / 0.92)),
    linear-gradient(115deg, rgb(255 79 162 / 0.16), transparent 45%, rgb(255 216 90 / 0.14));
  box-shadow: inset 0 0 40px rgb(255 111 135 / 0.1), 0 0 38px rgb(255 92 153 / 0.2);
}

.finale__choice span,
.finale__choice small {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.72;
}

.finale__choice strong {
  max-width: 520px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.2vw, 50px);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  color: transparent;
  background: linear-gradient(90deg, #fff5ef, #ffb687 54%, #ffd85a);
  background-clip: text;
  -webkit-background-clip: text;
}

.finale__choice::after {
  content: "Enter  ↗";
  justify-self: start;
  padding: 12px 0 5px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: 1px solid rgb(255 255 255 / 0.5);
}

.replay {
  position: absolute;
  left: 50%;
  bottom: 40px;
  cursor: pointer;
  background: transparent;
  border-bottom: 1px solid rgb(255 255 255 / 0.35);
  transform: translateX(-50%);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.event-note {
  left: 50%;
  bottom: 28%;
  display: none;
  width: min(430px, calc(100vw - 40px));
  padding: 30px;
  text-align: center;
  background: rgb(5 17 42 / 0.96);
  border: 1px solid rgb(87 175 255 / 0.55);
  box-shadow: 0 20px 60px rgb(0 5 20 / 0.6);
  transform: translateX(-50%);
}

.event-note:target { display: block; }

.event-note p {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-style: italic;
}

.event-note span {
  display: block;
  margin-bottom: 22px;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.event-note button {
  cursor: pointer;
  background: transparent;
  border-bottom: 1px solid currentColor;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.loader {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  color: white;
  background:
    radial-gradient(circle at 18% 55%, #ffd253 0, transparent 29%),
    radial-gradient(circle at 62% 34%, #ff766d 0, transparent 40%),
    radial-gradient(circle at 40% 76%, #f82978 0, transparent 35%),
    #f4a6c6;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader__mark {
  width: clamp(220px, 34vw, 380px);
  height: auto;
  mix-blend-mode: screen;
}

.loader__track {
  width: min(260px, 60vw);
  height: 1px;
  background: rgb(255 255 255 / 0.35);
}

.loader__track span {
  display: block;
  width: calc(var(--loaded) * 100%);
  height: 100%;
  background: white;
  transition: width 180ms linear;
}

.loader p {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.2em;
}

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

noscript {
  position: fixed;
  z-index: 200;
  inset: 20px 20px auto;
  padding: 16px;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--blueprint);
}

html[data-calibration="true"] .hud,
html[data-calibration="true"] .timeline,
html[data-calibration="true"] .scroll-cue {
  opacity: 0.2;
}

html[data-calibration-kind="chapter"] .spatial-copy,
html[data-calibration-kind="chapter"] .spatial-copy.is-concealed {
  inset: 0 !important;
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: 1 !important;
  filter: none;
  transform: none !important;
  perspective: none;
}

html[data-calibration-kind="chapter"] .spatial-copy__pin { display: none; }

html[data-calibration-kind="chapter"] .spatial-copy__surface.calibration-selected,
html[data-calibration-kind="cta"] .finale__choice.calibration-selected {
  position: absolute;
  top: 0;
  left: 0;
  width: 720px;
  height: 180px;
  min-height: 0;
  clip-path: none;
  transform: var(--calibration-matrix) !important;
  transform-origin: 0 0 !important;
  will-change: transform;
}

html[data-calibration-kind="chapter"] .finale { display: none !important; }
html[data-calibration-kind="cta"] .spatial-copy { opacity: 0 !important; }

html[data-calibration-kind="cta"] .finale,
html[data-calibration-kind="cta"] .finale.is-visible {
  inset: 0;
  display: block;
  padding: 0;
  opacity: 1 !important;
  pointer-events: none;
  transform: none !important;
}

html[data-calibration-kind="cta"] .finale__choice {
  opacity: 0.12;
  pointer-events: none;
}

html[data-calibration-kind="cta"] .finale__choice.calibration-selected { opacity: 1; }
html[data-calibration="true"] .replay { display: none; }

.calibrator-layer {
  position: fixed;
  z-index: 800;
  inset: 0;
  pointer-events: none;
}

.calibrator-quad {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.calibrator-quad polygon {
  fill: rgb(255 216 90 / 0.035);
  stroke: #ffd85a;
  stroke-width: 1.25;
  stroke-dasharray: 7 5;
  vector-effect: non-scaling-stroke;
}

.calibrator-handle {
  position: absolute;
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: move;
  pointer-events: auto;
  touch-action: none;
  color: #06132b;
  background: #ffd85a;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(255 79 162 / 0.72), 0 5px 18px rgb(0 0 0 / 0.45);
  transform: translate(-50%, -50%);
}

.calibrator-handle span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.calibrator {
  position: fixed;
  z-index: 900;
  top: 18px;
  left: 18px;
  width: min(330px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  overflow: auto;
  padding: 18px;
  color: #f7f1ef;
  background: rgb(3 11 30 / 0.94);
  border: 1px solid rgb(116 199 255 / 0.5);
  box-shadow: 0 18px 60px rgb(0 0 0 / 0.55), inset 0 0 36px rgb(35 136 232 / 0.08);
  backdrop-filter: blur(14px);
  font-size: 11px;
}

.calibrator__heading,
.calibrator__frame-header,
.calibrator__frame-row,
.calibrator__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calibrator__heading { margin-bottom: 16px; }
.calibrator__heading span,
.calibrator__field,
.calibrator__frame-header,
.calibrator__help,
.calibrator__status {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.calibrator__heading span { color: #9bcfff; font-size: 8px; }
.calibrator__heading h2 { margin: 3px 0 0; font: italic 25px/1 Georgia, serif; }
.calibrator__heading a { color: #ffd85a; font-size: 9px; text-decoration: none; border-bottom: 1px solid currentColor; }

.calibrator__field {
  display: grid;
  gap: 6px;
  margin-bottom: 15px;
  color: #9bcfff;
  font-size: 8px;
}

.calibrator select,
.calibrator input,
.calibrator textarea,
.calibrator button {
  color: inherit;
  background: rgb(10 31 62 / 0.9);
  border: 1px solid rgb(132 207 255 / 0.35);
  border-radius: 0;
}

.calibrator select,
.calibrator input[type="number"] {
  min-width: 0;
  padding: 9px 10px;
}

.calibrator__frame-header {
  margin-bottom: 6px;
  color: #bde4ff;
  font-size: 8px;
}

.calibrator__frame-row input { width: 100%; text-align: center; font-size: 15px; }
.calibrator__frame-row button { width: 38px; height: 36px; cursor: pointer; }

.calibrator__range {
  width: 100%;
  margin: 12px 0 14px;
  accent-color: #ff5c9b;
}

.calibrator__marks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.calibrator__marks button {
  display: grid;
  gap: 4px;
  padding: 9px 5px;
  cursor: pointer;
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.calibrator__marks output { color: #ffd85a; font-size: 12px; }
.calibrator__help { margin: 14px 0; color: rgb(247 241 239 / 0.65); font-size: 8px; line-height: 1.6; }
.calibrator__actions button { flex: 1; min-height: 36px; padding: 7px; cursor: pointer; font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.calibrator__actions button:last-child { color: #06132b; background: linear-gradient(90deg, #ff8cb8, #ffd85a); border-color: transparent; }

.calibrator__export {
  width: 100%;
  height: 62px;
  margin-top: 10px;
  padding: 8px;
  resize: vertical;
  color: rgb(225 240 255 / 0.72) !important;
  font: 9px/1.35 monospace;
}

.calibrator__status { margin: 10px 0 0; color: #ffcf83; font-size: 8px; line-height: 1.5; }

@media (max-width: 720px) {
  .experience { height: 1180vh; }

  .stage { min-height: 460px; }

  .film { transform: translateZ(0); }

  .hud {
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    gap: 12px;
  }

  .hud--top {
    top: max(18px, env(safe-area-inset-top));
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .hud--top p:nth-child(2) { display: none; }

  .skip {
    min-height: 44px;
    padding: 0;
    font-size: 8px;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }

  .hud--bottom {
    bottom: max(18px, env(safe-area-inset-bottom));
    grid-template-columns: 38px 1fr;
  }
  .hud--bottom p:last-child { display: none; }

  .timeline {
    right: max(4px, env(safe-area-inset-right));
    gap: 1px;
  }
  .timeline button { width: 44px; height: 24px; }
  .timeline button::after { width: 11px; }
  .timeline button.is-active::after,
  .timeline button:focus-visible::after { width: 25px; }
  .timeline button span { display: none; }

  .spatial-copy,
  .spatial-copy[data-placement] {
    --label-x: 50% !important;
    --label-y: auto !important;
    --label-width: calc(100vw - 52px);
    top: auto;
    bottom: max(68px, calc(52px + env(safe-area-inset-bottom)));
  }

  .spatial-copy__surface,
  .spatial-copy[data-placement] .spatial-copy__surface {
    max-height: 32svh;
    overflow: hidden;
    padding: 11px 16px 12px;
    text-align: left;
    clip-path: polygon(2% 0, 98% 0, 100% 100%, 0 100%);
    transform: none;
  }

  .spatial-copy__pin { display: none; }
  .spatial-copy__title { font-size: clamp(24px, 7.2vw, 29px); }
  .spatial-copy__copy { margin-left: 0; font-size: 11px; line-height: 1.38; }
  .spatial-copy__medium { margin-top: 6px; font-size: 7px; }
  .scroll-cue { display: none; }

  .finale {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 8px;
    padding: 0 max(16px, env(safe-area-inset-left)) max(72px, calc(58px + env(safe-area-inset-bottom)));
  }

  .finale__choice {
    min-height: 92px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgb(5 17 42 / 0.91), rgb(70 16 55 / 0.68));
    border-color: rgb(255 255 255 / 0.28);
    clip-path: polygon(2% 0, 98% 0, 100% 100%, 0 100%);
    transform: none;
  }

  .finale__choice:hover,
  .finale__choice:focus-visible { transform: translateY(-3px); }

  .finale__choice span,
  .finale__choice small { font-size: 7px; }
  .finale__choice strong { font-size: clamp(22px, 6.5vw, 27px); }
  .finale__choice::after { display: none; }

  .replay {
    bottom: max(24px, env(safe-area-inset-bottom));
    min-height: 36px;
    white-space: nowrap;
  }

  .event-note {
    top: 50%;
    bottom: auto;
    width: calc(100vw - 32px);
    padding: 24px 20px;
    transform: translate(-50%, -50%);
  }

  .event-note button { min-height: 44px; }

  .loader__mark { width: min(82vw, 340px); }
}

@media (max-height: 540px) and (orientation: landscape) {
  .spatial-copy,
  .spatial-copy[data-placement] {
    --label-width: min(430px, calc(100vw - 120px));
    bottom: 46px;
  }

  .spatial-copy__surface,
  .spatial-copy[data-placement] .spatial-copy__surface { padding: 8px 14px 9px; }
  .spatial-copy__title { font-size: 22px; }
  .spatial-copy__copy { font-size: 9px; }
  .spatial-copy__medium { display: none; }

  .finale {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 64px 52px;
  }

  .finale__choice { min-height: 92px; padding: 12px 15px; }
  .finale__choice small { display: none; }
  .replay { bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
