/* W17-08 — Home hero variant C «الافتتاح السينمائي» (internal preview: index.html?hero=c). B stays the public default.
   A dark sapphire film stage: one decisive two-line headline, then ONE flagship visual — four proof stations strung on a
   single cobalt signal wire that ends in a warm arrival — with three visitor-chosen illustrative stories.
   The entrance moves light, camera and wire; it never takes the copy's opacity below 1, so text and actions read at every
   moment. Ambient motion (>5s) starts only after the entrance with JS present, and is pausable (WCAG 2.2.2).
   Compositions: wide (≥1181px) · tablet (721–1180px) · mobile (≤720px, vertical signal) · narrow (≤420px). */

/* ---------- Variant switch: the original A/B DOM stays in place and is hidden only while C is active ---------- */
.hero:not([data-concept="c"]) > .cine { display: none; }
.hero[data-concept="c"] { grid-template-rows: 1fr; padding-block: 0; background: #040a1c; }
.hero[data-concept="c"] > .hero__backdrop,
.hero[data-concept="c"] > .hero__layout,
.hero[data-concept="c"] > .hero-proof,
.hero[data-concept="c"] > .hero__foot { display: none !important; }

.cine {
  --cine-ink: #040a1c;
  --cine-cobalt: #5b8cff;
  --cine-cobalt-2: #8cb8ff;
  --cine-warm: #ffbe6b;
  --wire-h: 72px;
  position: relative; isolation: isolate; overflow: clip;
  display: grid; align-content: center; align-self: stretch;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(1.25rem, .5rem + 1.8vw, 2.25rem);
  background-color: var(--cine-ink);
  color: var(--text-1);
}

/* ---------- The set: key light from above, haze on the floor, one warm practical light low on the far side ---------- */
.cine__set { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cine__set i { position: absolute; inset: 0; }
.cine__beam {
  background:
    radial-gradient(64% 58% at 80% -10%, rgb(56 106 255 / .42), rgb(40 80 210 / .12) 46%, transparent 74%),
    radial-gradient(40% 36% at 30% 0%, rgb(120 160 255 / .08), transparent 80%);
}
.cine__haze { background: radial-gradient(90% 38% at 50% 82%, rgb(60 110 255 / .15), transparent 72%), linear-gradient(180deg, transparent 58%, rgb(2 5 14 / .72)); }
.cine__warm { background: radial-gradient(36% 30% at 6% 96%, rgb(255 170 80 / .14), transparent 72%); }
.cine__grain {
  background-image: repeating-linear-gradient(90deg, rgb(150 180 255 / .035) 0 1px, transparent 1px 120px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 25%, #000 70%, transparent);
}

.cine__frame { display: grid; gap: clamp(1.1rem, .4rem + 1.7vw, 2.25rem); }

/* ---------- Slate: kicker + the preview's own controls ---------- */
.cine__slate { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; flex-wrap: wrap; }
.cine__kicker { display: inline-flex; align-items: center; gap: .55rem; margin: 0; color: var(--blue-200); font-size: .9375rem; font-weight: 500; }
.cine__tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cine__back, .cine__tool {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; min-width: 40px; padding: 0 .9rem;
  border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font-size: .875rem; line-height: 1.4; text-decoration: none; white-space: nowrap;
  transition: color var(--dur-1), border-color var(--dur-1), background var(--dur-1);
}
.cine__back:hover, .cine__tool:hover { color: var(--text-1); border-color: var(--line-3); background: rgb(255 255 255 / .03); }
.cine__back:focus-visible, .cine__tool:focus-visible { border-radius: 999px; }
.cine__tool svg { width: 16px; height: 16px; flex: none; }

/* ---------- Headline + pitch ---------- */
.cine__head { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: end; gap: 1.25rem clamp(2rem, 4vw, 4.5rem); }
.cine__title {
  position: relative; margin: 0;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2.3rem, 1rem + 3.6vw, 4.5rem);
  line-height: 1.25; letter-spacing: 0; color: #f6f8ff;
}
.cine__title > span { display: block; }
.cine__title em { position: relative; font-style: normal; color: var(--cine-warm); white-space: nowrap; }
.cine__title em::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .02em; height: .06em; border-radius: 1em;
  background: linear-gradient(270deg, var(--cine-warm), rgb(255 190 107 / .08)); transform-origin: right;
}
/* a light sweep crosses the headline once during the entrance (decoration only; the text stays fully opaque).
   The box never moves or grows past the h1 — only its background travels, so it adds no scroll width. */
.cine__title::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 46%, rgb(200 220 255 / .22) 50%, transparent 54%) 0% 0 / 300% 100% no-repeat;
}
.cine__pitch { display: grid; gap: 1.1rem; padding-bottom: .45rem; }
.cine__lead { margin: 0; max-width: 30em; color: var(--text-2); font-size: var(--fs-lead); line-height: 1.85; }
.cine__ctas { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Flagship: the film — story bar, signal wire, four stations, truth line ---------- */
.cine__film {
  position: relative; display: grid; gap: .9rem;
  padding: clamp(1rem, .6rem + 1vw, 1.5rem) clamp(1rem, .5rem + 1.4vw, 1.75rem) clamp(.9rem, .6rem + .8vw, 1.25rem);
  border-radius: 26px;
  background: linear-gradient(180deg, rgb(14 26 62 / .72), rgb(6 12 32 / .62));
  box-shadow: 0 0 0 1px rgb(140 175 255 / .14) inset, 0 40px 90px -50px rgb(0 0 0 / .95), 0 0 120px -60px rgb(70 120 255 / .6);
}
/* viewfinder corner marks */
.cine__film::before, .cine__film::after { content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none; border: 0 solid rgb(255 190 107 / .55); }
.cine__film::before { top: 10px; right: 10px; border-width: 1.5px 1.5px 0 0; border-top-right-radius: 10px; }
.cine__film::after { bottom: 10px; left: 10px; border-width: 0 0 1.5px 1.5px; border-bottom-left-radius: 10px; }

.cine__bar { display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.25rem; flex-wrap: wrap; }
.cine__story { margin: 0; font-family: var(--font-display); font-size: clamp(1rem, .92rem + .3vw, 1.15rem); font-weight: 600; line-height: 1.6; color: var(--text-1); }
.cine__modes { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgb(4 10 28 / .7); box-shadow: 0 0 0 1px var(--line-2) inset; }
.cine__mode {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 40px; padding: 0 1.05rem; border-radius: 999px;
  color: var(--text-2); font-size: .9375rem; font-weight: 500; white-space: nowrap;
  transition: background var(--dur-1), color var(--dur-1), box-shadow var(--dur-1);
}
.cine__mode::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); transition: background var(--dur-1), box-shadow var(--dur-1); }
.cine__mode:hover { color: var(--text-1); }
.cine__mode[aria-pressed="true"] { background: var(--surface-3); color: #fff; box-shadow: 0 0 0 1px rgb(140 184 255 / .55) inset, 0 8px 22px -12px rgb(60 120 255 / .9); }
.cine__mode[aria-pressed="true"]::before { background: var(--cine-warm); box-shadow: 0 0 8px 1px rgb(255 190 107 / .8); }
.cine__mode:focus-visible { border-radius: 999px; outline-offset: 2px; }

.cine__stage { position: relative; transform-origin: 50% 0; }
.cine__wire { position: absolute; top: 0; left: 0; width: 100%; height: var(--wire-h); overflow: visible; pointer-events: none; }
.cine__wire path { fill: none; stroke-linecap: round; }
.cine__wire-glow { stroke: rgb(91 140 255 / .2); stroke-width: 9; stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.cine__wire-line { stroke: url(#cine-g); stroke-width: 2; stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.cine__comet, .cine__comet-halo { stroke-dasharray: .05 2; stroke-dashoffset: .05; opacity: 0; }
.cine__comet { stroke: #fff4e2; stroke-width: 4; }
.cine__comet-halo { stroke: rgb(255 180 90 / .35); stroke-width: 14; }

.cine__stations { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.cine-st {
  position: relative; display: grid; align-content: start; gap: .2rem;
  padding: var(--wire-h) clamp(.75rem, .35rem + .9vw, 1.35rem) .2rem;
  border-inline-start: 1px solid rgb(140 175 255 / .12);
}
.cine-st:first-child { border-inline-start-color: transparent; }
.cine-st__dot {
  position: absolute; top: calc(var(--wire-h) / 2); left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: #0b1736; border: 2px solid var(--cine-cobalt-2);
  box-shadow: 0 0 0 5px rgb(8 16 42), 0 0 16px 2px rgb(91 140 255 / .6);
}
.cine-st:last-child .cine-st__dot { border-color: var(--cine-warm); box-shadow: 0 0 0 5px rgb(8 16 42), 0 0 18px 3px rgb(255 170 80 / .55); }
.cine-st__who { display: flex; align-items: baseline; gap: .55rem; margin: .3rem 0 0; color: var(--blue-200); font-size: .875rem; font-weight: 500; line-height: 1.6; }
.cine-st__n { font-family: var(--font-num); font-size: .875rem; font-weight: 600; letter-spacing: .06em; color: var(--cine-cobalt-2); }
.cine-st:last-child .cine-st__n { color: var(--cine-warm); }
.cine-st__t { margin: 0; font-family: var(--font-display); font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem); font-weight: 600; line-height: 1.45; color: #fff; }
.cine-st__d { margin: 0; color: var(--text-2); font-size: .9375rem; line-height: 1.75; }

.cine__truth {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem; margin: 0; padding-top: .8rem;
  border-top: 1px dashed rgb(140 175 255 / .16); color: var(--text-2); font-size: .875rem; line-height: 1.75;
}
.cine__tag { flex: none; padding: 0 .55rem; border-radius: 6px; border: 1px solid rgb(255 190 107 / .45); color: var(--cine-warm); font-size: .875rem; font-weight: 600; line-height: 1.7; }

/* ======================================================
   Motion — transforms, light and the wire only. Copy is never faded.
   .is-rolling: the 3–4s one-shot opening (set by markup, so it plays before JS; JS ends it and replays it)
   .is-swapping: a direct story choice · ambient: comet loop + breathing key light, only once the opening is over
   ====================================================== */
@media (prefers-reduced-motion: no-preference) {
  .cine.is-rolling .cine__beam { animation: cine-light 2.4s var(--ease-out) both; }
  .cine.is-rolling .cine__haze { animation: cine-fade 1.8s .2s var(--ease-out) both; }
  .cine.is-rolling .cine__warm { animation: cine-fade 1.4s 2.3s var(--ease-out) both; }
  .cine.is-rolling .cine__slate { animation: cine-drift .9s var(--ease-out) both; }
  .cine.is-rolling .cine__title > span { animation: cine-rise 1.05s .1s var(--ease-out) both; }
  .cine.is-rolling .cine__title > span + span { animation-delay: .26s; }
  .cine.is-rolling .cine__title em::after { animation: cine-under .8s 1.25s var(--ease-out) both; }
  .cine.is-rolling .cine__title::after { animation: cine-sweep 1.5s .95s var(--ease-io) both; }
  .cine.is-rolling .cine__pitch { animation: cine-drift .9s .45s var(--ease-out) both; }
  .cine.is-rolling .cine__film { animation: cine-dolly 1.7s .35s var(--ease-out) both; }
  .cine.is-rolling .cine__wire-line, .cine.is-rolling .cine__wire-glow { animation: cine-draw 1.5s 1s var(--ease-io) both; }
  .cine.is-rolling .cine-st { animation: cine-drift .8s .95s var(--ease-out) both; }
  .cine.is-rolling .cine-st:nth-child(2) { animation-delay: 1.15s; }
  .cine.is-rolling .cine-st:nth-child(3) { animation-delay: 1.35s; }
  .cine.is-rolling .cine-st:nth-child(4) { animation-delay: 1.55s; }
  .cine.is-rolling .cine-st__dot { animation: cine-pop .5s 1s var(--ease-out) both; }
  .cine.is-rolling .cine-st:nth-child(2) .cine-st__dot { animation-delay: 1.4s; }
  .cine.is-rolling .cine-st:nth-child(3) .cine-st__dot { animation-delay: 1.8s; }
  .cine.is-rolling .cine-st:nth-child(4) .cine-st__dot { animation: cine-pop .5s 2.2s var(--ease-out) both, cine-arrive 1s 3.3s var(--ease-out) both; }
  .cine.is-rolling .cine__comet, .cine.is-rolling .cine__comet-halo { animation: cine-comet 1.3s 2.2s var(--ease-io) both; }
  .cine.is-rolling .cine__truth { animation: cine-drift .8s 1.7s var(--ease-out) both; }

  .cine:not(.is-rolling) .cine__comet, .cine:not(.is-rolling) .cine__comet-halo { animation: cine-comet-loop 7s 1s var(--ease-io) infinite; }
  .cine:not(.is-rolling) .cine__beam { animation: cine-breathe 10s ease-in-out infinite alternate; }
  .cine:not(.is-rolling) .cine-st__dot { animation: cine-blink 7s 1s infinite; }
  .cine:not(.is-rolling) .cine-st:nth-child(2) .cine-st__dot { animation-delay: 1.7s; }
  .cine:not(.is-rolling) .cine-st:nth-child(3) .cine-st__dot { animation-delay: 2.4s; }
  .cine:not(.is-rolling) .cine-st:nth-child(4) .cine-st__dot { animation: cine-blink-warm 7s 3.1s infinite; }

  .cine.is-swapping .cine-st { animation: cine-swap .6s var(--ease-out) both; }
  .cine.is-swapping .cine-st:nth-child(2) { animation-delay: 60ms; }
  .cine.is-swapping .cine-st:nth-child(3) { animation-delay: 120ms; }
  .cine.is-swapping .cine-st:nth-child(4) { animation-delay: 180ms; }
  .cine.is-swapping .cine__story, .cine.is-swapping [data-cine-truth] { animation: cine-swap .5s var(--ease-out) both; }
  .cine.is-swapping .cine__wire-line, .cine.is-swapping .cine__wire-glow { animation: cine-draw .8s var(--ease-io) both; }
  .cine.is-swapping .cine__comet, .cine.is-swapping .cine__comet-halo { animation: cine-comet .9s .2s var(--ease-io) both; }

  /* visitor pause (WCAG 2.2.2), off-screen or hidden tab: everything holds where it is */
  .cine.is-still *, .cine.is-offstage *,
  .cine.is-still *::before, .cine.is-offstage *::before,
  .cine.is-still *::after, .cine.is-offstage *::after { animation-play-state: paused !important; }
}
@keyframes cine-light { from { opacity: 0; transform: scale(1.15) translateY(-4%); } to { opacity: 1; transform: none; } }
@keyframes cine-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cine-breathe { from { opacity: 1; } to { opacity: .72; } }
@keyframes cine-drift { from { transform: translateY(12px); } to { transform: none; } }
@keyframes cine-rise { from { transform: translateY(.32em) scale(.985); } to { transform: none; } }
@keyframes cine-under { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cine-sweep { 0% { opacity: 0; background-position: 0% 0; } 15%, 85% { opacity: 1; } 100% { opacity: 0; background-position: 100% 0; } }
@keyframes cine-dolly { from { transform: perspective(1400px) translateY(34px) rotateX(16deg) scale(.965); } to { transform: none; } }
@keyframes cine-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cine-pop { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
@keyframes cine-arrive {
  40% { box-shadow: 0 0 0 5px rgb(8 16 42), 0 0 0 12px rgb(255 190 107 / .3), 0 0 30px 8px rgb(255 170 80 / .75); scale: 1.2; }
}
@keyframes cine-comet { 0% { stroke-dashoffset: .05; opacity: 0; } 8%, 90% { opacity: 1; } 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes cine-comet-loop { 0% { stroke-dashoffset: .05; opacity: 0; } 3% { opacity: 1; } 30% { stroke-dashoffset: -1; opacity: 1; } 33%, 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes cine-blink { 0%, 16%, 100% { scale: 1; } 5% { scale: 1.3; box-shadow: 0 0 0 5px rgb(8 16 42), 0 0 24px 6px rgb(110 160 255 / .9); } }
@keyframes cine-blink-warm { 0%, 16%, 100% { scale: 1; } 5% { scale: 1.3; box-shadow: 0 0 0 5px rgb(8 16 42), 0 0 26px 7px rgb(255 170 80 / .85); } }
@keyframes cine-swap { from { transform: translateX(14px); } to { transform: none; } }
@keyframes cine-rail { from { transform: scaleY(0); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .cine *, .cine *::before, .cine *::after { animation: none !important; transition: none !important; }
  .cine__comet, .cine__comet-halo { display: none; }
}

/* ======================================================
   Tablet (721–1180px): headline over the pitch; the wire and four stations stay in one row
   ====================================================== */
@media (max-width: 1180px) {
  .cine__head { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 1.1rem; }
  .cine__title { font-size: clamp(2.2rem, 1.1rem + 3.4vw, 3.6rem); }
  .cine__lead { max-width: 40em; }
}

/* ======================================================
   Mobile (≤720px): its own composition — the signal turns vertical and runs down the start edge,
   the three stories become a full-width segmented control, the actions stack.
   ====================================================== */
@media (max-width: 720px) {
  .cine { --wire-h: 0px; align-content: start; padding-block: 1rem 1.25rem; }
  .cine__frame { gap: 1.1rem; }
  .cine__slate { align-items: flex-start; flex-direction: column; gap: .55rem; }
  .cine__kicker { font-size: .875rem; }
  .cine__title { font-size: clamp(1.75rem, 1rem + 4.2vw, 2.4rem); line-height: 1.32; }
  .cine__pitch { gap: .9rem; padding-bottom: 0; }
  .cine__lead { font-size: 1rem; line-height: 1.75; }
  .cine__ctas { gap: .6rem; }
  .cine__ctas .btn { flex: 1 1 100%; }

  .cine__film { gap: .75rem; padding: 1rem .9rem .9rem; border-radius: 20px; }
  .cine__bar { flex-direction: column; align-items: stretch; gap: .6rem; }
  .cine__modes { display: flex; }
  .cine__mode { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 .45rem; gap: .35rem; }
  .cine__wire { display: none; }

  .cine__stations { grid-template-columns: minmax(0, 1fr); }
  .cine__stations::before {
    content: ""; position: absolute; inset-inline-start: 12px; top: 1.1rem; bottom: 1.4rem; width: 2px; border-radius: 2px;
    background: linear-gradient(180deg, var(--cine-cobalt-2), var(--cine-cobalt) 72%, var(--cine-warm)); transform-origin: top;
  }
  .cine-st { padding: .6rem 0; padding-inline-start: 2.4rem; border-inline-start: 0; border-top: 1px solid rgb(140 175 255 / .1); }
  .cine-st:first-child { border-top: 0; }
  .cine-st__dot { top: calc(.6rem + 5px); left: auto; inset-inline-start: 6px; margin: 0; }
  .cine-st__who { margin: 0; }
  .cine-st__t { font-size: 1.0625rem; }
  .cine-st__d { line-height: 1.7; }
}
@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  .cine.is-rolling .cine__stations::before { animation: cine-rail 1.4s 1s var(--ease-io) both; }
  .cine.is-rolling .cine__film { animation-name: cine-drift; }
}

/* Narrow (≤420px): the replay / pause controls keep their names for assistive tech but show only their icons */
@media (max-width: 420px) {
  .cine__tools { width: 100%; }
  .cine__back { flex: 1 1 auto; }
  .cine__tool { padding: 0; width: 40px; }
  .cine__tool-l { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .cine__mode { padding: .2rem .3rem; font-size: .875rem; line-height: 1.25; white-space: normal; text-align: center; }
  .cine__mode::before { display: none; }
  .cine__film::before, .cine__film::after { display: none; }
}

@media print {
  .cine * { animation: none !important; }
  .cine__tools, .cine__modes { display: none !important; }
}
