/* «عشر ثوان» landing motion.
   Everything that moves lives under html.motion, which boot.js sets only when the visitor
   has not asked for reduced motion. Without it the page is the calm, static version. */

/* ---------- static additions (always on) ---------- */
/* the hero spans the full width so the crystal dust reaches both edges without any measuring */
.hero { max-width: none; padding-left: 0; padding-right: 0; }
.hero > .film-frame { width: calc(100% - 32px); max-width: 1048px; margin-left: auto; margin-right: auto; }
.hero-stage { position: relative; padding: 0 16px; }
.hero-stage > :not(.motes) { position: relative; z-index: 1; }
.motes { display: none; position: absolute; top: -18px; left: 0; width: 100%; height: calc(100% + 40px); pointer-events: none; z-index: 0; }
.film-frame .comet { display: none; }
.scene { position: relative; display: block; margin: 0 auto; max-width: 100%; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); }
.scene.on .art { visibility: hidden; }
.band-art { position: relative; max-width: 1400px; margin: 6px auto 0; }
.journey .band-art .art-band { margin: 0 auto; }
.streak { display: none; }
.fazaa .triad h3 .w { position: relative; display: inline-block; }
.perks { margin-top: 12px; color: var(--ink); font: 800 16.5px/1.7 Tajawal, sans-serif; }
.perks span { white-space: nowrap; }
.perks span + span::before { content: "•"; margin: 0 10px; color: var(--gold); }
.note-teacher { margin-top: 4px; font-size: 13.5px; }
.note-teacher a { color: var(--dim); text-decoration-color: rgba(124,196,255,.35); text-underline-offset: 5px; }
.note-teacher a:hover, .note-teacher a:focus-visible { color: var(--sky); }

/* ---------- scroll reveals ---------- */
html.motion :is(.band .kicker, .band h2, .band .wrap > p, .two > div > p, .stat, .triad > div, .roles > .role, .levels > li, .steps > .step, .two-lists > div, .lines > div, .band .actions, .scene, .band-art, .art:not(.wrapped), .explainer, .foot > *) {
  opacity: 0; transform: translate3d(0, 26px, 0);
  transition: opacity .9s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s);
}
html.motion :is(.band .kicker, .band h2, .band .wrap > p, .two > div > p, .stat, .triad > div, .roles > .role, .levels > li, .steps > .step, .two-lists > div, .lines > div, .band .actions, .scene, .band-art, .art:not(.wrapped), .explainer, .foot > *).in {
  opacity: 1; transform: none;
}
/* the kicker's underline is drawn after the word appears */
html.motion .kicker { background-position: right bottom; background-size: 0% 2px;
  transition: opacity .9s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s), background-size 1.4s var(--ease) calc(var(--d, 0s) + .3s); }
html.motion .kicker.in { background-size: 100% 2px; }
/* section hairlines draw out from the middle */
html.motion :is(.band, .foot)::before { transform: scaleX(0); transition: transform 1.8s var(--ease); }
html.motion :is(.band, .foot).in::before { transform: scaleX(1); }

/* ---------- the film: a light runs around the frame once every ten seconds ----------
   Four thin edges, each with a small light that slides along it in turn: compositor-only
   transforms on tiny layers, so it costs next to nothing on a phone. */
html.motion .film-frame .comet { display: block; position: absolute; inset: 0; z-index: 2; pointer-events: none; transition: opacity .8s var(--ease); }
.film-frame .comet i { position: absolute; overflow: hidden; }
.comet .c-t { top: 0; left: 14px; right: 14px; height: 7px; }
.comet .c-b { bottom: 0; left: 14px; right: 14px; height: 7px; }
.comet .c-r { right: 0; top: 14px; bottom: 14px; width: 7px; }
.comet .c-l { left: 0; top: 14px; bottom: 14px; width: 7px; }
.comet i::before { content: ""; position: absolute; border-radius: 2px; box-shadow: 0 0 8px rgba(45,212,191,.85);
  animation-duration: 10s; animation-timing-function: linear; animation-iteration-count: infinite; animation-play-state: paused; }
.comet .c-t::before { top: 0; left: 0; width: 34%; height: 1.5px; background: linear-gradient(90deg, rgba(124,196,255,0), rgba(45,212,191,.85) 80%, #fff); animation-name: comet-t; }
.comet .c-r::before { top: 0; right: 0; width: 1.5px; height: 34%; background: linear-gradient(180deg, rgba(124,196,255,0), rgba(45,212,191,.85) 80%, #fff); animation-name: comet-r; }
.comet .c-b::before { bottom: 0; left: 0; width: 34%; height: 1.5px; background: linear-gradient(270deg, rgba(124,196,255,0), rgba(45,212,191,.85) 80%, #fff); animation-name: comet-b; }
.comet .c-l::before { top: 0; left: 0; width: 1.5px; height: 34%; background: linear-gradient(0deg, rgba(124,196,255,0), rgba(45,212,191,.85) 80%, #fff); animation-name: comet-l; }
html.motion .film-frame.live .comet i::before { animation-play-state: running; }
html.motion .film-frame.playing .comet { opacity: 0; }
/* a 16:9 frame: the long edges take 32% of the lap each, the short ones 18% */
@keyframes comet-t { 0% { transform: translateX(-100%); } 32%, 100% { transform: translateX(295%); } }
@keyframes comet-r { 0%, 32% { transform: translateY(-100%); } 50%, 100% { transform: translateY(295%); } }
@keyframes comet-b { 0%, 50% { transform: translateX(295%); } 82%, 100% { transform: translateX(-100%); } }
@keyframes comet-l { 0%, 82% { transform: translateY(295%); } 100% { transform: translateY(-100%); } }

/* ---------- hero stage ---------- */
html.motion .motes { display: block; }
html.motion .btn-main { position: relative; overflow: hidden; isolation: isolate; }
html.motion .btn-main::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.7) 50%, transparent 100%);
  transform: translateX(270%) skewX(-18deg); animation: glint 7s ease-in-out 2s infinite;
}
@keyframes glint { 0%, 74% { transform: translateX(270%) skewX(-18deg); } 100% { transform: translateX(-170%) skewX(-18deg); } }

/* ---------- كلمة • صحبة • بلاغ: a ring of light on the floor passes the word along to the next ---------- */
html.motion .fazaa .triad h3 .w::before, html.motion .fazaa .triad h3 .w::after {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 86%; width: 2.6em; height: .74em; margin: -.37em 0 0 -1.3em;
  border-radius: 50%; border: 1.5px solid rgba(45,212,191,.85); box-shadow: 0 0 12px rgba(45,212,191,.35);
  opacity: 0; transform: scale(.25); pointer-events: none;
  animation: ripple 4.8s var(--ease) var(--rd, 0s) infinite; animation-play-state: paused;
}
html.motion .fazaa .triad h3 .w::after { animation-delay: calc(var(--rd, 0s) + .45s); }
html.motion .fazaa .triad > div:nth-child(2) { --rd: 1.2s; }
html.motion .fazaa .triad > div:nth-child(3) { --rd: 2.4s; }
html.motion .fazaa .triad.live > div.in h3 .w::before, html.motion .fazaa .triad.live > div.in h3 .w::after { animation-play-state: running; }
@keyframes ripple { 0% { opacity: 0; transform: scale(.25); } 10% { opacity: .8; } 58%, 100% { opacity: 0; transform: scale(1.45); } }

/* ---------- the three roles breathe ---------- */
html.motion .roles .role .orb { animation: breathe 3.6s ease-in-out infinite; animation-play-state: paused; }
html.motion .roles .role:nth-child(2) .orb { animation-delay: -1.2s; }
html.motion .roles .role:nth-child(3) .orb { animation-delay: -2.4s; }
html.motion .roles.live .role .orb { animation-play-state: running; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 10px var(--c); transform: scale(1); } 50% { box-shadow: 0 0 26px var(--c), 0 0 3px rgba(255,255,255,.6) inset; transform: scale(1.07); } }

/* ---------- journey: a light walks the case from discovery to closing ---------- */
html.motion .streak { display: block; position: absolute; left: 0; right: 0; top: 41%; height: 12.5%; pointer-events: none; }
.streak i {
  position: absolute; top: 0; bottom: 0; left: 79%; width: 14%; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(160,236,255,.6) 36%, rgba(45,212,191,0) 100%);
  animation: streak 7s cubic-bezier(.45, .05, .35, 1) infinite; animation-play-state: paused;
}
html.motion .band-art.live .streak i { animation-play-state: running; }
@keyframes streak { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 76% { transform: translateX(-515%); opacity: 1; } 86%, 100% { transform: translateX(-515%); opacity: 0; } }

@media print {
  html.motion :is(.band .kicker, .band h2, .band .wrap > p, .two > div > p, .stat, .triad > div, .roles > .role, .levels > li, .steps > .step, .two-lists > div, .lines > div, .band .actions, .scene, .band-art, .art:not(.wrapped), .explainer, .foot > *) { opacity: 1 !important; transform: none !important; }
  .motes, .comet, .streak { display: none !important; }
}
