/* Shamel intro (see splash.js). Hidden unless splash.js runs, so no-JS visitors never see a stuck overlay.
   Plain CSS only: the site's CSP forbids inline styles, so per-tile angles and colours are classes here. */
#splash { display: none; }
.has-splash #splash { position: fixed; inset: 0; z-index: 9999; display: block; overflow: hidden; color: #eef0fb;
  background: radial-gradient(70% 60% at 50% 42%, #16207a 0%, #0b1040 48%, #05081c 100%);
  font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif; }
.has-splash body { overflow: hidden; }

#sp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sp-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 70% at 50% 45%, transparent 55%, rgb(3 5 18 / 75%) 100%); }

/* scene: tilts with the pointer (--tx/--ty from splash.js) */
.sp-scene { --tx: 0deg; --ty: 0deg; position: absolute; left: 50%; top: 42%; width: 340px; height: 340px; margin: -170px 0 0 -170px; perspective: 1000px; }
.sp-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--tx)) rotateY(var(--ty)); }

/* gyroscope rings */
.sp-gyro { position: absolute; left: 50%; top: 50%; width: 300px; height: 300px; margin: -150px 0 0 -150px; border-radius: 50%; transform-style: preserve-3d;
  border: 1px solid rgb(232 182 74 / 30%); box-shadow: 0 0 30px rgb(108 128 255 / 18%), inset 0 0 30px rgb(108 128 255 / 14%); }
.sp-g1 { animation: sp-g1 16s linear infinite; }
.sp-g2 { width: 236px; height: 236px; margin: -118px 0 0 -118px; border-color: rgb(140 156 255 / 32%); animation: sp-g2 22s linear infinite; }
@keyframes sp-g1 { from { transform: rotateX(72deg) rotateY(14deg) rotateZ(0deg); } to { transform: rotateX(72deg) rotateY(14deg) rotateZ(360deg); } }
@keyframes sp-g2 { from { transform: rotateX(58deg) rotateY(-38deg) rotateZ(360deg); } to { transform: rotateX(58deg) rotateY(-38deg) rotateZ(0deg); } }

/* channel orbit */
.sp-orbit { --r: 160px; position: absolute; inset: 0; transform-style: preserve-3d; animation: sp-orbit 14s linear infinite; }
@keyframes sp-orbit { from { transform: rotateX(68deg) rotateZ(0deg); } to { transform: rotateX(68deg) rotateZ(360deg); } }
.sp-arm { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; transform: rotateZ(var(--a)) translateX(var(--r)); }
.sp-tile { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--c); box-shadow: 0 0 0 1px rgb(255 255 255 / 22%), inset 0 1px 0 rgb(255 255 255 / 25%); /* no outer glow: 3D boxes clip it to a rectangle */
  animation: sp-face 14s linear infinite, sp-in 1.4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: 0s, var(--d); }
@keyframes sp-face { from { transform: rotateZ(calc(var(--a) * -1)) rotateX(-68deg); } to { transform: rotateZ(calc(var(--a) * -1 - 360deg)) rotateX(-68deg); } }
@keyframes sp-in { from { opacity: 0; } to { opacity: 1; } }
.sp-tile svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sp-a1 { --a: 0deg; --c: #22b35e; --d: .2s; } .sp-a2 { --a: 51.4deg; --c: #e1306c; --d: .35s; } .sp-a3 { --a: 102.8deg; --c: #0a7cff; --d: .5s; }
.sp-a4 { --a: 154.2deg; --c: #d99100; --d: .65s; } .sp-a5 { --a: 205.6deg; --c: #0f9f80; --d: .8s; } .sp-a6 { --a: 257deg; --c: #229ed9; --d: .95s; }
.sp-a7 { --a: 308.4deg; --c: #6c80ff; --d: 1.1s; }

/* core mark */
/* The box is large enough to hold the glow: content outside a 3D-transformed box is clipped to a rectangle. */
.sp-core { position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; margin: -160px 0 0 -160px; display: grid; place-items: center; pointer-events: none;
  animation: sp-arrive 1.6s cubic-bezier(.2, .8, .2, 1) both, sp-float 6s ease-in-out 1.6s infinite; }
@keyframes sp-arrive { from { opacity: 0; transform: translateZ(-420px) rotateY(-70deg) scale(.6); } to { opacity: 1; transform: translateZ(40px) rotateY(-14deg); } }
@keyframes sp-float { 0%, 100% { transform: translateZ(40px) rotateY(-14deg) rotateX(6deg); } 50% { transform: translateZ(40px) rotateY(14deg) rotateX(-5deg); } }
.sp-core svg { position: relative; display: block; width: 112px; height: 112px; border-radius: 30px; box-shadow: 0 0 0 1px rgb(232 182 74 / 55%); }
.sp-core::before { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgb(108 128 255 / 55%) 0%, rgb(108 128 255 / 18%) 30%, rgb(232 182 74 / 10%) 46%, transparent 68%); }
.sp-pulse { position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; margin: -85px 0 0 -85px; border-radius: 50%; border: 1.5px solid rgb(232 182 74 / 50%); animation: sp-pulse 3.2s ease-out infinite; }
@keyframes sp-pulse { from { transform: scale(.55); opacity: .85; } to { transform: scale(1.6); opacity: 0; } }

/* counter */
.sp-hud { position: absolute; left: 0; right: 0; bottom: max(10vh, 64px); display: grid; justify-items: center; gap: 14px; animation: sp-hud 1.2s ease .6s both; }
@keyframes sp-hud { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.sp-num { font-size: 64px; font-weight: 300; line-height: 1; letter-spacing: .12em; font-variant-numeric: tabular-nums; direction: ltr;
  background: linear-gradient(180deg, #ffffff 10%, #c9d0ff 60%, #e8b64a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sp-bar { width: min(320px, 70vw); height: 1px; background: rgb(255 255 255 / 14%); overflow: hidden; direction: ltr; }
.sp-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6c80ff, #e8b64a); box-shadow: 0 0 10px #e8b64a;
  transform-origin: left center; transform: scaleX(var(--p, 0)); }
.sp-word { display: flex; gap: 14px; align-items: center; font-size: 12px; font-weight: 500; letter-spacing: .5em; text-transform: uppercase; color: #a9b0d6; }
.sp-word i { width: 26px; height: 1px; background: rgb(232 182 74 / 60%); }
.sp-skip { position: absolute; top: max(18px, env(safe-area-inset-top)); right: 20px; padding: 8px 14px; border-radius: 99px; border: 1px solid rgb(255 255 255 / 16%);
  background: rgb(255 255 255 / 4%); color: #c9d0ff; font: inherit; font-size: 12px; letter-spacing: .12em; cursor: pointer; opacity: .7; transition: opacity .2s, background .2s;
  animation: sp-hud 1s ease 1.2s both; }
.sp-skip:hover, .sp-skip:focus-visible { opacity: 1; background: rgb(255 255 255 / 10%); outline: none; }

/* exit: channels spiral into the core, a gilt bloom flares, then the site emerges */
.sp-bloom { position: absolute; left: 50%; top: 42%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff6dc 0%, #e8b64a 30%, rgb(108 128 255 / 60%) 60%, transparent 72%); }
#splash.exit .sp-arm { transition: transform .7s cubic-bezier(.6, 0, .4, 1); transform: rotateZ(calc(var(--a) + 220deg)) translateX(0); }
#splash.exit .sp-tile { transition: opacity .6s ease .2s; opacity: 0; }
#splash.exit .sp-core { animation: none; transition: transform .7s cubic-bezier(.6, 0, .4, 1); transform: translateZ(80px) scale(1.25); }
#splash.exit .sp-gyro, #splash.exit .sp-hud, #splash.exit .sp-skip, #splash.exit .sp-pulse { transition: opacity .5s ease; opacity: 0; }
#splash.bloom .sp-bloom { animation: sp-bloom .9s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes sp-bloom { 0% { opacity: 0; transform: scale(1); } 35% { opacity: 1; } 100% { opacity: 1; transform: scale(400); } }
#splash.done { transition: opacity .9s ease, filter .9s ease, transform .9s ease; opacity: 0; filter: blur(6px); transform: scale(1.06); }

@media (max-width: 480px) {
  .sp-scene { width: 280px; height: 280px; margin: -140px 0 0 -140px; top: 40%; }
  .sp-gyro { width: 250px; height: 250px; margin: -125px 0 0 -125px; }
  .sp-g2 { width: 196px; height: 196px; margin: -98px 0 0 -98px; }
  .sp-num { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-g1, .sp-g2, .sp-orbit, .sp-tile, .sp-core, .sp-pulse, .sp-hud, .sp-skip { animation: none; }
  .sp-orbit { transform: rotateX(68deg); }
  .sp-tile { transform: rotateZ(calc(var(--a) * -1)) rotateX(-68deg); }
  .sp-core { transform: translateZ(40px); }
  #sp-canvas, .sp-bloom { display: none; }
  #splash.done { transform: none; filter: none; transition: opacity .4s ease; }
}
