/* ============================================================================
   THE ENDLESS OPTICAL RAIL — TACTILE INDUSTRIAL POP (ETAP 2/3: styles.css)
   Jasnoszara scena + głęboki atrament + mocne akcenty druku.
   Zdjęcia kart leżą na białych podkładach z miękkim cieniem, jakby unosiły się nad sceną.
   ============================================================================ */

:root {
  /* Paleta bazowa i drukarska */
  --cyclorama: #FFFFFF;
  --outer-desk: #E5E6E1;
  --surface-soft: #F4F5F2;
  --surface-alert: #FFF2EE;
  --ink: #0B0C0E;
  --ink-muted: #5C606B;
  --hairline: #DCDDE0;

  /* Akcenty Industrial Pop */
  --vermilion: #FF3B00;
  --ultramarine: #0038FF;
  --chartreuse: #D4FF00;

  /* Kolory marek */
  --nvidia-green: #00A84F;
  --ati-red: #D82128;
  --tdfx-amber: #D97706;
  --intel-blue: #0068B5;
  --pioneer-slate: #3F444E;
  --brand-accent: #0038FF;

  /* Typografia (nadpisywana dynamicznie przez Google Fonts CSS2 API) */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ----------------------------------------------------------------------------
   RESET I KONTENER SCENY 16:9 (1920x1080)
   ---------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--outer-desk);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.render-mode {
  background-color: var(--cyclorama);
}

.is-hidden,
.hidden {
  display: none !important;
}

#viewportWrapper {
  position: fixed;
  inset: 0;
  bottom: 92px; /* Miejsce na panel reżyserski w trybie podglądu */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

body.hud-hidden #viewportWrapper,
body.render-mode #viewportWrapper {
  bottom: 0;
  padding: 0;
}

#stage {
  position: relative;
  width: 1920px;
  height: 1080px;
  flex-shrink: 0;
  overflow: hidden;
  transform-origin: center center;
  box-shadow: 0 18px 48px rgba(11, 12, 14, 0.14);
  background: radial-gradient(ellipse 72% 82% at 38% 44%, #F8F9F6 0%, #E7E9E4 100%);
}

body.render-mode #stage {
  box-shadow: none;
}

/* ----------------------------------------------------------------------------
   WSPÓLNE ETYKIETY, ODZNAKI I PASKI POSTĘPU
   ---------------------------------------------------------------------------- */
.badge-ink-chartreuse,
.badge-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  line-height: 1;
  white-space: nowrap;
}

.badge-ink-chartreuse {
  background-color: var(--ink);
  color: var(--chartreuse);
}





.badge-brand {
  background-color: var(--ultramarine);
  color: #FFFFFF;
  min-width: 120px;
}

.scene-progress-track {
  width: 100%;
  height: 3px;
  background-color: rgba(11, 12, 14, 0.12);
  overflow: hidden;
  margin-bottom: 12px;
}

.scene-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--ultramarine);
  will-change: width;
}

/* ----------------------------------------------------------------------------
   GÓRNY PASEK TELEMETRII (#topBar)
   ---------------------------------------------------------------------------- */
#topBar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 64px;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--hairline);
}

.top-bar-left,
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.top-era-label {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
  text-transform: uppercase;
}


.top-counter {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--ink-muted);
  margin-left: 6px;
}

.top-counter strong {
  color: var(--ink);
  font-weight: 700;
}

.top-year {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  padding-left: 12px;
  border-left: 1px solid var(--hairline);
  min-width: 120px;
  text-align: right;
}

/* ----------------------------------------------------------------------------
   WARSTWA 0 (PARALAKSA 0.4x): HASŁO POD KARTĄ
   Jedno słowo aktywnej karty, pod suwmiarką, przesuwa się wolniej niż sama karta.
   ---------------------------------------------------------------------------- */
#parallaxBgLayer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
}

#bgTypoRail {
  position: absolute;
  top: 0;
  left: 0;
  height: 1080px;
  will-change: transform;
}

.bg-mega-word {
  position: absolute;
  top: 840px;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 80px;
  line-height: 1;
  white-space: nowrap;
  color: rgba(11, 12, 14, 0.1);
  letter-spacing: -0.03em;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}

/* ----------------------------------------------------------------------------
   WARSTWA 1 (PARALAKSA 1.0x): CIĄGŁA SZYNA 58 KART (#cardsRail)
   Każde zdjęcie leży na białym podkładzie z paddingiem i unosi się nad cieniem.
   ---------------------------------------------------------------------------- */
#railViewport {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
}

#cardsRail {
  position: absolute;
  top: 0;
  left: 0;
  height: 1080px;
  will-change: transform;
}

.rail-card-slot {
  position: absolute;
  top: 0;
  width: 960px;
  height: 1080px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  will-change: opacity, filter;
}

.card-cam-rig {
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  position: relative;
}
.card-plate {
  position: relative;
  padding: 40px 48px;
  background-color: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(11, 12, 14, 0.06), 0 26px 54px -20px rgba(11, 12, 14, 0.26);
  will-change: transform;
}

/* Cień rzucany na scenę: nie rusza się z kartą, tylko reaguje na jej wysokość */
.card-ground-shadow {
  position: absolute;
  left: 7%;
  right: 7%;
  top: calc(100% + 16px);
  height: 46px;
  background: radial-gradient(ellipse at center, rgba(11, 12, 14, 0.3) 0%, rgba(11, 12, 14, 0.1) 44%, rgba(11, 12, 14, 0) 70%);
  will-change: transform, opacity;
}

/* Pas w kolorze marki przy wejściu kamienia milowego */
#heroSweep {
  position: absolute;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  opacity: 0;
  will-change: clip-path;
}


.gpu-photo {
  max-width: 800px;
  max-height: 440px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: contrast(1.06) brightness(1.03);
}

/* ----------------------------------------------------------------------------
   TRYB 1: SPRINT CONVEYOR (#sprintHeader)
   ---------------------------------------------------------------------------- */
#sprintHeader {
  position: absolute;
  top: 86px;
  left: 64px;
  right: 64px;
  z-index: 32;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

.sprint-progress-track {
  margin-bottom: 14px;
}

.sprint-top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.sprint-title-block {
  min-width: 0;
}

.sprint-kicker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.sprint-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.sprint-tags-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tag-solid-ink,
.tag-outline-ink,
.tag-solid-vermilion {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  padding: 10px 16px;
  line-height: 1;
  white-space: nowrap;
}

.tag-solid-ink {
  background-color: var(--ink);
  color: #FFFFFF;
}

.tag-outline-ink {
  background-color: #FFFFFF;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.tag-solid-vermilion {
  background-color: var(--vermilion);
  color: #FFFFFF;
}

.sprint-bottom-row {
  max-width: 1480px;
  padding-top: 12px;
}

.sprint-trivia {
  margin: 0;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.sprint-flaw-pill {
  display: none;
  font-family: var(--font-mono);
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--vermilion);
  background-color: var(--surface-alert);
  border: 1px solid var(--vermilion);
  padding: 6px 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#sprintHeader.shows-flaw .sprint-trivia {
  display: none;
}

#sprintHeader.shows-flaw .sprint-flaw-pill {
  display: inline-block;
}

/* ----------------------------------------------------------------------------
   TRYB 2: HERO DISSECTION (#heroPanel)
   Bezpieczny margines bottom: 172px chroni przed nachodzeniem na Word-Burst!
   ---------------------------------------------------------------------------- */
#heroPanel {
  position: absolute;
  right: 64px;
  top: 90px;
  bottom: 172px;
  width: 760px;
  z-index: 32;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
  opacity: 0;
  will-change: transform, opacity;
}

.hero-kicker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.mono-meta-brand {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-accent);
}

.hero-title {
  margin: 0 0 14px 0;
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.odometer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.odometer-cell {
  padding: 10px 14px;
  border-right: 1px solid var(--hairline);
}

.odometer-cell:first-child {
  padding-left: 0;
}

.odometer-cell:last-child {
  padding-right: 0;
  border-right: none;
}

.odo-label {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.odo-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 3px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.odo-value-accent {
  color: var(--ultramarine);
}

.odo-sub {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Moduł deterministycznego <canvas> w panelu HERO */
.viz-box {
  border: 2px solid var(--ink);
  background-color: var(--ink);
  padding: 14px 16px;
}

.viz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.viz-title {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--chartreuse);
  text-transform: uppercase;
}


.viz-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 648 / 142;
}

/* Karty faktów i wad (progresywne pojawianie się w rytmie lektora) */
/* Ciekawostka i wada zajmują to samo miejsce: wada zastępuje ciekawostkę */
.hero-facts-stack {
  display: grid;
}

.hero-facts-stack > .fact-card {
  grid-area: 1 / 1;
  align-self: start;
}

.fact-card {
  padding: 18px 22px;
  will-change: transform, opacity;
  box-shadow: 0 14px 30px -18px rgba(11, 12, 14, 0.3);
}

.fact-card-trivia {
  background-color: #FFFFFF;
  border-left: 6px solid var(--ultramarine);
}

.fact-card-flaw {
  background-color: var(--surface-alert);
  border-left: 6px solid var(--vermilion);
}


.fact-kicker {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}


.fact-kicker-blue {
  color: var(--ultramarine);
}

.fact-kicker-red {
  color: var(--vermilion);
}

.fact-kicker-chartreuse {
  color: var(--chartreuse);
}


.fact-text {
  margin: 0;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.32;
  color: var(--ink);
}


/* ----------------------------------------------------------------------------
   TRYB 3: CLASH & SCANDAL CUT (#clashCurtain)
   Ukośna kurtyna clip-path po prawej — lewa połowa pod kartą jest czysto biała.
   ---------------------------------------------------------------------------- */
#clashCurtain {
  position: absolute;
  inset: 0;
  z-index: 30;
  background-color: var(--vermilion);
  clip-path: polygon(100% 0%, 100% 0%, 100% 100%, 100% 100%);
  pointer-events: none;
  opacity: 0;
  will-change: clip-path, opacity;
}

#clashContent {
  position: absolute;
  right: 64px;
  top: 80px;
  bottom: 172px;
  width: 740px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  color: #FFFFFF;
  will-change: transform;
}

.clash-progress-track {
  background-color: rgba(255, 255, 255, 0.24);
}

.clash-progress-fill {
  background-color: var(--chartreuse);
}

.clash-kicker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.clash-brand-date {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
}

.clash-title {
  margin: 0 0 12px 0;
  font-family: var(--font-display);
  font-size: 50px;
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.025em;
  color: #FFFFFF;
}

.clash-headline {
  display: inline-block;
  background-color: var(--chartreuse);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.015em;
  padding: 8px 18px;
  margin-bottom: 16px;
}

.clash-desc {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.36;
  color: rgba(255, 255, 255, 0.96);
}
/* Rok premiery wypełnia wolne miejsce kurtyny i znika, gdy treści jest dużo */
.clash-year-wrap {
  flex: 1 1 0;
  min-height: 0;
  container-type: size;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.clash-year {
  font-family: var(--font-display);
  font-size: 230px;
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: rgba(11, 12, 14, 0.16);
}

@container (max-height: 190px) {
  .clash-year {
    display: none;
  }
}


.clash-bottom-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clash-viz-wrap {
  background-color: var(--ink);
  border: 2px solid rgba(255, 255, 255, 0.24);
  padding: 12px 14px;
}

.clash-viz-canvas {
  height: auto;
  aspect-ratio: 660 / 132;
}

.clash-spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.clash-spec-cell {
  background-color: rgba(11, 12, 14, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.26);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.clash-spec-label {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.72);
}

.clash-spec-val {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.15;
}

.clash-trivia-card {
  background-color: rgba(11, 12, 14, 0.92);
  border-left: 4px solid var(--chartreuse);
  padding: 16px 20px;
  will-change: transform, opacity;
}

.clash-trivia-text {
  margin: 0;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.32;
  color: rgba(255, 255, 255, 0.95);
}

/* ----------------------------------------------------------------------------
   WARSTWA 2 (OVERFLOW: VISIBLE): WEKTOR SVG + NIEPRZYCINANE CALLOUTY MAKRO
   ---------------------------------------------------------------------------- */
#vectorHudLayer {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  overflow: visible;
  pointer-events: none;
  z-index: 55;
}

#calloutTagBox {
  position: absolute;
  width: 480px;
  z-index: 56;
  background-color: #FFFFFF;
  border: 2px solid var(--ink);
  border-left: 7px solid var(--ultramarine);
  padding: 16px 20px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.callout-kicker {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ultramarine);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.callout-label {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.28;
  color: var(--ink);
}

/* ----------------------------------------------------------------------------
   KINETYCZNE NAPISY WORD-BURST (DEDYKOWANY PAS Y: 938–996 PX)
   ---------------------------------------------------------------------------- */
#wordBurstContainer {
  position: absolute;
  left: 72px;
  right: 72px;
  bottom: 104px;
  z-index: 58;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

#wordBurstPill {
  background-color: var(--ink);
  color: #FFFFFF;
  padding: 12px 28px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
  max-width: 1300px;
  text-align: center;
  opacity: 0;
  will-change: transform, opacity;
}

/* ----------------------------------------------------------------------------
   DOLNA OŚ OPTYCZNA (#opticalBar)
   ---------------------------------------------------------------------------- */
#opticalBar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92px;
  padding: 10px 64px 8px;
  z-index: 48;
  background-color: #FFFFFF;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.optical-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-legend {
  display: flex;
  align-items: center;
  gap: 22px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
}

.dot-nvidia { background-color: var(--nvidia-green); }
.dot-ati { background-color: var(--ati-red); }
.dot-tdfx { background-color: var(--tdfx-amber); }
.dot-intel { background-color: var(--intel-blue); }
.dot-pioneer { background-color: var(--pioneer-slate); }

.optical-caption {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}

#optTrack {
  position: relative;
  width: 100%;
  height: 18px;
  border-bottom: 2px solid var(--ink);
}

#optTicksContainer {
  position: absolute;
  inset: 0;
}

.opt-tick {
  position: absolute;
  bottom: 0;
  width: 3px;
  height: 9px;
  transform: translateX(-50%);
  opacity: 0.65;
  transition: height 0.12s ease, opacity 0.12s ease;
}

.opt-tick.active {
  height: 17px;
  width: 5px;
  opacity: 1;
}

body.render-mode .opt-tick {
  transition: none;
}

#optPlayhead {
  position: absolute;
  top: -2px;
  bottom: -4px;
  left: 0%;
  width: 3px;
  background-color: var(--vermilion);
  transform: translateX(-50%);
  z-index: 2;
}
#optYears {
  position: relative;
  height: 20px;
}

.opt-year {
  position: absolute;
  top: 3px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-muted);
}


/* ----------------------------------------------------------------------------
   STINGER EPOK (MECHANICZNA MIGAWKA + SPLIT-FLAP)
   ---------------------------------------------------------------------------- */
#stingerLayer {
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
}

.shutter-blade {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  background-color: var(--ink);
  will-change: transform;
}

.shutter-top {
  top: 0;
  transform: translateY(-100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.shutter-bottom {
  bottom: 0;
  transform: translateY(100%);
  border-top: 2px solid rgba(255, 255, 255, 0.08);
}

#stingerCenter {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.stinger-code {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--chartreuse);
  text-transform: uppercase;
}

.split-flap-row {
  display: flex;
  align-items: center;
  gap: 16px;
  perspective: 700px;
}

.flap-digit {
  position: relative;
  width: 124px;
  height: 166px;
  background-color: #17191E;
  border: 2px solid #2A2E37;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 108px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform-origin: center center;
  will-change: transform;
}

/* Połówki klapki: każda pokazuje górną albo dolną część całej cyfry */
.flap-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background-color: inherit;
  backface-visibility: hidden;
}

.flap-half span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200%;
}

.flap-top,
.flap-leaf-top {
  top: 0;
  transform-origin: center bottom;
}

.flap-bottom,
.flap-leaf-bottom {
  bottom: 0;
  transform-origin: center top;
}

.flap-bottom span,
.flap-leaf-bottom span {
  transform: translateY(-50%);
}

.flap-digit::after {
  z-index: 3;
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  background-color: var(--ink);
  transform: translateY(-50%);
}

.stinger-title {
  margin: 4px 0 0 0;
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  text-align: center;
  text-transform: uppercase;
}

.stinger-sub {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------------------
   SCENY INTRO I OUTRO (BOOKENDS)
   ---------------------------------------------------------------------------- */
#introLayer,
#outroLayer {
  position: absolute;
  inset: 0;
  z-index: 42;
  background: radial-gradient(ellipse 72% 82% at 38% 44%, #F8F9F6 0%, #E7E9E4 100%);
  padding: 92px 84px 184px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  will-change: opacity;
}

.bookend-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.bookend-top-meta {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.bookend-center {
  margin: auto 0;
}

.bookend-kicker {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ultramarine);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.bookend-title {
  margin: 0 0 26px 0;
  font-family: var(--font-display);
  font-size: 86px;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 1580px;
  will-change: transform, opacity;
}

.bookend-title-outro {
  font-size: 66px;
  margin-bottom: 34px;
}

.bookend-lead {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.36;
  color: var(--pioneer-slate);
  max-width: 1380px;
  will-change: transform, opacity;
}

.bookend-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 2px solid var(--ink);
  padding-top: 22px;
  will-change: opacity;
}

.bookend-stat-cell {
  padding: 0 28px;
  border-right: 1px solid var(--hairline);
}

.bookend-stat-cell:first-child {
  padding-left: 0;
}

.bookend-stat-cell:last-child {
  padding-right: 0;
  border-right: none;
}

.bookend-stat-label {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.bookend-stat-value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 6px;
  letter-spacing: -0.02em;
}

.value-ultramarine {
  color: var(--ultramarine);
}
.value-vermilion {
  color: var(--vermilion);
}

/* Intro: nagłówek u góry, pod nim taśma kamieni milowych, na dole liczby */
.intro-head {
  margin: 24px 0 0;
}

.intro-strip-window {
  position: relative;
  height: 280px;
  margin: 30px 0 auto;
}

#introStrip {
  position: absolute;
  left: -84px;
  top: 0;
  display: flex;
  align-items: flex-end;
  gap: 40px;
  width: max-content;
  will-change: transform, opacity;
}

.intro-plate {
  margin: 0;
  padding: 22px 26px 16px;
  background-color: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(11, 12, 14, 0.06), 0 22px 40px -20px rgba(11, 12, 14, 0.28);
}

.intro-plate img {
  display: block;
  height: 186px;
  width: auto;
  max-width: 440px;
  object-fit: contain;
}

/* Podpis nie poszerza podkładu: bierze szerokość zdjęcia i ucina resztę */
.intro-plate figcaption {
  width: 0;
  min-width: 100%;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intro-plate figcaption strong {
  margin-right: 12px;
  font-size: 24px;
  color: var(--ink);
}



/* Siatka trzech fal grafiki w Outro */
.waves-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.wave-card {
  background-color: var(--surface-soft);
  border: 2px solid var(--ink);
  border-top-width: 6px;
  padding: 24px 26px;
}

.wave-card-1 { border-top-color: var(--pioneer-slate); }
.wave-card-2 { border-top-color: var(--ultramarine); }
.wave-card-3 { border-top-color: var(--vermilion); }

.wave-tag {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.wave-name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.wave-desc {
  margin: 0;
  font-size: 24px;
  line-height: 1.4;
  color: var(--pioneer-slate);
}

.outro-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.outro-epilogue {
  margin: 24px 0 0;
  font-size: 24px;
  line-height: 1.4;
  color: var(--ink);
}

.outro-cta-question {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--ultramarine);
}

.outro-cta-sub {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.12em;
}

/* ----------------------------------------------------------------------------
   NAKŁADKA BEZPIECZNYCH STREF YOUTUBE (#ytSafeArea)
   ---------------------------------------------------------------------------- */
#ytSafeArea {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.yt-safe-frame {
  position: absolute;
  inset: 54px 96px;
  border: 2px dashed rgba(0, 56, 255, 0.55);
}

.yt-endscreen-left,
.yt-endscreen-right {
  position: absolute;
  bottom: 170px;
  width: 520px;
  height: 292px;
  border: 2px dashed rgba(255, 59, 0, 0.7);
  background-color: rgba(255, 59, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--vermilion);
}

.yt-endscreen-left { left: 110px; }
.yt-endscreen-right { right: 110px; }

.yt-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 82px;
  background-color: rgba(255, 59, 0, 0.12);
  border-top: 2px dashed rgba(255, 59, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--vermilion);
}

/* ----------------------------------------------------------------------------
   PANEL REŻYSERSKI (#directorHud) — STYL TEENAGE ENGINEERING
   ---------------------------------------------------------------------------- */
#directorHud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background-color: #F4F5F2;
  border-top: 2px solid var(--ink);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

body.hud-hidden #directorHud,
body.render-mode #directorHud {
  display: none !important;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.hud-row-controls {
  justify-content: space-between;
  flex-wrap: wrap;
}

.hud-transport-group,
.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  background-color: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.hud-btn:hover {
  background-color: var(--chartreuse);
  color: var(--ink);
}

.hud-btn-primary {
  background-color: var(--vermilion);
  border-color: var(--ink);
  color: #FFFFFF;
  min-width: 82px;
}

.hud-btn-primary:hover {
  background-color: var(--ink);
  color: var(--chartreuse);
}

.hud-btn-dark {
  background-color: var(--ink);
  color: var(--chartreuse);
}

.hud-btn-dark:hover {
  background-color: var(--ultramarine);
  border-color: var(--ultramarine);
  color: #FFFFFF;
}

.hud-btn-blue {
  background-color: var(--ultramarine);
  border-color: var(--ultramarine);
  color: #FFFFFF;
}

.hud-btn-blue:hover {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--chartreuse);
}

.hud-btn-chartreuse {
  background-color: var(--chartreuse);
  color: var(--ink);
}

.hud-btn-chartreuse:hover {
  background-color: var(--ink);
  color: var(--chartreuse);
}

.hud-btn-danger {
  border-color: var(--vermilion);
  color: var(--vermilion);
  background-color: #FFFFFF;
}

.hud-btn-danger:hover {
  background-color: var(--vermilion);
  color: #FFFFFF;
}

.hud-btn-xs {
  padding: 3px 8px;
  font-size: 10.5px;
}

.hud-timecode {
  min-width: 146px;
  line-height: 1.2;
}

.hud-time-main {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hud-time-sub {
  font-size: 10px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.hud-scrub {
  flex: 1;
  min-width: 160px;
  appearance: none;
  -webkit-appearance: none;
  height: 10px;
  background-color: #FFFFFF;
  border: 1px solid var(--ink);
  cursor: pointer;
}

.hud-scrub::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 18px;
  background-color: var(--vermilion);
  border: 1px solid var(--ink);
  cursor: pointer;
}

.hud-scrub::-moz-range-thumb {
  width: 14px;
  height: 18px;
  background-color: var(--vermilion);
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}

.hud-select {
  width: 270px;
  max-width: 30vw;
  padding: 5px 8px;
  border: 1px solid var(--ink);
  background-color: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.hud-inline-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background-color: #FFFFFF;
  border: 1px solid var(--ink);
}

.hud-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

.hud-wpm-slider {
  width: 68px;
  accent-color: var(--vermilion);
  cursor: pointer;
}

.hud-wpm-val {
  font-weight: 700;
  min-width: 26px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hud-font-select {
  border: none;
  background-color: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

.hud-font-input {
  width: 126px;
  padding: 2px 6px;
  border: none;
  border-left: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink);
  outline: none;
  user-select: text;
}

/* ----------------------------------------------------------------------------
   MODAL STUDIA EKSPORTU (#exportModal) I POWIADOMIENIA TOAST
   ---------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(11, 12, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-window {
  width: min(1040px, 95vw);
  max-height: 88vh;
  background-color: #FFFFFF;
  border: 3px solid var(--ink);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.modal-meta {
  margin: 4px 0 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-tab {
  cursor: pointer;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  background-color: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.exp-tab.is-active {
  background-color: var(--ink);
  color: var(--chartreuse);
}

.modal-textarea {
  width: 100%;
  height: 430px;
  padding: 14px;
  border: 2px solid var(--ink);
  background-color: var(--surface-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  user-select: text;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.modal-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.modal-hint code {
  background-color: var(--surface-soft);
  padding: 2px 5px;
  border: 1px solid var(--hairline);
  color: var(--ink);
}

.toast-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 120;
  background-color: var(--ink);
  color: var(--chartreuse);
  border: 2px solid var(--chartreuse);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-box.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
