/* XAG shared theme tokens, v1. ONE source for both sites.
   Source of truth: xaglobally-lgtm/xag-education-website/xag-theme.css (this file).
   xaglobal.app keeps a byte-identical copy in css/xag-theme.css, made by `node scripts/sync-theme.mjs <path to this file>`.
   Both repos have a test that compares the file with xag-theme.sha256, so a one-sided edit fails CI.
   This file only DEFINES variables and OPT-IN classes (xag-glass, xag-glow, xag-bgsec): loading it changes nothing by itself.
   Dark by default. Motion (glow animation) runs only when the visitor allows motion; otherwise the glow is static. */

:root {
  /* background layers: deep navy, never black */
  --xag-bg-0: #071433;
  --xag-bg-1: #0b1f4d;
  --xag-bg-2: #10306b;
  --xag-bg-3: #143270;
  --xag-horizon: radial-gradient(120% 70% at 50% 100%, rgba(47, 128, 255, 0.34), rgba(26, 163, 255, 0.14) 38%, rgba(7, 20, 51, 0) 72%);
  --xag-page: linear-gradient(180deg, var(--xag-bg-0) 0%, var(--xag-bg-1) 55%, var(--xag-bg-2) 100%);

  /* blues and ink */
  --xag-blue: #1356d6;
  --xag-blue-bright: #2f80ff;
  --xag-sky: #1aa3ff;
  --xag-cyan: #4fd8ff;
  --xag-ice: #eaf3ff;
  --xag-ink: #eaf3ff;
  --xag-ink-2: rgba(234, 243, 255, 0.80);
  --xag-ink-3: rgba(234, 243, 255, 0.64);

  /* gold: key highlights and primary buttons only */
  --xag-gold: #ffb000;
  --xag-gold-ink: #1a1100;

  /* glow and luminous borders */
  --xag-glow: 0 0 0 1px rgba(79, 216, 255, 0.30), 0 0 22px rgba(47, 128, 255, 0.32);
  --xag-glow-strong: 0 0 0 1px rgba(127, 224, 255, 0.60), 0 0 34px rgba(47, 128, 255, 0.55);
  --xag-border: rgba(127, 208, 255, 0.22);
  --xag-border-glow: linear-gradient(135deg, rgba(127, 224, 255, 0.85), rgba(47, 128, 255, 0.18) 42%, rgba(79, 216, 255, 0.60));
  --xag-line-glow: linear-gradient(90deg, rgba(79, 216, 255, 0), rgba(127, 224, 255, 0.75) 50%, rgba(79, 216, 255, 0));

  /* shape and depth */
  --xag-radius-s: 10px;
  --xag-radius: 16px;
  --xag-radius-l: 24px;
  --xag-radius-pill: 999px;
  --xag-shadow: 0 10px 30px rgba(3, 10, 30, 0.45);
  --xag-shadow-lg: 0 22px 56px rgba(3, 10, 30, 0.55);

  /* glass panels (blur, fill, border); the solid colour is the fallback where backdrop-filter is missing */
  --xag-glass-blur: 14px;
  --xag-glass-fill: rgba(16, 48, 107, 0.55);
  --xag-glass-solid: #0f2a63;
  --xag-glass-border: rgba(127, 208, 255, 0.28);

  /* section background images: the overlay keeps text at WCAG AA (ink on at least 78% navy is above 7:1) */
  --xag-img-overlay: linear-gradient(180deg, rgba(7, 20, 51, 0.80), rgba(7, 20, 51, 0.90));
  --xag-section-img: none;

  /* type scale */
  --xag-font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Inter, Roboto, Arial, sans-serif;
  --xag-font-text: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, Roboto, Arial, sans-serif;
  --xag-fs-xs: 0.75rem;
  --xag-fs-s: 0.875rem;
  --xag-fs-m: 1rem;
  --xag-fs-l: 1.25rem;
  --xag-fs-xl: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  --xag-fs-2xl: clamp(1.9rem, 1.2rem + 3vw, 3.2rem);
  --xag-fs-display: clamp(2.1rem, 1rem + 5vw, 4.6rem);
}

/* glass panel: a deep-blue frosted panel (never a black box) */
.xag-glass {
  position: relative;
  background: var(--xag-glass-solid);
  border: 1px solid var(--xag-glass-border);
  border-radius: var(--xag-radius);
  box-shadow: var(--xag-shadow);
  color: var(--xag-ink);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .xag-glass {
    background: var(--xag-glass-fill);
    -webkit-backdrop-filter: blur(var(--xag-glass-blur)) saturate(1.2);
    backdrop-filter: blur(var(--xag-glass-blur)) saturate(1.2);
  }
}
/* Save-Data, reduced transparency or the page's own "lite" class: no blur, solid fill */
@media (prefers-reduced-transparency: reduce) {
  .xag-glass { background: var(--xag-glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
html.lite .xag-glass { background: var(--xag-glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* luminous gradient border (drawn with a mask so it works over translucent fills); the element needs position: relative */
.xag-glow { position: relative; box-shadow: var(--xag-glow); }
.xag-glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--xag-border-glow);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.xag-glow:hover, .xag-glow:focus-visible { box-shadow: var(--xag-glow-strong); }
@media (prefers-reduced-motion: no-preference) {
  .xag-glow-pulse { animation: xag-glow-pulse 5.5s ease-in-out infinite; }
}
@keyframes xag-glow-pulse {
  0%, 100% { box-shadow: var(--xag-glow); }
  50% { box-shadow: var(--xag-glow-strong); }
}

/* a divider line with light in it */
.xag-rule { height: 1px; border: 0; margin: 0; background: var(--xag-line-glow); }

/* section with a background image: set the --xag-section-img variable on it to a picture (the page script does so only near the viewport, and not on Save-Data).
   The image never changes the layout; the overlay darkens it. Without an image it is a plain navy section. */
.xag-bgsec { position: relative; isolation: isolate; background-color: var(--xag-bg-1); background-image: var(--xag-section-img); background-size: cover; background-position: center; }
.xag-bgsec::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--xag-img-overlay); }
html.lite .xag-bgsec { background-image: none; }

/* theme_mode = "Site decides": the page script sets data-theme-mode="site" on <html>; the visitor's personal theme / dark / light control is hidden.
   "Visitor chooses" (data-theme-mode="visitor", the default) leaves every control as it is. */
html[data-theme-mode="site"] .xt-wrap,
html[data-theme-mode="site"] #xtFootLink,
html[data-theme-mode="site"] .foot-look { display: none !important; }
