/* ODE · Christmas — night tokens.
   The --ink / --paper names are kept from the encore build, but they now
   carry NIGHT values: --ink is the light type, --paper the dark ground.
   Everything downstream keeps working; only the values flipped. */

:root {
  color-scheme: dark;
  --ink: #f4ede1;
  --ink-soft: #ded3c2;
  --ink-60: rgba(244, 237, 225, 0.62);
  --ink-40: rgba(244, 237, 225, 0.42);
  --ink-18: rgba(244, 237, 225, 0.18);
  --paper: #0c0a11;
  --paper-warm: #171019;
  --paper-hi: #07060d;
  --terracotta: #d4825a;
  --warm-amber: #f0c052;
  --sage: #4f9160;
  --signal: #e04a40;
  --ultramarine: #6f93e8;
  --gold: #e8b134;
  --pine: #2f6b3c;
  --font-display: "Newsreader", "Times New Roman", serif;
  --font-wordmark: "Archivo Black", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-kr: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  --font-kid: "Rock Salt", "Segoe Print", "Comic Sans MS", cursive;
  --easing: cubic-bezier(0.2, 0.8, 0.2, 1);
  /*
   * Vertical composition reserves — the building box is centered in the band
   * left between the fixed header (top) and the fixed score + footer (bottom).
   * Tuned per breakpoint below. Keeping the building sized to this band (rather
   * than a fixed pixel lift) is what prevents top-clipping on short/landscape
   * screens and the dead void on tall/wide screens.
   */
  --top-reserve: 84px;
  --bottom-reserve: 196px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  /* Belt-and-suspenders: never let decorative bleed create a wider layout
     viewport (which would push fixed chrome off-center on mobile). */
  overflow-x: clip;
}

body {
  min-height: 100svh;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /*
   * Every radial here fades on a LONG tail. A short ramp to `transparent NN%`
   * still has alpha on the table when the stop lands, and the eye reads that
   * terminus as a faint hard-edged disc — worst on wide, short viewports where
   * the ellipse is enormous. Same trap as the facade SVG gradients had.
   */
  background:
    /* Warm bloom where the lit facade stands */
    radial-gradient(ellipse 72vw 58vh at 50% 34%,
      rgba(240, 176, 72, 0.16) 0%,
      rgba(240, 176, 72, 0.07) 34%,
      rgba(240, 176, 72, 0.025) 58%,
      rgba(240, 176, 72, 0.006) 80%,
      transparent 100%),
    radial-gradient(ellipse 52vw 50vh at 82% 72%,
      rgba(216, 52, 43, 0.07) 0%,
      rgba(216, 52, 43, 0.03) 36%,
      rgba(216, 52, 43, 0.008) 66%,
      transparent 100%),
    radial-gradient(ellipse 58vw 64vh at 12% 24%,
      rgba(70, 96, 164, 0.14) 0%,
      rgba(70, 96, 164, 0.06) 36%,
      rgba(70, 96, 164, 0.016) 66%,
      transparent 100%),
    linear-gradient(170deg, #11131f 0%, var(--paper) 52%, #120b10 100%);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.06  0 0 0 0 0.05  0 0 0 0 0.04  0 0 0 0.38 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Falling snow — sits in the air above the building, under grain / chrome;
   never captures the pointer. Flakes tumble slowly as they drift down. */
.snow-field {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
}
.flake {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}
.flake svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: flake-spin var(--spin, 18s) linear infinite;
  animation-direction: var(--spin-dir, normal);
  animation-delay: var(--spin-delay, 0s);
  filter: drop-shadow(0 0 4px rgba(190, 220, 255, 0.45));
}
@keyframes flake-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .flake svg { animation: none; }
}

/* —— top bar —— */
.top-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(16px, 3vw, 36px) 14px;
  pointer-events: none;
}

.meta-left,
.meta-right {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
  white-space: nowrap;
}

.meta-left .kr,
.meta-right .kr {
  font-family: var(--font-kr);
  letter-spacing: 0.04em;
  text-transform: none;
}

.meta-right { text-align: right; }
.dot { opacity: 0.45; margin: 0 0.35em; }

.tagline {
  font-family: var(--font-kid);
  font-weight: 400;
  font-style: normal;
  /* Rock Salt runs ~45% wider than Indie Flower (~27em for this title), so it
     is sized down to hold on one line. */
  font-size: clamp(13px, 1.9vw, 23px);
  letter-spacing: 0;
  color: var(--ink-soft);
  text-align: center;
  white-space: nowrap;
}
.tagline .ode-mark {
  /* Warm gold reads where the poster blue goes muddy at night */
  color: var(--gold);
}

/* Title links out to the Seoul Encore page — keep the hand-drawn look.
   No underline ever: the affordance is the ink warming to the building's
   terracotta on hover ([ALIVE] keeps its poster blue). */
.tagline-link {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
  transition: color 180ms var(--easing);
}
.tagline-link:hover {
  color: var(--terracotta);
}
.tagline-link:focus-visible {
  /* Keyboard focus needs a visible indicator — dashed suits the sketch look */
  color: var(--terracotta);
  outline: 1.5px dashed var(--terracotta);
  outline-offset: 6px;
  border-radius: 2px;
}

/* —— stage —— */
.stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Center the building in the band between header and the fixed score/footer */
  justify-content: center;
  gap: 0;
  /* Reserve header (top) + score/footer (bottom); building fits between */
  padding: var(--top-reserve) 0 var(--bottom-reserve);
  isolation: isolate;
  /*
   * .sky bleeds 25% past each side for a soft atmospheric edge. Clip that
   * horizontal bleed here so it can't expand the mobile LAYOUT viewport —
   * otherwise position: fixed chrome (header, score) centers against the wider
   * layout width while the in-flow building centers against the visual width,
   * and the two drift out of alignment. clip on X keeps Y overflow visible
   * (building shadow/glow still spill vertically).
   */
  overflow-x: clip;
}

.stage .installation {
  margin-top: 0;
  /* Allow the box to shrink to fit the band on short screens (no overlap) */
  flex-shrink: 1;
  min-height: 0;
  /*
   * Desktop: the facade only fills ~51% of the 720/900 artboard, which left
   * the building small in the band. Same trick as mobile — a centered scale()
   * grows the building AND its curtain together (they stay registered) so the
   * facade spans from just under the header to just above the score, while the
   * empty artboard margins overflow and clip harmlessly. translateY (pre-scale)
   * re-centers the facade in the band; proportions untouched. Overridden by
   * the max-width: 720px and max-height: 560px blocks below.
   */
  transform: scale(1.82) translateY(43px);
}

.stage .installation .building-wrap {
  /* Desktop: building sit 10px lower than prior -50px lift; curtain stays put */
  transform: translateY(-40px);
}

/* Full-stage atmosphere — cold night sky with a warm pool around the facade */
.sky {
  position: absolute;
  inset: -12% -25% 18% -25%;
  pointer-events: none;
  background:
    /* Warm haze thrown by the lit bands. Radial, because it genuinely
       radiates from the building — but on a long tail so no rim can form. */
    radial-gradient(ellipse 120% 58% at 50% 36%,
      rgba(255, 206, 128, 0.28) 0%,
      rgba(246, 184, 92, 0.14) 26%,
      rgba(220, 150, 56, 0.055) 46%,
      rgba(200, 128, 40, 0.018) 68%,
      rgba(200, 128, 40, 0.004) 86%,
      transparent 100%),
    /* Crown-strip bloom hugging the roofline */
    radial-gradient(ellipse 70% 30% at 50% 15%,
      rgba(255, 232, 176, 0.2) 0%,
      rgba(255, 232, 176, 0.08) 32%,
      rgba(255, 232, 176, 0.022) 60%,
      rgba(255, 232, 176, 0.005) 82%,
      transparent 100%),
    /*
     * Night field. Deliberately LINEAR: a radial large enough to cover a wide
     * viewport always terminates somewhere on screen, and that terminus is
     * the faint "orb" edge. A vertical ramp has no boundary to see.
     */
    linear-gradient(180deg,
      rgba(34, 44, 78, 0.72) 0%,
      rgba(30, 38, 66, 0.6) 22%,
      rgba(26, 32, 56, 0.44) 42%,
      rgba(21, 25, 42, 0.26) 62%,
      rgba(18, 20, 34, 0.12) 80%,
      transparent 100%);
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 42%,
    rgba(0, 0, 0, 0.55) 62%,
    transparent 88%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 42%,
    rgba(0, 0, 0, 0.55) 62%,
    transparent 88%
  );
}

/* Foreground plaza — dark wet pavement holding the storefront's warm spill */
.ground {
  position: absolute;
  inset: 46% 0 -20% 0;
  /* Match building + ornament floor nudge */
  transform: translateY(10px);
  pointer-events: none;
  background:
    /* Warm reflection directly under the lit facade — long tail, no rim */
    radial-gradient(ellipse 66% 54% at 50% 16%,
      rgba(255, 186, 94, 0.2) 0%,
      rgba(238, 162, 72, 0.09) 32%,
      rgba(220, 140, 54, 0.032) 54%,
      rgba(200, 122, 44, 0.008) 78%,
      transparent 100%),
    /* Horizontal band of night pavement */
    linear-gradient(180deg,
      transparent 0%,
      rgba(28, 26, 32, 0.22) 8%,
      rgba(22, 20, 26, 0.4) 24%,
      rgba(18, 16, 22, 0.46) 42%,
      rgba(20, 18, 24, 0.3) 60%,
      rgba(24, 20, 26, 0.12) 78%,
      transparent 94%);
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 14%,
    #000 58%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 14%,
    #000 58%,
    transparent 100%
  );
}

.installation {
  position: relative;
  z-index: 4;
  /*
   * Uniform 720/900 box (building proportions untouched — object-fit: contain).
   * Size is driven by the SHORTER of: the available vertical band (height 100%
   * of the stage content box), the width cap expressed as a height, and an
   * absolute cap. min() keeps the building whole on every viewport while the
   * aspect-ratio guarantees the scale stays uniform.
   */
  height: min(100%, calc(88vw * 900 / 720), 792px);
  width: auto;
  aspect-ratio: 720 / 900;
  max-width: 92vw;
  margin-inline: auto;
  flex-shrink: 1;
  min-height: 0;
  overflow: visible;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.building-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: visible;
}

.building-svg,
.building {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  /* Critical: default SVG overflow is hidden and hard-clips soft shadow */
  overflow: visible;
  pointer-events: none;
  user-select: none;
  display: block;
  margin: 0 auto;
}

/* Code-drawn facade — crown light pulse (evening ref) */
@media (prefers-reduced-motion: no-preference) {
  .building-svg .crown-core {
    animation: crown-breathe 4.5s ease-in-out infinite;
  }
}

/* Interactive room lights — panel by panel, gentle on / off */
.building-svg .panel-glow,
.building-svg .panel-led {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.75s cubic-bezier(0.22, 0.8, 0.25, 1);
}

.building-svg .room-panel.is-lit .panel-glow {
  opacity: 0.62;
}

.building-svg .room-panel.is-lit .panel-led {
  opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
  .building-svg .panel-glow,
  .building-svg .panel-led {
    transition-duration: 0.12s;
  }
}

@keyframes crown-breathe {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

#curtain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  /* Canvas still has its own pixel bounds, but no CSS box paint */
  background: transparent;
  overflow: visible;
}

/* —— piano window → ALIVE ——
   A real link laid over the right-hand ground-floor pane (sized by main.js).
   It sits above the curtain canvas so it takes the click; the window warms
   up on hover / focus, and breathes very faintly otherwise. */
.alive-door {
  position: absolute;
  z-index: 3;
  display: block;
  cursor: pointer;
  border-radius: 1px;
  -webkit-tap-highlight-color: transparent;
}
.alive-door[hidden] { display: none; }
.alive-door:focus-visible {
  outline: 1.5px dashed var(--terracotta);
  outline-offset: 3px;
}
/* Same lift as the building it sits on */
.stage .installation .alive-door { transform: translateY(-40px); }

.building-svg .alive-glow {
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--easing);
}
@media (prefers-reduced-motion: no-preference) {
  .building-svg .alive-glow { animation: alive-breathe 5.5s ease-in-out infinite; }
}
.installation:has(.alive-door:hover) .alive-glow,
.installation:has(.alive-door:focus-visible) .alive-glow {
  animation: none;
  opacity: 0.55;
}
@keyframes alive-breathe {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.2; }
}

/* Full-stage bloom layer — can drift into sky / ground beyond the building card */
#fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 6;
  pointer-events: none;
}

.hint {
  /* Fixed above score — must clear full score block (~6rem) + gap */
  position: fixed;
  left: 50%;
  bottom: calc(12.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 18;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  pointer-events: none;
  transition: opacity 480ms var(--easing);
}

.hint.is-hidden { opacity: 0; }

.hint-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 4px rgba(196, 113, 74, 0.18);
  animation: pulse 1.8s var(--easing) infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.7; }
}

/* —— live score —— */
.score {
  position: fixed;
  left: 50%;
  /* Clear multi-line mobile footer + home indicator */
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(88vw, 560px);
  z-index: 18;
  pointer-events: none;
  text-align: center;
  flex-shrink: 0;
}

.score-label {
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-40);
}

/* Note-voice picker — segmented control below the staff */
.voice-picker {
  pointer-events: auto;
  display: inline-flex;
  gap: 2px;
  margin-top: 10px;
  padding: 2px;
  border: 1px solid var(--ink-18);
  border-radius: 999px;
  background: rgba(22, 18, 28, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.voice-opt {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
  padding: 4px 10px;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s var(--easing), color 0.2s var(--easing);
}
.voice-opt:hover { color: var(--ink-60); }
.voice-opt[aria-checked="true"] { background: #c4231c; color: #fff; }
.voice-opt[aria-checked="true"]:hover { color: #fff; }

/* Gentle-breeze toggle — a switch fixed to the top-right, under the header */
.breeze-toggle {
  position: fixed;
  top: 3.6rem;
  right: clamp(16px, 3vw, 36px);
  z-index: 25;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 6px 8px;
  border: 0;
  background: transparent;
  color: var(--ink-40);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s var(--easing);
}
.breeze-toggle:hover { color: var(--ink-60); }
.breeze-toggle:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
/* Paper pinwheel — still outline when off; colored + spinning while on */
.breeze-toggle svg {
  width: 25px;
  height: 25px;
  display: block;
  overflow: visible;
}
.pin-stick {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke 0.25s var(--easing);
}
.pin-head {
  transform-box: view-box;
  transform-origin: 32px 30px;
}
.pin-blade {
  fill: rgba(245, 240, 228, 0);
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linejoin: round;
  transition: fill 0.25s var(--easing), stroke 0.25s var(--easing);
}
.pin-dot { fill: currentColor; transition: fill 0.25s var(--easing); }
.breeze-toggle:hover .pin-blade { fill: rgba(232, 177, 52, 0.22); }
.breeze-toggle.is-on { color: var(--gold); }
.breeze-toggle.is-on .pin-blade { stroke: rgba(232, 177, 52, 0.6); }
.breeze-toggle.is-on .pin-b1 { fill: #e04a40; }
.breeze-toggle.is-on .pin-b2 { fill: #f0c96a; }
.breeze-toggle.is-on .pin-b3 { fill: #4f9160; }
.breeze-toggle.is-on .pin-b4 { fill: #f3f7fb; }
.breeze-toggle.is-on .pin-dot { fill: var(--gold); }
.breeze-toggle.is-on .pin-head { animation: pin-spin 5.5s linear infinite; }
@keyframes pin-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .breeze-toggle.is-on .pin-head { animation: none; }
}

#staff {
  width: 100%;
  height: auto;
  max-height: 72px;
  opacity: 0.95;
}

/* —— footer —— */
.bottom-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  padding: 10px clamp(16px, 3vw, 36px) 16px;
  pointer-events: none;
  border-top: 1px solid var(--ink-18);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px);
}

.credit {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ink-40);
  max-width: 36ch;
}

.credit .kr {
  font-family: var(--font-kr);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.venue {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
  text-align: right;
  justify-self: end;
  white-space: nowrap;
}

.venue .kr {
  font-family: var(--font-kr);
  letter-spacing: 0.04em;
  text-transform: none;
}

.venue .dot {
  opacity: 0.45;
  margin: 0 0.35em;
}

.dates {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* —— responsive —— */
@media (max-width: 720px) {
  body { overflow: hidden; }

  :root {
    /* Mobile chrome is taller: stacked header + multi-line footer + score.
       Bottom reserve trimmed (~25%) so the flower ground is smaller and the
       enlarged building can sit slightly lower. */
    --top-reserve: calc(4.4rem + env(safe-area-inset-top, 0px));
    --bottom-reserve: calc(10.5rem + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: max(6px, env(safe-area-inset-top, 0px)) 10px 4px;
  }
  .meta-left, .meta-right { font-size: 8px; }
  .meta-right { text-align: center; }
  .tagline {
    /* Keep the full title on ONE line; size scales with viewport width so it
       fits from ~320px up (Rock Salt renders this title ~27em wide, so the
       vw factor is capped to (vw−20px)/27 ≈ 3.3vw). */
    font-size: clamp(10px, 3.3vw, 15px);
    white-space: nowrap;
    line-height: 1.25;
    max-width: none;
  }

  /* Stacked header is taller — drop the controls into the sky below it */
  .breeze-toggle {
    top: calc(4.35rem + env(safe-area-inset-top, 0px));
    right: 12px;
    padding: 5px 3px 5px 6px;
  }
  .breeze-toggle svg { width: 21px; height: 21px; }

  .stage {
    height: 100dvh;
    min-height: 100dvh;
    /* Centered in the band; reserves above clear the mobile chrome */
    padding: var(--top-reserve) 0 var(--bottom-reserve);
    justify-content: center;
    gap: 0;
  }

  .stage .installation {
    /*
     * Enlarge the building so its top reaches up near the header and its base
     * sits a little lower, shrinking the empty flower ground. A centered
     * scale() (not a width change) grows the building AND its curtain together
     * — they stay registered — while the empty artboard margins overflow and
     * clip harmlessly; transforming from the center avoids the left-anchor that
     * a wider-than-viewport layout box would cause. Ratio is untouched.
     * translateY lifts the top the last bit to the header line.
     * Scale is stepped down on shorter phones (below) so it never overlaps.
     */
    height: min(100%, calc(94vw * 900 / 720));
    width: auto;
    max-width: 96vw;
    aspect-ratio: 720 / 900;
    margin-inline: auto;
    transform: scale(1.55) translateY(-34px);
  }

  .stage .installation .building-wrap {
    transform: translateY(10px);
  }
  .stage .installation .alive-door {
    transform: translateY(10px);
  }

  /* Step the enlargement down as viewport height shrinks (largest max-height
     first so the smallest matching rule wins by source order). */
  @media (max-height: 799px) {
    .stage .installation { transform: scale(1.4) translateY(-18px); }
  }
  @media (max-height: 679px) {
    .stage .installation { transform: scale(1.3) translateY(-6px); }
  }
  @media (max-height: 599px) {
    .stage .installation { transform: scale(1.18); }
  }

  /* score clears tall multi-line footer; hint clears score */
  .hint {
    bottom: calc(13.5rem + env(safe-area-inset-bottom, 0px));
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .score {
    bottom: calc(6.85rem + env(safe-area-inset-bottom, 0px));
    width: min(92vw, 400px);
  }

  .score-label {
    font-size: 9px;
    margin-bottom: 4px;
  }

  #staff {
    height: 58px;
    max-height: 58px;
  }

  /* Short copy now fits on one line — mirror the desktop 3-column footer */
  .bottom-bar {
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    gap: 8px;
    padding: 8px clamp(12px, 4vw, 22px) calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .credit {
    max-width: none;
    font-size: 9px;
  }
  .credit .kr { font-size: 9px; }
  .venue { font-size: 9px; }
  .dates { font-size: 9px; }
}

/*
 * —— short / landscape ——
 * Little vertical room: the building must shrink to the band and the score
 * must stay compact so the two never collide (the old fixed-lift layout let
 * the building clip the top and overrun the staff here).
 */
@media (max-height: 560px) {
  :root {
    --top-reserve: calc(2.6rem + env(safe-area-inset-top, 0px));
    --bottom-reserve: calc(3.4rem + env(safe-area-inset-bottom, 0px));
  }

  .stage {
    height: 100dvh;
    min-height: 100dvh;
    padding: var(--top-reserve) 0 var(--bottom-reserve);
    justify-content: center;
  }

  .stage .installation {
    transform: none;
    height: min(100%, calc(64vw * 900 / 720));
    width: auto;
    max-width: 82vw;
    aspect-ratio: 720 / 900;
  }

  /* Keep the wrap/curtain registration but drop the desktop 10px nudge */
  .stage .installation .building-wrap { transform: none; }

  /* Hide the live score in landscape — no room, and it fought the building */
  .score { display: none; }
  .hint { display: none; }

  .bottom-bar {
    padding: 4px clamp(10px, 3vw, 28px) calc(4px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hint-dot { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ============================================================
   TIME OF DAY
   An inline script in <head> stamps data-time="day|dusk|night"
   on <html> from the visitor's own clock, before first paint:
     night 18:00–06:00 · dusk 06:00–08:00 and 16:00–18:00 · day 08:00–16:00
   Night is the default, so the page is correct with no JS at all.
   The facade SVG is inline in the DOM, so its fills and gradient
   stops are styled from here like any other element.
   Every gradient below fades on a long tail — a radial that still
   carries alpha where its last stop lands shows that terminus as
   a disc edge.
   ============================================================ */

/* —— DAY —————————————————————————————————————————————— */
:root[data-time="day"] {
  color-scheme: light;
  --ink: #0f0d0b;
  --ink-soft: #2a241c;
  --ink-60: rgba(15, 13, 11, 0.62);
  --ink-40: rgba(15, 13, 11, 0.4);
  --ink-18: rgba(15, 13, 11, 0.18);
  --paper: #f5f0e4;
  --paper-warm: #ebe3d1;
  --paper-hi: #fbf7ee;
  --terracotta: #c4714a;
  --warm-amber: #e2a820;
  --sage: #7a9464;
  --signal: #d8291d;
  --gold: #bb8410; /* darker: gold must hold its own on paper */
  --pine: #2f6b3c;
}

:root[data-time="day"] body {
  background:
    radial-gradient(ellipse 72vw 58vh at 50% 34%,
      rgba(226, 168, 32, 0.09) 0%,
      rgba(226, 168, 32, 0.04) 36%,
      rgba(226, 168, 32, 0.012) 64%,
      transparent 100%),
    radial-gradient(ellipse 58vw 64vh at 12% 70%,
      rgba(196, 113, 74, 0.07) 0%,
      rgba(196, 113, 74, 0.03) 38%,
      transparent 100%),
    linear-gradient(160deg, var(--paper-hi) 0%, var(--paper) 48%, var(--paper-warm) 100%);
}

:root[data-time="day"] .sky {
  background:
    radial-gradient(ellipse 120% 58% at 50% 36%,
      rgba(255, 246, 224, 0.26) 0%,
      rgba(255, 238, 200, 0.12) 28%,
      rgba(250, 226, 178, 0.04) 52%,
      transparent 100%),
    linear-gradient(180deg,
      rgba(198, 216, 234, 0.6) 0%,
      rgba(210, 224, 238, 0.44) 24%,
      rgba(224, 230, 232, 0.26) 46%,
      rgba(236, 232, 222, 0.1) 72%,
      transparent 100%);
}

:root[data-time="day"] .ground {
  background:
    radial-gradient(ellipse 66% 54% at 50% 16%,
      rgba(170, 165, 155, 0.12) 0%,
      rgba(170, 165, 155, 0.05) 38%,
      transparent 100%),
    linear-gradient(180deg,
      transparent 0%,
      rgba(165, 160, 150, 0.07) 8%,
      rgba(155, 150, 140, 0.14) 22%,
      rgba(148, 144, 134, 0.18) 40%,
      rgba(160, 154, 142, 0.12) 58%,
      rgba(180, 172, 158, 0.05) 75%,
      transparent 92%);
}

:root[data-time="day"] .grain { mix-blend-mode: multiply; opacity: 0.42; }
:root[data-time="day"] .flake svg {
  /* White-on-pale needs an edge, not a glow */
  filter: drop-shadow(0 1px 2px rgba(70, 95, 130, 0.55));
}

:root[data-time="day"] .building-svg .tile-a { fill: #b45333; }
:root[data-time="day"] .building-svg .tile-b { fill: #b45333; }
:root[data-time="day"] .building-svg .tile-mortar { fill: #9a442c; }
:root[data-time="day"] .building-svg .tile-line { fill: rgba(70, 28, 16, 0.16); }
:root[data-time="day"] .building-svg .tile-line2 { fill: rgba(70, 28, 16, 0.1); }
:root[data-time="day"] .building-svg .glass-1 { stop-color: #9ec0d4; stop-opacity: 0.65; }
:root[data-time="day"] .building-svg .glass-2 { stop-color: #5a7e96; stop-opacity: 0.75; }
:root[data-time="day"] .building-svg .glass-3 { stop-color: #243848; stop-opacity: 0.88; }
:root[data-time="day"] .building-svg .glass-4 { stop-color: #141c24; stop-opacity: 0.92; }
:root[data-time="day"] .building-svg .room-1 { stop-color: #2a323a; }
:root[data-time="day"] .building-svg .room-2 { stop-color: #12181e; }
:root[data-time="day"] .building-svg .crown-strip { fill: #e8d4a0; }
:root[data-time="day"] .building-svg .crown-glow { opacity: 0.22; }
:root[data-time="day"] .building-svg .bloom-1 { stop-opacity: 0.1; }
:root[data-time="day"] .building-svg .bloom-2 { stop-opacity: 0.045; }
/* Daylight swallows the bleed — the strings read as strings, not a glow */
:root[data-time="day"] .building-svg .bleed-1 { stop-opacity: 0.05; }
:root[data-time="day"] .building-svg .bleed-2 { stop-opacity: 0.03; }
:root[data-time="day"] .building-svg .bleed-3 { stop-opacity: 0.015; }
:root[data-time="day"] .building-svg .cove { opacity: 0.22; }
:root[data-time="day"] .building-svg .spill-1 { stop-opacity: 0.07; }
:root[data-time="day"] .building-svg .walk-edge { stop-color: #9a968f; stop-opacity: 0.5; }
:root[data-time="day"] .building-svg .recess-in { fill: rgba(40, 18, 10, 0.14); }
:root[data-time="day"] .building-svg .rail-face { fill: rgba(190, 205, 218, 0.22); }
:root[data-time="day"] .building-svg .base-shadow { fill: rgba(15, 13, 11, 0.1); }
:root[data-time="day"] .building-svg feDropShadow { flood-color: #0f0d0b; flood-opacity: 0.12; }

/* —— DUSK ————————————————————————————————————————————— */
:root[data-time="dusk"] {
  color-scheme: dark;
  --ink: #f2ecdf;
  --ink-soft: #d8ceba;
  --ink-60: rgba(242, 236, 223, 0.62);
  --ink-40: rgba(242, 236, 223, 0.42);
  --ink-18: rgba(242, 236, 223, 0.18);
  --paper: #1d1b2c;
  --paper-warm: #28202c;
  --paper-hi: #161624;
  --gold: #e8b134;
}

:root[data-time="dusk"] body {
  background:
    radial-gradient(ellipse 72vw 58vh at 50% 34%,
      rgba(244, 170, 84, 0.15) 0%,
      rgba(244, 170, 84, 0.07) 34%,
      rgba(244, 170, 84, 0.02) 62%,
      transparent 100%),
    radial-gradient(ellipse 58vw 64vh at 14% 22%,
      rgba(96, 120, 196, 0.17) 0%,
      rgba(96, 120, 196, 0.07) 38%,
      transparent 100%),
    linear-gradient(170deg, #242744 0%, var(--paper) 54%, #22121c 100%);
}

:root[data-time="dusk"] .sky {
  background:
    radial-gradient(ellipse 120% 58% at 50% 36%,
      rgba(255, 196, 120, 0.24) 0%,
      rgba(246, 168, 86, 0.11) 28%,
      rgba(214, 132, 56, 0.035) 52%,
      transparent 100%),
    linear-gradient(180deg,
      rgba(62, 78, 134, 0.66) 0%,
      rgba(74, 76, 118, 0.5) 24%,
      rgba(86, 72, 94, 0.32) 46%,
      rgba(70, 54, 66, 0.15) 72%,
      transparent 100%);
}

:root[data-time="dusk"] .ground {
  background:
    radial-gradient(ellipse 66% 54% at 50% 16%,
      rgba(255, 186, 94, 0.15) 0%,
      rgba(230, 150, 64, 0.06) 36%,
      transparent 100%),
    linear-gradient(180deg,
      transparent 0%,
      rgba(44, 40, 52, 0.2) 10%,
      rgba(38, 34, 44, 0.34) 26%,
      rgba(32, 28, 38, 0.38) 44%,
      rgba(36, 30, 40, 0.22) 62%,
      transparent 94%);
}

:root[data-time="dusk"] .building-svg .tile-a { fill: #4e2415; }
:root[data-time="dusk"] .building-svg .tile-b { fill: #582a16; }
:root[data-time="dusk"] .building-svg .tile-mortar { fill: #371a0f; }
:root[data-time="dusk"] .building-svg .tile-line { fill: rgba(28, 12, 6, 0.3); }
:root[data-time="dusk"] .building-svg .tile-line2 { fill: rgba(28, 12, 6, 0.18); }
:root[data-time="dusk"] .building-svg .glass-1 { stop-color: #3d5068; stop-opacity: 0.78; }
:root[data-time="dusk"] .building-svg .glass-2 { stop-color: #283a4e; stop-opacity: 0.86; }
:root[data-time="dusk"] .building-svg .glass-3 { stop-color: #17232f; stop-opacity: 0.92; }
:root[data-time="dusk"] .building-svg .glass-4 { stop-color: #0d141c; stop-opacity: 0.94; }
:root[data-time="dusk"] .building-svg .room-1 { stop-color: #1d2630; }
:root[data-time="dusk"] .building-svg .room-2 { stop-color: #0c1218; }
:root[data-time="dusk"] .building-svg .crown-glow { opacity: 0.55; }
:root[data-time="dusk"] .building-svg .bloom-1 { stop-opacity: 0.22; }
:root[data-time="dusk"] .building-svg .bleed-1 { stop-opacity: 0.15; }
:root[data-time="dusk"] .building-svg .bleed-2 { stop-opacity: 0.095; }
:root[data-time="dusk"] .building-svg .bleed-3 { stop-opacity: 0.05; }
:root[data-time="dusk"] .building-svg .cove { opacity: 0.58; }
:root[data-time="dusk"] .building-svg .spill-1 { stop-opacity: 0.2; }
:root[data-time="dusk"] .building-svg .walk-edge { stop-color: #6a5a4a; stop-opacity: 0.5; }
:root[data-time="dusk"] .building-svg .recess-in { fill: rgba(40, 18, 10, 0.18); }
:root[data-time="dusk"] .building-svg .base-shadow { fill: rgba(0, 0, 0, 0.22); }
:root[data-time="dusk"] .building-svg feDropShadow { flood-opacity: 0.3; }

/* Segmented control needs a light pill on the day palette */
:root[data-time="day"] .voice-picker { background: rgba(245, 240, 228, 0.5); }

/* Footer countdown to the next comeback — sits beside the season label */
.comeback {
  color: var(--gold);
  letter-spacing: 0.1em;
}
/* Two items in a fixed-width footer: let them stack rather than overflow */
.dates {
  flex-wrap: wrap;
  justify-content: center;
}
