:root {
  /* Warm dark — Claude.ai palette */
  --bg-page:      #1C1917;
  --bg-card:      #292524;
  --bg-raised:    #312E2B;
  --bg-hover:     #3D3935;
  --bg-border:    #44403C;

  /* Text */
  --text-primary:   #E7E5E4;
  --text-secondary: #A8A29E;
  --text-muted:     #78716C;

  /* Accents */
  --coral:       #D97757;
  --coral-light: #E8956A;
  --coral-dark:  #B85C3C;
  --teal:        #5EEAD4;
  --teal-dark:   #0D9488;
  --gold:        #FBBF24;
  --red:         #C41E2A;
  --green:       #4ADE80;

  /* Typography */
  --font-display: 'Newsreader', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Type scale */
  --text-hero:  clamp(1.9rem, 4vw, 3.5rem);    /* 30px → 56px */
  --text-h2:    clamp(1.45rem, 2.8vw, 2.2rem); /* 23px → 35px */
  --text-h3:    1.05rem;                         /* ~16.8px */
  --text-body:  0.925rem;                        /* ~14.8px */
  --text-sm:    0.7rem;                          /* ~11.2px */
  --text-xs:    0.65rem;                         /* ~10.4px */
  --text-nav:   0.8125rem;                       /* 13px */
  --text-stat:  clamp(1.5rem, 2.5vw, 2.75rem);  /* 24px → 44px */

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.2);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.5), 0 8px 16px rgba(0,0,0,.3);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-mid:  280ms cubic-bezier(.4,0,.2,1);
  --t-slow: 500ms cubic-bezier(.4,0,.2,1);

  /* Legacy aliases (keep for other templates) */
  --bg-dark:    #1C1917;
  --bg-light:   #F5F5F4;
  --navy:       #1C1917;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --shadow-red: 0 8px 24px rgba(196,30,42,.25);
  --t-normal:   280ms cubic-bezier(.4,0,.2,1);
  --accent-red:   #D97757;
  --accent-teal:  #5EEAD4;
  --accent-gold:  #FBBF24;
  --accent-navy:  #5EEAD4;
  --accent-blue:  #5EEAD4;
  --accent-green: #4ADE80;
  --text-inverted: #E7E5E4;
  --transition-fast: 150ms ease;
}

/* Light mode overrides — applied when <html data-theme="light"> */
/* Using html[data-theme="light"] (specificity 0,1,1) to beat :root (0,1,0) */
html[data-theme="light"] {
  --bg-page:        #FAF9F7;
  --bg-card:        #F0EDE8;
  --bg-raised:      #E8E4DE;
  --bg-hover:       #DDD8D0;
  --bg-border:      #D6D0C8;
  --text-primary:   #1C1917;
  --text-secondary: #57534E;
  --text-muted:     #78716C;
  --bg-dark:        #FAF9F7;
  --navy:           #1C1917;
  --accent-red:     #D97757;
  --accent-teal:    #5EEAD4;
  --accent-gold:    #FBBF24;
  --accent-navy:    #5EEAD4;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 16px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:      0 20px 40px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.08);
  background-color: #FAF9F7;
}

/* Explicit light-mode element overrides — direct hex + !important to beat any
   later-cascade rules (inline <style> blocks, base.css, etc.) */
html[data-theme="light"] body { background-color: #FAF9F7 !important; color: #1C1917 !important; }
html[data-theme="light"] nav.main-nav { background-color: #F0EDE8 !important; border-bottom-color: #D6D0C8 !important; }
html[data-theme="light"] .nav-inner { background-color: #F0EDE8 !important; }
html[data-theme="light"] .topbar { background-color: #E8E4DE !important; color: #57534E !important; }
html[data-theme="light"] .topbar a { color: #57534E !important; }
html[data-theme="light"] .card,
html[data-theme="light"] .prog-card,
html[data-theme="light"] .metric-card { background-color: #F0EDE8 !important; border-color: #D6D0C8 !important; }
html[data-theme="light"] #radioBar { background-color: #E8E4DE !important; border-top-color: #D6D0C8 !important; }
html[data-theme="light"] footer,
html[data-theme="light"] .site-footer { background-color: #E8E4DE !important; border-top-color: #D6D0C8 !important; }
html[data-theme="light"] #mobileMenu { background-color: #FAF9F7 !important; }
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5 { color: #1C1917 !important; }
html[data-theme="light"] .nav-link { color: #57534E !important; }
html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active { color: #1C1917 !important; background-color: #E8E4DE !important; }
html[data-theme="light"] p,
html[data-theme="light"] span,
html[data-theme="light"] li,
html[data-theme="light"] div { color: inherit; }

/* TASK 1 fix — force inline color:var(--text-*) elements to readable values.
   Attribute selector specificity 0,2,1 + !important beats inline style (1,0,0) */
html[data-theme="light"] *[style*="color:var(--text-primary)"],
html[data-theme="light"] *[style*="color: var(--text-primary)"] { color: #1C1917 !important; }
html[data-theme="light"] *[style*="color:var(--text-secondary)"],
html[data-theme="light"] *[style*="color: var(--text-secondary)"] { color: #57534E !important; }
html[data-theme="light"] *[style*="color:var(--text-muted)"],
html[data-theme="light"] *[style*="color: var(--text-muted)"] { color: #78716C !important; }

/* Hero section light mode — use hardcoded hex to bypass any var() cascade issues.
   .page-hero uses var(--navy) = #1C1917 in both modes; text is hardcoded white. */
html[data-theme="light"] .page-hero,
html[data-theme="light"] .listen-hero,
html[data-theme="light"] .hero-section { background-color: #E8E4DE !important; background-image: none !important; color: #1C1917 !important; }
html[data-theme="light"] .page-hero-title { color: #1C1917 !important; }
html[data-theme="light"] .page-hero-sub { color: #57534E !important; }
html[data-theme="light"] .page-hero-label { color: #D97757 !important; }

/* Smooth theme transition — applies to all elements that use these vars */
body, .site-footer, nav.main-nav, .topbar, #radioBar,
[class*="bg-"], .card, .metric-card, .case-card,
.partner-card, .quote-card, .prog-card, .recog-item {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
