/* Interactive VOD player — measured from Figma node 2223:69858 (player)
   and 2223:69381 (episodes bottom sheet). All lengths in design px on a
   994.48 × 493 chassis; the composer scales the whole document. */

@font-face {
  font-family: "Inter";
  src: url("assets/InterVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --on-surface: #efeff0;
  --on-surface-variant: #a6a6ae;
  --surface: #1e1e1f;
  --surface-container: #3f3f46;
  --surface-container-lowest: #52525c;
  --track: #71717b;
  --primary: #05a55d;
  --state-layer: rgba(244, 244, 245, 0.08);
  --hairline: rgba(244, 244, 245, 0.1);
  --sheet-ease-in: cubic-bezier(0.32, 0.72, 0, 1);
  --sheet-ease-out: cubic-bezier(0.5, 0.05, 0.7, 0.3);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f6f6f7;
  font-family: "Inter", system-ui, sans-serif;
  font-feature-settings: "ss01" 1, "ss07" 1;
  -webkit-font-smoothing: antialiased;
}

.demo-stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

/* ---------------------------------------------------------------- chassis */

.player {
  position: relative;
  width: 994.48px;
  height: 493px;
}

/* Black backing that hugs the inside of the chassis art's opaque outline
   (opaque ring starts ~4-5px in; transparent slivers sit between bezel and
   screen). Inset 6px keeps it from poking past the frame edge. */
.player__backing {
  position: absolute;
  inset: 6px;
  border-radius: 73px;
  background: #000;
}

.player__chassis {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

/* ----------------------------------------------------------------- screen */

.screen {
  position: absolute;
  left: calc(50% + 0.6px);
  top: calc(50% - 0.6px);
  width: 937.53px;
  height: 436.06px;
  transform: translate(-50%, -50%);
  border-radius: 46.03px;
  overflow: hidden;
  background: #000;
}

.screen__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  transition: opacity 320ms ease;
}

.ui {
  position: absolute;
  inset: 0;
  color: var(--on-surface);
  transition: opacity 320ms ease;
}

.screen.is-idle .scrim,
.screen.is-idle .ui {
  opacity: 0;
}

.screen.is-idle .ui {
  pointer-events: none;
}

.ui img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* buttons ---------------------------------------------------------------- */

button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 58.14px;
  height: 58.14px;
  border-radius: 50%;
}

.icon-button::after {
  content: "";
  position: absolute;
  inset: 8.33%;
  border-radius: 50%;
  background: var(--state-layer);
  opacity: 0;
  transition: opacity 160ms ease;
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 1;
}

.icon-button--lg {
  width: 106.59px;
  height: 106.59px;
}

/* ----------------------------------------------------------------- topbar */

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 29.07px;
}

.topbar__meta {
  display: flex;
  flex-direction: column;
  gap: 2.42px;
}

.topbar__title {
  font-size: 19.38px;
  line-height: 29.07px;
  font-weight: 600;
}

.topbar__episode {
  display: flex;
  gap: 9.69px;
  font-size: 15.75px;
  line-height: 26.65px;
}

.topbar__buttons {
  display: flex;
  align-items: center;
}

/* ------------------------------------------------------------ controllers */

.controllers {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 77.52px;
}

/* Only the bottom-bar buttons keep a hover state; the top-bar and center
   controls have none (play/pause crossfades its glyphs instead). */
.topbar .icon-button::after,
.controllers .icon-button::after {
  content: none;
}

#btn-play img {
  grid-area: 1 / 1;
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.2, 0, 0, 1);
}

#btn-play[data-state="paused"] .glyph-play,
#btn-play[data-state="playing"] .glyph-pause {
  opacity: 1;
  transform: scale(1);
}

/* -------------------------------------------------------------- bottombar */

.bottombar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 29.07px 14.54px;
}

.seek-row {
  display: flex;
  align-items: center;
  gap: 9.69px;
  height: 62.99px;
}

.seek {
  --p: 0%;
  --track-h: 4.85px;
  position: relative;
  flex: 1;
  height: 100%;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.seek__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: var(--track-h);
  border-radius: 9.69px;
  background: var(--track);
  overflow: hidden;
  transition: height 140ms ease;
}

.seek__fill {
  height: 100%;
  width: var(--p);
  background: var(--primary);
}

/* the requested scrub state: 2px thicker while the thumb is dragged */
.seek.is-scrubbing {
  --track-h: 6.85px;
}

.seek__thumb {
  position: absolute;
  top: 50%;
  left: clamp(0px, calc(var(--p) - 14.54px), calc(100% - 29.07px));
  width: 29.07px;
  height: 30.28px;
  transform: translateY(-47%);
  transition: transform 140ms ease;
  pointer-events: none;
}

.seek.is-scrubbing .seek__thumb {
  transform: translateY(-47%) scale(1.25);
}

/* Scrubbing Preview, from the product's Farsi player mock (374:9418) at the
   player's x1.2113 scale: 152x90 thumbnail on a surface-overlay card,
   radius 4, 60px soft shadow, Title Medium time below. Frames come from a
   10x7 sprite (192x108 tiles, 1 frame/s), cover-cropped to the 1.69 box. */
.seek__preview {
  position: absolute;
  bottom: calc(50% + 29.07px);
  left: 0;
  width: 184.12px;
  transform: translateX(-50%) translateY(4px);
  background: rgba(24, 24, 27, 0.8);
  border-radius: 4.85px;
  box-shadow: 0 0 72.68px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.seek.is-scrubbing .seek__preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.seek__preview-img {
  width: 184.12px;
  height: 109.02px;
  border-radius: 4.85px 4.85px 0 0;
  background-image: url("assets/scrub-sprite.jpg");
  background-size: 1938.13px 763.14px;
}

.seek__preview-time {
  padding: 4.85px 0;
  text-align: center;
  font-size: 16.96px;
  line-height: 29.07px;
  font-weight: 400;
  color: var(--on-surface);
  font-variant-numeric: tabular-nums;
}

.seek-row__time {
  width: 70.25px;
  text-align: right;
  font-size: 14.54px;
  line-height: 19.38px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58.14px;
}

.actions__group {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4.85px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 7.27px;
  height: 38.76px;
  padding: 7.27px 14.54px;
  border-radius: 7.27px;
  font-size: 16.96px;
  line-height: 29.07px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 160ms ease;
}

.pill:hover,
.pill:focus-visible {
  background: var(--state-layer);
}

/* ------------------------------------------------------------------ sheet */

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 360ms ease;
}

.sheet-backdrop.is-open {
  opacity: 1;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--on-surface);
  transform: translateY(103%);
}

.sheet.is-animating {
  transition: transform 480ms var(--sheet-ease-in);
}

.sheet.is-closing {
  transition: transform 340ms var(--sheet-ease-out);
}

.sheet.is-open {
  transform: translateY(0);
}

.sheet__header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 29.3px;
  flex-shrink: 0;
  touch-action: none;
}

.sheet__season {
  display: flex;
  align-items: center;
  gap: 4.88px;
  padding: 9.77px 14.65px;
  border-radius: 7.32px;
  background: var(--surface-container);
  font-size: 17.09px;
  line-height: 24.41px;
  font-weight: 600;
  transition: background-color 160ms ease;
}

.sheet__season:hover,
.sheet__season:focus-visible {
  background: #4a4a52;
}

/* rectangular ripple, matching the other rounded-rect buttons */
.sheet__close::after {
  border-radius: 7.32px;
}

.sheet__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 21.97px;
  line-height: 34.18px;
  font-weight: 600;
}

.sheet__list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 19.53px 29.3px 29.3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 51.27px;
  row-gap: 39.06px;
  align-content: start;
  scrollbar-width: none;
}

.sheet__list::-webkit-scrollbar {
  display: none;
}

.episode {
  display: flex;
  flex-direction: column;
  gap: 9.77px;
  cursor: pointer;
  outline: none;
}

.episode__top {
  display: flex;
  align-items: center;
  gap: 14.65px;
}

.episode__thumb {
  position: relative;
  width: 139.16px;
  height: 78.13px;
  flex-shrink: 0;
  border: 1.22px solid var(--hairline);
  border-radius: 9.77px;
  overflow: hidden;
  transition: border-color 160ms ease;
}

.episode:hover .episode__thumb,
.episode:focus-visible .episode__thumb {
  border-color: rgba(244, 244, 245, 0.28);
}

.episode__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.88px;
  background: var(--surface-container-lowest);
}

.episode__progress span {
  display: block;
  height: 100%;
  border-radius: 0 1220px 1220px 0;
  background: var(--primary);
}

.episode__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4.88px;
}

.episode__title {
  font-size: 17.09px;
  line-height: 26.86px;
  font-weight: 600;
}

.episode__subtitle {
  font-size: 14.65px;
  line-height: 24.41px;
  color: var(--on-surface-variant);
}

.episode__tags {
  display: flex;
  align-items: center;
  gap: 7.32px;
  font-size: 13.43px;
  line-height: 19.53px;
  font-weight: 600;
  color: var(--on-surface-variant);
}

.episode__tags i {
  width: 2.44px;
  height: 2.44px;
  border-radius: 50%;
  background: var(--on-surface-variant);
}

.episode__paragraph {
  margin: 0;
  font-size: 14.65px;
  line-height: 24.41px;
  color: var(--on-surface-variant);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------- fullscreen */

.demo-stage:fullscreen {
  background: #000;
}

.demo-stage:fullscreen .player {
  transform: scale(var(--fs-scale, 1));
}
