/* v06 One Word: white, black giant type, one red accent. Swiss: a grid, hard edges, nothing extra. */
:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --red: #e60f00;
  --red-soft: #ffe4e1;
  --grey: #5f5f5f;
  --rule: #e4e4e4;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --hudh: calc(76px + var(--sat));
  --gut: 16px;
  --font: 'Helvetica Neue', Helvetica, 'Inter Tight', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); overflow: hidden; }
body { font: 500 16px/1.35 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; }
b, strong { font-weight: 800; }

/* ---------- the stage (the engine's 3D) ---------- */
.stage { position: fixed; inset: 0; z-index: 0; }
body[data-phase="boot"] .stage, body[data-phase="between"] .stage,
body[data-phase="gate"] .stage, body[data-phase="results"] .stage { visibility: hidden; }

/* ---------- pages ---------- */
.screen { position: fixed; inset: 0; z-index: 10; overflow-x: hidden; overflow-y: auto; background: var(--paper); -webkit-overflow-scrolling: touch; }
.screen[hidden] { display: none; }
.screen.clear { background: transparent; overflow: hidden; }
.screen.over { background: transparent; pointer-events: none; overflow: hidden; }
.screen.over > * { pointer-events: auto; }
.pg { min-height: 100%; display: flex; flex-direction: column; }

.bar { position: relative; z-index: 1; flex: none; height: calc(56px + var(--sat)); padding: var(--sat) var(--gut) 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font: 900 13px/1 var(--font); letter-spacing: .14em; display: inline-flex; align-items: center; gap: 7px; }
.brand i { width: 10px; height: 10px; background: var(--red); display: inline-block; }
.bar-r { font: 700 12px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
body[data-phase="intro"] .bar, body[data-phase="between"] .bar { padding-right: 108px; }

.sound { position: fixed; z-index: 30; top: calc(8px + var(--sat)); right: 8px; height: 40px; min-width: 88px; padding: 0 12px; border: 0; background: transparent; color: var(--ink);
  font: 800 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.sound.off { color: var(--grey); text-decoration-style: dotted; }
body:not([data-phase="landing"]):not([data-phase="intro"]):not([data-phase="between"]) .sound { display: none; }

/* progress: 5 steps, never empty (GO is done the moment they start) */
.prog { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex: 1; }
.prog li { flex: 1; display: grid; gap: 5px; }
.prog i { display: block; height: 4px; background: var(--rule); }
.prog li.on i { background: var(--ink); }
.prog li.now i { background: var(--red); animation: grow .6s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.prog span { font: 800 9px/1 var(--font); letter-spacing: .08em; color: #9a9a9a; }
.prog li.on span { color: var(--ink); }
.prog li.now span { color: var(--red); }
@keyframes grow { from { transform: scaleX(0); } }

/* giant type: one word fills its line (JS sets the size) */
.fit { display: inline-block; white-space: nowrap; font-weight: 900; line-height: .86; letter-spacing: -.045em; }
.lw, .bw, .gw, .frac, .r-tier, .r-ww, .who-w, .rv-w { width: 100%; min-width: 0; overflow: visible; }

/* buttons: one per screen, big, square, black; red arrow */
.btn { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 64px; padding: 0 20px 0 22px; border: 0; border-radius: 0;
  background: var(--ink); color: #fff; font: 900 19px/1 var(--font); letter-spacing: .04em; text-align: left; cursor: pointer; transition: background .15s, transform .12s; }
.btn:hover { background: #262626; }
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.btn[disabled] { background: #ededed; color: #8a8a8a; cursor: progress; }
.arr { flex: none; width: 34px; height: 34px; background: var(--red); display: grid; place-items: center; transition: transform .2s; }
.arr::after { content: '→'; color: #fff; font: 900 20px/1 var(--font); }
.btn:hover .arr { transform: translateX(4px); }
.spin { width: 20px; height: 20px; border: 3px solid #c9c9c9; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fine { margin: 10px 0 0; font: 500 13px/1.35 var(--font); color: var(--grey); }
.red { color: var(--red); }

/* ---------- landing: the pitch through the letters ---------- */
.land { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 8px var(--gut) calc(20px + var(--sab)); }
.kicker { position: relative; z-index: 1; margin: 6vh 0 10px; font: 800 26px/1.05 var(--font); letter-spacing: -.02em; }
.knockbox { position: relative; z-index: 0; }
.knock { display: block; width: 100%; height: auto; max-height: 72vh; box-shadow: 0 0 0 200vmax var(--paper); --hole: 24vh; }
.knock-cap { position: absolute; right: 0; bottom: 0; background: var(--ink); color: #fff; font: 800 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; }
body[data-phase="landing"] .stage { background: #0b1a10 url(../media/posters/dec-mid-2.jpg) center / cover no-repeat; }
.knock-t { font: 900 200px var(--font); letter-spacing: -10px; }
.land-foot { position: relative; z-index: 1; display: grid; gap: 22px; margin-top: auto; padding-top: 24px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-top: 3px solid var(--ink); padding-top: 12px; }
.facts li { font: 900 44px/1 var(--font); letter-spacing: -.035em; }
.facts li b { font-weight: 900; }
.facts li.red { color: var(--red); }

/* ---------- level page: a number, a word, a window onto his eyes ---------- */
.intro { position: relative; flex: 1; display: flex; flex-direction: column; padding: 4px var(--gut) calc(16px + var(--sab)); }
.win { position: relative; z-index: 0; height: 35vh; min-height: 200px; box-shadow: 0 0 0 200vmax var(--paper); }
.win-tag { position: absolute; right: 0; top: 0; background: var(--ink); color: #fff; font: 800 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; transition: opacity .2s; }
.intro-txt { position: relative; z-index: 1; display: flex; flex-direction: column; transition: opacity .25s; }
.opening .intro-txt, .opening .bar, .opening .win-tag, .opening .sound { opacity: 0; }
.lvl { display: flex; align-items: flex-end; gap: 12px; margin-top: -52px; }
.lvl .num { font: 900 132px/.78 var(--font); letter-spacing: -.06em; color: var(--red); }
.lvl span { font: 800 12px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; padding-bottom: 4px; }
.lvl em { font-style: normal; color: var(--grey); }
.intro .lw { margin-top: 14px; }
.how { margin: 12px 0 0; font: 700 19px/1.25 var(--font); letter-spacing: -.01em; }
.meta { margin: 6px 0 0; font: 700 12px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
.rate { margin-top: auto; padding-top: 18px; }
.rate p { margin: 0 0 10px; font: 600 15px/1.3 var(--font); }
.rate-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rt { height: 54px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 900 22px/1 var(--font); cursor: pointer; transition: background .12s, color .12s, transform .12s; }
.rt:hover { background: var(--red-soft); }
.rt:active { transform: scale(.94); }
.rt.on { background: var(--ink); color: #fff; animation: pop .3s ease-out; }
@keyframes pop { 40% { transform: scale(1.12); } }

/* ---------- between: a fraction, a word ---------- */
.btw { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px var(--gut) calc(18px + var(--sab)); }
.tag { margin: 0 0 6px; font: 800 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--grey); }
.frac .fit { line-height: .8; }
.bw { margin-top: 20px; }
.line { margin: 14px 0 0; font: 600 17px/1.35 var(--font); max-width: 34em; }
.words { margin-top: 18px; }
.words small, .sealed small { display: block; font: 800 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--grey); margin-bottom: 8px; }
.words div, .sealed .words { display: flex; flex-wrap: wrap; gap: 5px; }
.wd { font: 900 13px/1 var(--font); letter-spacing: .02em; padding: 7px 8px; border: 2px solid var(--ink); background: var(--ink); color: #fff; }
.wd.soft { background: var(--paper); color: var(--ink); }
.wd.blank { background: transparent; color: #a8a8a8; border: 2px dashed #c4c4c4; min-width: 34px; text-align: center; }
.go { padding-top: 30px; }
.peek { margin: 0 0 12px; font: 500 15px/1.35 var(--font); }

/* ---------- gate: DONE., the sealed number, two huge fields ---------- */
.gt { flex: 1; display: flex; flex-direction: column; padding: 8px var(--gut) calc(18px + var(--sab)); }
.sealed { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.sealed .words { flex: 1; }
.eq { font: 900 30px/1 var(--font); }
.seal { flex: none; width: 86px; height: 86px; background: var(--ink); color: #fff; display: grid; place-items: center; align-content: center; gap: 2px; animation: breathe 1.8s ease-in-out infinite; }
.seal b { font: 900 46px/.8 var(--font); color: var(--red); }
.seal small { font: 800 12px/1 var(--font); color: #fff; margin: 0; letter-spacing: 0; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.form { margin-top: 10px; display: grid; gap: 6px; }
.fld { display: grid; gap: 2px; }
.fld span { font: 800 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--grey); margin-top: 12px; }
.fld input { width: 100%; border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); padding: 6px 0 8px; font: 800 28px/1.1 var(--font); letter-spacing: -.02em; outline: none; transition: border-color .15s; }
.fld input::placeholder { color: #c2c2c2; }
.fld input:focus { border-bottom-color: var(--red); }
.fld.bad input { border-bottom-color: var(--red); }
.err { display: block; min-height: 18px; font: 700 13px/1.3 var(--font); font-style: normal; color: var(--red); }
.form .btn { margin-top: 10px; }

.pg-err { justify-content: center; padding: 24px var(--gut); }
.err-box { display: grid; gap: 16px; max-width: 560px; }

/* ---------- laptop ---------- */
@media (min-width: 900px) {
  :root { --gut: 40px; }
  .bar { height: 64px; }
  .kicker { margin: 3vh 0 14px; font-size: 40px; }
  .knock { max-height: 50vh; --hole: 0; }
  .knock-cap { display: none; }
  .land-foot { grid-template-columns: 1fr 420px; align-items: end; gap: 40px; }
  .facts { grid-auto-flow: column; justify-content: start; gap: 36px; }
  .facts li { font-size: 54px; }

  body[data-phase="intro"] .stage, body[data-phase="play"] .stage, body[data-phase="reveal"] .stage { inset: 104px 40px 56px 40px; }
  .intro { display: grid; grid-template-columns: minmax(380px, 500px) minmax(0, 1fr); gap: 48px; padding: 0 40px; height: calc(100vh - 64px); }
  .win { order: 2; height: auto; margin: 40px 0 56px; min-height: 0; }
  .intro-txt { order: 1; justify-content: center; padding-bottom: 56px; }
  .lvl { margin-top: 0; }
  .lvl .num { font-size: 180px; }
  .rate { margin-top: 32px; }

  .btw, .gt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 72px; align-content: center; padding: 0 0 48px; max-width: 1360px; margin: 0 auto; width: calc(100% - 80px); }
  .btw { grid-template-areas: "tag tag" "frac bw" "frac line" "frac words" "frac go"; }
  .btw > .tag { grid-area: tag; } .btw > .frac { grid-area: frac; align-self: center; }
  .btw > .bw { grid-area: bw; margin: 0; } .btw > .line { grid-area: line; } .btw > .words { grid-area: words; } .btw > .go { grid-area: go; margin-top: 28px; }
  .gt { grid-template-areas: "gw form" "sealed form" "line form"; align-items: start; }
  .gt > .gw { grid-area: gw; } .gt > .sealed { grid-area: sealed; } .gt > .line { grid-area: line; } .gt > .form { grid-area: form; align-self: center; }
  .fld input { font-size: 34px; }
}
