@font-face {
  font-family: Film Display;
  src: url('assets/display.ttf') format('truetype');
  font-weight: 900;
  font-display: swap;
}
:root {
  color-scheme: dark;
  background: #000;
  color: #f3f5f6;
  font-family: 'Film Display', Impact, sans-serif;
  font-weight: 900;
  --screen: 100svh;
  --meta: ui-monospace, 'Courier New', monospace;
}
@supports not (height: 100svh) { :root { --screen: 100vh; } }
* { box-sizing: border-box; }
body { margin: 0; overflow-x: clip; overscroll-behavior-x: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.entry, .screen, .waiting { min-height: var(--screen); }
.entry { display: grid; place-items: center; }
.open .entry { position: fixed; z-index: 3; inset: 0; background: #000; animation: release .95s .17s both; pointer-events: none; }
@keyframes release { 0%,20% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.switch {
  position: relative; appearance: none; background: none; border: 0; color: inherit;
  padding: 24px; margin: 0; cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; display: grid; place-items: center;
}
.switch:focus-visible { outline: 1px solid #ddd; outline-offset: 8px; }
.mechanism {
  display: grid; place-items: center; width: 64px; height: 115px; padding: 5px;
  background: #0a0b0c; box-shadow: 0 15px 32px #000, -1px -1px #292b2e, 1px 1px #141517;
  perspective: 220px;
}
.rocker {
  display: block; width: 100%; height: 100%; position: relative;
  transform: rotateX(19deg); transform-origin: center; transition: transform .17s cubic-bezier(.25,.75,.25,1), filter .25s;
  background: linear-gradient(163deg,#383b40 0%,#24262a 46%,#191a1c 100%);
  box-shadow: inset 1px 1px #777a80, inset -1px -1px #080809, 0 7px 7px #000;
}
.rocker i { position: absolute; left: calc(50% - 1px); top: 20%; width: 2px; height: 11px; background: #9eaaaf; box-shadow: 0 0 6px #c9e4ff45; }
.rocker b { position: absolute; left: calc(50% - 4px); bottom: 21%; width: 8px; height: 8px; border: 1px solid #70767c; border-radius: 50%; }
.switch:hover .rocker { filter: brightness(1.25); }
.open .rocker, .switch:active .rocker { transform: rotateX(-18deg); }
.open .rocker i { background: #fff; box-shadow: 0 0 13px #effaff; }
.switch-caption, .scroll-cue, .label, footer {
  font: 700 10px/1.2 var(--meta); letter-spacing: .22em; text-transform: uppercase;
}
.switch-caption { color: #c0c4c8; white-space: nowrap; position: absolute; top: calc(100% + 7px); }
.switch:disabled { cursor: progress; }
.switch:disabled .rocker { filter: brightness(.74); }
.load-progress { position: absolute; top: calc(100% + 50px); left: 8px; right: 8px; height: 1px; background: #dce8f526; overflow: hidden; }
.load-progress i { display: block; width: 100%; height: 100%; background: #dcecff; transform: scaleX(0); transform-origin: left; transition: transform .24s ease; }
.load-status { position: absolute; top: calc(100% + 64px); color: #747d86; white-space: nowrap; font: 9px/1.2 var(--meta); letter-spacing: .13em; text-transform: uppercase; }
.load-status b { color: #bbc5ce; font-weight: 400; }
.loaded .load-status, .loaded .load-progress { opacity: 0; transition: opacity .55s; }
.loaded .switch-caption { color: #e2e8ee; }
.load-error .load-status { color: #c3a9a9; white-space: normal; max-width: 290px; text-align: center; line-height: 1.6; }
.load-error .switch-caption { white-space: normal; max-width: 290px; text-align: center; line-height: 1.6; }
.reel { height: calc(var(--screen) * 6.65); }
.miracle { height: calc(var(--screen) * 4.2); }
.screen { position: sticky; top: 0; width: 100%; height: var(--screen); overflow: hidden; isolation: isolate; }
.exposure, .vignette, .window-screen canvas, .last-snow { position: absolute; inset: 0; width: 100%; height: 100%; }
.exposure { opacity: var(--exposure,1); }
.poster, .frames { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%; }
.frames { visibility: hidden; }
.reel-screen.ready .frames { visibility: visible; }
.reel-screen.ready .poster { visibility: hidden; }
.vignette { pointer-events: none; background: radial-gradient(ellipse at 50% 43%,transparent 28%,#0002 65%,#000 100%); }
.scroll-cue {
  position: absolute; bottom: max(34px, calc(env(safe-area-inset-bottom) + 20px)); left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 8px; text-shadow: 0 2px 8px #000;
  opacity: var(--cue,1);
}
.scroll-cue i { font-style: normal; font-size: 21px; font-weight: 400; }
.window-screen { opacity: var(--window,0); background: radial-gradient(ellipse at 50% 40%,#192630 0%,#040609 69%); }
.window-snow { opacity: .7; }
.ice { pointer-events: none; }
.waiting { display: grid; place-items: center; position: relative; isolation: isolate; padding: 9vh 12px 14vh; overflow: hidden; }
.end-content { opacity: var(--end,0); width: min(100%, 1100px); text-align: center; transform: translateY(calc((1 - var(--end,0)) * 16px)); }
.last-snow { z-index: -1; opacity: var(--end,0); }
.clock { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.unit { min-width: 0; }
.number {
  display: block; position: relative; font-size: clamp(55px, 15vw, 220px); height: .9em;
  line-height: .9em; font-variant-numeric: tabular-nums; letter-spacing: -.085em;
  transform: scaleX(.68) scaleY(1.1); white-space: nowrap; perspective: 2.3em;
}
.digit { position: absolute; inset: 0; padding-right: .085em; display: block; }
.top { clip-path: inset(0 0 50.4%); }
.bottom { clip-path: inset(50.4% 0 0); color: #e3e7e9; }
.flap { z-index: 1; transform-origin: center; backface-visibility: hidden; }
.outgoing { animation: fold .19s cubic-bezier(.45,.02,.85,.53) both; }
.incoming { animation: unfold .23s .19s cubic-bezier(.2,.62,.37,1) both; }
@keyframes fold { from { transform: rotateX(0); } to { transform: rotateX(-89deg); filter: brightness(.57); } }
@keyframes unfold { from { transform: rotateX(89deg); filter: brightness(.53); } to { transform: rotateX(0); } }
.label { display: block; color: #bdc3cb; margin-top: 24px; font-size: clamp(7px,1.85vw,12px); letter-spacing: .14em; }
.tagline { margin: 14vh 0 0; text-transform: uppercase; font-size: clamp(24px,6.7vw,96px); letter-spacing: -.055em; line-height: .9; transform: scaleX(.65) scaleY(1.23); white-space: nowrap; }
footer { position: absolute; bottom: max(28px,calc(env(safe-area-inset-bottom) + 12px)); justify-self: center; color: #899097; opacity: var(--end,0); text-align: center; letter-spacing: .19em; }
noscript { position: fixed; bottom: 3vh; left: 0; right: 0; text-align: center; font: 12px var(--meta); }
@media (min-width: 620px) {
  .mechanism { width: 70px; height: 125px; }
  .waiting { padding-inline: 5vw; }
  .label { margin-top: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
@media (min-aspect-ratio: 4/5) {
  .poster, .frames {
    width: min(82vw, calc(var(--screen) * .71)); left: 50%; transform: translateX(-50%);
    mask-image: linear-gradient(90deg, transparent, #000 13% 87%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 13% 87%, transparent);
  }
}
