:root {
  /* Color Tokens */
  --brand-900: #1E293B;
  --brand-800: #1E40AF;
  --brand-700: #0F3A8D;
  --brand-100: #DBEAFE;
  --brand-50:  #EFF6FF;

  --slate-900: #0F172A;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748B;
  --slate-300: #CBD5E1;
  --slate-100: #F1F5F9;
  --slate-50:  #F8FAFC;

  --lavender: #9B8FCC;
  --amber:    #F4B942;
  --cream:    #FFF8F3;

  --positive:        #7FB069;
  --warning:         #F59E0B;
  --critical-strong: #DC2626;
  --critical-soft:   #D08770;

  /* Derived */
  --bg: var(--slate-50);
  --surface: #FFFFFF;
  --text: var(--slate-900);
  --text-muted: var(--slate-700);
  --border: var(--slate-300);
  --link: var(--brand-700);

  /* Typography */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;
  --size-xs: 12px; --size-sm: 14px; --size-md: 16px; --size-lg: 18px; --size-xl: 20px; --size-2xl: 24px; --size-3xl: 32px; --size-4xl: 40px; --size-5xl: 48px;
  --lh-tight: 1.2; --lh-normal: 1.6; --lh-loose: 1.7;

  /* Spacing & Radius */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px;

  /* Elevation & Focus */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --focus-ring: 0 0 0 3px rgba(29,78,216,0.45), 0 0 0 5px #FFFFFF;
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg); font-family: var(--font-sans);
  font-size: var(--size-md); line-height: var(--lh-normal);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
a:visited { color: var(--brand-800); }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

h1, h2, h3 { color: var(--slate-900); margin: 0 0 var(--space-4); }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; line-height: 1.1; }
h2 { font-size: clamp(24px, 3.5vw, 32px); font-weight: 600; line-height: 1.2; }
h3 { font-size: clamp(20px, 2.5vw, 24px); font-weight: 600; line-height: 1.25; }
p { margin: 0 0 var(--space-4); }
ul { margin: 0 0 var(--space-4); padding-left: 1.25rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-muted); }
.small { font-size: var(--size-sm); }
.eyebrow { font-size: var(--size-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-700); margin-bottom: var(--space-2);
}

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; left: var(--space-4); top: var(--space-4); width: auto; height: auto; padding: var(--space-2) var(--space-4); background: var(--brand-700); color: #fff; z-index: 1000; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.85); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--slate-100); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--slate-900); font-weight: 700; }
.brand-mark { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--brand-700), var(--brand-800)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); }
.brand-text { font-size: var(--size-lg); }

.nav-toggle { display: inline-flex; flex-direction: column; gap: 3px; border: 1px solid var(--border); background: #fff; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.nav-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.nav-toggle-bar { width: 22px; height: 2px; background: var(--slate-700); display: block; }

.site-nav { position: fixed; inset: 64px 0 auto 0; background: #fff; transform: translateY(-100%); transition: transform 180ms ease-out; border-bottom: 1px solid var(--slate-100); }
.site-nav.open { transform: translateY(0); }
.site-nav ul { list-style: none; display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; }
.site-nav a { display: block; padding: 14px 24px; color: var(--slate-900); text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { background: var(--brand-50); text-decoration: underline; }
.no-scroll { overflow: hidden; }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .site-nav { position: static; transform: none; border: 0; }
  .site-nav ul { flex-direction: row; gap: var(--space-6); }
  .site-nav a { padding: 0; }
}

/* Hero */
.hero { background: radial-gradient(1200px 600px at 20% -10%, var(--brand-50), transparent), radial-gradient(1000px 500px at 80% -20%, #e0edff, transparent); padding: var(--space-16) 0 var(--space-12); }
.hero-inner { text-align: center; max-width: 960px; margin: 0 auto; }
.hero-title { font-size: clamp(32px, 5vw, 48px); }
.lead { font-size: var(--size-lg); color: var(--slate-700); max-width: 75ch; margin-left: auto; margin-right: auto; }
.cta-group { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); justify-content: center; }
.micro-note { margin-top: var(--space-2); color: var(--slate-600); font-size: var(--size-sm); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 var(--space-4); border-radius: var(--radius-md); font-weight: 600; font-family: var(--font-sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background-color 160ms ease, box-shadow 160ms ease, transform 120ms ease; }
.btn--primary { 
  background: var(--brand-700); 
  color: #fff; 
  font-weight: 600;
  border: 1px solid var(--brand-700);
}
.btn--primary:hover { 
  background: var(--brand-900); 
  border-color: var(--brand-900);
  transform: translateY(-1px); 
}
.btn--secondary { background: #fff; color: var(--brand-700); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--slate-100); }
.btn--ghost { background: transparent; color: var(--brand-700); }
.btn--ghost:hover { background: var(--brand-50); }
.btn--empathy { background: var(--lavender); color: #fff; }
.btn--empathy:hover { filter: brightness(0.96); transform: translateY(-1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Sections */
.section { padding: var(--space-16) 0; }
.section + .section { border-top: 1px solid var(--slate-100); }
.section-lead { color: var(--slate-700); max-width: 75ch; }

/* Visually hidden */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Problem */
.problem-grid { display: grid; gap: var(--space-8); grid-template-columns: 1fr; align-items: start; }
.problem-aside h2 { margin-top: 0; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { padding-left: 28px; position: relative; margin-bottom: var(--space-2); }
.checklist li::before { content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-100); box-shadow: inset 0 0 0 2px var(--brand-700); }

@media (min-width: 768px) {
  .problem-grid { grid-template-columns: 1fr 2fr; }
  .problem-aside { position: sticky; top: 80px; }
}

/* Cards */
.cards { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: var(--space-4); 
  margin-top: var(--space-8); 
  grid-auto-rows: 1fr;
}
.card { 
  background: var(--surface); 
  border: 1px solid var(--border); 
  border-radius: var(--radius-lg); 
  padding: 0;
  box-shadow: var(--shadow-sm); 
  transition: box-shadow 160ms ease, transform 120ms ease, border-color 160ms ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card--interactive:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-700);
  transform: translateY(-2px);
}
.card details { 
  margin: 0; 
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card summary { 
  list-style: none; 
  display: flex; 
  align-items: start; 
  justify-content: space-between; 
  gap: var(--space-4); 
  cursor: pointer;
  padding: var(--space-6);
  transition: background-color 160ms ease;
  user-select: none;
  flex: 1;
}
.card summary:hover {
  background-color: var(--brand-50);
}
.card summary:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: -2px;
  border-radius: var(--radius-lg);
}
.card summary::-webkit-details-marker { display: none; }
.card summary h3 { 
  margin-bottom: var(--space-2);
  color: var(--brand-800);
}
.card summary p { color: var(--slate-700); margin: 0; }

/* Chevron icon */
.card .chevron {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--brand-700);
  transition: transform 240ms ease;
  margin-top: 2px;
}
.card details[open] .chevron {
  transform: rotate(90deg);
}

/* Expanded state */
.card details[open] {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-700);
  position: relative;
  z-index: 2;
}
.card details[open] summary { 
  margin-bottom: 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--slate-100);
  flex: none;
}
.card details[open] ul {
  padding: var(--space-4) var(--space-6) var(--space-6) var(--space-6);
}
.card ul { 
  margin: 0; 
  padding-left: 1.25rem; 
  color: var(--slate-700);
  list-style-type: disc;
}
.card ul li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

@media (min-width: 600px) {
  .cards { 
    grid-template-columns: repeat(2, 1fr); 
    gap: var(--space-6);
  }
}
@media (min-width: 900px) {
  .cards { 
    grid-template-columns: repeat(3, 1fr); 
    gap: var(--space-6);
  }
}

.cta-center { margin-top: var(--space-8); display: flex; justify-content: center; }

/* Callouts */
.callout { padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border); }
.callout.info { background: var(--brand-50); color: var(--slate-900); border-color: #c9ddff; }

/* Privacy */
.privacy { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.privacy .privacy-header { text-align: center; margin-bottom: var(--space-8); }
.privacy-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); margin-bottom: var(--space-6); }
.privacy-column { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); }
.privacy-column h3 { margin: 0 0 var(--space-3); font-size: var(--size-xl); }
.privacy-column ul { margin: 0; padding-left: 1.25rem; }
.privacy-column.can-submit h3::before { content: "✓"; color: var(--positive); margin-right: 8px; }
.privacy-column.cannot-submit h3::before { content: "✗"; color: var(--critical-strong); margin-right: 8px; }
.privacy-note { text-align: center; }

@media (min-width: 900px) {
  .privacy-grid { grid-template-columns: 1fr 1fr; }
}

/* About */
.about-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-8); }
.badge { display: inline-block; background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; font-size: var(--size-sm); }
.bullets { list-style: disc; }

@media (min-width: 900px) {
  .about-grid { grid-template-columns: 2fr 1fr; }
}

/* Footer */
.site-footer { background: #fff; border-top: 1px solid var(--slate-100); }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: var(--space-8); padding-top: var(--space-12); padding-bottom: var(--space-12); }
.footer-title { font-size: var(--size-lg); margin-bottom: var(--space-3); }
.footer-links { list-style: none; padding-left: 0; }
.footer-links li { margin-bottom: 8px; }

/* Placeholder links */
.placeholder-link {
  color: var(--slate-500);
  text-decoration: none;
  cursor: not-allowed;
  opacity: 0.7;
  font-style: italic;
}
.placeholder-link:hover {
  color: var(--slate-500);
  text-decoration: none;
}
.footer-meta { padding-bottom: var(--space-8); border-top: 1px solid var(--slate-100); }

@media (min-width: 768px) {
  .footer-inner { grid-template-columns: repeat(4, 1fr); }
}

/* Bottom CTA band */
.cta-band { text-align: center; padding: var(--space-16) 0; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff; }
.cta-band h2 { color: #fff; margin-bottom: var(--space-3); }
.cta-band p { color: #cbd5e1; margin-bottom: var(--space-6); }
.btn--light { 
  background: #fff; 
  color: var(--slate-900); 
  font-weight: 600;
  border: 2px solid #fff;
}
.btn--light:hover { 
  background: var(--slate-50); 
  color: var(--slate-900);
  border-color: var(--slate-50);
}

/* Loading animation */
@keyframes gentle-pulse { 
  0%, 100% { opacity: 1; } 
  50% { opacity: 0.7; } 
}
.loading { animation: gentle-pulse 1.5s ease-in-out infinite; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-nav { transition: none; }
  .card .chevron { transition: none; }
  .btn { transition: none; }
  .card { transition: none; }
  .loading { animation: none; opacity: 0.85; }
}
