:root {
  color: #141414;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button:focus-visible { outline: 1px dashed #141414; outline-offset: 4px; }
button:disabled { visibility: hidden; }

.stage, .boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.plate {
  position: relative;
  width: min(100vw, 177.7778svh);
  aspect-ratio: 16 / 9;
  isolation: isolate;
}
.plate video {
  display: block;
  width: 100%;
  height: 100%;
}
#hold { position: absolute; inset: 0; width: 100%; height: 100%; }
#detail { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.plate.splicing #world { animation: splice 400ms ease-out both; }
@keyframes splice {
  0% { opacity: 0; clip-path: inset(44% 0 48%); transform: translateX(9px); }
  40% { opacity: .46; clip-path: inset(17% 0 11%); transform: translateX(-3px); }
  100% { opacity: 1; clip-path: inset(0); }
}

.viewfinder {
  position: absolute;
  width: clamp(110px, 16vw, 198px);
  border: 1px solid #222;
  background: #fff;
  transform: translate(-50%, -50%);
  padding: 0;
  box-shadow: 2px 3px 0 #0000000e;
  transition: box-shadow 140ms;
}
.finder-bar {
  height: 18px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #222;
  background: #fff;
}
.viewfinder:hover { box-shadow: 3px 4px 0 #0000001c; }
.viewfinder:hover .finder-mark { background: #141414; color: #fff; }
.finder-bar .dot { --dot-size: .64; }
.finder-mark { font: 11px/1 monospace; }
#crop { display: block; width: 100%; aspect-ratio: 9 / 5; image-rendering: pixelated; }

.menu {
  position: absolute;
  z-index: 1;
  left: max(4.6vw, 22px);
  bottom: max(5.5vh, 24px);
  animation: menu-arrival 480ms cubic-bezier(.15,.55,.3,1) both;
}
@keyframes menu-arrival {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
h1 {
  margin: 0 0 .25em -.05em;
  font-size: clamp(40px, 5.9vw, 86px);
  line-height: .88;
  letter-spacing: -.071em;
  font-weight: 640;
  padding: .025em .09em .025em 0;
  width: fit-content;
}
.menu[data-scene="tram"] h1 { background: #fff; }
nav {
  width: min(177px, 62vw);
  background: #fff;
  border-top: 1px solid #171717;
}
nav button {
  position: relative;
  display: flex;
  align-items: center;
  padding: 9px 9px 8px 18px;
  border-bottom: 1px solid #1b1b1b;
  width: 100%;
  min-height: 31px;
  text-align: left;
}
nav button::before {
  content: "";
  position: absolute;
  left: 3px;
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
}
nav button[aria-pressed="true"]::before { background: currentColor; }
nav button:hover { color: #fff; background: #151515; }
#replay, .under { padding: 9px 0; margin-top: 6px; }
#replay { padding-right: 7px; background: #fff; }
.under { position: absolute; bottom: max(3vh, 16px); right: max(4vw, 20px); }
#replay:hover, .under:hover { text-decoration: underline; }

.boot { background: #fff; z-index: 5; }
.boot.out { opacity: 0; pointer-events: none; transition: opacity 400ms ease; }
.boot-inner { width: min(232px, 68vw); }
.boot-title { --dot-size: 1.15; display: block; margin-bottom: 11px; }
.boot-progress { display: flex; align-items: center; gap: 12px; }
.bar { width: 100%; height: 5px; border: 1px solid #101010; }
#fill { width: 0; height: 100%; background: #111; }
#enter { margin-top: 24px; padding: 6px 8px; border: 1px solid #111; }
#enter:hover { color: #fff; background: #111; }
.dot { --dot-size: 1; font: 10px/1 monospace; white-space: nowrap; }
.dot canvas { height: calc(var(--dot-size) * 11px); width: auto; display: block; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-aspect-ratio: 1/1) {
  .plate { margin-top: -19svh; }
  .menu { bottom: max(9vh, 28px); }
  .viewfinder { width: 116px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
