/* ReelST: ink night + reel red (taken from the brand logo) */
:root {
  --night: #13293A;   /* page base: ink blue, so the brand red reads clean */
  --lagoon: #1B3549;  /* raised surfaces */
  --pearl: #F4EFE6;   /* primary text */
  --dune: #C9BBA4;    /* secondary text */
  --red: #E11B18;     /* single accent from the logo: CTA, playback progress */
  --red-press: #C4140F;
  --seam: #34506A;    /* lines and borders */

  --display: "Lalezar", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --body: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;

  --fs-display: clamp(2.4rem, 1.5rem + 4vw, 4.6rem);
  --fs-h2: clamp(1.9rem, 1.35rem + 2.2vw, 3rem);
  --fs-h3: 1.35rem;
  --fs-body: 1.125rem;
  --fs-small: 0.95rem;

  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --ease-play: cubic-bezier(.45, .05, .55, .95);
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--pearl);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.8;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: 0; }
h1, h2 { font-family: var(--display); line-height: 1.3; }
h2 { font-size: var(--fs-h2); }
h3 { font-family: var(--body); font-weight: 700; font-size: var(--fs-h3); line-height: 1.4; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: var(--gutter); }

:focus-visible { outline: 3px solid var(--pearl); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: 700 1.1rem/1.2 var(--body);
  color: #FFFFFF;
  background: var(--red);
  padding: 15px 26px;
  border-radius: 14px;
  min-height: 54px;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); background-color: var(--red-press); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: 90ms; }
.btn--small { padding: 9px 16px; min-height: 42px; font-size: 1rem; border-radius: 10px; }
.btn--big { padding: 18px 32px; min-height: 62px; font-size: 1.2rem; }
.btn--ghost { background: transparent; color: var(--pearl); box-shadow: inset 0 0 0 2px var(--seam); }
.btn--ghost:hover { background: var(--lagoon); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  background: rgba(19, 41, 58, .5);
  border-bottom: 1px solid transparent;
  transition: background-color 240ms var(--ease-out), border-color 240ms var(--ease-out);
}
.topbar.is-solid { background: rgba(19, 41, 58, .95); border-bottom-color: var(--seam); }
.topbar__inner {
  max-width: 1240px; margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
/* logo is a red tile: a slightly tighter radius than buttons marks it as the brand, not an action */
.brand { display: block; height: 50px; width: auto; border-radius: 9px; }

/* ---------- Playback segments (the page's signature) ---------- */
.segments, .show__bar { display: flex; gap: 4px; }
.segments i, .show__bar i {
  position: relative; flex: 1; height: 3px; border-radius: 2px;
  background: rgba(244, 239, 230, .28); overflow: hidden;
}
.segments i::after, .show__bar i::after {
  content: ""; position: absolute; inset: 0;
  background: var(--red);
  transform: scaleX(0); transform-origin: right; /* RTL: fills from the right */
}
.segments i.is-done::after { transform: scaleX(1); }
.segments i.is-playing::after { transform: scaleX(1); transition: transform 2400ms var(--ease-play); }
.show.is-in .show__bar i:first-child::after { transform: scaleX(1); transition: transform 1600ms var(--ease-play) 500ms; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden; isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 20%; }
/* legibility scrim behind the text block only */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(19,41,58,.96) 0%, rgba(19,41,58,.75) 38%, rgba(19,41,58,0) 62%);
}
.hero__content { width: 100%; padding: 96px var(--gutter) 30px; }
.hero__panel { max-width: 620px; }
.segments { max-width: 260px; }
.hero__kicker { margin-top: 10px; font-size: var(--fs-small); color: var(--dune); }
.hero__title { font-size: var(--fs-display); margin-top: 6px; }
.hero__title .line { display: block; overflow: hidden; padding-block: .06em .12em; }
.hero__title .line > span { display: inline-block; }
.hero__sub { margin-top: 12px; color: var(--dune); max-width: 32em; }
.hero__cta { margin-top: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hero__note { font-size: var(--fs-small); color: var(--dune); }

/* ---------- Genre rail ---------- */
.board { padding: 84px 0 72px; }
.board__head { display: grid; gap: 10px; max-width: 640px; }
.board__head p { color: var(--dune); }
.board__rail {
  margin-top: 30px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%;
  gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 10px; scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.board__rail::-webkit-scrollbar { display: none; }
.show {
  position: relative; scroll-snap-align: start;
  border-radius: 12px; overflow: hidden;
  background: var(--lagoon);
  aspect-ratio: 9 / 16;
}
.show img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.show:hover img { transform: scale(1.04); }
.show__bar { position: absolute; top: 12px; inset-inline: 12px; }
.show__text {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: 64px 14px 16px;
  background: linear-gradient(to top, rgba(19,41,58,.96) 42%, rgba(19,41,58,0));
}
.show__text p { color: var(--dune); font-size: var(--fs-small); line-height: 1.6; margin-top: 2px; }
.board__foot { margin-top: 26px; }

/* tiles rise like a swipe-up to the next episode */
.js .show { opacity: 0; transform: translateY(48px); transition: opacity 600ms var(--ease-out), transform 800ms var(--ease-out); }
.js .show.is-in { opacity: 1; transform: none; }

/* ---------- Episode beats ---------- */
.beats { padding: 80px 0; background: var(--lagoon); }
.beats__grid { display: grid; gap: 40px; }
.beats__copy { display: grid; gap: 16px; align-content: start; }
.beats__copy > p { color: var(--dune); max-width: 34em; }
.timeline {
  --p: 0;
  position: relative; list-style: none; margin: 12px 0 0; padding: 0 30px 0 0;
  display: grid; gap: 22px;
}
/* track + scroll-driven fill (vertical on mobile) */
.timeline::before, .timeline::after {
  content: ""; position: absolute; right: 7px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px;
}
.timeline::before { background: var(--seam); }
.timeline::after { background: var(--red); transform: scaleY(var(--p)); transform-origin: top; }
.timeline li { position: relative; display: grid; }
.timeline li::before {
  content: ""; position: absolute; right: -30px; top: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--lagoon); box-shadow: inset 0 0 0 2px var(--seam);
  transition: background-color 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}
.timeline li.is-hit::before { background: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.timeline strong { font-size: 1.2rem; }
.timeline span { color: var(--dune); }
.beats__media { border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 5; max-height: 640px; }
.beats__media img { width: 100%; height: 118%; object-fit: cover; will-change: transform; }

/* ---------- Subtitles ---------- */
.subs { padding: 80px 0; }
.subs__grid { display: grid; gap: 28px; }
.subs__copy { display: grid; gap: 14px; align-content: start; }
.subs__copy > p { color: var(--dune); max-width: 34em; }
.screen { position: relative; margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--seam); }
.screen img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.screen__sub {
  position: absolute; inset-inline: 0; bottom: 6%;
  padding: 0 16px; min-height: 2.6em;
  display: flex; align-items: flex-end; justify-content: center;
  text-align: center;
  font-size: clamp(1.05rem, .85rem + 1.2vw, 1.7rem); font-weight: 500; line-height: 1.5;
  color: #FFFDF8;
  text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.6);
}
.caret { display: inline-block; width: 2px; height: 1em; margin-inline-start: 3px; background: #FFFDF8; vertical-align: -0.1em; animation: blink 900ms steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Offline ---------- */
.offline { padding: 80px 0; overflow: hidden; }
.offline__grid { display: grid; gap: 30px; align-items: center; }
.offline__media { border-radius: 12px; overflow: hidden; }
.offline__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.offline__copy { display: grid; gap: 16px; justify-items: start; }
.offline__copy > p { color: var(--dune); max-width: 32em; }
.facts { margin: 4px 0 8px; display: grid; gap: 12px; }
.facts div { border-inline-start: 2px solid var(--seam); padding-inline-start: 14px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; color: var(--dune); }

/* RTL: the image glides in from the right, the reading-start side */
.js [data-slide] { transform: translateX(16%); opacity: 0; transition: transform 1100ms var(--ease-out), opacity 700ms var(--ease-out); }
.js [data-slide].is-in { transform: none; opacity: 1; }

/* ---------- Pass ---------- */
.start { padding: 88px 0; }
.ticket { --notch: 18px; position: relative; display: grid; background: var(--lagoon); border-radius: 18px; }
.ticket__main { padding: 30px 22px 26px; display: grid; gap: 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; }
.steps li::before {
  content: counter(step, arabic-indic);
  grid-row: span 2;
  font-family: var(--display); font-size: 2rem; line-height: 1.1; color: var(--dune);
}
.steps strong { font-size: 1.2rem; }
.steps span { color: var(--dune); }
.ticket__stub {
  position: relative; padding: 26px 22px 30px;
  border-top: 2px dashed var(--seam);
  display: grid; gap: 4px; justify-items: start;
}
/* notches mark the tear-off line */
.ticket__stub::before, .ticket__stub::after {
  content: ""; position: absolute; top: calc(var(--notch) / -2 - 1px);
  width: var(--notch); height: var(--notch); border-radius: 50%; background: var(--night);
}
.ticket__stub::before { right: calc(var(--notch) / -2); }
.ticket__stub::after { left: calc(var(--notch) / -2); }
.stub__label { color: var(--dune); font-size: var(--fs-small); }
.stub__price { font-family: var(--display); font-size: 2.1rem; line-height: 1.3; margin-bottom: 12px; }

/* RTL tilt: leans toward the reading start */
.js [data-tilt] { transform: rotate(1.2deg) translateY(30px); opacity: 0; transition: transform 900ms var(--ease-out), opacity 600ms var(--ease-out); }
.js [data-tilt].is-in { transform: none; opacity: 1; }

/* ---------- FAQ ---------- */
.faq { padding: 16px 0 80px; }
.faq__list { margin: 28px 0 0; display: grid; }
.faq__list div { padding: 18px 0; border-top: 1px solid var(--seam); }
.faq__list dt { font-weight: 700; font-size: 1.2rem; }
.faq__list dd { margin: 4px 0 0; color: var(--dune); max-width: 40em; }

/* ---------- Finale ---------- */
.finale { padding: 80px 0 112px; border-top: 1px solid var(--seam); }
.finale__inner { display: grid; gap: 26px; justify-items: start; }
.finale h2 { font-size: var(--fs-display); max-width: 11em; }

/* ---------- Footer ---------- */
.foot { padding: 26px 0 120px; border-top: 1px solid var(--seam); }
.foot__inner { display: grid; gap: 4px; color: var(--dune); font-size: var(--fs-small); justify-items: start; }
.foot__logo { display: block; height: 64px; width: auto; border-radius: 12px; margin-bottom: 12px; }

/* ---------- Mobile dock ---------- */
.dock {
  position: fixed; inset-inline: 12px; z-index: 40;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px; padding-inline-start: 18px;
  background: var(--lagoon); border: 1px solid var(--seam); border-radius: 18px;
  transform: translateY(140%);
  transition: transform 320ms var(--ease-out);
}
.dock.is-shown { transform: none; }
.dock__text { font-weight: 500; color: var(--dune); font-size: 1rem; }
.dock .btn { padding: 11px 18px; min-height: 46px; font-size: 1.05rem; border-radius: 12px; }

/* ---------- Hero entrance ---------- */
.js .hero__media img { opacity: 0; transform: scale(1.08); }
.js .segments, .js .hero__kicker { opacity: 0; }
.js .hero__title .line > span { transform: translateY(110%); }
.js .hero__sub, .js .hero__cta { opacity: 0; transform: translateY(14px); }
.js .topbar { transform: translateY(-100%); }

.is-ready .hero__media img { animation: heroImg 1600ms var(--ease-out) forwards; }
.is-ready .segments { animation: fadeIn 400ms var(--ease-out) 300ms forwards; }
.is-ready .hero__kicker { animation: fadeIn 400ms var(--ease-out) 380ms forwards; }
.is-ready .hero__title .line > span { animation: rise 800ms var(--ease-out) forwards; }
.is-ready .hero__title .line:nth-child(1) > span { animation-delay: 460ms; }
.is-ready .hero__title .line:nth-child(2) > span { animation-delay: 580ms; }
.is-ready .hero__sub { animation: lift 600ms var(--ease-out) 820ms forwards; }
.is-ready .hero__cta { animation: lift 600ms var(--ease-out) 980ms forwards; }
.is-ready .topbar { animation: drop 500ms var(--ease-out) 1100ms forwards; }

@keyframes heroImg { to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes rise { to { transform: translateY(0); } }
@keyframes lift { to { opacity: 1; transform: none; } }
@keyframes drop { to { transform: none; } }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .brand { height: 54px; border-radius: 10px; }
  .hero { align-items: center; }
  .hero__media img { object-position: 30% 50%; }
  .hero::after { background: linear-gradient(to left, rgba(19,41,58,.92) 0%, rgba(19,41,58,.7) 38%, rgba(19,41,58,0) 62%); }
  .hero__content { max-width: 1240px; margin: 0 auto; padding: 120px var(--gutter) 80px; }
  .hero__cta { flex-direction: row; align-items: center; gap: 20px; }

  .board { padding: 116px 0 96px; }
  .board__head { grid-template-columns: 1fr 1fr; max-width: none; align-items: end; gap: 40px; }
  .board__rail {
    max-width: 1240px; margin: 44px auto 0;
    grid-auto-flow: row; grid-template-columns: repeat(5, 1fr);
    overflow: visible; padding: 0 var(--gutter);
  }
  /* staggered heights read like a feed being scrolled */
  .show:nth-child(even) { margin-top: 48px; }

  .beats { padding: 112px 0; }
  .beats__grid { grid-template-columns: 7fr 5fr; gap: 72px; align-items: center; }
  .timeline { padding: 34px 0 0; grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .timeline::before, .timeline::after { top: 7px; bottom: auto; right: 0; left: 0; width: auto; height: 2px; }
  .timeline::after { transform: scaleX(var(--p)); transform-origin: right; }
  .timeline li::before { right: 0; top: -34px; }

  .subs { padding: 112px 0; }
  .subs__grid { grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; }

  .offline { padding: 112px 0 128px; }
  .offline__grid { grid-template-columns: 7fr 5fr; gap: 64px; }

  .start { padding: 120px 0; }
  .ticket { grid-template-columns: 1fr 320px; }
  .ticket__main { padding: 46px 46px 42px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .ticket__stub { border-top: 0; border-inline-start: 2px dashed var(--seam); padding: 46px 40px; align-content: center; }
  .ticket__stub::before, .ticket__stub::after { right: calc(var(--notch) / -2 - 1px); left: auto; }
  .ticket__stub::before { top: calc(var(--notch) / -2); }
  .ticket__stub::after { top: auto; bottom: calc(var(--notch) / -2); }

  .faq__list { grid-template-columns: 1fr 1fr; column-gap: 56px; }

  .finale { padding: 120px 0 136px; }
  .finale h2 { max-width: 15em; }
  .foot { padding-bottom: 40px; }
  .dock { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .js .hero__media img, .js .segments, .js .hero__kicker, .js .hero__sub, .js .hero__cta,
  .js .hero__title .line > span, .js .topbar,
  .js .show, .js [data-slide], .js [data-tilt] {
    opacity: 1 !important; transform: none !important; animation: none !important;
  }
  .caret { display: none; }
  .beats__media img { transform: none !important; height: 100%; }
}
