/* Explainer player (kutatas-crown, lane M). Uses the story's tokens when present (story.css), with the same values
   as fallbacks. Square corners, no pill, no italic, no monospace, no transform or animation on <video>: only the
   wrapper (.xp-stage) fades in when the video replaces the poster. */
.xp {
  margin: 0; max-width: 960px;
  font-family: var(--sans, "Sofia Sans", system-ui, sans-serif); font-style: normal;
  color: var(--fg, #1D3244);
}
.xp-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--night-2, #0F1A24); border-radius: 0;
}
/* portrait phone: the 9:16 cut, never taller than the viewport */
@media (orientation: portrait) and (max-width: 700px) {
  .xp-stage { aspect-ratio: 9 / 16; width: min(100%, calc(78svh * 9 / 16)); margin-inline: auto; }
}
/* once playing, the stage follows the cut that was picked, whatever the orientation does afterwards */
.xp[data-fmt="16x9"] .xp-stage { aspect-ratio: 16 / 9; width: 100%; }
.xp[data-fmt="9x16"] .xp-stage { aspect-ratio: 9 / 16; width: min(100%, calc(78svh * 9 / 16)); margin-inline: auto; }

.xp-poster {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent; color: inherit; cursor: pointer; font: inherit;
}
.xp-poster[hidden] { display: none; }
.xp-poster picture, .xp-poster img { display: block; width: 100%; height: 100%; }
.xp-poster img { object-fit: cover; }
.xp-poster:focus-visible { outline: 3px solid var(--acc, #9C4526); outline-offset: 3px; }

/* play mark: a square ink tile with a paper triangle, bottom left like a caption card */
.xp-play {
  position: absolute; left: 16px; bottom: 16px; width: 64px; height: 64px; border-radius: 0;
  background: var(--ink, #1D3244); box-shadow: 0 1px 0 rgba(15, 26, 36, .25);
}
.xp-play::before {
  content: ""; position: absolute; left: 25px; top: 20px; width: 0; height: 0;
  border-style: solid; border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--paper, #F0F0EA);
}
.xp-poster:hover .xp-play, .xp-poster:focus-visible .xp-play { background: var(--terra, #9C4526); }
.night .xp-play { background: var(--night-acc, #E28A62); }
.night .xp-play::before { border-left-color: var(--night, #15232F); }
.night .xp-poster:hover .xp-play, .night .xp-poster:focus-visible .xp-play { background: #EEF0EA; }

.xp video {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: contain; background: var(--night-2, #0F1A24);
}
.xp video:focus-visible { outline: 3px solid var(--acc, #9C4526); outline-offset: 3px; }
.xp video::cue {
  font-family: var(--sans, "Sofia Sans", system-ui, sans-serif); font-style: normal; font-weight: 500;
  color: #EEF0EA; background: rgba(15, 26, 36, .84); line-height: 1.3;
}

@media (prefers-reduced-motion: no-preference) {
  .xp-stage.xp-live { animation-name: xp-in; animation-duration: .24s; animation-timing-function: ease-out; }
  @keyframes xp-in { from { opacity: .6; } to { opacity: 1; } }
}

.xp-cap {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 10px;
  font-size: 15px; line-height: 1.35; color: var(--fg, #1D3244);
}
.xp-t { font-weight: 600; }
.xp-d { color: var(--fg-2, #4F6173); font-variant-numeric: tabular-nums; }
.xp-file { margin-left: auto; color: var(--fg-2, #4F6173); font-size: 13px; text-underline-offset: 3px; }
.xp-file:hover { color: var(--acc, #9C4526); }
