/* Intro: Respark identity (navy #072331, spark gold #fcb856) as a short cinematic opener.
   Easing and page exit follow the Shadad dashboard (cubic-bezier(.2,.8,.2,1), rise, pageOut, progress). */
:root {
  --navy: #072331;
  --deep: #041219;
  --gold: #fcb856;
  --gold-2: #ffd796;
  --teal: #5fd4c4;
  --ink: #eef4f6;
  --muted: #9fb3ba;
  --glass: rgb(255 255 255 / .055);
  --glass-line: rgb(255 255 255 / .11);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--deep); color: var(--ink); overflow-x: hidden;
  font-family: "IBM Plex Sans Arabic", "Cairo", Tahoma, Arial, sans-serif; font-size: 16px; line-height: 1.7;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

/* ---------------------------------------------------------------- background */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(1200px 800px at 70% 20%, #0b3346 0%, var(--navy) 45%, var(--deep) 100%); }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; animation: fade 2s var(--ease) .2s forwards; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; will-change: transform; }
.orb-a { width: 520px; height: 520px; background: rgb(252 184 86 / .2); top: -160px; left: -120px; animation: drift-a 18s ease-in-out infinite alternate; }
.orb-b { width: 460px; height: 460px; background: rgb(95 212 196 / .18); bottom: -180px; right: -80px; animation: drift-b 22s ease-in-out infinite alternate; }
.orb-c { width: 300px; height: 300px; background: rgb(252 184 86 / .16); top: 45%; left: 38%; animation: drift-a 26s ease-in-out infinite alternate-reverse; }
.grid { position: absolute; inset: -2px; background-image: linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 60% 40%, #000 0%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 0%, transparent 70%); animation: grid-move 30s linear infinite; }
@keyframes drift-a { to { transform: translate(140px, 90px) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-120px, -70px) scale(1.1); } }
@keyframes grid-move { to { background-position: 56px 56px; } }
@keyframes fade { to { opacity: 1; } }

/* ---------------------------------------------------------------- layout */
.stage { position: relative; z-index: 1; width: min(1240px, 100% - 40px); margin: 0 auto; padding: 26px 0 150px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); grid-template-areas: "top top" "copy device"; column-gap: clamp(24px, 4vw, 64px); align-items: center; min-height: 100vh; }
.presents { grid-area: top; display: flex; align-items: center; gap: 12px; align-self: start; }
.presents img { width: 132px; height: auto; clip-path: inset(0 0 0 100%); animation: wipe 1s var(--ease) .1s forwards; }
.presents span { font-size: 14px; color: var(--muted); letter-spacing: .02em; opacity: 0; animation: rise .55s var(--ease) .6s both; }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }

.copy { grid-area: copy; }
.title-row { display: flex; align-items: center; gap: clamp(14px, 2vw, 22px); }
.mark { position: relative; flex: none; width: clamp(60px, 7vw, 92px); aspect-ratio: 1; animation: pop .9s var(--spring) .35s both; }
.mark img { width: 100%; height: 100%; border-radius: 24%; box-shadow: 0 18px 40px -12px rgb(31 111 235 / .6); }
.mark-ring { position: absolute; inset: -9px; border-radius: 30%; border: 2px solid transparent; background: conic-gradient(from 0deg, var(--gold), transparent 30%, transparent 60%, var(--gold)) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 6s linear infinite, fade .8s ease 1s both; opacity: 0; }
@keyframes pop { from { opacity: 0; transform: scale(.3) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.title { margin: 0; white-space: nowrap; font-family: "Cairo", sans-serif; font-weight: 900; line-height: 1.05; font-size: clamp(56px, 9vw, 128px); letter-spacing: -.01em; }
.title span { display: inline-block; padding: 0 .04em .12em; background: linear-gradient(100deg, #fff 0%, #fff 40%, var(--gold-2) 50%, #fff 60%, #fff 100%); background-size: 250% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  clip-path: inset(0 0 0 100%); filter: blur(14px); animation: title-in 1.1s var(--ease) .5s forwards, shimmer 2.4s ease-in-out 1.8s 2; }
@keyframes title-in { to { clip-path: inset(0 0 -20% 0); filter: blur(0); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.tag { margin: 14px 0 22px; font-size: clamp(18px, 2vw, 25px); font-weight: 600; color: #dbe7eb; max-width: 30em; }
.tag .w { display: inline-block; opacity: 0; animation: word .6s var(--ease) both; animation-delay: calc(1.3s + var(--i) * 70ms); }
@keyframes word { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

.chips { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(8px); animation: rise .55s var(--ease) both; animation-delay: calc(3s + var(--i) * 90ms); }
.chips li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-inline-end: 8px; vertical-align: middle; box-shadow: 0 0 10px var(--gold); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { padding: 14px 16px; border-radius: 18px; background: linear-gradient(160deg, rgb(255 255 255 / .08), rgb(255 255 255 / .02)); border: 1px solid var(--glass-line); animation: rise .55s var(--ease) both; animation-delay: calc(4s + var(--i) * 110ms); }
.stat b { display: block; font-family: "Cairo", sans-serif; font-size: clamp(30px, 3.4vw, 44px); font-weight: 900; line-height: 1.1; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgb(252 184 86 / .35); }
.stat span { font-size: 13.5px; color: var(--muted); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; perspective: 900px; }
.pillars article { padding: 14px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: blur(10px); transform-origin: top center; animation: flip .8s var(--ease) both; animation-delay: calc(5.6s + var(--i) * 160ms); }
.pillars .k { font-family: "Cairo", sans-serif; font-weight: 800; color: var(--gold); font-size: 15px; }
.pillars p { margin: 4px 0 0; font-size: 14px; color: #c6d5da; line-height: 1.65; }
@keyframes flip { from { opacity: 0; transform: rotateX(-70deg) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- device */
.device-wrap { grid-area: device; position: relative; display: grid; place-items: center; perspective: 1400px; min-height: 620px; }
.halo { position: absolute; width: 440px; height: 440px; border-radius: 50%; background: radial-gradient(circle, rgb(252 184 86 / .35), transparent 62%); animation: halo 4s ease-in-out 1.6s infinite alternate, fade 1.2s ease .9s both; opacity: 0; }
.halo::after { content: ""; position: absolute; inset: 40px; border-radius: 50%; border: 1px solid rgb(252 184 86 / .35); animation: ripple 3.2s ease-out 2s infinite; }
@keyframes halo { to { transform: scale(1.12); } }
@keyframes ripple { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
.device { position: relative; width: 290px; height: 590px; border-radius: 46px; padding: 12px; background: linear-gradient(145deg, #2a3d47, #0d1a20 40%, #1d2c34); box-shadow: 0 50px 90px -30px rgb(0 0 0 / .8), inset 0 0 0 2px rgb(255 255 255 / .08), 0 0 0 1px rgb(0 0 0 / .6);
  transform-style: preserve-3d; animation: device-in 1.4s var(--ease) .8s both, float 6s ease-in-out 2.3s infinite; }
@keyframes device-in { from { opacity: 0; transform: translateY(120px) rotateY(-35deg) rotateX(18deg) scale(.85); } to { opacity: 1; transform: rotateY(-10deg) rotateX(4deg); } }
@keyframes float { 0%, 100% { transform: rotateY(-10deg) rotateX(4deg) translateY(0); } 50% { transform: rotateY(-6deg) rotateX(2deg) translateY(-12px); } }
.notch { position: absolute; top: 20px; left: 50%; width: 92px; height: 24px; margin-left: -46px; border-radius: 20px; background: #05090b; }
.screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; background: #f3f5f8; color: #1b2533; display: flex; flex-direction: column; font-size: 11px; }
.s-hdr { display: flex; align-items: center; gap: 6px; margin: 44px 10px 8px; padding: 7px 10px; border-radius: 10px; background: #fff; color: #7a8797; box-shadow: 0 1px 3px rgb(16 24 40 / .08); }
.s-cats { display: flex; gap: 5px; padding: 0 10px 8px; overflow: hidden; }
.s-cats i { font-style: normal; white-space: nowrap; padding: 4px 9px; border-radius: 99px; background: #fff; color: #4c5a6b; font-weight: 600; }
.s-cats i.on { background: #1f6feb; color: #fff; }
.s-feed { position: relative; flex: 1; overflow: hidden; mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 6%, #000 94%, transparent); }
.s-track { padding: 0 10px; animation: feed 26s linear 2.6s infinite; }
@keyframes feed { to { transform: translateY(-50%); } }
.s-ad { display: grid; grid-template-columns: 1fr 64px; gap: 8px; background: #fff; border-radius: 12px; padding: 8px; margin-bottom: 7px; box-shadow: 0 1px 2px rgb(16 24 40 / .06); }
.s-ad img { width: 64px; height: 64px; border-radius: 9px; object-fit: cover; background: #eef2f7; }
.s-ad b { display: block; font-size: 11.5px; line-height: 1.45; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s-ad small { display: block; color: #7a8797; font-size: 10px; margin-top: 3px; }
.s-ad em { font-style: normal; color: #12b886; font-weight: 800; font-size: 11.5px; }
.s-ad .pin { display: inline-block; font-size: 9px; background: #fff3d6; color: #9a6400; padding: 0 6px; border-radius: 6px; margin-inline-start: 5px; }
.s-nav { display: flex; justify-content: space-around; align-items: center; height: 46px; background: #fff; border-top: 1px solid #e6eaf0; }
.s-nav i { width: 16px; height: 16px; border-radius: 5px; background: #c9d2dd; }
.s-nav b { width: 34px; height: 34px; border-radius: 11px; background: #1f6feb; color: #fff; display: grid; place-items: center; font-size: 20px; margin-top: -16px; }

.pops { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.pops li { position: absolute; display: flex; align-items: center; gap: 8px; max-width: 250px; font-size: 13px; font-weight: 600; padding: 9px 13px; border-radius: 14px; background: rgb(10 30 40 / .72); border: 1px solid rgb(252 184 86 / .3); backdrop-filter: blur(12px); box-shadow: 0 18px 40px -16px rgb(0 0 0 / .8); color: #fff; opacity: 0; }
.pops li b { flex: none; width: 24px; height: 24px; border-radius: 8px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-size: 12px; }
.pops .p1 { top: 14%; right: -6%; animation: pop-in .7s var(--spring) 3.4s forwards, bob 5s ease-in-out 4.1s infinite; }
.pops .p2 { top: 40%; left: -12%; animation: pop-in .7s var(--spring) 5s forwards, bob 6s ease-in-out 5.7s infinite; }
.pops .p3 { bottom: 24%; right: -10%; animation: pop-in .7s var(--spring) 6.6s forwards, bob 5.5s ease-in-out 7.3s infinite; }
.pops .p4 { bottom: 6%; left: -2%; animation: pop-in .7s var(--spring) 8.2s forwards, bob 6.5s ease-in-out 8.9s infinite; }
@keyframes pop-in { from { opacity: 0; transform: translateY(16px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: none; } 50% { transform: translateY(-8px); } }

/* ---------------------------------------------------------------- countdown HUD */
.hud { position: fixed; z-index: 5; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: min(780px, 100% - 24px); transform: translateX(-50%);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 12px 14px 12px 12px; border-radius: 24px;
  background: rgb(6 24 33 / .78); border: 1px solid rgb(255 255 255 / .12); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / .8), 0 0 0 1px rgb(252 184 86 / .08); animation: hud-in .8s var(--ease) .5s both; }
@keyframes hud-in { from { opacity: 0; transform: translate(-50%, 40px); } to { opacity: 1; transform: translate(-50%, 0); } }
.hud-ring { position: relative; width: 60px; height: 60px; }
.hud-ring svg { width: 100%; height: 100%; transform: rotate(-90deg) scaleY(-1); }
.hud-ring circle { fill: none; stroke-width: 4.5; }
.r-bg { stroke: rgb(255 255 255 / .1); }
.r-fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px rgb(252 184 86 / .7)); }
.hud-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Cairo", sans-serif; font-weight: 900; font-size: 24px; font-variant-numeric: tabular-nums; }
.hud-ring b.tick { animation: tick .5s var(--ease); }
@keyframes tick { from { opacity: 0; transform: translateY(-10px) scale(1.3); } to { opacity: 1; transform: none; } }
.hud.final .hud-ring b { color: var(--gold); }
.hud.final .hud-ring { animation: beat 1s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.08); } }
.hud-txt p { margin: 0 0 8px; font-size: 14.5px; color: #cfdde2; }
.hud-txt p b { color: #fff; }
.segs { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; }
.segs i { height: 5px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 8px rgb(252 184 86 / .55); transition: background .4s ease, box-shadow .4s ease, transform .4s var(--ease); }
.segs i.off { background: rgb(255 255 255 / .12); box-shadow: none; transform: scaleY(.6); }
.hud-act { display: flex; gap: 8px; align-items: center; }
.go { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; font-weight: 800; font-size: 15px; color: var(--navy); background: linear-gradient(135deg, var(--gold-2), var(--gold)); padding: 12px 18px; border-radius: 15px; box-shadow: 0 10px 26px -10px rgb(252 184 86 / .9); transition: transform .28s var(--ease), box-shadow .28s ease; }
.go::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .6) 50%, transparent 70%); transform: translateX(120%); animation: sheen 3.2s ease-in-out 2.4s infinite; }
@keyframes sheen { 60%, 100% { transform: translateX(-120%); } }
.go:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgb(252 184 86 / 1); }
.go span { transition: transform .28s var(--ease); }
.go:hover span { transform: translateX(-4px); }
.pause { width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgb(255 255 255 / .16); background: rgb(255 255 255 / .06); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pause svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pause .ic-play { display: none; fill: currentColor; }
.pause[aria-pressed="true"] .ic-pause { display: none; }
.pause[aria-pressed="true"] .ic-play { display: block; }
.hud.paused .r-fg, .hud.paused .segs { opacity: .45; }

.credit .credit-note { display: inline-block; margin-top: 4px; font-size: 11px; opacity: .8; }
.credit { position: relative; z-index: 1; margin: 0; padding: 0 20px 110px; text-align: center; font-size: 12px; color: #6f8890; }

/* ---------------------------------------------------------------- exit (Shadad) */
.stage.leaving, body.leaving .hud, body.leaving .credit { animation: pageOut .15s ease-in both; }
@keyframes pageOut { to { opacity: 0; transform: translateY(6px); } }
body.leaving .hud { animation-name: hudOut; }
@keyframes hudOut { to { opacity: 0; transform: translate(-50%, 6px); } }
#pageProgress { position: fixed; top: 0; right: 0; left: 0; height: 3px; background: var(--gold); box-shadow: 0 0 12px var(--gold); transform-origin: right center; transform: scaleX(0); opacity: 0; z-index: 99; pointer-events: none; }
#pageProgress.run { animation: prog .6s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes prog { 0% { opacity: 1; transform: scaleX(0); } 70% { opacity: 1; transform: scaleX(.85); } 100% { opacity: 0; transform: scaleX(1); } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .stage { grid-template-columns: minmax(0, 1fr) 300px; }
  .device { width: 250px; height: 510px; }
  .pillars { grid-template-columns: 1fr; }
  .pops li { max-width: 210px; font-size: 12px; }
}
@media (max-width: 820px) {
  .stage { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding-top: 18px; gap: 0; }
  .copy { display: contents; }
  .presents { order: 0; margin-bottom: 18px; } .title-row { order: 1; } .tag { order: 2; } .chips { order: 3; margin-bottom: 8px; }
  .device-wrap { order: 4; margin-bottom: 8px; } .stats { order: 5; } .pillars { order: 6; }
  .device-wrap { min-height: 560px; }
  .pops .p1 { right: 2%; } .pops .p2 { left: 0; } .pops .p3 { right: 0; } .pops .p4 { left: 4%; }
}
@media (max-width: 560px) {
  .stage { width: calc(100% - 28px); padding-bottom: 130px; overflow-x: clip; }
  html { overflow-x: clip; }
  .presents img { width: 108px; }
  .title { font-size: clamp(44px, 13vw, 64px); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tag { font-size: 18px; margin: 10px 0 16px; }
  .chips li { font-size: 12.5px; padding: 6px 11px; }
  .device-wrap { min-height: 500px; }
  .device { width: 228px; height: 466px; border-radius: 38px; padding: 10px; }
  .screen { border-radius: 30px; }
  .halo { width: 320px; height: 320px; }
  .pops li { max-width: 170px; font-size: 11.5px; padding: 7px 10px; }
  .pops .p1 { right: -2%; top: 8%; } .pops .p2 { left: -2%; top: 36%; } .pops .p3 { right: -2%; bottom: 22%; } .pops .p4 { left: -1%; bottom: 4%; }
  .hud { grid-template-columns: auto 1fr; gap: 10px 12px; padding: 10px 12px; border-radius: 20px; }
  .hud-ring { width: 52px; height: 52px; }
  .hud-ring b { font-size: 21px; }
  .hud-txt p { font-size: 13px; margin-bottom: 6px; }
  .hud-act { grid-column: 1 / -1; }
  .go { flex: 1; justify-content: center; padding: 11px 14px; }
  .credit { padding-bottom: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .s-track { animation: none !important; }
  .presents img, .title span { clip-path: none; filter: none; }
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
