/* ══════════════════════════════════════════════════════════════════
   advisor-sky.css — the "Open Sky" daylight theme.
   Filename kept for continuity; scope is now site-wide (formerly
   /advisor/ only). Loaded by page-header.php on every request where
   wpSkyTheme() returns non-empty. <body> carries .theme-sky plus one
   intensity modifier:
     .theme-sky--landing  full open sky  (marketing / advisor landing)
     .theme-sky--calm     calm sky      (auth: login, register)
     .theme-sky--work     palest sky    (dashboards, buy-credits)
   Everything restyles through the vercel.css token layer wherever
   possible; component touch-ups below are the exceptions.
   ════════════════════════════════════════════════════════════════ */

/* ── Token flip ─────────────────────────────────────────────────────
   Same @layer tokens as vercel.css so the cascade story stays honest:
   the !important token declarations there can only be beaten from the
   same layer with higher specificity — body.theme-sky does that. */
@layer tokens {
  body.theme-sky {
    --bg:   #cfe4fb !important;
    --bg-1: #dcebfc !important;
    --bg-2: rgba(255,255,255,0.32) !important; /* --alt section bands: faint frost */
    --bg-3: #eef6ff !important;

    /* interactive blue reads as "ice, in daylight" */
    --ice:    #1f5fd0 !important;
    --violet: #6a55c8 !important;
    --cyan:   #1a7ab8 !important;

    --text:   #101c30 !important;
    --text-2: #3f5170 !important;
    --text-3: #5e6d8a !important; /* spec #71809c failed AA at 11px — darkened */
    --success: #087f5b !important; /* light-theme success; #2effc0 is illegible on white */

    --glow-ice:    rgba(70,110,170,0.18) !important; /* soft shadow, not glow */
    --glow-violet: rgba(106,85,200,0.14) !important;
    --edge:   rgba(255,255,255,0.50) !important;
    --edge-h: rgba(255,255,255,0.70) !important;
    --edge-t: rgba(255,255,255,0.85) !important; /* bright top rim */
    --hairline: rgba(16,28,48,0.10) !important;
    --ice-mark: rgba(31,95,208,0.55) !important;

    /* light glass recipe: white frost */
    --glass:   rgba(255,255,255,0.55) !important;
    --glass-2: rgba(255,255,255,0.65) !important;
    --glass-3: rgba(255,255,255,0.75) !important;

    --accent:   var(--ice) !important;
    --accent-2: var(--violet) !important;
    --accent-3: var(--cyan) !important;
    --blue:     var(--ice) !important;
    --purple:   var(--violet) !important;
    --pink:     #b0489a !important;
    --green:    var(--success) !important;
    --muted:    var(--text-2) !important;
    --border:   rgba(16,28,48,0.12) !important;
    --border-h: rgba(16,28,48,0.22) !important;
    --line:     rgba(16,28,48,0.12) !important;
    --surface:  rgba(255,255,255,0.45) !important;
    --ink:      #ffffff !important; /* text on accent surfaces: accent is deep blue now */
    --vault:    #dcebfc !important;
    --smoke:    #101c30 !important;
    --slate:    var(--text-2) !important;
    --brass:    var(--ice) !important;
    --current:  var(--ice) !important;
  }
}

/* ── Sky backdrops, by intensity ──────────────────────────────────
   These live in @layer reset on purpose: vercel's reset layer nails
   `html, html body { background:#050508 !important }`, and for
   !important declarations EARLIER layers win — so a components-layer
   gradient can never beat it. Same layer + higher specificity can. */
@layer reset {
  /* body carries the fixed sky gradient. HTML gets a solid sky-mid fallback
     so any pixel not covered by the gradient (headless-Chrome full-page
     screenshots hit this — background-attachment:fixed paints only the
     visible viewport, so below-fold falls through to <html>, which vercel
     pins to #050508) still reads as sky, not navy. */
  html:has(body.theme-sky)             { background: #cfe4fb !important; }
  html:has(body.theme-sky--calm)       { background: #dcebfc !important; }
  html:has(body.theme-sky--work)       { background: #f2f8ff !important; }

  html body.theme-sky {
    background: linear-gradient(180deg, #8fbdf2 0%, #cfe4fb 52%, #eef6ff 100%) fixed !important;
    color: var(--text) !important;
  }
  html body.theme-sky--calm {
    background: linear-gradient(180deg, #aecff5 0%, #dcebfc 50%, #f0f7ff 100%) fixed !important;
  }
  html body.theme-sky--work {
    background: linear-gradient(180deg, #dcebfc 0%, #f2f8ff 45%, #f7fbff 100%) fixed !important;
  }
}

/* All component overrides live in @layer reset, NOT components: vercel
   puts !important rules in base AND components, and for !important
   EARLIER layers win — reset outranks both. (glacier is earlier still,
   but its rules are all data-zone-scoped and never match here.) */
@layer reset {

  /* ── Clouds: two fixed parallax layers, each a set of DISTINCT cumulus
        (clustered hard-stop radial gradients, lightly blurred) — not haze.
        Geometry: the layer spans -50vw..150vw, so the resting viewport is
        the 25%..75% band of the layer. Every cloud is placed inside
        27%..72% and the drift is ±5% of the layer, so clouds are visible
        on a COLD LOAD and stay visible through the whole loop — including
        the reduced-motion static frame (rest position = clouds on show).
        v1 failure for the record: giant aspect-squashed gradients +
        blur(26px) + halved opacity rendered as flat tint, and half the
        blobs started outside the viewport. ── */
  body.theme-sky::before,
  body.theme-sky::after {
    content: '';
    position: fixed;
    left: -50vw;
    width: 200vw;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
  }
  /* far layer: smaller, hazier, drifts left */
  body.theme-sky::before {
    top: 2vh;
    height: 42vh;
    opacity: 0.7;
    filter: blur(13px);
    background:
      /* far cloud 1 */
      radial-gradient(ellipse 4.5% 26% at 40% 24%, rgba(255,255,255,0.95) 0% 42%, rgba(255,255,255,0) 72%),
      radial-gradient(ellipse 3.2% 19% at 42.8% 30%, rgba(255,255,255,0.85) 0% 40%, rgba(255,255,255,0) 70%),
      /* far cloud 2 */
      radial-gradient(ellipse 5% 28% at 58% 46%, rgba(255,255,255,0.95) 0% 44%, rgba(255,255,255,0) 72%),
      radial-gradient(ellipse 3.4% 20% at 55.4% 52%, rgba(255,255,255,0.82) 0% 40%, rgba(255,255,255,0) 70%),
      radial-gradient(ellipse 4.5% 16% at 58% 58%, rgba(196,217,242,0.45) 0% 38%, rgba(196,217,242,0) 68%),
      /* far cloud 3 */
      radial-gradient(ellipse 4% 23% at 70.5% 20%, rgba(255,255,255,0.9) 0% 42%, rgba(255,255,255,0) 72%);
    animation: sky-drift-far 240s linear infinite alternate;
  }
  /* near layer: three big defined cumulus with #c4d9f2 undersides, drifts right */
  body.theme-sky::after {
    top: 4vh;
    height: 52vh;
    opacity: 0.92;
    filter: blur(8px);
    background:
      /* cloud A — left of hero, high */
      radial-gradient(ellipse 7% 30% at 30% 34%, #ffffff 0% 46%, rgba(255,255,255,0.9) 58%, rgba(255,255,255,0) 74%),
      radial-gradient(ellipse 5% 22% at 26.4% 42%, rgba(255,255,255,0.96) 0% 44%, rgba(255,255,255,0) 72%),
      radial-gradient(ellipse 5.4% 24% at 33.6% 41%, rgba(255,255,255,0.96) 0% 44%, rgba(255,255,255,0) 72%),
      radial-gradient(ellipse 8% 18% at 30% 50%, rgba(196,217,242,0.55) 0% 40%, rgba(196,217,242,0) 70%),
      /* cloud B — center-right, higher and wider */
      radial-gradient(ellipse 8% 32% at 52.5% 22%, #ffffff 0% 46%, rgba(255,255,255,0.9) 58%, rgba(255,255,255,0) 74%),
      radial-gradient(ellipse 5.6% 24% at 48.4% 31%, rgba(255,255,255,0.95) 0% 44%, rgba(255,255,255,0) 72%),
      radial-gradient(ellipse 6% 25% at 56.6% 30%, rgba(255,255,255,0.95) 0% 44%, rgba(255,255,255,0) 72%),
      radial-gradient(ellipse 9% 18% at 52.5% 39%, rgba(196,217,242,0.5) 0% 40%, rgba(196,217,242,0) 70%),
      /* cloud C — right edge, lower */
      radial-gradient(ellipse 6.4% 28% at 69% 56%, #ffffff 0% 46%, rgba(255,255,255,0.88) 58%, rgba(255,255,255,0) 74%),
      radial-gradient(ellipse 4.6% 21% at 65.8% 63%, rgba(255,255,255,0.94) 0% 44%, rgba(255,255,255,0) 72%),
      radial-gradient(ellipse 7% 16% at 69% 70%, rgba(196,217,242,0.5) 0% 40%, rgba(196,217,242,0) 70%);
    animation: sky-drift-near 120s linear infinite alternate;
  }
  @keyframes sky-drift-far  { from { transform: translateX(0); } to { transform: translateX(-10vw); } }
  @keyframes sky-drift-near { from { transform: translateX(0); } to { transform: translateX(10vw); } }

  /* working screens: the same clouds as faint static wisps, near layer off */
  body.theme-sky--work::before { opacity: 0.45; animation: none; }
  body.theme-sky--work::after  { display: none; }
  /* reduced motion: parked at rest — which is designed to show clouds */
  @media (prefers-reduced-motion: reduce) {
    body.theme-sky::before, body.theme-sky::after { animation: none; }
  }

  /* content sits above the cloud layers */
  body.theme-sky main, body.theme-sky .auth-layout, body.theme-sky footer { position: relative; z-index: 1; }

  /* ── Nav on sky ──
     (!important below where the opponent is an UNLAYERED rule — page
     <style> blocks and base.css — or a vercel !important rule) */
  body.theme-sky .nav a { color: var(--text-2) !important; }
  body.theme-sky .nav a:hover { color: var(--text) !important; }
  body.theme-sky .nav {
    background: rgba(255,255,255,0.50) !important; /* vercel: rgba(5,5,8,.72) always */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  body.theme-sky .nav.scrolled {
    background: rgba(255,255,255,0.68) !important;
    border-bottom: 1px solid rgba(16,28,48,0.08);
  }
  /* generic .btn: vercel base paints white-10% glass + white text —
     illegible on sky. Frost + ink; the variants below re-specialize. */
  body.theme-sky .btn {
    background: rgba(255,255,255,0.55) !important;
    color: var(--text) !important;
    border-color: rgba(16,28,48,0.18) !important;
  }
  body.theme-sky .logo__word { color: var(--text) !important; }
  body.theme-sky .logo__word span { color: var(--text-2) !important; }
  /* reticle-diamond mark: dark-on-light stroke variant (CSS stroke beats
     the SVG presentation attributes, incl. the url(#lg) gradient) */
  body.theme-sky .logo__mark rect { stroke: #1f5fd0; }
  body.theme-sky .logo__mark path { stroke: #3f5170; }
  body.theme-sky .logo__mark circle { fill: #1f5fd0; }
  body.theme-sky .nav__hamburger span { background: var(--text) !important; }
  /* dropdown panel: page-header inlines a #111 panel — lift it to frost */
  body.theme-sky .nav__dropdown {
    background: rgba(255,255,255,0.92) !important;
    border: 0.5px solid rgba(16,28,48,0.12) !important;
    border-top-color: rgba(255,255,255,0.85) !important;
    box-shadow: 0 8px 30px rgba(70,110,170,0.18) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  body.theme-sky .nav__dropdown a { color: var(--text-2) !important; }
  body.theme-sky .nav__dropdown a:hover { background: rgba(31,95,208,0.08) !important; color: var(--text) !important; }
  body.theme-sky .nav__drop-label { color: var(--text-3) !important; }

  /* ── Mobile menu: frost overlay instead of the flat token flip ──
     (text/link colors already follow the ink tokens) */
  body.theme-sky #mobile-menu {
    background: rgba(255,255,255,0.72) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  /* the overlay's inner <nav> is classless and catches vercel's bare
     `nav { background:rgba(5,5,8,.72) }` — clear it on the frost */
  body.theme-sky #mobile-menu nav { background: transparent !important; }

  /* ── Buttons ── */
  body.theme-sky .btn--primary {
    background: var(--ice) !important;   /* vercel: hardcoded white — invisible on sky */
    color: #ffffff !important;
  }
  body.theme-sky .btn--primary:hover { background: #174aa6 !important; }
  body.theme-sky .btn--outline, body.theme-sky .btn--secondary, body.theme-sky .btn--ghost {
    color: var(--text) !important;
    border-color: rgba(16,28,48,0.30) !important;
  }
  body.theme-sky .btn--outline:hover, body.theme-sky .btn--secondary:hover, body.theme-sky .btn--ghost:hover {
    background: rgba(16,28,48,0.08) !important;
  }
  body.theme-sky a { color: var(--ice); }
  body.theme-sky a:hover { color: #174aa6; }

  /* ── Glass cards: soft blue drop shadow instead of glow ── */
  body.theme-sky .vcard, body.theme-sky .card {
    box-shadow: 0 8px 30px rgba(70,110,170,0.18) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }
  body.theme-sky .vcard:hover, body.theme-sky .card:hover {
    background: var(--glass-2) !important;
    box-shadow: 0 10px 34px rgba(70,110,170,0.24) !important;
  }

  /* ── Footer: dark ground under the sky (its hardcoded grays stay legible) ── */
  body.theme-sky .footer {
    background: #0d1830;
    border-top: 1px solid rgba(255,255,255,0.08);
  }

  /* ── Landing page (adv-*) touch-ups: the page's own <style> block keeps a
        few hardcoded darks; same-specificity-plus-one wins here ── */
  body.theme-sky .adv-hero__label, body.theme-sky .adv-section-label { color: var(--ice); }
  body.theme-sky .adv-feature,
  body.theme-sky .adv-mockup,
  body.theme-sky .adv-plan {
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  body.theme-sky .adv-plan--featured {
    background: var(--glass-2) !important;
    border: 1px solid rgba(31,95,208,0.45) !important;
    box-shadow: 0 8px 30px rgba(70,110,170,0.22) !important;
  }
  body.theme-sky .adv-plan__popular { background: var(--ice) !important; color: #fff !important; }
  body.theme-sky .adv-final { background: transparent; }
  body.theme-sky .adv-final__h { color: var(--text); }
  body.theme-sky .adv-final__signin { color: var(--text-3); }
  body.theme-sky .adv-final__signin a { color: var(--text-2); }
  body.theme-sky .adv-final__signin a:hover { color: var(--text); }

  /* ── Phase 4 marketing pages: about / contact / tests ──
     Each carries inline dark blocks (background:#111111 or #0a0a0a) in its
     own <style> block. Instead of rewriting those pages we override the
     specific classes to read as sky-glass. Same-layer + higher specificity
     wins layered !important ties (reset is the strongest layer). */

  /* about.php ------------------------------------------------------- */
  body.theme-sky .about-bio__panel,
  body.theme-sky .about-bio__content,
  body.theme-sky .about-book,
  body.theme-sky .about-ref {
    background: var(--glass-2) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text) !important;
  }
  body.theme-sky .about-bio__panel  { background: var(--glass-3) !important; }
  body.theme-sky .about-bio__monogram { color: rgba(16, 28, 48, 0.14) !important; }
  body.theme-sky .about-bio__cred-item  { border-top-color: rgba(16, 28, 48, 0.14) !important; }
  body.theme-sky .about-bio__cred-label { color: var(--ice) !important; }
  body.theme-sky .about-bio__cred-value { color: var(--text-2) !important; }
  body.theme-sky .about-book__year      { color: var(--ice) !important; }
  body.theme-sky .about-book__title,
  body.theme-sky .about-book__desc      { color: var(--text) !important; }
  body.theme-sky .about-book__desc      { color: var(--text-2) !important; }
  body.theme-sky .about-ref             { color: var(--text-2) !important; }
  /* about.php:489 "What you get" panel — inline background:#111111 was
     removed at source (2026-07-14 C8); now uses the .about-block class. */
  body.theme-sky .about-block {
    background: var(--glass-2) !important;
    color: var(--text) !important;
  }

  /* contact.php ---------------------------------------------------- */
  body.theme-sky .contact-wrap { background: transparent !important; }

  /* tests.php ------------------------------------------------------ */
  body.theme-sky .test-card-full {
    background: var(--glass-2) !important;
    color: var(--text) !important;
  }
  body.theme-sky .test-card-full:hover { background: var(--glass-3) !important; }
  body.theme-sky .test-card-full__name    { color: var(--text) !important; }
  body.theme-sky .test-card-full__tagline { color: var(--ice) !important; }
  body.theme-sky .test-card-full__desc,
  body.theme-sky .test-card-full__stat    { color: var(--text-2) !important; }
  body.theme-sky .test-card-full__meta    { border-top-color: var(--hairline) !important; }
  body.theme-sky .tests-page__header h1   { color: var(--text) !important; }
  body.theme-sky .tests-page__sub         { color: var(--text-2) !important; }
  body.theme-sky .filter-tab {
    border-color: rgba(16, 28, 48, 0.22) !important;
    color: var(--text-2) !important;
    background: rgba(255, 255, 255, 0.35) !important;
  }
  body.theme-sky .filter-tab:hover,
  body.theme-sky .filter-tab.active {
    border-color: var(--ice) !important;
    background: var(--ice) !important;
    color: #fff !important;
  }
  body.theme-sky .tests-section-label { color: var(--text-3) !important; border-bottom-color: var(--hairline) !important; }

  /* auth pages: bullet panel sits directly on sky (page <style> blocks
     are unlayered → they beat layered normal rules, hence !important) */
  body.theme-sky .auth-panel--left { background: transparent !important; color: var(--text) !important; }
  body.theme-sky .auth-panel--right { background: transparent !important; }
  body.theme-sky .auth-bullets h2 { color: var(--text) !important; }
  body.theme-sky .auth-bullets__item p { color: var(--text-2) !important; }
  body.theme-sky .auth-bullets__dot { background: var(--ice) !important; }
  body.theme-sky .auth-bullets__label, body.theme-sky .auth-form-wrap .auth-kicker { color: var(--ice) !important; }
  body.theme-sky .auth-field input {
    background: rgba(255,255,255,0.65) !important;
    border: 1px solid rgba(16,28,48,0.18) !important;
    color: var(--text) !important;
  }
  body.theme-sky .auth-field input:focus { border-color: var(--ice) !important; }
  body.theme-sky .auth-submit { background: var(--text) !important; color: #fff !important; }
  body.theme-sky .auth-submit:hover { background: var(--ice) !important; color: #fff !important; }
}
