/* xaglobal.app homepage, theme v2 ("homepage_theme_v2"). Loaded ONLY when js/theme-v2.js turns v2 on, so the old look is untouched and undoable.
   Built on the shared tokens in xag-theme.css (same file as the education site). Dark default; the visitor's Light and Brite themes keep their own look.
   Brightness comes from glow frames, luminous gradient borders, deep-blue glass panels, a blue/cyan horizon glow, a navy footer and lines with light in them.
   It is NOT lighter overall: every layer stays darker than the education site's #143270. Motion: the glow animates only inside html.motion
   (no reduced-motion preference, no Save-Data) and inside a prefers-reduced-motion: no-preference query; otherwise the glow is static. */

html[data-home-theme="v2"][data-theme="dark"] {
  --bg: var(--xag-bg-0);
  --bg-2: var(--xag-bg-1);
  --ink: var(--xag-ink);
  --ink-2: var(--xag-ink-2);
  --ink-3: var(--xag-ink-3);
  --line: var(--xag-border);
  --blue: var(--xag-blue);
  --sky: var(--xag-sky);
  --ice: var(--xag-cyan);
  --gold: var(--xag-gold);
  --font-display: var(--xag-font-display);
  background-color: var(--xag-bg-1);
  background-image: var(--xag-page);
  color-scheme: dark;
}

/* light: one key light behind the page in blue and cyan, with a soft navy (not black) edge */
html[data-home-theme="v2"][data-theme="dark"] .keylight i {
  background-image:
    radial-gradient(closest-side, rgba(47, 128, 255, 0.44), rgba(47, 128, 255, 0)),
    radial-gradient(closest-side, rgba(79, 216, 255, 0.20), rgba(79, 216, 255, 0)),
    radial-gradient(120% 90% at 50% 45%, rgba(7, 20, 51, 0) 60%, rgba(7, 20, 51, 0.32) 100%);
}

/* soft blue/cyan horizon glow toward the bottom of the screen */
html[data-home-theme="v2"][data-theme="dark"] body::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 48vh; z-index: -1; pointer-events: none;
  background: var(--xag-horizon);
}
@media (prefers-reduced-motion: no-preference) {
  html[data-home-theme="v2"][data-theme="dark"].motion body::after { animation: v2-horizon 9s ease-in-out infinite; }
}
@keyframes v2-horizon { 0%, 100% { opacity: 0.8; } 50% { opacity: 1; } }

/* headings: ice-white; gold only on the highlighted words that matter */
html[data-home-theme="v2"][data-theme="dark"] .kinetic { color: var(--xag-ice); }
html[data-home-theme="v2"][data-theme="dark"] .kinetic em { color: var(--xag-cyan); }
html[data-home-theme="v2"][data-theme="dark"] .main-title em, html[data-home-theme="v2"][data-theme="dark"] .kinetic em[data-hl] { color: var(--xag-gold); }
html[data-home-theme="v2"][data-theme="dark"] .ticker-track li, html[data-home-theme="v2"][data-theme="dark"] .q-type { color: var(--xag-ice); }
html[data-home-theme="v2"][data-theme="dark"] .ask-title, html[data-home-theme="v2"][data-theme="dark"] .welcome-title { color: var(--xag-ice); }

/* dividers with light in them */
html[data-home-theme="v2"][data-theme="dark"] .chapter::after { height: 1px; background: var(--xag-line-glow); }
html[data-home-theme="v2"][data-theme="dark"] .foot { border-top: 0; background: linear-gradient(180deg, rgba(16, 48, 107, 0) 0%, var(--xag-bg-2) 70%); position: relative; }
html[data-home-theme="v2"][data-theme="dark"] .foot::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--xag-line-glow); box-shadow: 0 0 18px rgba(79, 216, 255, 0.45); }

/* deep-blue glass panels instead of black boxes */
html[data-home-theme="v2"][data-theme="dark"] .q-panel, html[data-home-theme="v2"][data-theme="dark"] .welcome-in, html[data-home-theme="v2"][data-theme="dark"] .focus-pick, html[data-home-theme="v2"][data-theme="dark"] .focus-card, html[data-home-theme="v2"][data-theme="dark"] .family, html[data-home-theme="v2"][data-theme="dark"] .card-link {
  background: linear-gradient(160deg, rgba(27, 66, 136, 0.62), rgba(12, 36, 88, 0.80));
  border: 1px solid var(--xag-glass-border);
  border-radius: var(--xag-radius);
  box-shadow: var(--xag-glow);
  overflow: hidden;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html[data-home-theme="v2"][data-theme="dark"] .q-panel, html[data-home-theme="v2"][data-theme="dark"] .welcome-in, html[data-home-theme="v2"][data-theme="dark"] .focus-pick {
    -webkit-backdrop-filter: blur(var(--xag-glass-blur)) saturate(1.2);
    backdrop-filter: blur(var(--xag-glass-blur)) saturate(1.2);
  }
}
html[data-home-theme="v2"][data-theme="dark"].lite .q-panel, html[data-home-theme="v2"][data-theme="dark"].lite .welcome-in, html[data-home-theme="v2"][data-theme="dark"].lite .focus-pick { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--xag-glass-solid); }
html[data-home-theme="v2"][data-theme="dark"] .welcome-in { border-left: 3px solid var(--xag-gold); }
html[data-home-theme="v2"][data-theme="dark"] .focus-pick { border-color: var(--xag-glass-border); }
html[data-home-theme="v2"][data-theme="dark"] .focus-pick:hover, html[data-home-theme="v2"][data-theme="dark"] .focus-pick:focus-visible { border-color: var(--xag-gold); box-shadow: var(--xag-glow-strong); }
html[data-home-theme="v2"][data-theme="dark"] .q-panel:hover, html[data-home-theme="v2"][data-theme="dark"] .q-panel:focus-visible, html[data-home-theme="v2"][data-theme="dark"] .family:hover, html[data-home-theme="v2"][data-theme="dark"] .family:focus-visible, html[data-home-theme="v2"][data-theme="dark"] .card-link:hover, html[data-home-theme="v2"][data-theme="dark"] .card-link:focus-visible, html[data-home-theme="v2"][data-theme="dark"] .card-soon:hover {
  background: linear-gradient(160deg, rgba(36, 84, 168, 0.70), rgba(15, 44, 106, 0.86));
  border-color: rgba(127, 224, 255, 0.60);
  box-shadow: var(--xag-glow-strong);
}
/* the ledger lines of the grids give way to separate glowing tiles */
html[data-home-theme="v2"][data-theme="dark"] .split, html[data-home-theme="v2"][data-theme="dark"] .cards, html[data-home-theme="v2"][data-theme="dark"] .focus-grid { border: 0; gap: 1rem; }
html[data-home-theme="v2"][data-theme="dark"] .card { background: none; border: 0; }
html[data-home-theme="v2"][data-theme="dark"] .card-link .chip { background: var(--xag-bg-2); }
/* luminous gradient border on app tiles and cards */
html[data-home-theme="v2"][data-theme="dark"] .card-link::after {
  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);
}

/* the coloured tabs: ONE row block under the heading and the rolling text bar, in two rows; the fixed side tabs stay as well.
   Under the tabs comes "Welcome back" and nothing else: the Go-to-website button, the Scroll cue, the typed line, the section title, the lede and the see-all line are hidden. */
html[data-home-theme="v2"][data-theme="dark"] .hero .hero-cta, html[data-home-theme="v2"][data-theme="dark"] .hero .cue, html[data-home-theme="v2"][data-theme="dark"] .q-line, html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main .main-title, html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main .lede, html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main .door-all-item { display: none; }
html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main { min-height: 0; padding: clamp(0.4rem, 1.5vh, 1rem) 0 clamp(0.8rem, 2vh, 1.4rem); width: 100%; }
html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main::after { display: none; }
html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main .wrap { max-width: var(--max); }
html[data-home-theme="v2"][data-theme="dark"] .hero .door-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
html[data-home-theme="v2"][data-theme="dark"] .hero .door-wide { grid-column: auto; }
@media (min-width: 700px) { html[data-home-theme="v2"][data-theme="dark"] .hero .door-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main .wrap { max-width: min(var(--max), calc(100vw - 2 * var(--float-w) - 3rem)); } }
html[data-home-theme="v2"][data-theme="dark"] .hero .welcome { width: 100%; padding-inline: var(--gutter); }
html[data-home-theme="v2"][data-theme="dark"] .hero .seal-hero { position: relative; left: auto; bottom: auto; justify-self: center; margin: clamp(0.6rem, 2vh, 1.2rem) auto 0; }
html[data-home-theme="v2"][data-theme="dark"] .welcome-count { padding-inline: 0.6rem; }
html[data-home-theme="v2"][data-theme="dark"] .wc-label { max-width: 15rem; text-wrap: balance; }

/* header and menu surfaces stay navy, never black */
html[data-home-theme="v2"][data-theme="dark"] .top.scrolled { background: rgba(11, 31, 77, 0.78); }
html[data-home-theme="v2"][data-theme="dark"] .lang, html[data-home-theme="v2"][data-theme="dark"] .lang-noscript { background: var(--xag-bg-0); }
html[data-home-theme="v2"][data-theme="dark"] .menu { background: var(--xag-bg-1); }
html[data-home-theme="v2"][data-theme="dark"] .nav .nav-edu-panel { background: var(--xag-glass-solid); }

/* buttons: gold stays for the key actions, with a gold glow */
html[data-home-theme="v2"][data-theme="dark"] .hero-cta, html[data-home-theme="v2"][data-theme="dark"] .btn-gold, html[data-home-theme="v2"][data-theme="dark"] .pr-btn { box-shadow: 0 0 0 1px rgba(255, 176, 0, 0.55), 0 0 20px rgba(255, 176, 0, 0.30); }

/* section pictures (set by js/theme-v2.js from the admin setting): the overlay keeps text at WCAG AA */
html[data-home-theme="v2"][data-theme="dark"] .xag-bgsec { background-color: transparent; }

/* footer mark: the shared HD logo, sized by CSS (the width/height attributes reserve the space) */
html[data-home-theme="v2"][data-theme="dark"] .v2-foot-logo { width: min(220px, 60vw); height: auto; filter: drop-shadow(0 0 18px rgba(79, 216, 255, 0.35)); }
@media (min-width: 601px) { html[data-home-theme="v2"][data-theme="dark"] .v2-foot-logo { width: 320px; } }

/* phones: the tabs become one compact row each (icon, small label, name), so every label stays on one line and the side tabs have room */
@media (max-width: 699px) {
  html[data-home-theme="v2"][data-theme="dark"] .hero .chapter-main { padding-inline: var(--gutter) calc(var(--gutter) + 3rem); }
  html[data-home-theme="v2"][data-theme="dark"] .hero .door-list { grid-template-columns: 1fr; gap: 0.55rem; }
  html[data-home-theme="v2"][data-theme="dark"] .hero .door { grid-template-columns: 2.4rem minmax(0, 1fr); column-gap: 0.8rem; align-items: center; align-content: center; gap: 0 0.8rem; min-height: 0; padding: 0.55rem 0.8rem; text-align: left; }
  html[data-home-theme="v2"][data-theme="dark"] .hero .door-icon { grid-row: 1 / span 2; width: 2.2rem; height: 2.2rem; margin: 0; }
  html[data-home-theme="v2"][data-theme="dark"] .hero .door-label { font-size: 0.62rem; letter-spacing: 0.06em; }
  html[data-home-theme="v2"][data-theme="dark"] .hero .door-action { font-size: 1rem; }
  html[data-home-theme="v2"][data-theme="dark"] .hero .door-go { display: none; }
}
