/* ==========================================================================
   effects.css — the "2040" layer: motion, light and depth.
   Everything stays inside the brand: light first, dark last, orange only for
   the dot. Remove this file and the site still works, just calmer.
   Contents
     1. Ambient background (soft light and an open lattice texture)
     2. Glass surfaces
     3. Living lattice hero
     4. Partner orbit
     5. Card spotlight, button light, header progress
     6. Company structure (styled in future.css, section 18)
   ========================================================================== */

/* ---- 1. Ambient background -------------------------------------------- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; background: var(--white); }
/* Two soft pools of light. They are gradients (already soft), so no blur filter, and they stay
   still: a moving blurred layer this size was the main cause of lag on every page. */
.ambient::before, .ambient::after { content: ""; position: absolute; border-radius: 50%; opacity: 0.85; }
.ambient::before {
  width: 62vmax; height: 62vmax; left: -18vmax; top: -22vmax;
  background: radial-gradient(circle, rgba(185, 218, 241, 0.75), rgba(232, 244, 252, 0) 65%);
}
.ambient::after {
  width: 56vmax; height: 56vmax; right: -20vmax; bottom: -24vmax;
  background: radial-gradient(circle, rgba(175, 233, 245, 0.55), rgba(232, 244, 252, 0) 65%);
}
.ambient__texture {
  position: absolute; inset: 0;
  /* Open lattice: whole white tiles with a light-blue edge (brand "Open" variant). */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M17 4 L30 17 L17 30 L4 17 Z' fill='none' stroke='%23B9DAF1' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 34px 34px;
  opacity: 0.35;
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}

/* The page shows through: white sections become clear, ice sections become translucent. */
body { background: var(--white); }
.section--ice { background: rgba(232, 244, 252, 0.72); }
.page-hero { background: linear-gradient(180deg, rgba(232, 244, 252, 0.9), rgba(255, 255, 255, 0)); position: relative; overflow: hidden; }
.card { background: rgba(255, 255, 255, 0.82); }
.section--ice .card { background: rgba(255, 255, 255, 0.9); }

/* ---- 2. Glass surfaces -------------------------------------------------- */
.glass {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(185, 218, 241, 0.95);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(75, 151, 200, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ---- 3. Living lattice hero ------------------------------------------- */
.hero--live { position: relative; overflow: hidden; background: transparent; padding-block: var(--s8) var(--s6); isolation: isolate; }
.hero__field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hero__veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.85) 34%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.95) 100%);
}
[dir="rtl"] .hero__veil {
  background:
    linear-gradient(270deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.85) 34%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.95) 100%);
}
@media (max-width: 960px) {
  .hero__veil { background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 55%, rgba(255, 255, 255, 0.3) 100%); }
  [dir="rtl"] .hero__veil { background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 55%, rgba(255, 255, 255, 0.3) 100%); }
}
.hero__hud { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); margin-top: var(--s7); }
.hud-chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line);
  font-size: 0.68rem;
}
.hud-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); position: relative; }
.hud-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--sky); }
@media (prefers-reduced-motion: no-preference) { .hud-pulse::after { animation: orbit-pulse 2.4s var(--ease) infinite; } }
@media (max-width: 640px) { .hero__hud .hud-chip:nth-child(2) { display: none; } }

/* Inner page heroes get a quieter living lattice on the far side. */
/* The soft lattice sits on the start side and fades to clear (lattice-field.js), so the far side stays calm. */
.page-hero__field { position: absolute; inset-block: 0; inset-inline-start: 0; width: 70%; height: 100%; z-index: 0; pointer-events: auto; }
.page-hero > .wrap { position: relative; z-index: 1; }
/* On small screens the lattice sits behind the words: lattice-field.js draws its soft tiles fainter there. */
@media (max-width: 860px) { .page-hero__field { width: 100%; } }

/* ---- 4. Partner orbit --------------------------------------------------- */
.section--partners { position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(232, 244, 252, 0.4), rgba(232, 244, 252, 0.95)); }
.orbit { display: grid; gap: var(--s5); }
.orbit__stage { position: relative; height: clamp(360px, 40vw, 500px); touch-action: pan-y; user-select: none; cursor: grab; }
.orbit__stage.is-dragging { cursor: grabbing; }
.orbit__floor {
  /* A holographic lattice floor: the ring floats above it, the floor runs toward you. */
  position: absolute; left: -40%; right: -40%; top: 47%; height: 95%;
  transform-origin: 50% 0;
  transform: perspective(600px) rotateX(74deg);
  -webkit-mask-image: radial-gradient(ellipse 45% 70% at 50% 0%, #000 0%, transparent 80%);
  mask-image: radial-gradient(ellipse 45% 70% at 50% 0%, #000 0%, transparent 80%);
  opacity: 0.9;
  pointer-events: none; /* decoration only: never blocks the buttons below */
}
/* The floor's tiles live on a layer 40px taller than the floor; moving that layer by one tile
   (transform only) makes the floor run toward you with no repainting. */
.orbit__floor { overflow: hidden; }
.orbit__floor::before {
  content: ""; position: absolute; left: 0; right: 0; top: -40px; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M20 5 L35 20 L20 35 L5 20 Z' fill='none' stroke='%2371B5E2' stroke-width='1.4'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}
@media (prefers-reduced-motion: no-preference) { .orbit--live .orbit__floor::before { animation: floor-run 6s linear infinite; } }
@keyframes floor-run { from { transform: translateY(0); } to { transform: translateY(40px); } }
.orbit__rings, .orbit__ring-line { pointer-events: none; }
.orbit__ring-line { position: absolute; border: 1px solid var(--blue-light); border-radius: 50%; }
.orbit__ring-line.r2 { border-style: dashed; border-color: var(--sky); opacity: 0.7; }
.orbit__ring-line.r3 { opacity: 0.5; }
.orbit__ring-line i { position: absolute; left: 50%; top: 100%; transform: translate(-50%, -50%); width: 7px; height: 7px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px rgba(113, 181, 226, 0.18); }
.orbit__links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.orbit__links line { stroke: var(--sky); stroke-width: 1.4; stroke-dasharray: 3 7; }
@media (prefers-reduced-motion: no-preference) { .orbit__links line { animation: flow 1.4s linear infinite; } }
.orbit__core { position: absolute; z-index: 50; width: clamp(92px, 11vw, 128px); aspect-ratio: 1; transform: translate(-50%, -50%); }
.orbit__core img { position: relative; width: 100%; height: 100%; border-radius: 22%; }
/* White clear space around the brand mark (the lattice never sits behind the logo), then a soft sky glow. */
.orbit__halo { position: absolute; inset: -34%; border-radius: 50%; background: radial-gradient(circle, #FFFFFF 0 56%, rgba(113, 181, 226, 0.32) 58%, rgba(113, 181, 226, 0) 72%); }
@media (prefers-reduced-motion: no-preference) { .orbit__halo { animation: halo 3.6s ease-in-out infinite; } }
@keyframes halo { 50% { transform: scale(1.08); } }
.orbit__list { list-style: none; margin: 0; padding: 0; }
.orbit--live .orbit__item { position: absolute; left: 0; top: 0; will-change: transform; }
.orbit__card {
  display: grid; place-items: center; width: clamp(170px, 19vw, 230px); height: clamp(96px, 10vw, 124px); padding: var(--s4) var(--s5);
  background: rgba(255, 255, 255, 0.86); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 18px 40px rgba(75, 151, 200, 0.18);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
@media (max-width: 640px) {
  .orbit__stage { height: 340px; }
  .orbit__card { width: 136px; height: 80px; padding: var(--s3) var(--s4); border-radius: 18px; }
  .orbit__card img { max-height: 44px; }
}
.orbit__card img { max-height: 62px; width: auto; max-width: 100%; object-fit: contain; pointer-events: none; }
.orbit__item.is-front .orbit__card { border-color: var(--sky); box-shadow: 0 24px 56px rgba(75, 151, 200, 0.28), 0 0 0 4px rgba(113, 181, 226, 0.16); }
.orbit__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); }
.orbit__caption { display: grid; gap: 0.15rem; max-width: 60ch; }
.orbit__now { font-size: 1.2rem; }
.orbit__note { color: var(--muted); font-size: var(--fs-small); }
.orbit__controls { display: flex; gap: var(--s2); }
.orbit__btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); display: grid; place-items: center; cursor: pointer; }
.orbit__btn:hover { border-color: var(--sky); background: var(--ice); }
.orbit__btn[data-orbit-prev] .icon { transform: scaleX(-1); }
[dir="rtl"] .orbit__btn[data-orbit-prev] .icon { transform: none; }
[dir="rtl"] .orbit__btn[data-orbit-next] .icon { transform: scaleX(-1); }
.orbit__btn[aria-pressed="true"] { background: var(--sky); border-color: var(--sky); }
/* Still version (reduced motion or no JavaScript) */
.orbit:not(.orbit--live) .orbit__stage { height: auto; cursor: default; }
.orbit:not(.orbit--live) .orbit__floor, .orbit:not(.orbit--live) .orbit__rings, .orbit:not(.orbit--live) .orbit__links, .orbit:not(.orbit--live) .orbit__core, .orbit:not(.orbit--live) .orbit__controls { display: none; }
.orbit:not(.orbit--live) .orbit__list { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s4); }
.orbit:not(.orbit--live) .orbit__caption { display: none; }

/* ---- 5. Card spotlight, button light, header progress ------------------- */
.card { position: relative; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(113, 181, 226, 0.16), transparent 60%);
  transition: opacity var(--fast) var(--ease);
}
.card:hover::after { opacity: 1; }
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg); pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) { .btn:hover::after { animation: sheen 900ms var(--ease); } }
@keyframes sheen { to { left: 130%; } }
.scroll-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: var(--sky); }
[dir="rtl"] .scroll-progress { transform-origin: 100% 50%; }

/* ---- 6. Company structure: styled in future.css, section 18 (the Qaly system) ---- */

/* Logos in inner page heroes sit on a white plate, so the lattice never touches their clear space. */
.page-hero__logo { background: var(--white); padding: clamp(18px, 3vw, 32px); border-radius: 28px; border: 1px solid var(--line); box-sizing: content-box; position: relative; z-index: 1; }
