/* ============================================================
   ELARIS — FX FOUNDATION  (fx.css)
   Loaded on every page AFTER main.css and nav.css.
   Holds: tokens, skeleton loader, scroll-reveal states, background
   patterns, dust canvas, shared section parts (eyebrow, heading,
   buttons, cards). Page sections live in their own css files.
   Prefix rule: everything new starts with  x-
   ============================================================ */

:root {
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --x-navy:  #00296b;
  --x-ink:   #04152f;
  --x-ink-2: #0a2350;
  --x-gold:  #fdc500;
  --x-gold-d:#e0a800;
  --x-teal:  #0b8a96;
  --x-mint:  #6fe0d4;
  --x-paper: #f6f8fc;
  --x-text:  #46556f;
  --x-line:  rgba(0, 41, 107, .12);
  --x-line-d:rgba(255, 255, 255, .12);

  --x-pad:   clamp(20px, 4.5vw, 56px);
  --x-max:   1280px;
  --x-sec:   clamp(72px, 9vw, 128px);
  --x-gap:   clamp(14px, 2vw, 22px);
  --x-r:     22px;
  --x-nav:   80px;               /* NOT --nav-h: that one is scoped to the header */
  --x-ease:  cubic-bezier(.22, 1, .36, 1);
}
@media (max-width: 1024px) { :root { --x-nav: 70px; } }

/* `overflow-x:hidden` on html/body breaks position:sticky. `clip` does not. */
html, body { overflow-x: clip; max-width: 100%; }
body { font-family: var(--font-body); }

.x-skip {
  position: fixed; left: 12px; top: -80px; z-index: 10001;
  background: var(--x-gold); color: var(--x-navy); font-weight: 700;
  padding: 10px 16px; border-radius: 10px; transition: top .2s;
}
.x-skip:focus { top: 12px; }

/* thin scroll progress under the navbar */
.x-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 1100; pointer-events: none; }
.x-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--x-gold), var(--x-mint)); transform: scaleX(0); transform-origin: 0 50%; }

/* ============================================================
   SKELETON (page loader)
   ============================================================ */
.x-skel {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: var(--x-paper);
  overflow: hidden;
  transition: opacity .5s ease, visibility .5s ease;
  animation: x-skel-fail .01s 7s forwards;          /* fail-safe: never traps the page */
}
.js .x-skel { display: block; }
html.x-ready .x-skel { opacity: 0; visibility: hidden; }
@keyframes x-skel-fail { to { opacity: 0; visibility: hidden; } }

.x-sk {
  display: block; border-radius: 10px;
  background: linear-gradient(100deg, #e6ecf6 30%, #f6f9fe 50%, #e6ecf6 70%);
  background-size: 220% 100%;
  animation: x-shimmer 1.35s linear infinite;
}
@keyframes x-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.x-skel__bar { height: var(--x-nav); display: flex; align-items: center; gap: 20px; padding-inline: var(--x-pad); background: #fff; border-bottom: 1px solid var(--x-line); }
.x-skel__hero { max-width: var(--x-max); margin: clamp(18px, 4vw, 48px) auto 0; padding-inline: var(--x-pad); display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; min-height: 440px; }
.x-skel__art { display: grid; place-items: center; }
.x-skel__orb { width: min(360px, 80%); aspect-ratio: 1; border-radius: 50%; }
.x-skel__row { max-width: var(--x-max); margin: 28px auto 0; padding-inline: var(--x-pad); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.x-skel__row .x-sk { height: 150px; border-radius: 22px; }
@media (max-width: 820px) {
  .x-skel__hero { grid-template-columns: 1fr; min-height: 0; gap: 22px; }
  .x-skel__art { order: -1; }
  .x-skel__orb { width: 210px; }
  .x-skel__row { grid-template-columns: 1fr; }
  .x-skel__row .x-sk { height: 92px; }
  .x-skel__bar span:nth-child(2) { display: none; }
}

/* image boxes: shimmer sits BEHIND the image, so a broken script can never hide a photo */
.x-imgbox { position: relative; overflow: hidden; background: linear-gradient(100deg, #e6ecf6 30%, #f6f9fe 50%, #e6ecf6 70%) 0 0 / 220% 100%; animation: x-shimmer 1.35s linear infinite; }
.x-imgbox.is-loaded { animation: none; background: #e6ecf6; }
.x-imgbox img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.x-imgbox.is-loaded img { opacity: 1; }
html:not(.x-ready) .x-imgbox img { opacity: 1; }          /* before JS marks them, still visible */

/* ============================================================
   SCROLL REVEAL STATES  (engine = fx.js)
   Hidden only while html.x-anim exists. Removed after 3s if motion never starts.
   ============================================================ */
.x-anim [data-a] { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .x-anim [data-a] { opacity: 1 !important; } }

/* ============================================================
   BACKGROUND PATTERNS + DUST
   Usage: <div class="x-bg x-bg--grid"></div>  inside a section with position:relative
   ============================================================ */
.x-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; --pc: rgba(0, 41, 107, .08); }
.is-dark .x-bg, .x-bg.is-dark { --pc: rgba(255, 255, 255, .075); }

.x-bg--grid {
  background-image: linear-gradient(var(--pc) 1px, transparent 1px), linear-gradient(90deg, var(--pc) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
}
.x-bg--dots {
  background-image: radial-gradient(circle, var(--pc) 1.3px, transparent 1.7px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 25%, #000 75%, transparent);
}
.x-bg--lines {
  background-image: repeating-linear-gradient(135deg, var(--pc) 0 1px, transparent 1px 16px);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 80% 20%, #000, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 80% at 80% 20%, #000, transparent 75%);
}
.x-bg--cross {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 17v10M17 22h10' stroke='%2300296b' stroke-opacity='.16' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 20%, transparent 100%);
          mask-image: radial-gradient(ellipse 85% 75% at 50% 50%, #000 20%, transparent 100%);
}
.is-dark .x-bg--cross, .x-bg--cross.is-dark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M22 17v10M17 22h10' stroke='%23ffffff' stroke-opacity='.14' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}
.x-bg--rings {
  background: repeating-radial-gradient(circle at 85% 15%, transparent 0 46px, var(--pc) 46px 47px);
  -webkit-mask-image: radial-gradient(circle at 85% 15%, #000, transparent 60%);
          mask-image: radial-gradient(circle at 85% 15%, #000, transparent 60%);
}
.x-bg--glow {
  background:
    radial-gradient(520px 320px at 12% 8%, rgba(253, 197, 0, .16), transparent 70%),
    radial-gradient(560px 360px at 92% 88%, rgba(11, 138, 150, .14), transparent 70%);
}
.is-dark .x-bg--glow {
  background:
    radial-gradient(560px 340px at 10% 0%, rgba(111, 224, 212, .16), transparent 70%),
    radial-gradient(520px 320px at 95% 100%, rgba(253, 197, 0, .12), transparent 70%);
}
.x-dust { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ============================================================
   SHARED SECTION PARTS
   ============================================================ */
.x-wrap { width: 100%; max-width: var(--x-max); margin-inline: auto; padding-inline: var(--x-pad); position: relative; z-index: 1; }
.x-sec { position: relative; isolation: isolate; padding-block: var(--x-sec); overflow: clip; color: var(--x-text); }
.x-sec.is-dark { background: radial-gradient(1200px 600px at 20% 0%, #0b2f66 0%, transparent 60%), linear-gradient(160deg, var(--x-ink-2) 0%, var(--x-ink) 100%); color: rgba(255, 255, 255, .78); }
.x-sec.is-paper { background: var(--x-paper); }

.x-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.x-head.is-center { margin-inline: auto; text-align: center; }
.x-head.is-center .x-eyebrow { justify-content: center; }
.x-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font: 800 12px/1 var(--font-body); letter-spacing: .17em; text-transform: uppercase; color: var(--x-teal);
  margin-bottom: 18px;
}
.x-eyebrow::before { content: ""; width: 34px; height: 2px; border-radius: 2px; background: var(--x-gold); }
.is-dark .x-eyebrow { color: var(--x-gold); }

.x-h2 {
  font: 800 clamp(2.1rem, 4.6vw, 3.6rem)/1.04 var(--font-heading);
  letter-spacing: -.035em; color: var(--x-ink); margin: 0;
}
.x-h2 em { font-style: normal; color: var(--x-teal); }
.is-dark .x-h2 { color: #fff; }
.is-dark .x-h2 em { color: var(--x-mint); }

.x-lead { margin-top: 20px; font-size: clamp(15px, 1.25vw, 17px); line-height: 1.75; max-width: 58ch; }
.x-head.is-center .x-lead { margin-inline: auto; }

/* Buttons */
.x-btn {
  --b-bg: var(--x-navy); --b-fg: #fff; --b-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 13px 26px; border-radius: 999px;
  font: 700 14.5px/1 var(--font-heading); letter-spacing: .01em;
  background: var(--b-bg); color: var(--b-fg); border: 1.5px solid var(--b-bd);
  cursor: pointer; transition: translate .35s var(--x-ease), box-shadow .35s var(--x-ease), background .25s, color .25s, border-color .25s;
}
.x-btn i { transition: translate .35s var(--x-ease); font-size: 12px; }
.x-btn:hover { translate: 0 -3px; box-shadow: 0 16px 30px -12px rgba(0, 41, 107, .45); }
.x-btn:hover i.fa-arrow-right { translate: 4px 0; }
.x-btn:focus-visible, .x-faq__q:focus-visible, .x-field:focus-visible { outline: 3px solid var(--x-gold); outline-offset: 3px; }
.x-btn--gold  { --b-bg: var(--x-gold); --b-fg: var(--x-navy); }
.x-btn--gold:hover { --b-bg: #ffd633; box-shadow: 0 16px 30px -12px rgba(224, 168, 0, .6); }
.x-btn--ghost { --b-bg: transparent; --b-fg: var(--x-navy); --b-bd: var(--x-line); }
.x-btn--ghost:hover { --b-bd: var(--x-navy); box-shadow: none; }
.is-dark .x-btn--ghost { --b-fg: #fff; --b-bd: rgba(255, 255, 255, .28); }
.is-dark .x-btn--ghost:hover { --b-bd: #fff; }
.x-btn--light { --b-bg: #fff; --b-fg: var(--x-navy); }
.x-btn--wa    { --b-bg: #1fb855; --b-fg: #fff; }
.x-btn--wa:hover { box-shadow: 0 16px 30px -12px rgba(31, 184, 85, .6); }

/* Cards (hover uses `translate`, which never fights GSAP's `transform`) */
.x-card {
  background: #fff; border: 1px solid var(--x-line); border-radius: var(--x-r);
  padding: clamp(18px, 2.2vw, 28px);
  box-shadow: 0 1px 2px rgba(0, 41, 107, .04), 0 14px 32px -22px rgba(0, 41, 107, .25);
  transition: translate .4s var(--x-ease), box-shadow .4s var(--x-ease), border-color .3s;
}
.x-card:hover { translate: 0 -5px; box-shadow: 0 24px 44px -24px rgba(0, 41, 107, .38); border-color: rgba(0, 41, 107, .22); }

/* soft pastel tints (numbered cards in the reference designs) */
.t-mint { background: linear-gradient(150deg, #f0fbfb, #e2f4f5); --tc: #0b8a96; }
.t-lav  { background: linear-gradient(150deg, #f5f6ff, #e8ebff); --tc: #4a5fd1; }
.t-vio  { background: linear-gradient(150deg, #fbf4ff, #f1e5fb); --tc: #8a56b8; }
.t-sun  { background: linear-gradient(150deg, #fffaea, #fff0c2); --tc: #b98400; }
.t-rose { background: linear-gradient(150deg, #fff5f6, #ffe6ea); --tc: #d0364f; }

.x-ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: #fff; color: var(--tc, var(--x-teal)); font-size: 18px;
  box-shadow: 0 6px 16px -8px rgba(0, 41, 107, .3);
}

/* Floating chips */
.x-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font: 700 12.5px/1 var(--font-body); background: rgba(0, 41, 107, .06); color: var(--x-navy); }
.is-dark .x-chip { background: rgba(255, 255, 255, .1); color: #fff; }

@media (max-width: 820px) { .x-btn { width: 100%; } .x-btn--inline { width: auto; } }

@media (prefers-reduced-motion: reduce) {
  .x-sk, .x-imgbox { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

/* Closed mobile menu drawer leaked its shadow onto the right edge of every page (blurry strip) */
.eln__drawer { box-shadow: none; }
.eln[data-open="true"] ~ .eln__drawer { box-shadow: -10px 0 40px rgba(0, 0, 0, .2); }

/* ============================================================
   ACCORDION (.x-faq) — shared by home, about and program pages
   ============================================================ */
.x-faq { display: grid; gap: 12px; }
.x-faq__item { background: #fff; border: 1px solid var(--x-line); border-radius: 20px; transition: border-color .3s, box-shadow .3s; }
.x-faq__item.is-open { border-color: rgba(0, 41, 107, .28); box-shadow: 0 22px 40px -28px rgba(0, 41, 107, .5); }
.x-faq__q { width: 100%; display: flex; align-items: center; gap: 16px; padding: 18px 20px; text-align: left; color: var(--x-ink); font: 700 15.5px/1.4 var(--font-heading); }
.x-faq__no { font: 800 12px/1 var(--font-heading); color: var(--x-teal); letter-spacing: .08em; min-width: 22px; }
.x-faq__t { flex: 1; }
.x-faq__chev { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--x-paper); border: 1px solid var(--x-line); transition: rotate .4s var(--x-ease), background .3s, border-color .3s; }
.x-faq__item.is-open .x-faq__chev { rotate: 180deg; background: var(--x-gold); border-color: var(--x-gold); color: var(--x-navy); }
.x-faq__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--x-ease); }
.x-faq__item.is-open .x-faq__a { grid-template-rows: 1fr; }
.x-faq__a > div { overflow: hidden; }
.x-faq__a p { padding: 0 20px 20px 58px; font-size: 15px; line-height: 1.75; color: var(--x-text); }
