/* ============================================================
   personality-test-hub, aura-shell.css
   THE COHESION LAYER. Loads after components.css on EVERY page.
   Contract: AURA_UI_FRAMEWORK.md  (defers to AURA_DESIGN_SYSTEM.md
   for palette/motion/type semantics).

   Purpose: one shared shell + surface + component vocabulary so
   landing / dashboard / quiz / result / library read as ONE product.
   Additive & opt-in by class, does not rewrite existing .card/.btn.
   ============================================================ */

/* ---------- Extended tokens (glass + rhythm + glow) ---------- */
:root {
  /* Glass surface tiers (white veil over obsidian + blur).
     Tier goes UP with importance: page < card < feature < hero panel. */
  --glass-1:        rgba(255, 255, 255, 0.035);  /* quiet fill / rows */
  --glass-2:        rgba(255, 255, 255, 0.055);  /* default card */
  --glass-3:        rgba(255, 255, 255, 0.085);  /* raised / hero panel */
  --glass-border:   rgba(255, 255, 255, 0.10);
  --glass-border-strong: rgba(255, 255, 255, 0.16);
  --glass-blur:      16px;
  --glass-blur-soft: 8px;

  /* Brand glows (elevation = light, not just shadow) */
  --glow-blue:   0 0 24px rgba(77, 142, 255, 0.30);
  --glow-violet: 0 0 24px rgba(139, 92, 246, 0.28);
  --glow-gold:   0 0 22px rgba(246, 199, 106, 0.35);

  /* Layout rhythm (shared vertical cadence across rooms) */
  --rhythm-section: clamp(48px, 8vw, 96px);   /* space between major sections */
  --rhythm-block:   clamp(24px, 4vw, 40px);   /* space between blocks */
  --measure:        62ch;                     /* max readable prose width */

  /* Extra radii */
  --radius-2xl:  20px;
  --radius-3xl:  28px;
  --radius-pill: 999px;

  /* Aurora energy budget per room (set by .room--* on <body>) */
  --aura-alpha: 0;      /* 0 = off (quiz). 1 = full (dashboard). */
}

/* ---------- Room energy budget (AURA_DESIGN_SYSTEM.md §5) ----------
   Put ONE class on <body>. Controls how loud the ambient aurora is. */
body.room--landing   { --aura-alpha: 0.85; }
body.room--dashboard { --aura-alpha: 0.42; }  /* subtle background fill; synthesis text must stay readable over it */
body.room--result    { --aura-alpha: 0.45; }
body.room--library   { --aura-alpha: 0.22; }
body.room--quiz      { --aura-alpha: 0.00; }  /* near-clinical, zero aurora */
body.room--utility   { --aura-alpha: 0.15; }  /* login / auth / admin */

/* ---------- Ambient aurora backdrop ----------
   Fixed, BEHIND everything, opacity driven by the room budget.
   A room with --aura-alpha:0 renders nothing (quiz stays clinical).
   Markup: <div class="aura-bg" aria-hidden="true"></div> right after <body>. */
.aura-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--aura-alpha);
  transition: opacity var(--transition-slow);
  /* Richer static fallback so the aurora still reads even if WebGL is
     unavailable (the animated shader canvas layers on top when it works). */
  background:
    radial-gradient(46% 40% at 20% 16%, rgba(77,142,255,0.40), transparent 70%),
    radial-gradient(44% 42% at 84% 26%, rgba(139,92,246,0.36), transparent 72%),
    radial-gradient(52% 46% at 66% 86%, rgba(244,114,182,0.26), transparent 74%),
    radial-gradient(42% 42% at 34% 82%, rgba(78,222,163,0.20), transparent 74%),
    var(--bg-primary);
}
.aura-bg::after {   /* keeps content legible: gentle fade toward the base */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(15,15,26,0.22) 60%, rgba(15,15,26,0.72) 100%);
}
@media (prefers-reduced-motion: reduce) { .aura-bg { transition: none; } }

/* ---------- Surface system (the one card vocabulary) ---------- */
.surface {
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.surface--quiet   { background: var(--glass-1); }
.surface--raised  { background: var(--glass-3); border-color: var(--glass-border-strong); box-shadow: var(--shadow-elevated); }
.surface--pad     { padding: var(--space-xl); }
.surface--pad-lg  { padding: var(--space-2xl); }
.surface--round   { border-radius: var(--radius-3xl); }

.surface--interactive { cursor: pointer; transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base); }
.surface--interactive:hover { transform: translateY(-3px); border-color: var(--glass-border-strong); box-shadow: var(--shadow-elevated), var(--glow-blue); }
.surface--interactive:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .surface--interactive:hover { transform: none; }
}

/* Graceful fallback where backdrop-filter is unsupported */
@supports not (backdrop-filter: blur(1px)) {
  .surface { background: var(--bg-card); }
}

/* ---------- Eyebrow pill (section kicker / status label) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

/* ---------- Section rhythm + heading (shared cadence) ---------- */
.aura-section { padding-block: var(--rhythm-section); }
.aura-section--tight { padding-block: var(--rhythm-block); }

.aura-head { text-align: center; margin-bottom: var(--rhythm-block); }
.aura-head__eyebrow { margin-bottom: var(--space-md); }
/* Display serif, UPRIGHT (italic is reserved for pull-quotes only) */
.aura-head__title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  color: var(--text-primary);
}
.aura-head__sub {
  margin-top: var(--space-md);
  max-width: var(--measure);
  margin-inline: auto;
  color: var(--text-secondary);
}

/* Pull-quote / big insight, the ONE place serif italic is allowed */
.aura-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.4;
  color: var(--text-primary);
  max-width: var(--measure);
}

/* ---------- Brand buttons (extend components.css .btn) ---------- */
/* ONE primary button style, on-palette mint (--brand-mint #4EDEA3) with an
   elegant metallic finish. Applied to BOTH .btn--brand and .btn--primary so
   every filled CTA across the site is identical. */
.btn--brand,
.btn--primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0) 44%),
    linear-gradient(180deg, #7bf0c8 0%, #4EDEA3 52%, #38cc93 100%);
  color: #04231a;
  border: 1px solid rgba(255,255,255,0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -2px 3px rgba(0,0,0,0.14),
    0 6px 18px rgba(78,222,163,0.30);
  text-shadow: 0 1px 0 rgba(255,255,255,0.22);
}
.btn--brand:hover:not(:disabled),
.btn--primary:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.66),
    inset 0 -2px 3px rgba(0,0,0,0.14),
    0 9px 24px rgba(78,222,163,0.42);
}

/* Disabled / not-clickable: must be dimmed AND unclickable (hard rule). */
.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-disabled {
  opacity: 0.38;
  filter: grayscale(0.4) brightness(0.85);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
/* A locked / empty assessment card: dimmed and not clickable. */
.a-card.is-locked,
.surface--interactive.is-locked {
  opacity: 0.45;
  filter: grayscale(0.35);
  cursor: not-allowed;
  pointer-events: none;
}

/* Wordmark colour uniform with the footer (beats the legacy
   components.css `.header__logo span` rule that tinted AURA blue). */
.header__logo .header__logo-text { color: var(--text-primary); }
.header__logo .header__logo-text > span { color: var(--brand-blue); }

.btn--glass {
  background: var(--glass-2);
  color: var(--text-primary);
  border-color: var(--glass-border);
  backdrop-filter: blur(var(--glass-blur-soft));
}
.btn--glass:hover:not(:disabled) { background: var(--glass-3); border-color: var(--glass-border-strong); }

.btn--pill { border-radius: var(--radius-pill); }

/* ---------- Unified header refinement (all pages already use .header) ----------
   Gentle glass upgrade so every page's top bar matches, without new markup. */
.header {
  background: rgba(15, 15, 26, 0.55);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}
.header.scrolled { background: rgba(15, 15, 26, 0.80); }
/* Brand wordmark: sans by rule (no serif on nav chrome), accent on AURA */
/* Brand lockup: crisp vector mark + wordmark in the UI typeface (guideline:
   sans for chrome, AURA in brand blue). Replaces the low-res raster logo. */
.header__logo { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.header__logo-mark { height: 42px; width: 42px; display: block; flex-shrink: 0; }
.header__logo-text { font-family: var(--font-primary); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--text-primary); line-height: 1; }
.header__logo-text span { color: var(--brand-blue); font-weight: 600; }
.header__logo-img { height: 42px; width: auto; display: block; } /* legacy fallback */

/* Keep account entry on one row, comfortably spaced */
.header__actions { display: flex; align-items: center; gap: 0.6rem; }

/* Account entry inside the mobile burger (top of menu); hidden on desktop */
.nav-account { display: none; }
.header__nav a.nav-account { color: var(--text-primary); font-weight: 700; }

@media (max-width: 768px) {
  /* Mobile top bar: logo CENTERED, burger pinned right, nothing else. */
  .header__inner { position: relative; justify-content: center; }
  .header__menu-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
  .header__actions { display: none; }

  /* Open menu = one clean glass panel; all items live inside it. */
  .header__nav.open {
    background: rgba(15, 15, 26, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
    padding: 1rem 1.25rem 1.25rem;
    gap: 0.1rem;
  }
  .header__nav.open > a,
  .header__nav.open .nav-dropdown > .nav-dropdown__trigger { padding: 0.55rem 0; }
  .header__nav a.nav-account {
    display: block;
    padding: 0.15rem 0 0.85rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--glass-border);
  }
}

/* ---------- Domain chip (public-labelled, color-locked to v8 domain) ----------
   Usage: <span class="domain-chip" data-dom="mind">Identity</span>
   Colors come straight from base.css --dom-* (single source of truth). */
.domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
}
.domain-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--_c, var(--text-secondary)); box-shadow: 0 0 8px var(--_c, transparent); }
.domain-chip[data-dom="mind"]         { --_c: var(--dom-mind); }
.domain-chip[data-dom="self"]         { --_c: var(--dom-self); }
.domain-chip[data-dom="talent"]       { --_c: var(--dom-talent); }
.domain-chip[data-dom="relationship"] { --_c: var(--dom-relationship); }
.domain-chip[data-dom="direction"]    { --_c: var(--dom-direction); }

/* ---------- Feature / bento card (landing + library grids) ---------- */
.feature-card { padding: var(--space-xl); border-radius: var(--radius-2xl); }
.feature-card__icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--glass-1);
  border: 1px solid var(--glass-border);
  margin-bottom: var(--space-md);
  color: var(--brand-blue);
}
.feature-card__title { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-xs); }
.feature-card__body  { color: var(--text-secondary); font-size: var(--text-base); }

/* ---------- Step timeline (how-it-works) ---------- */
.step-row { display: flex; gap: var(--space-lg); align-items: flex-start; }
.step-row__num {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--glass-2);
  border: 1px solid var(--glass-border-strong);
  color: var(--brand-blue);
  font-weight: 700;
}

/* ---------- Big CTA panel (landing + result footer) ---------- */
.cta-panel {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  border-radius: var(--radius-3xl);
}
.cta-panel__glow {
  position: absolute; inset: auto -20% -40% auto;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(77,142,255,0.25), transparent 70%);
  filter: blur(40px); z-index: 0; pointer-events: none;
}
.cta-panel > * { position: relative; z-index: 1; }

/* ---------- Prose measure helper (library editorial calm) ---------- */
.prose { max-width: var(--measure); margin-inline: auto; }
.prose p { color: var(--text-secondary); line-height: 1.7; }

/* ---------- Focus-visible baseline (a11y across all rooms) ---------- */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Proper site footer (brand lockup on top + link columns) ---------- */
.site-footer { border-top: 1px solid var(--glass-border); margin-top: 3rem; padding: 2.75rem 0 1.75rem; }
.site-footer__top { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; padding-bottom: 2rem; }
.site-footer__logo { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.site-footer__logo-mark { height: 40px; width: 40px; display: block; }
.site-footer__logo-text { font-family: var(--font-primary); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--text-primary); }
.site-footer__logo-text span { color: var(--brand-blue); font-weight: 600; }
.site-footer__tag { font-family: var(--font-display); font-style: italic; font-size: 0.95rem; color: var(--brand-blue); }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.75rem 2rem; max-width: 720px; margin: 0 auto; padding-bottom: 1.75rem; border-bottom: 1px solid var(--glass-border); }
.site-footer__col { display: flex; flex-direction: column; gap: 0.55rem; text-align: center; }
.site-footer__col h4 { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); margin-bottom: 0.35rem; }
.site-footer__col a { font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; transition: color var(--transition-fast); }
.site-footer__col a:hover { color: var(--text-primary); }
.site-footer__bottom { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; padding-top: 1.5rem; font-size: 0.75rem; color: var(--text-secondary); }
.site-footer__disclaimer { opacity: 0.75; max-width: 520px; }
