/* Cuut: the runway hall. Palette from the reference (black-green, phosphor, white, one orange). */
@font-face { font-family: "Zodiak"; src: url("/fonts/Zodiak-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Zodiak"; src: url("/fonts/Zodiak-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Azeret Mono"; src: url("/fonts/AzeretMono-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #050b08; --deep: #0b2a1a; --phos: #57ff9a; --hot: #f4fff7; --orange: #ff5a1f; --dim: #9fd9b8; --mid: #cfe9d9;
  --display: "Zodiak", Georgia, serif;
  --mono: "Azeret Mono", "Cascadia Mono", Consolas, monospace;
  --t-display: clamp(36px, 2.9vw, 52px);
  --t-title: 36px; --t-big: 24px; --t-body: 18px; --t-label: 16px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px;
  --key-h: 56px; --key-pad: 28px;
  --wrap: 1600px;
  /* nine-slice numbers, measured on the plates in public/img (tools/art-web.mjs prints the edge profiles) */
  --key-slice: 40 40 60 40; --key-w: 6px 6px 9px 6px;
  --print-slice: 44; --print-w: 16px;
}
* { box-sizing: border-box; }
html { background: var(--ink); color: var(--mid); overflow-x: clip; scrollbar-width: thin; scrollbar-color: var(--deep) transparent; }
body { margin: 0; font: 400 var(--t-body)/1.5 var(--mono); font-synthesis: none; min-height: 100vh; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, dl, dd, dt { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: var(--deep); border-radius: 5px; } ::-webkit-scrollbar-button { display: none; }
:focus-visible { outline: 3px solid var(--phos); outline-offset: 3px; }

/* ---- the hall: video ground under everything ---- */
.hall { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--ink) url("/img/hall.webp") center / cover no-repeat; transition: filter .6s ease, transform .6s ease; }
.hall-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hall-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,11,8,.3) 0%, rgba(5,11,8,.1) 40%, rgba(5,11,8,.6) 100%); }
body:not([data-view="runway"]) .hall { filter: blur(14px) brightness(.5); transform: scale(1.06); }

/* ---- the intro ---- */
.intro { position: fixed; inset: 0; z-index: 50; background: var(--ink); display: grid; place-items: center; }
.intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.intro-keys { position: relative; z-index: 1; display: flex; gap: var(--s-4); flex-wrap: wrap; justify-content: center; align-self: end; margin-bottom: max(8vh, 56px); padding: 0 var(--s-4); }
.intro.is-out { opacity: 0; pointer-events: none; transition: opacity .7s ease; }
.intro.is-gone { display: none; }

/* ---- keys: generated plates, nine-sliced ---- */
.key { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-3); min-height: var(--key-h); padding: 0 var(--key-pad); color: var(--hot); font-weight: 500; font-size: var(--t-body); letter-spacing: .01em; white-space: nowrap; border: 0; background: transparent;
  border-image: url("/img/key.webp") var(--key-slice) fill / var(--key-w) / 0 stretch; border-style: solid; border-width: var(--key-w); transition: transform .12s ease, filter .12s ease; }
.key:hover { filter: brightness(1.18); }
.key:active { transform: translateY(2px); }
.key:disabled, .key[aria-disabled="true"] { border-image-source: url("/img/key-dim.webp"); border-image-slice: 65 fill; border-image-width: 8px; border-width: 8px; color: var(--dim); opacity: .85; cursor: not-allowed; }
.key-orange { border-image-source: url("/img/key-orange.webp"); border-image-slice: 45 fill; border-image-width: 6px; border-width: 6px; }
.key-big { min-height: 64px; font-size: var(--t-big); padding: 0 40px; }
.key-mark img { width: 30px; height: 30px; object-fit: contain; }
.key.is-on { color: var(--phos); }
.key[aria-disabled="true"] img { filter: grayscale(1) opacity(.6); }

/* ---- prints: the read surface ---- */
.print { border-image: url("/img/print.webp") var(--print-slice) fill / var(--print-w) / 0 stretch; border-style: solid; border-width: var(--print-w); background: transparent; filter: drop-shadow(0 12px 18px rgba(0,0,0,.45)); }

/* ---- layout ---- */
#app { position: relative; z-index: 1; }
.view { width: min(var(--wrap), 100% - 2 * var(--s-6)); margin: 0 auto; padding: var(--s-6) 0 var(--s-8); }
.view-title { font: 900 var(--t-title)/1.25 var(--display); color: var(--hot); text-align: center; text-wrap: balance; margin: var(--s-5) 0 var(--s-4); }
.view-title.small { margin-top: var(--s-8); }
.view-lede { text-align: center; max-width: 60ch; margin: 0 auto var(--s-6); color: var(--mid); text-wrap: pretty; }
.view-empty { padding: var(--s-5) var(--s-6); text-align: center; max-width: 720px; margin: var(--s-6) auto 0; }

/* ---- runway: the first screen is the hall; the stage column and the pass column share one top edge ---- */
.view-runway { min-height: 100vh; padding-top: var(--s-5); }
.stage-row { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s-7); align-items: start; }
.stage { position: relative; display: grid; grid-template-rows: auto auto auto auto; justify-items: center; row-gap: var(--s-4); }
.board { position: relative; width: min(900px, 100%); padding: var(--s-3) var(--s-7) var(--s-4); text-align: center;
  border-image: url("/img/board.webp") 48 fill / 40px / 0 stretch; border-style: solid; border-width: 40px; filter: drop-shadow(0 16px 24px rgba(0,0,0,.5)); }
.board-mark { width: min(240px, 44%); margin: 0 auto var(--s-1); }
.board-line { font: 900 var(--t-display)/1.25 var(--display); color: var(--hot); text-wrap: balance; letter-spacing: -.01em; min-height: 1.25em; }
.board-line b { color: var(--phos); font-weight: 900; }
.board-sub { color: var(--dim); margin: var(--s-2) auto 0; max-width: 54ch; font-size: var(--t-label); text-wrap: pretty; min-height: 3em; }

.stage-cat { position: relative; width: min(47vh, 100%, 600px); aspect-ratio: 1; }
.cat-img, .cat-next { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 30px 30px rgba(0,0,0,.7)); transform-origin: 50% 100%; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.cat-img.is-out { opacity: 0; transform: translateY(6%) scale(.96); }
.cat-next.is-in { opacity: 1; }
.cat-next { opacity: 0; }
.reticle { position: absolute; inset: 0; opacity: 0; border-image: url("/img/reticle.webp") 120 / 60px / 0 stretch; border-style: solid; border-width: 60px; pointer-events: none; mix-blend-mode: screen; transform: scale(1.06); transition: opacity .3s, transform .3s; }
.reticle.is-on { opacity: 1; transform: scale(1); }
.tag-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: center; width: min(760px, 100%); }
.stage-tag { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: center; padding: var(--s-3) var(--s-5); min-width: 0; }
.tag-no { display: block; font: 900 var(--t-big)/1.25 var(--display); color: var(--hot); white-space: nowrap; }
.tag-traits { color: var(--dim); font-size: var(--t-label); min-width: 0; overflow-wrap: anywhere; }
.meter { position: relative; width: min(760px, 100%); height: 56px; display: grid; align-items: center; padding: 0 var(--s-5); border-image: url("/img/key-dim.webp") 65 fill / 8px / 0 stretch; border-style: solid; border-width: 8px; }
.meter-fill { position: absolute; left: 10px; right: 10px; top: 10px; bottom: 10px; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--deep), var(--phos)); opacity: .55; transition: transform .8s ease; border-radius: 3px; }
.meter-label { position: relative; color: var(--hot); font-weight: 500; font-variant-numeric: tabular-nums; text-align: center; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.pit { display: flex; gap: var(--s-2); }
.badge { display: grid; place-items: center; width: 72px; height: 74px; padding-top: 14px; background: url("/img/badge.webp") center / contain no-repeat; transition: transform .12s; }
.badge img { width: 28px; height: 28px; object-fit: contain; }
.badge:hover { transform: translateY(-2px); }
.badge[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.badge[aria-disabled="true"] img { filter: grayscale(1); }

/* the backstage pass: the card plate stretches only vertically (top/bottom slices scaled by the pass width, so the
   grommet and the corners keep their shape); the strap hangs above it */
.pass-wrap { container-type: inline-size; margin-top: 84px; }
.pass { position: relative; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-3) var(--s-6) var(--s-5); color: var(--mid);
  border-image: url("/img/pass-card.webp") 130 0 40 0 fill / 26.2cqw 0 8.1cqw 0 / 0 stretch; border-style: solid; border-width: 26.2cqw 0 8.1cqw 0; filter: drop-shadow(0 20px 30px rgba(0,0,0,.5)); }
.pass::before { content: ""; position: absolute; left: 50%; top: -92px; width: 28cqw; height: 100px; transform: translateX(-50%); background: url("/img/lanyard.webp") center bottom / contain no-repeat; pointer-events: none; }
.pass-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); }
.pass-name { display: block; font: 900 var(--t-title)/1.25 var(--display); color: var(--hot); }
.pass-ticker { color: var(--phos); font-weight: 700; font-size: var(--t-big); }
.pass-label { color: var(--dim); font-size: var(--t-label); }
.pass-address { color: var(--hot); font-weight: 500; font-size: var(--t-body); line-height: 1.45; min-height: 2.9em; overflow-wrap: anywhere; user-select: all; }
.pass-row { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); }
.pass-note { color: var(--dim); font-size: var(--t-label); min-height: 3em; text-wrap: pretty; }
.pass-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-2); }
.pass-nav .key { padding-inline: var(--s-4); }
.pass-nav .key.is-on { color: var(--phos); }
.pass-sound { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: center; }
.volume { width: 100%; accent-color: var(--phos); height: 24px; }

/* ---- lookbook ---- */
.filters { display: flex; gap: var(--s-3); justify-content: center; flex-wrap: wrap; margin-bottom: var(--s-6); }
.prints { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-5); }
.print-tile { display: grid; gap: var(--s-2); padding: var(--s-2) var(--s-3) var(--s-3); text-align: left; color: var(--mid); background: transparent; border: 0; transition: transform .15s ease, filter .15s ease; }
.print-tile:hover { transform: translateY(-4px) scale(1.02); filter: drop-shadow(0 0 18px rgba(87,255,154,.35)); }
.print-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #000; }
.print-tile .no { font: 900 var(--t-big)/1.25 var(--display); color: var(--hot); }
.print-tile .who { color: var(--dim); font-size: var(--t-label); overflow-wrap: anywhere; }
.print-tile .walk { color: var(--phos); font-size: var(--t-label); }
.print-tile .walk.legendary { color: #ffd166; } .print-tile .walk.rare { color: var(--orange); }
.print-tile.is-rehearsal .no::after { content: " · rehearsal"; color: var(--dim); font: 500 var(--t-label) var(--mono); }

/* ---- fitting room ---- */
.fitting { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.fitting-preview { padding: var(--s-3); }
.fitting-preview canvas { width: 100%; height: auto; display: block; background: #000; }
.fitting-controls { display: grid; gap: var(--s-5); }
.fit-group { display: grid; gap: var(--s-3); }
.fit-label { display: block; font: 900 var(--t-big)/1.25 var(--display); color: var(--hot); }
.fit-keys { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.fit-keys .key { padding-inline: var(--s-4); }
.fit-keys .key.is-locked { border-image-source: url("/img/key-dim.webp"); border-image-slice: 65 fill; border-image-width: 8px; border-width: 8px; color: var(--dim); }
.fit-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* ---- backstage ---- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); align-items: stretch; }
.step { display: grid; grid-template-rows: auto auto 1fr; gap: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-5); }
.step img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #000; }
.step h3 { font: 900 var(--t-big)/1.25 var(--display); color: var(--hot); padding: 0 var(--s-3); }
.step p { color: var(--mid); padding: 0 var(--s-3); text-wrap: pretty; }
.memes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); }
.meme { padding: var(--s-2); border: 0; background: transparent; transition: transform .15s ease, filter .15s ease; }
.meme:hover { transform: translateY(-4px) scale(1.02); filter: drop-shadow(0 0 18px rgba(87,255,154,.35)); }
.meme img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #000; }

/* ---- dialogs, flash, toast ---- */
.dialog { border: 0; padding: 0; background: transparent; max-width: min(1100px, 100vw - 2 * var(--s-4)); width: 100%; color: var(--mid); }
.dialog::backdrop { background: rgba(5, 11, 8, .82); backdrop-filter: blur(6px); }
.dialog-print { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: var(--s-5); padding: var(--s-3); }
.dialog-print.wide { grid-template-columns: 1fr; }
.dialog-img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #000; }
.dialog-print.wide .dialog-img { aspect-ratio: 3 / 2; }
.dialog-body { display: grid; gap: var(--s-4); align-content: start; padding: var(--s-3) var(--s-3) var(--s-3) 0; }
.dialog-title { font: 900 var(--t-title)/1.25 var(--display); color: var(--hot); }
.dialog-traits { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4); }
.dialog-traits dt { color: var(--dim); font-size: var(--t-label); }
.dialog-traits dd { color: var(--hot); }
.dialog-owner { color: var(--dim); font-size: var(--t-label); overflow-wrap: anywhere; }
.dialog-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: auto; padding: var(--s-2) var(--s-3); }
.flash { position: fixed; inset: 0; z-index: 40; background: #fff; opacity: 0; pointer-events: none; }
.flash.is-on { animation: flash 1.1s steps(1) forwards; }
@keyframes flash { 0% { opacity: .9 } 8% { opacity: 0 } 18% { opacity: .7 } 24% { opacity: 0 } 40% { opacity: .8 } 46% { opacity: 0 } 70% { opacity: .5 } 76% { opacity: 0 } 100% { opacity: 0 } }
.blackout .hall, .blackout .board, .blackout .pass-wrap { filter: brightness(.15); transition: filter .35s ease; }
.toast { position: fixed; left: 50%; bottom: var(--s-6); transform: translate(-50%, 140%); z-index: 45; padding: var(--s-3) var(--s-5); color: var(--hot); font-weight: 500; transition: transform .4s cubic-bezier(.2,.8,.2,1); max-width: min(720px, 100vw - 2 * var(--s-4)); text-align: center; }
.toast.is-on { transform: translate(-50%, 0); }

/* ---- motion ---- */
@keyframes idle { 0%, 100% { transform: rotate(-.35deg) } 50% { transform: rotate(.35deg) } }
.cat-img { animation: idle 9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .cat-img { animation: none; }
  .hall-video { display: none; }
  .flash.is-on { animation: none; }
  .meter-fill, .cat-img, .cat-next, .reticle, .toast, .hall { transition: none; }
}

/* ---- widths ---- */
@media (max-width: 1180px) {
  .stage-row { grid-template-columns: 1fr; }
  .pass-wrap { max-width: 520px; width: 100%; justify-self: center; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fitting { grid-template-columns: 1fr; }
  .dialog-print { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  :root { --t-title: 30px; --t-big: 21px; --key-pad: 20px; --wrap: 100%; --t-display: 34px; }
  .view { width: calc(100% - 2 * var(--s-4)); padding-top: var(--s-4); }
  .view-runway { padding-top: var(--s-4); }
  .stage-row { gap: var(--s-6); }
  .board { padding: var(--s-3) var(--s-3) var(--s-4); border-width: 24px; border-image-width: 24px; }
  .board-mark { width: 60%; }
  .board-sub { min-height: 0; }
  .stage-cat { width: 100%; }
  .stage-tag { grid-template-columns: 1fr; gap: var(--s-1); text-align: center; }
  .meter { height: auto; min-height: 56px; padding: var(--s-2) var(--s-4); }
  .tag-row { grid-template-columns: 1fr; justify-items: center; }
  .pit { justify-content: center; }
  .pass-wrap { margin-top: 80px; }
  .pass { padding: var(--s-2) var(--s-5) var(--s-4); }
  .pass::before { top: -78px; height: 86px; }
  .pass-row { grid-template-columns: 1fr; }
  .prints { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .steps, .memes { grid-template-columns: 1fr; }
  .intro-keys { flex-direction: column; align-items: stretch; width: min(360px, 100% - 32px); }
}
@media (max-width: 400px) {
  .prints { grid-template-columns: 1fr; }
  .pass-nav { grid-template-columns: 1fr; }
}
