/* AI Inclusion film: stage, scenes and player chrome. */

:root {
  --ink: #1C1833;
  --ink-2: #2A2645;
  --paper: #FAF8FC;
  --accent: #6E62AA;
  --gold: #F5C76B;
  --display: 'Fraunces', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--ink);
  cursor: default;
}
#viewport.idle { cursor: none; }

#stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  background: var(--ink);
  transform-origin: 0 0;
  contain: layout paint;
}

/* ------------------------------------------------------------ stage primitives */

.layer { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
.abs { position: absolute; }
.fill { position: absolute; inset: 0; }
.tile { position: absolute; }
.art > svg { display: block; width: 100%; height: 100%; overflow: visible; }

.display {
  font-family: var(--display);
  font-weight: 750;
  font-variation-settings: 'SOFT' 60, 'opsz' 144;
  letter-spacing: -0.03em;
}
.mask { overflow: hidden; }
.mask > span { display: block; will-change: transform; }
.chars > span { display: inline-block; white-space: pre; }
.eyebrow {
  font: 600 24px/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 12px 14px;
  border-radius: 999px;
  font: 600 26px/1 var(--sans);
  white-space: nowrap;
}
.chip i { display: block; width: 22px; height: 22px; border-radius: 6px; }
.panel {
  position: absolute;
  border-radius: 30px;
  background: #2A2645;
  box-shadow: inset 0 0 0 2px rgb(250 248 252 / 0.08), 0 30px 60px rgb(0 0 0 / 0.35);
  overflow: hidden;
}
.mono { font-family: var(--mono); }

/* Grain and vignette sit above every scene. */
.vignette {
  background: radial-gradient(120% 90% at 50% 45%, rgb(28 24 51 / 0) 55%, rgb(28 24 51 / 0.42) 100%);
  pointer-events: none;
}
.grain {
  left: -60px;
  top: -60px;
  width: 2040px;
  height: 1200px;
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ------------------------------------------------------------ player chrome */

.bigplay {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0 1.2em 0 0.5em;
  height: 2.4em;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 600 16px/1 var(--sans);
  cursor: pointer;
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.35), 0 0 0 0 rgb(247 175 152 / 0.6);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s;
  animation: pulse 2.6s ease-out infinite;
  z-index: 3;
}
.bigplay:hover { transform: scale(1.05); }
.bigplay:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.bigplay svg {
  width: 1.8em;
  height: 1.8em;
  padding: 0.38em;
  border-radius: 50%;
  background: var(--accent);
  fill: var(--paper);
}
.bigplay.hide { opacity: 0; visibility: hidden; transform: scale(0.9); }
@keyframes pulse {
  0% { box-shadow: 0 10px 40px rgb(0 0 0 / 0.35), 0 0 0 0 rgb(247 175 152 / 0.55); }
  70%, 100% { box-shadow: 0 10px 40px rgb(0 0 0 / 0.35), 0 0 0 18px rgb(247 175 152 / 0); }
}

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 28px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgb(20 17 38 / 0.82), rgb(20 17 38 / 0));
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 4;
}
.controls.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.ctl {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}
.ctl:hover { background: rgb(250 248 252 / 0.12); }
.ctl:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.ctl svg { width: 22px; height: 22px; fill: currentColor; }
.ctl .i-pause, .ctl .i-sound { display: none; }
.playing .ctl .i-pause { display: block; }
.playing .ctl .i-play { display: none; }
.sound-on .ctl .i-sound { display: block; }
.sound-on .ctl .i-muted { display: none; }

.scrub {
  position: relative;
  flex: 1;
  min-width: 60px;
  height: 30px;
  margin: 0 6px;
  cursor: pointer;
  touch-action: none;
}
.scrub:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.scrub-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 13px;
  height: 4px;
  border-radius: 4px;
  background: rgb(250 248 252 / 0.25);
  overflow: hidden;
}
.scrub-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #F7AF98, #E893B4, #A69AD2, #8EC3DC, #B0DFCD);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.scrub-ticks { position: absolute; inset: 0; pointer-events: none; }
.scrub-ticks i {
  position: absolute;
  top: 11px;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: rgb(250 248 252 / 0.7);
}
.scrub-knob {
  position: absolute;
  top: 8px;
  left: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.4);
  transform: scale(0.85);
  transition: transform 0.2s ease;
}
.scrub:hover .scrub-knob { transform: scale(1.1); }
.time {
  flex: none;
  min-width: 3.2em;
  font: 500 13px/1 var(--mono);
  color: rgb(250 248 252 / 0.85);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .controls { gap: 2px; padding-top: 18px; }
  .ctl { width: 32px; height: 32px; }
  .ctl svg { width: 18px; height: 18px; }
  .time { display: none; }
  #btn-replay { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bigplay { animation: none; }
  .controls, .bigplay { transition: none; }
}

.controls[hidden] { display: none; }

/* Gradient and accent text inside kinetic lines. */
.grad, .grad2, .grad3, .gold {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.grad { background-image: linear-gradient(90deg, #F7AF98, #E893B4 35%, #A69AD2 65%, #8EC3DC 85%, #B0DFCD); }
.grad2 { background-image: linear-gradient(90deg, #E893B4, #A69AD2 55%, #9AD2D7); }
.grad3 { background-image: linear-gradient(90deg, #E0826A, #D46A9A 50%, #6E62AA); }
.gold { background-image: linear-gradient(90deg, #C98A1E, #E0A53A 50%, #B8741A); }

/* Burned-in narration captions: bottom centre, never below 12.5px on screen (see fit()). */
.caps {
  display: grid;
  place-items: end center;
  padding: 0 120px 46px;
  pointer-events: none;
  transform: translateY(calc(-1 * var(--lift, 0px)));
  transition: transform 0.35s ease;
}
.cap {
  grid-area: 1 / 1;
  max-width: 1500px;
  padding: 0.3em 0.78em 0.36em;
  border-radius: 0.5em;
  background: rgb(28 24 51 / 0.74);
  box-shadow: 0 10px 30px rgb(28 24 51 / 0.22), inset 0 0 0 1.5px rgb(250 248 252 / 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--paper);
  font: 600 var(--cap, 42px)/1.26 var(--sans);
  letter-spacing: 0.005em;
  text-align: center;
  text-wrap: balance;
}
