/* arab-i — coming-soon landing. Colours from arab-i-colour-system.pdf. */
:root {
  --ink-0: #05061F;
  --ink-1: #080A33;
  --ink-2: #0B294F;
  --violet: #190B5A;
  --cyan-1: #5FE2E8;
  --cyan-2: #04C6CF;
  --teal: #0298A6;
  --teal-d: #037D94;
  --electric: #3C1FD9;
  --lilac: #AEB1F4;
  --white: #FFFFFF;
  --mist: #B5BBCB;
  --slate: #6D7789;

  --surface: rgba(32, 47, 99, .55);
  --surface-hi: rgba(44, 62, 124, .75);
  --line: rgba(174, 177, 244, .14);

  --gradient-mark: linear-gradient(135deg, #3C1FD9 0%, #0298A6 55%, #5FE2E8 100%);
  --gradient-brand-sweep: linear-gradient(120deg, #05061F 35%, #0B294F 70%, #04C6CF 120%);

  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-lat: "Poppins", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --radius: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  --card-w: clamp(196px, 20vw, 248px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ink-0);
  color: var(--white);
  font-family: var(--font-ar);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--cyan-1); outline-offset: 3px; }

/* ---------- background glow (look & feel p.2/4) ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.aurora span:nth-child(1) {
  width: 60vmax; height: 34vmax; top: -16vmax; inset-inline-start: -12vmax;
  background: radial-gradient(closest-side, var(--cyan-2), transparent);
  transform: rotate(-24deg);
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora span:nth-child(2) {
  width: 52vmax; height: 30vmax; bottom: -18vmax; inset-inline-end: -14vmax;
  background: radial-gradient(closest-side, var(--electric), transparent);
  opacity: .45;
  animation: drift 26s ease-in-out infinite alternate-reverse;
}
.aurora span:nth-child(3) {
  width: 40vmax; height: 22vmax; top: 38%; inset-inline-start: 30%;
  background: radial-gradient(closest-side, var(--ink-2), transparent);
  opacity: .8;
}
@keyframes drift {
  from { translate: 0 0; }
  to { translate: 6vmax 4vmax; }
}

/* ---------- coming-soon bar ---------- */
.soon-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px var(--gutter);
  background: linear-gradient(90deg, var(--cyan-1), var(--cyan-2));
  color: var(--ink-1);
  font-weight: 700;
  font-size: clamp(16px, 2.2vw, 21px);
  text-align: center;
}
.pulse {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--ink-1);
  box-shadow: 0 0 0 0 rgba(8, 10, 51, .5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(8, 10, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(8, 10, 51, 0); }
}

/* ---------- layout ---------- */
.stage {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(32px, 6vh, 64px) 0 clamp(24px, 4vh, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vh, 48px);
}

.brand { text-align: center; padding: 0 var(--gutter); }
.brand-logo { height: clamp(44px, 7vw, 76px); width: auto; margin: 0 auto; }
.tagline {
  margin: 14px 0 0;
  color: var(--mist);
  font-size: clamp(15px, 1.8vw, 18px);
  letter-spacing: .01em;
}
.tagline::before, .tagline::after {
  content: ""; display: inline-block; vertical-align: middle;
  width: 28px; height: 1px; margin: 0 12px;
  background: linear-gradient(90deg, transparent, var(--cyan-2));
}
.tagline::after { background: linear-gradient(90deg, var(--cyan-2), transparent); }

/* ---------- "building the site" loader ---------- */
.loader {
  width: min(440px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  text-align: center;
}
.loader-text {
  margin: 0 0 12px;
  min-height: 1.6em;
  color: var(--cyan-1);
  font-size: clamp(16px, 1.7vw, 18px);
  font-weight: 500;
  transition: opacity .3s ease, translate .3s ease;
}
.loader-text.is-out { opacity: 0; translate: 0 -6px; }
.loader-track {
  position: relative;
  height: 24px;
  border-radius: 99px;
  background: rgba(174, 177, 244, .14);
  box-shadow: inset 0 0 0 1px rgba(174, 177, 244, .12);
  overflow: hidden;
}
/* Fill and its label share the same box; JS sets both widths from LOADER_PERCENT. */
.loader-fill, .loader-pct {
  /* Physical right, not inset-inline-start: the label is direction:ltr, which would flip it left. */
  position: absolute; inset-block: 0; right: 0;
  width: 0;
  transition: width 1.6s cubic-bezier(.4, 0, .2, 1);
}
.loader-fill {
  border-radius: inherit;
  background: linear-gradient(270deg, var(--cyan-1), var(--cyan-2));
  box-shadow: 0 0 16px rgba(4, 198, 207, .55);
  overflow: hidden;
}
.loader-pct {
  display: grid; place-items: center;
  color: var(--ink-1);
  font: 700 13px/1 var(--font-lat);
  direction: ltr;
  white-space: nowrap;
}
.loader-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  translate: 100% 0;
  animation: shine 1.4s ease-in-out infinite;
}
@keyframes shine { from { translate: 100% 0; } to { translate: -100% 0; } }

/* ---------- episodes ---------- */
.episodes-head {
  display: flex; align-items: baseline; gap: 14px;
  padding: 0 var(--gutter);
  margin-bottom: 18px;
}
.episodes-head h1 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; }
.count { margin: 0; color: var(--slate); font-size: 15px; }
.count b { color: var(--cyan-1); font-weight: 600; font-family: var(--font-lat); }

.rail-nav { margin-inline-start: auto; display: flex; gap: 8px; }
.nav-btn, .icon-btn, .side-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background .2s, border-color .2s, opacity .2s;
}
.nav-btn svg, .icon-btn svg, .side-btn svg { width: 20px; height: 20px; }
.nav-btn:hover, .icon-btn:hover, .side-btn:hover { background: var(--surface-hi); border-color: rgba(95, 226, 232, .5); }
.nav-btn:disabled, .side-btn:disabled { opacity: .3; cursor: default; }

.rail {
  list-style: none; margin: 0;
  display: flex; gap: clamp(14px, 1.6vw, 22px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding: 6px var(--gutter) 18px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 var(--gutter), #000 calc(100% - 64px), transparent);
          mask-image: linear-gradient(to left, transparent 0, #000 var(--gutter), #000 calc(100% - 64px), transparent);
}
.rail::-webkit-scrollbar { display: none; }
.rail > li { flex: 0 0 var(--card-w); scroll-snap-align: start; }

.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #2C3E7C, #1A2756);
  text-align: start;
  cursor: pointer;
  isolation: isolate;
  opacity: 0;
  translate: 0 18px;
  animation: rise .7s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms + 120ms);
  transition: transform .45s var(--ease), border-color .3s, box-shadow .45s var(--ease);
}
@keyframes rise { to { opacity: 1; translate: 0 0; } }

.card img, .card video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), opacity .4s;
}
.card video { opacity: 0; }
.card.is-previewing video { opacity: 1; }
.card::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  /* Light touch: only the bottom strip darkens, so the thumbnail's own title stays clear. */
  background: linear-gradient(180deg, transparent 78%, rgba(5, 6, 31, .55) 100%);
}

/* Bottom corner, not centre: every poster carries its episode title mid-frame. */
.card-play {
  position: absolute; z-index: 2; bottom: 16px; left: 14px;
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(5, 6, 31, .35);
  border: 1.5px solid rgba(95, 226, 232, .7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--cyan-1);
  transition: transform .4s var(--ease), background .3s, opacity .3s;
}
.card-play svg { width: 20px; height: 20px; margin-left: 3px; fill: currentColor; stroke: none; }

.card-meta { position: absolute; z-index: 2; right: 16px; left: 74px; bottom: 16px; }
.card-ep { display: block; font-size: 14px; color: var(--cyan-1); font-weight: 600; }
.card-title { display: block; font-size: 18px; font-weight: 700; line-height: 1.35; margin-top: 2px; }

.card-dur {
  position: absolute; z-index: 2; top: 12px; inset-inline-end: 12px;
  padding: 2px 9px; border-radius: 99px;
  background: rgba(5, 6, 31, .6);
  font: 500 12px/1.6 var(--font-lat);
  direction: ltr;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (hover: hover) {
  .card:not(.is-locked):hover {
    transform: translateY(-6px);
    border-color: rgba(95, 226, 232, .55);
    box-shadow: 0 18px 40px -12px rgba(4, 198, 207, .35);
  }
  .card:not(.is-locked):hover img { transform: scale(1.04); }
  .card:not(.is-locked):hover .card-play { transform: scale(1.1); background: var(--cyan-2); color: var(--ink-1); border-color: var(--cyan-2); }
  .card.is-previewing .card-play { opacity: 0; }
}

/* locked (not yet released) */
.card.is-locked {
  cursor: default;
  background:
    radial-gradient(120% 60% at 80% 0%, rgba(4, 198, 207, .22), transparent 60%),
    radial-gradient(100% 50% at 10% 100%, rgba(60, 31, 217, .28), transparent 60%),
    linear-gradient(180deg, #16224A, #0C1435);
}
.card.is-locked::after { background: none; }
.card.is-locked .card-mark {
  position: absolute; z-index: 1; width: 62%; top: 22%; left: 19%;
  opacity: .12; filter: grayscale(1) brightness(2);
}
.card.is-locked .card-meta { left: 16px; }
.card.is-locked .card-play { top: 50%; left: 50%; bottom: auto; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: rgba(174, 177, 244, .3); color: var(--lilac); background: rgba(5, 6, 31, .3); }
.card.is-locked .card-play svg { fill: none; stroke: currentColor; margin: 0; width: 22px; height: 22px; }
.card.is-locked .card-ep { color: var(--mist); }
.card.is-locked .card-title { color: var(--slate); font-weight: 600; }

.swipe-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 10px 0 0; color: var(--slate); font-size: 15px;
}
.swipe-hint svg { width: 18px; height: 18px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { translate: -5px 0; } }

/* ---------- socials ---------- */
.socials {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  padding: 0 var(--gutter);
}
.social {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--white);
  font: 500 16px/1.4 var(--font-lat);
  text-decoration: none;
  direction: ltr;
  transition: background .2s, border-color .2s, transform .3s var(--ease), color .2s;
}
a.social:hover { background: var(--surface-hi); border-color: rgba(95, 226, 232, .55); color: var(--cyan-1); transform: translateY(-2px); }

.foot {
  padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--slate);
  font: 400 13px/1.5 var(--font-lat);
  direction: ltr;
}

/* ---------- player ---------- */
.player {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--white);
}
.player::backdrop { background: rgba(5, 6, 31, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.player[open] { display: grid; place-items: center; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }

.player-shell { display: flex; flex-direction: column; gap: 14px; padding: 16px; max-height: 100%; }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.player-kicker { margin: 0; color: var(--cyan-1); font-size: 14px; font-weight: 600; }
.player-title { margin: 0; font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; }

.player-frame { display: flex; align-items: center; gap: 18px; }
.player-frame video {
  height: min(78vh, 820px);
  height: min(78svh, 820px);
  width: auto;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  background: #000;
  box-shadow: 0 30px 80px -20px rgba(4, 198, 207, .35);
}
.side-btn { width: 52px; height: 52px; flex: none; }
.side-btn svg { width: 24px; height: 24px; }

.up-next {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--mist); font-size: 15px;
}
.up-next[hidden] { display: none; }
.up-next b { color: var(--cyan-1); font-family: var(--font-lat); }
.up-next button {
  padding: 4px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer;
}

/* ---------- small screens ---------- */
@media (min-width: 900px) {
  .swipe-hint { display: none; }
}
@media (max-width: 899px) {
  .rail-nav { display: none; }
}
@media (max-width: 600px) {
  :root { --card-w: 62vw; --radius: 18px; }
  /* Phone hero: bar, logo and tagline sized to own the first screen. */
  .soon-bar {
    padding: max(20px, env(safe-area-inset-top)) var(--gutter) 20px;
    font-size: 23px;
    gap: 14px;
  }
  .pulse { width: 12px; height: 12px; }
  .stage { padding-top: 52px; gap: 44px; }
  .brand { position: relative; }
  .brand::before {
    content: ""; position: absolute; z-index: -1;
    inset: -30px 0 -10px;
    background: radial-gradient(closest-side, rgba(4, 198, 207, .22), transparent);
    pointer-events: none;
  }
  .brand-logo { width: min(86vw, 360px); height: auto; }
  .tagline { margin-top: 18px; font-size: 21px; font-weight: 500; color: var(--white); }
  .tagline::before, .tagline::after { width: 36px; }
  .loader-text { font-size: 18px; }
  .loader-track { height: 26px; }
  .loader-pct { font-size: 14px; }
  .card-title { font-size: 17px; }
  .social { padding: 8px 14px; font-size: 14px; border-radius: 12px; }

  .player-shell { width: 100%; height: 100%; padding: 12px; justify-content: center; }
  .player-frame { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .player-frame video { grid-column: 1 / -1; grid-row: 1; width: 100%; height: auto; max-height: 76svh; object-fit: contain; }
  .side-btn { grid-row: 2; width: 100%; height: 46px; border-radius: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .card { opacity: 1; translate: 0 0; }
}
