/* Final visual-QA refinements kept separate from the core design system. */
.grain { inset: 0; animation: none; }
.scene { contain: layout paint; }
.scene .image-layer { inset: 0; }

/* Global finish: stronger hierarchy, quieter chrome, and a more legible progress system. */
.scene h1,
.scene h2 { text-wrap: balance; overflow: visible; }

.chrome { height: 72px; padding-inline: 4.8vw; }
.chrome-actions { gap: 8px; }
.icon-btn,
.nav-controls button {
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(3, 12, 26, .62);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
  backdrop-filter: blur(12px);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.icon-btn:hover,
.nav-controls button:hover { border-color: var(--amber); background: rgba(3, 12, 26, .9); transform: translateY(-1px); }

.rail { background: rgba(255, 255, 255, .2); }
.rail-label {
  position: absolute;
  left: 0;
  top: -25px;
  color: rgba(255, 255, 255, .72);
  font: 800 9px/1 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .16em;
  white-space: nowrap;
}
.rail-dots button { box-shadow: 0 0 0 2px rgba(4, 15, 31, .32); }
.rail-dots button.visited { background: rgba(245, 170, 0, .72); }
.rail-dots button.active { box-shadow: 0 0 0 4px rgba(245, 170, 0, .2); }
.is-light-scene .rail-label { color: rgba(7, 27, 56, .68); }
.is-light-scene .rail { background: rgba(7, 27, 56, .2); }

.scene-cream,
.scene-engine,
.scene-franchise {
  background-image: radial-gradient(circle at 82% 12%, rgba(255, 255, 255, .96), rgba(255, 255, 255, 0) 34%);
}
.poster-frame img { box-shadow: 0 22px 55px rgba(7, 27, 56, .16); }
.poster-frame::before {
  content: "";
  position: absolute;
  inset: -10px 10px 10px -10px;
  border: 1px solid rgba(122, 31, 98, .24);
  pointer-events: none;
}
.act { box-shadow: 0 14px 32px rgba(7, 27, 56, .12); }
.act.active { outline: 2px solid rgba(245, 170, 0, .8); outline-offset: 5px; }
.launch-steps b { box-shadow: 0 0 0 6px rgba(243, 239, 229, .75); }
.scene .image-layer { transform: scale(1.02); filter: saturate(.92) contrast(1.025); }
.scene.is-active .image-layer { transform: scale(1); }
.ending-claim { border-top: 4px solid var(--amber); }
.orbit-core { box-shadow: 0 0 80px rgba(245, 170, 0, .1); }
.city-stage { border-top: 4px solid var(--amber); box-shadow: 0 20px 45px rgba(7, 27, 56, .14); }
.end-score { border-top: 5px solid var(--amber); box-shadow: 0 22px 60px rgba(0, 0, 0, .24); }
.dialog-close { border: 1px solid rgba(7, 27, 56, .25); width: 45px; height: 45px; line-height: 38px; }

@media (min-width: 801px) {
  .scene { overflow: clip; }
  .rail { right: 23vw; }
  .vote-copy h2 { font-size: clamp(46px, 5.6vw, 82px); }
  .vote-copy .light-text { margin-block: 2vh; }
  .votes { margin-top: 1.8vh; gap: 5px; }
  .votes button { padding-block: 10px; }
  .vote-result { margin-top: 7px; padding-block: 9px; font-size: 11px; }
}

@media (max-width: 800px) {
  html, body, #deck { max-width: 100vw; overflow-x: hidden; }
  .scene {
    overflow-x: hidden;
    padding: 78px 24px 138px;
    scrollbar-width: none;
  }
  .scene::-webkit-scrollbar { display: none; }
  .scene .image-layer { inset: 0; transform: none; }
  .grain { inset: 0; animation: none; }

  .chrome { height: 58px; padding-inline: 20px; }
  .icon-btn { width: 40px; height: 40px; }
  .wipe-title { margin-bottom: 30px; }
  .scene h2 { font-size: clamp(36px, 10.4vw, 42px); line-height: .98; letter-spacing: -.035em; }
  .rail { left: 24px; right: 96px; bottom: 36px; }
  .rail-label { top: -22px; font-size: 8px; }
  .nav-controls { right: 20px; bottom: 19px; }
  .nav-controls button { width: 44px; height: 44px; }

  .poster-frame { display: block; margin-top: 34px; }
  .poster-frame::before { inset: -7px 7px 7px -7px; }
  .poster-frame img { height: 190px; }
  .poster-frame p { right: -1%; bottom: -14px; width: 88%; padding: 13px 15px; font-size: 14px; }
  .promise { margin-top: 28px; }

  .scene-engine h2 { font-size: 38px; }
  .act-selector { gap: 11px; margin-top: 20px; }
  .act { min-height: 116px; padding: 16px 18px; gap: 7px; }
  .act strong { font-size: 28px; }
  .act em { font-size: 19px; }
  .act:hover,
  .act.active { transform: none; }
  .act.active { outline-offset: 2px; }

  .scene-launch h2 { font-size: 36px; }
  .launch-steps { gap: 11px; margin-top: 24px; }
  .launch-steps li { grid-template-columns: 50px 1fr; column-gap: 16px; row-gap: 4px; }
  .launch-steps b { width: 50px; height: 50px; }
  .launch-steps:before { left: 24px; }
  .launch-steps strong { font-size: 17px; }
  .launch-steps span { font-size: 13px; line-height: 1.32; }
  .bar-claim { margin-top: 18px; padding: 13px 14px; font-size: 11px; line-height: 1.25; }

  .race-copy h2,
  .truck-copy h2,
  .vote-copy h2,
  .pilot-copy h2,
  .end-copy h2 { font-size: 40px; line-height: .96; }
  .countdown { margin-top: 24px; gap: 12px; }
  .countdown strong { font-size: 18px; }
  .truck-copy dl { margin-top: 28px; gap: 14px; }
  .truck-copy dl div { padding-top: 10px; }

  .why-layout ol { margin-top: 24px; gap: 18px; }
  .why-layout li { grid-template-columns: 48px 1fr; gap: 16px; }
  .why-layout li > b { width: 48px; height: 48px; }
  .why-layout strong { font-size: 18px; }
  .why-layout em { font-size: 14px; line-height: 1.34; }
  .ending-claim { padding: 17px; font-size: 14px; }
  .ending-claim strong { font-size: 27px; }

  .ecosystem-orbit { gap: 16px; margin-top: 26px; }
  .orbit-core { width: 116px; height: 116px; }
  .orbit-core span { font-size: 19px; }
  .orbit strong { font-size: 18px; }
  .orbit p { margin-block: 7px 0; font-size: 13px; }

  .scene-thesis {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    display: block;
    margin: 28px 0 0;
    padding: 15px 0 4px;
    border-top: 1px solid rgba(255, 255, 255, .24);
    max-width: none;
    white-space: normal;
    text-align: left;
    line-height: 1.35;
  }
  .scene-hero .scene-thesis {
    position: absolute;
    left: 50%;
    bottom: 78px;
    transform: translateX(-50%);
    width: max-content;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: center;
  }

  .franchise-layout { gap: 20px; }
  .fixed-engine { padding-right: 0; }
  .fixed-engine ul { gap: 10px; }
  .city-stage { min-height: 250px; padding: 27px; }
  .city-stage > strong { font-size: 55px; margin-top: 18px; }
  .cities {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 18px;
    padding: 11px 8px;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 28px), transparent 100%);
  }
  .cities::-webkit-scrollbar { display: none; }
  .cities button { flex: 0 0 auto; padding-inline: 10px; }

  .scene-pilot .scene-thesis,
  .scene-race .scene-thesis,
  .scene-truck .scene-thesis,
  .scene-ecosystem .scene-thesis { margin-bottom: 12px; }

  .scene-ecosystem h2 { font-size: 36px; }
  .scene-ecosystem .ecosystem-orbit { gap: 10px; margin-top: 20px; }
  .scene-ecosystem .orbit-core { width: 100px; height: 100px; }
  .scene-ecosystem .orbit-core span { font-size: 17px; }
  .scene-ecosystem .orbit strong { font-size: 17px; }
  .scene-ecosystem .orbit p { margin-top: 4px; font-size: 12px; line-height: 1.28; }
  .scene-ecosystem .scene-thesis { margin-top: 14px; padding-top: 9px; font-size: 8px; }

  .scene-franchise h2 { font-size: 36px; }
  .scene-franchise .franchise-layout { gap: 12px; }
  .scene-franchise .fixed-engine ul { margin-top: 13px; gap: 6px; font-size: 16px; }
  .scene-franchise .city-stage { min-height: 205px; padding: 20px 26px; }
  .scene-franchise .city-stage p { margin: 0; font-size: 14px; line-height: 1.35; }
  .scene-franchise .city-stage > strong { margin-top: 12px; font-size: 48px; }
  .scene-franchise .city-stage > small { margin-top: 7px; font-size: 12px; }
  .scene-franchise .cities { margin-top: 12px; padding-block: 8px; }
}
