/* ==========================================================================
   Mondios — cinema mode. A native <dialog> gives us the top layer, Esc and
   the focus trap; this only draws the room and the controls.
   ========================================================================== */

.cinema {
  inset: 0;
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: var(--ground-black);
  color: var(--bone);
  overflow: clip;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}
.cinema[open] { opacity: 1; display: grid; place-items: center; }
.cinema::backdrop { background: var(--ground-black); }

.cinema__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--ground-black);
}

/* --- controls -------------------------------------------------------------
   A single bar that hides itself after a moment of stillness. --------------*/
.cinema__bar {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-4);
  background: linear-gradient(to top, oklch(0% 0 0 / .85), transparent);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.cinema[data-idle='true'] .cinema__bar { opacity: 0; transform: translateY(0.5rem); pointer-events: none; }
.cinema[data-idle='true'] { cursor: none; }

.cinema__btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  transition: border-color var(--dur) var(--ease-out);
}
.cinema__btn svg { width: 1.05rem; height: 1.05rem; stroke: var(--bone); fill: var(--bone); stroke-width: 1.25; }
.cinema__btn:hover { border-color: var(--gold); }
.cinema__btn:hover svg { stroke: var(--gold); fill: var(--gold); }
.cinema__btn [data-when='playing'] { display: none; }
.cinema__btn[aria-pressed='true'] [data-when='playing'] { display: block; }
.cinema__btn[aria-pressed='true'] [data-when='paused'] { display: none; }

.cinema__close { position: absolute; inset-block-start: var(--space-4); inset-inline-end: var(--space-4); }
.cinema__close svg { fill: none; }

/* The scrub rail: a range input, drawn as a gold hairline. */
.cinema__scrub {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.5rem;
  background: transparent;
  cursor: pointer;
}
.cinema__scrub::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(90deg, var(--gold) var(--p, 0%), var(--hairline) var(--p, 0%));
}
.cinema__scrub::-moz-range-track { height: 1px; background: var(--hairline); }
.cinema__scrub::-moz-range-progress { height: 1px; background: var(--gold); }
.cinema__scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  margin-block-start: -4.5px;
  border-radius: 50%;
  background: var(--gold);
  transition: transform var(--dur-fast) var(--ease-out);
}
.cinema__scrub::-moz-range-thumb {
  width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--gold);
}
.cinema__scrub:hover::-webkit-slider-thumb { transform: scale(1.5); }

.cinema__time {
  font-family: var(--font-ui);
  font-size: var(--text-micro);
  letter-spacing: var(--track-caps);
  color: var(--bone-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The affordance on the hero */
.hero__watch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--bone-dim);
  transition: color var(--dur) var(--ease-out);
}
.hero__watch-ring {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  transition: border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.hero__watch-ring svg { width: 0.9rem; height: 0.9rem; fill: var(--bone); transform: translateX(1px); transition: fill var(--dur) var(--ease-out); }
.hero__watch:hover { color: var(--gold); }
.hero__watch:hover .hero__watch-ring { border-color: var(--gold); transform: scale(1.08); }
.hero__watch:hover .hero__watch-ring svg { fill: var(--gold); }

@media (max-width: 40em) {
  .cinema__bar { grid-template-columns: auto 1fr auto; gap: var(--space-3); padding-inline: var(--space-3); }
  .cinema__time, .cinema__full { display: none; }
}
