/* lightsout.css: LIGHTS OUT, a night race under floodlights.

   The page's one idea is the start: five red lights come on one by one over
   the key art, hold, and go out, and only then does the name set itself and
   the Play button arrive (html.lo-seq, lightsout.js). The same gantry closes
   the page, lit by the scroll. Dark bands (.lo-band.on-night) carry the art
   and the captures in both themes; the reading sections follow the theme.
   Display type is the family's most condensed cut, set in capitals like a
   timing board; Chinese keeps its own width and case. */

body[data-pp="lights"] {
  --lo-red: #ff3a2e;
  --lo-glow: #ff8a80;
  --lo-dark: #3a0806;
  --lo-black: #000006;
  --lo-ink: #f3f1ed;
  --accent: #ff4a3d; --accent-rgb: 255, 74, 61; --on-accent: #000006;
}
[data-theme="light"] body[data-pp="lights"] { --accent: #c4221a; --accent-rgb: 196, 34, 26; --on-accent: #ffffff; }
body[data-pp="lights"] .on-night { --accent: #ff4a3d; --accent-rgb: 255, 74, 61; --on-accent: #000006; }

/* condensed capitals for headings, like a timing board */
body[data-pp="lights"] .display { font-stretch: 72%; font-weight: 800; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.92; }
body[data-pp="lights"] .display em { padding-right: 0.06em; }
html[lang="zh-CN"] body[data-pp="lights"] .display { font-stretch: 100%; text-transform: none; letter-spacing: 0; line-height: 1.15; }

/* ── the start ─────────────────────────────────────────────────────── */
.lo-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh; display: grid; align-items: end;
  background: var(--lo-black); color: var(--lo-ink);
}
.lo-art { position: absolute; inset: 0; z-index: -3; }
.lo-art img { width: 100%; height: 100%; object-fit: cover; object-position: 66% 50%; transform-origin: 72% 38%; will-change: transform; }
.lo-rain { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.lo-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 6, 0.7) 0%, rgba(0, 0, 6, 0) 22%),
    linear-gradient(90deg, rgba(0, 0, 6, 0.92) 0%, rgba(0, 0, 6, 0.62) 34%, rgba(0, 0, 6, 0.08) 68%),
    linear-gradient(0deg, var(--lo-black) 0%, rgba(0, 0, 6, 0.55) 26%, rgba(0, 0, 6, 0) 52%);
}
/* the red the lights throw on the wet asphalt, one step per light */
.lo-shade::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 22% 42%, rgba(255, 58, 46, 0.5), rgba(255, 58, 46, 0) 70%);
  opacity: calc(var(--lit, 0) * 0.1);
  transition: opacity 0.25s linear;
}
.lo-hero.is-go .lo-shade::after { transition: opacity 0.9s var(--ease); }

.lo-hero-inner { padding-top: calc(var(--nav-h) + clamp(28px, 6vh, 88px)); padding-bottom: clamp(24px, 4vw, 48px); display: grid; justify-items: start; }
.lo-chapter { font: 500 var(--step--1)/1.4 var(--f-sans); font-stretch: var(--wd-label); color: rgba(243, 241, 237, 0.72); margin-bottom: clamp(20px, 3vw, 36px); }

/* the gantry: five columns, two lamps each */
.lo-gantry { display: flex; gap: clamp(6px, 0.9vw, 12px); margin-bottom: clamp(18px, 2.6vw, 32px); }
.lo-pod {
  display: grid; gap: clamp(5px, 0.6vw, 8px); padding: clamp(5px, 0.6vw, 8px);
  background: #07070c; border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.lo-pod i {
  display: block; width: clamp(16px, 2.1vw, 30px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #2a0c0a, #120403 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: background 0.08s linear, box-shadow 0.08s linear;
}
.lo-pod.is-on i {
  background: radial-gradient(circle at 36% 32%, #ffd9d4 0%, var(--lo-glow) 18%, var(--lo-red) 48%, #b8170e 100%);
  box-shadow: 0 0 0 1px rgba(255, 138, 128, 0.5), 0 0 14px 2px rgba(255, 58, 46, 0.75), 0 0 46px 6px rgba(255, 58, 46, 0.32);
}
.lo-gantry.is-out .lo-pod i { transition: background 0.05s linear, box-shadow 0.05s linear; }

.lo-title {
  margin: 0; font: 800 clamp(84px, min(16vw, 25vh), 288px)/0.8 var(--f-disp); font-stretch: 62%;
  text-transform: uppercase; letter-spacing: -0.012em; color: var(--lo-ink);
  display: flex; flex-wrap: wrap; column-gap: 0.14em;
}
.lo-w { display: inline-block; overflow: hidden; padding: 0.04em 0.02em 0.02em; margin: -0.04em -0.02em -0.02em; }
.lo-w + .lo-w { color: transparent; -webkit-text-stroke: clamp(1.5px, 0.22vw, 3px) var(--lo-ink); }
.lo-c { display: inline-block; transition: transform 1.15s var(--ease) calc(var(--i, 0) * 32ms), opacity 0.5s linear calc(var(--i, 0) * 32ms); }
html[lang="zh-CN"] .lo-title { letter-spacing: 0; }

.lo-sub { margin: clamp(14px, 2vw, 26px) 0 0; max-width: 26ch; font: 500 var(--step-2)/1.25 var(--f-sans); color: rgba(243, 241, 237, 0.92); text-wrap: balance; }
.lo-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: clamp(22px, 3vw, 36px); }
.lo-play { min-height: 56px; padding: 0 30px; font-size: 16px; font-weight: 700; }
.lo-hero .lo-play, .on-night .lo-play { background: var(--lo-red); border-color: var(--lo-red); color: var(--lo-black); }
@media (hover: hover) and (pointer: fine) {
  .lo-hero .lo-play:hover, .on-night .lo-play:hover { background: #ff5b50; border-color: #ff5b50; }
  .lo-play:hover svg { transform: translate(2px, -2px); }
}
.lo-more { color: var(--lo-ink); min-height: 44px; }
.lo-note { margin: 14px 0 0; font: 400 var(--step--1)/1.5 var(--f-sans); color: rgba(243, 241, 237, 0.68); }

/* the readouts as a timing strip */
.lo-tower { width: 100%; margin-top: clamp(28px, 4.5vh, 64px); border-top: 1px solid rgba(255, 255, 255, 0.2); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lo-tower > div + div { border-left-color: rgba(255, 255, 255, 0.12); }
.lo-tower .hstat-num { color: var(--lo-ink); font-stretch: 70%; font-weight: 800; font-variant-numeric: tabular-nums; }
.lo-tower .hstat-lbl { color: rgba(243, 241, 237, 0.66); }
@media (max-width: 760px) {
  .lo-tower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lo-tower > div { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .lo-tower > div:first-child { border-top: 0; }
  .lo-tower > div:nth-child(2) { border-top: 0; }
  .lo-tower > div:last-child { grid-column: 1 / -1; }
}

.lo-skip {
  position: absolute; right: var(--mx); bottom: clamp(16px, 3vw, 32px); z-index: 2;
  min-height: 44px; padding: 0 16px; font: 500 var(--step--1)/1 var(--f-sans);
  color: rgba(243, 241, 237, 0.8); background: rgba(0, 0, 6, 0.4); border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s 0.3s;
}
html.lo-seq .lo-skip { opacity: 1; visibility: visible; transition: opacity 0.3s; }

/* the held state before the start: everything but the gantry waits */
.lo-sub, .lo-cta, .lo-note, .lo-tower { transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); }
.lo-sub { transition-delay: 0.32s; } .lo-cta { transition-delay: 0.44s; } .lo-note { transition-delay: 0.52s; } .lo-tower { transition-delay: 0.6s; }
html.lo-seq .lo-c { transform: translateY(108%); opacity: 0; transition: none; }
html.lo-seq .lo-sub, html.lo-seq .lo-cta, html.lo-seq .lo-note, html.lo-seq .lo-tower { opacity: 0; transform: translateY(22px); transition: none; }
.lo-hero.is-go .lo-art img { animation: lo-go 2.2s var(--ease) both; }
@keyframes lo-go { from { transform: scale(1.07); filter: brightness(0.7); } to { transform: scale(1); filter: brightness(1); } }

/* ── dark bands ────────────────────────────────────────────────────── */
.lo-band { background: var(--lo-black); color: var(--text); }
.lo-band .eyebrow { color: var(--text-2); }
.lo-head { margin-bottom: clamp(32px, 5vw, 72px); }
.lo-head .display { margin-top: 14px; font-size: var(--step-5); }
.lo-head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 48px; }
.lo-screens-note { max-width: 34ch; color: var(--text-2); font: 400 var(--step-0)/1.5 var(--f-sans); margin: 0; }
.lo-modes { padding-bottom: clamp(48px, 6vw, 96px); }
.lo-screens { padding-top: clamp(48px, 6vw, 96px); }

/* modes: a mosaic of the key art */
.lo-grid { display: grid; gap: clamp(8px, 0.9vw, 14px); grid-template-columns: minmax(0, 1fr); }
.lo-tile { position: relative; margin: 0; overflow: hidden; aspect-ratio: 16 / 9; background: #0c0c12; }
.lo-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lo-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 6, 0.82) 0%, rgba(0, 0, 6, 0) 46%); pointer-events: none; }
.lo-tile figcaption { position: absolute; left: clamp(14px, 1.6vw, 24px); right: 14px; bottom: clamp(12px, 1.4vw, 20px); z-index: 1; display: grid; gap: 4px; color: var(--lo-ink); }
.lo-tile figcaption span { font: 800 var(--step-3)/0.9 var(--f-disp); font-stretch: 66%; text-transform: uppercase; letter-spacing: -0.005em; }
.lo-tile figcaption small { font: 500 var(--step--1)/1.3 var(--f-sans); font-stretch: var(--wd-label); color: rgba(243, 241, 237, 0.74); }
html[lang="zh-CN"] .lo-tile figcaption span { font-stretch: 100%; text-transform: none; }
.lo-also { margin: 8px 0 0; color: var(--text-2); font: 400 var(--step-0)/1.5 var(--f-sans); max-width: 30ch; }
@media (min-width: 900px) {
  .lo-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 14.5vw, 250px); }
  .lo-tile { aspect-ratio: auto; }
  .t-champ { grid-column: 1 / 8; grid-row: span 2; }
  .t-champ figcaption span { font-size: var(--step-5); }
  .t-driver { grid-column: 8 / 13; }
  .t-team { grid-column: 8 / 13; }
  .t-story { grid-column: 1 / 5; }
  .t-chal { grid-column: 5 / 9; }
  .t-scen { grid-column: 9 / 13; }
  .t-coop { grid-column: 1 / 9; }
  .lo-also { grid-column: 9 / 13; align-self: end; margin: 0; padding-left: clamp(4px, 1vw, 16px); }
}

/* captures: a reel of browser frames */
.lo-reel { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 12px; }
.lo-reel:focus-visible { outline-offset: -4px; }
.lo-track { display: flex; gap: clamp(16px, 2vw, 32px); padding-inline: var(--mx); width: max-content; align-items: start; }
.lo-shot { --fh: clamp(220px, 50vh, 560px); flex: none; margin: 0; width: min(84vw, calc(var(--fh) * var(--ar, 1.78))); scroll-snap-align: center; cursor: zoom-in; }
.lo-frame { background: #0b0b11; border: 1px solid rgba(255, 255, 255, 0.14); }
.lo-url { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; font: 500 11px/1 var(--f-mono); color: rgba(243, 241, 237, 0.5); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.lo-url::before { content: ""; width: 7px; height: 7px; background: var(--lo-red); }
.lo-frame img { display: block; width: 100%; height: auto; }
.lo-shot .fig-cap { margin-top: 12px; color: var(--text-2); font: 400 var(--step--1)/1.5 var(--f-sans); }
html.lo-pin .lo-reel { overflow: hidden; scroll-snap-type: none; }

/* ── what is modelled: a spec sheet ────────────────────────────────── */
.lo-sheet { margin: 0; }
.lo-row { display: grid; gap: 6px 32px; padding: clamp(16px, 1.8vw, 22px) 0; border-top: 1px solid var(--line-2); }
.lo-row:last-child { border-bottom: 1px solid var(--line-2); }
.lo-row dt { font: 800 var(--step-1)/1 var(--f-disp); font-stretch: 70%; text-transform: uppercase; color: var(--text); }
.lo-row dd { margin: 0; color: var(--text-2); max-width: 62ch; }
html[lang="zh-CN"] .lo-row dt { font-stretch: 100%; text-transform: none; }
@media (min-width: 700px) { .lo-row { grid-template-columns: 12ch minmax(0, 1fr); align-items: baseline; } }

/* ── how it was built ──────────────────────────────────────────────── */
.lo-built-grid { display: grid; gap: clamp(40px, 6vw, 96px); }
@media (min-width: 980px) {
  .lo-built-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}
@media (min-width: 980px) and (min-height: 780px) { .lo-built-side { position: sticky; top: calc(var(--nav-h) + 32px); } }
.lo-built .display { margin-top: 14px; font-size: var(--step-4); }
.lo-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(28px, 4vw, 52px); border-top: 1px solid var(--line-2); }
.lo-num { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); }
.lo-num:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.lo-n { font: 800 var(--step-4)/0.95 var(--f-disp); font-stretch: 66%; font-variant-numeric: tabular-nums; color: var(--text); }
.lo-nl { margin-top: 8px; font: 500 var(--step--1)/1.4 var(--f-sans); font-stretch: var(--wd-label); color: var(--text-2); }
.lo-asof { margin: 12px 0 0; font: 400 var(--step--1)/1.4 var(--f-sans); color: var(--text-3); }
.lo-stack { margin-top: clamp(20px, 3vw, 32px); color: var(--text-2); max-width: 44ch; }
.lo-laps { display: grid; }
.lo-lap { padding: clamp(22px, 2.6vw, 34px) 0; border-top: 1px solid var(--line-2); }
.lo-lap:last-child { border-bottom: 1px solid var(--line-2); }
.lo-lap h3 { margin: 0 0 10px; font: 700 var(--step-2)/1.15 var(--f-disp); }
.lo-lap p { margin: 0; color: var(--text-2); max-width: 60ch; }

/* ── the closing start ─────────────────────────────────────────────── */
.lo-end .cta-inner { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; border-top: 0; padding-top: 0; gap: 0; }
.lo-end .display { max-width: 14ch; margin: 0; font-size: var(--step-5); }
.lo-gantry-end { margin-bottom: clamp(24px, 3vw, 40px); }
.lo-cta-sub { margin: 18px 0 28px; color: var(--text-2); font: 400 var(--step-1)/1.4 var(--f-sans); }
.lo-end .showcase-links { justify-content: center; }
.lo-fine { margin: clamp(40px, 6vw, 80px) 0 0; max-width: 64ch; font: 400 var(--step--1)/1.6 var(--f-sans); color: var(--text-3); }
.lo-end .pp-marquee { -webkit-text-stroke-color: rgba(243, 241, 237, 0.16); font-stretch: 62%; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  .lo-c, .lo-sub, .lo-cta, .lo-note, .lo-tower, .lo-pod i { transition: none !important; }
  .lo-hero.is-go .lo-art img { animation: none; }
}

/* pinned: the whole reel, its heading and its captions fit one screen under the nav */
html.lo-pin .lo-screens { min-height: 100vh; padding-top: calc(var(--nav-h) + clamp(16px, 3vh, 40px)); padding-bottom: clamp(16px, 3vh, 40px); }
html.lo-pin .lo-screens .lo-head { margin-bottom: clamp(20px, 3.5vh, 48px); }
html.lo-pin .lo-screens .display { font-size: var(--step-4); }
html.lo-pin .lo-shot { --fh: clamp(170px, calc(100vh - var(--nav-h) - 330px), 560px); }
