:root {
  /* Brand Colors */
  --brand-primary: #D24B3B;
  --brand-secondary: #E69952;
  --brand-accent: #F5D88A;
  --brand-green: #3e605d;
  --brand-dark: #284A5E;
  --brand-black: #182328;
  --brand-light: #F2EDE7;
  
  /* Brand Color Opacity Variations */
  --brand-primary-80: rgba(210, 75, 59, 0.8);
  --brand-primary-60: rgba(210, 75, 59, 0.6);
  --brand-primary-40: rgba(210, 75, 59, 0.4);
  --brand-primary-20: rgba(210, 75, 59, 0.2);
  
  --brand-secondary-80: rgba(230, 153, 82, 0.8);
  --brand-secondary-60: rgba(230, 153, 82, 0.6);
  --brand-secondary-40: rgba(230, 153, 82, 0.4);
  --brand-secondary-20: rgba(230, 153, 82, 0.2);
  
  --brand-dark-80: rgba(40, 74, 94, 0.8);
  --brand-dark-60: rgba(40, 74, 94, 0.6);
  --brand-dark-40: rgba(40, 74, 94, 0.4);
  --brand-dark-30: rgba(40, 74, 94, 0.3);
  --brand-dark-20: rgba(40, 74, 94, 0.2);
  
  --brand-light-90: rgba(242, 237, 231, 0.9);
  --brand-light-80: rgba(242, 237, 231, 0.8);
  --brand-light-60: rgba(242, 237, 231, 0.6);
  --brand-light-40: rgba(242, 237, 231, 0.4);
  --brand-light-20: rgba(242, 237, 231, 0.2);
  
  --brand-green-80: rgba(62, 96, 93, 0.8);
  --brand-green-60: rgba(62, 96, 93, 0.6);
  --brand-green-40: rgba(62, 96, 93, 0.4);
  --brand-green-20: rgba(62, 96, 93, 0.2);
  
  --brand-blue: #3C5F68;
  --brand-blue-80: rgba(60, 95, 104, 0.8);
  --brand-blue-60: rgba(60, 95, 104, 0.6);
  --brand-blue-40: rgba(60, 95, 104, 0.4);
  --brand-blue-20: rgba(60, 95, 104, 0.2);
  
  --brand-orange: #D74C2D;
  --brand-orange-80: rgba(215, 76, 45, 0.8);
  --brand-orange-60: rgba(215, 76, 45, 0.6);
  --brand-orange-40: rgba(215, 76, 45, 0.4);
  --brand-orange-20: rgba(215, 76, 45, 0.2);
  
  --card-blue: #4A6A74;
  --text-light: #F9F9F9;
  --text-accent: #FFD18C;
  
  /* Accordion state colors */
  --blue-odd: rgba(60, 95, 104, 0.85);
  --blue-even: rgba(60, 95, 104, 0.70);
  --blue-hover: rgba(60, 95, 104, 0.92);
  
  /* Brighter, more vivid but calm color for first 5 sections */
  --vivid-blue: #4A6A74;
  --vivid-blue-80: rgba(74, 106, 116, 0.80);
  --vivid-blue-60: rgba(74, 106, 116, 0.60);
  --vivid-blue-40: rgba(74, 106, 116, 0.40);
  --vivid-blue-20: rgba(74, 106, 116, 0.20);
  --vivid-blue-hover: rgba(74, 106, 116, 0.90);
  --orange-hover: rgba(215, 76, 45, 0.92);
  --amber-accent: rgba(255, 209, 140, 0.35);
  --focus-outline: #FFD18C;
  
  /* Evidence-Backed Practices colors */
  --coral-orange: #F07F49;
  --practice-card-bg: rgba(60, 95, 104, 0.80);
  --practice-card-border: rgba(249, 249, 249, 0.08);
  --practice-card-text: rgba(249, 249, 249, 0.90);
  --practice-card-hover: rgba(60, 95, 104, 0.90);
  
  /* Founder Voices colors - dark mode brand-aligned */
  --charcoal-black: #2A2A2A;
  --forest-green: #1F4C44;
  --story-card-bg: var(--brand-dark-20);
  --story-card-border: var(--brand-dark-40);
  --story-text: var(--brand-light-80);
  --story-quote-text: var(--brand-light-90);
  --story-link-color: var(--brand-accent);
  --story-link-hover: var(--brand-secondary);
  --expanded-bg: var(--brand-dark-30);
  --expanded-accent: var(--brand-accent);
  --story-try-text: var(--brand-accent);
  
  /* Theme Colors */
  --bg: var(--brand-black);
  --card: var(--brand-black-80);
  --ink: var(--brand-light);
  --muted: var(--brand-light-60);
  --brand: var(--brand-primary);

  /* Status Colors */
  --ok: #1F4C44;
  --warn: #3C5F68;
  --alert: #7a1a1a;

  /* mobile safe areas */
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  /* keep content clear of gesture bar on mobile */
  padding-bottom: max(0px, var(--safe-bottom));
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  box-sizing: border-box;
}

.small {
  font-size: .9rem;
  color: var(--muted);
}

/* common card (used across pages, incl. results) */
.card {
  background: var(--card);
  border: 1px solid var(--brand-dark-40);
  border-radius: 12px;
  padding: 16px;
}

.site-header {
  border-bottom: 1px solid var(--brand-dark-40);
  background: var(--brand-black);
  position: sticky;
  top: 0;
  padding: max(12px, var(--safe-top)) 0 12px;
  z-index: 100;
}

.site-header .brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
}

.nav a {
  margin-left: 16px;
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover { color: var(--ink); }

.hero { 
  padding: 56px 0;
  text-align: center;
}
.hero h1 {
  font-size: 40px;
  margin: 0 0 12px;
}
.sub {
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto;
  margin-bottom: 24px;
}

.sub.authority {
  margin-top: 24px;
  margin-bottom: 8px;
}

.btn {
  display: inline-block;
  padding: 14px 24px; /* Increased padding for better mobile tap targets */
  border-radius: 12px;
  background: #2a2f3a;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid #2f3643;
  cursor: pointer;
  font-size: 16px; /* prevents iOS zoom */
  transition: all 0.2s ease; /* Smoother transition */
  min-height: 52px; /* Larger tap target */
  touch-action: manipulation; /* Improves mobile tap responsiveness */
}
.btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-light);
}
.btn-primary:hover {
  background: var(--brand-secondary-80);
  border-color: var(--brand-secondary-80);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brand-primary-40);
}
.btn:hover { 
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Secondary button styles */
.btn-secondary {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--brand-light);
}
.btn-secondary:hover {
  background: var(--brand-dark-80);
  border-color: var(--brand-dark-80);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brand-dark-40);
}

/* CTA button polish */
.cta-btn {
  font-weight: 600;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin: 24px 0;
}

/* Mobile button optimization */
@media (max-width: 640px) {
  .btn {
    width: 100%; /* Full width on mobile */
    justify-content: center;
  }
  
  .btn-primary {
    width: 100%;
  }
}

/* Enhanced score styling for better contrast */
.meter-score {
  color: var(--brand-secondary) !important;
  font-weight: 700 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
}

/* Better spacing for content sections */
.result-card h3 {
  margin-bottom: 12px !important;
}

.result-card ul {
  line-height: 1.6 !important;
}

.result-card .cta-bar {
  margin-top: 20px !important;
  gap: 12px !important;
}
.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brand-primary-40);
}

.site-footer {
  border-top: 1px solid var(--brand-dark-40);
  margin-top: 40px;
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
}

.hidden { display: none; }

/* ----- Header: one-line layout + active state ----- */
.header-row{
  display:flex;
  align-items:center;
  gap:28px;
  min-height:56px;
}
.header-row .brand{
  font-weight:700;
  letter-spacing:.2px;
}
.header-row .nav{
  margin-left:auto;
  display:flex;
  gap:18px;
}
.header-row .nav a{ margin:0; }
.header-row .nav a.active{
  color:#fff;
  text-decoration:underline;
}
main.container{ padding-top:8px; }

/* --- Quiz cards & spacing --- */
.q {
  margin: 22px 0; /* Increased spacing */
  padding: 18px; /* More padding for better breathing room */
  border: 1px solid var(--brand-dark-40);
  border-radius: 12px;
  background: var(--brand-black-80);
}
.q h3 { margin: 0 0 12px; font-size: 18px; }

/* --- 0 to 4 scale as ROWS with clear selected state --- */
.scale { display: grid; gap: 8px; }
.scale label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px; /* Increased padding for better tap targets */
  border-radius: 12px; /* More rounded corners */
  background: var(--brand-black-80);
  border: 1px solid var(--brand-dark-40);
  cursor: pointer;
  min-height: 56px; /* Larger tap target */
  transition: all 0.2s ease; /* Smoother transition */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}
.scale label:hover { 
  background: var(--brand-dark-80);
  border-color: var(--brand-dark);
  color: var(--brand-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--brand-dark-40);
}

.scale input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

/* Focus ring on the whole row for accessibility */
.scale label:focus-within {
  box-shadow: 0 0 0 2px var(--brand-primary-40);
  border-color: var(--brand-primary);
}

/* Selected state: highlight the whole row */
.scale label.selected {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-light) !important;
  box-shadow: 0 4px 12px var(--brand-primary-40);
  transform: translateY(-1px);
}

/* Ensure text is visible in selected state */
.scale label.selected span {
  color: var(--brand-light) !important;
  font-weight: 600;
}

/* Enhanced radio button styling for selected state */
.scale label.selected input[type="radio"] {
  accent-color: var(--brand-light);
}

/* Ensure the entire label content is visible when selected */
.scale label.selected * {
  color: var(--brand-light) !important;
}
.scale input:checked + span {
  color: var(--brand-primary);
  font-weight: 600;
}

/* score/progress */
.progress { margin: 8px 0 16px; color: var(--muted); }
.badge {
  display: inline-block;
  padding: 6px 12px; /* More padding for better appearance */
  border-radius: 999px;
  background: var(--brand-secondary);
  color: var(--brand-light);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* resources lists */
.card ol, .card ul { margin: 8px 0 0 18px; }
.card li { margin: 6px 0; }
details > summary { cursor: pointer; list-style: none; }
details > summary::marker { content: ""; }
details[open] summary { opacity: .95; }
pre.small {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink);
}

/* results page tweaks */
.results .card h2 { margin-top: 0; }
.share .btn { padding:10px 14px; }
/* leave room at bottom so chat widget doesn't cover CTAs */

/* Breadcrumb Navigation */
.breadcrumb {
  margin-bottom: 20px;
  padding: 12px 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: var(--brand-light-60);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin: 0 8px;
  color: var(--brand-light-40);
  font-weight: 500;
}

.breadcrumb-item a {
  color: var(--brand-light-60);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

.breadcrumb-item a[aria-current="page"] {
  color: var(--brand-light);
  font-weight: 500;
  text-decoration: none;
  pointer-events: none;
}

.breadcrumb-item a[aria-current="page"]:hover {
  color: var(--brand-light);
  text-decoration: none;
}

@media (max-width: 640px) {
  .breadcrumb-list {
    font-size: 13px;
  }
  
  .breadcrumb-item:not(:last-child)::after {
    margin: 0 6px;
  }
}

/* Content Freshness Styles */
.content-freshness {
  margin-top: 12px;
  padding: 6px 12px;
  background: rgba(30, 41, 59, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.last-updated {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.update-icon {
  font-size: 12px;
  opacity: 0.7;
}

.version-badge {
  background: #D74C2D;
  color: white;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-left: auto;
}

.time {
  font-weight: 400;
  color: #cbd5e1;
}

/* Content Age Indicators */
.content-age {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.content-age.fresh {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.content-age.recent {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.content-age.updated {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.share { margin-bottom: calc(12px + var(--safe-bottom)); }

/* ---------- DESKTOP OPTIMIZATION ---------- */
@media (min-width: 641px) {
  .hero {
    padding: 80px 0;
  }
  .hero h1 {
    font-size: 48px;
    line-height: 1.2;
  }
  .sub {
    font-size: 18px;
    line-height: 1.5;
  }
  .container {
    padding: 32px 24px;
  }
}

/* ---------- MOBILE POLISH ---------- */
@media (max-width:640px){
  .container{ padding:16px; }
  .hero{ padding:32px 0; }
  .hero h1{ font-size:28px; }
  .q{ padding:12px; }
  .scale label{ padding:12px; font-size:14px; }
  .btn{ width:100%; text-align:center; }
  .cta-btn{ width:100%; justify-content:center; }
  .results .card{ padding:16px; }
  .nav a{ margin-left:12px; font-size:14px; }
  .share{ display:flex; flex-direction:column; gap:10px; }
}

/* Touch devices: avoid sticky hover effects */
@media (hover: none) {
  .btn:hover { opacity: 1; box-shadow: none; transform: none; }
  .cta-btn:hover { box-shadow: none; transform: none; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Accordion state styles */
.accordion-header {
  transition: all 0.2s ease;
}

.accordion-header:hover {
  background: var(--vivid-blue-hover) !important;
}

.accordion-header:focus {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.accordion-header[aria-expanded="true"] {
  border: 1px solid var(--amber-accent) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

/* Personalized Guidance specific hover */
.personalized-guidance .accordion-header:hover {
  background: var(--orange-hover) !important;
}

/* Evidence-Backed Practices card styles */
.practice-card {
  transition: all 0.2s ease;
  cursor: pointer;
}

.practice-card:hover {
  background: var(--practice-card-hover) !important;
}

.practice-card:focus {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}

.practice-link {
  color: var(--text-accent);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.practice-link:hover {
  color: var(--coral-orange);
  text-decoration: underline;
}

/* Founder Voices story button styles */
.story-button {
  background: var(--story-button-bg);
  color: var(--text-light);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: underline;
}

.story-button:hover {
  background: var(--story-button-hover);
}

/* Founder Voices story link styles */
.story-link {
  color: var(--story-link-color);
  text-decoration: underline;
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
  margin-bottom: 12px;
}

.story-link:hover {
  color: var(--story-link-hover);
  text-decoration: underline;
}

input[type="range"] {
  appearance: none;
  height: 4px;
  background: #273045;
  border-radius: 999px;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff1;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff1;
}

/* Slider label styling for first set of questions */
.slider-label-first-set {
  font-size: 0.85em !important;
  color: var(--brand-light-40) !important;
}

/* ===== Results page polish ===== */

/* big stage + score */
.result-hero {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}
.result-stage {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: .2px;
}
.result-sub {
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  color: var(--muted);
}
.result-score {
  font-size: clamp(18px, 2.8vw, 24px);
  font-weight: 700;
  color: var(--ink);
}

/* thicker progress bar */
.scorebar {
  background:#0f1420;
  border:1px solid #273045;
  border-radius:12px;
  height:16px;             /* thicker */
  overflow:hidden;
}
.scorebar-fill {
  height:100%;
  width:0%;
  background: linear-gradient(90deg, #D74C2D, #f07a60);
  transition: width .6s ease;
}

/* two-block layout (auto-stacks on mobile) */
.result-grid {
  display:grid;
  gap:16px;
}
@media (min-width: 840px){
  .result-grid {
    grid-template-columns: 1.15fr .85fr;  /* content | actions */
    align-items:start;
  }
}

/* share card preview */
.sharecard {
  border:1px solid #273045; background:#0f1420; border-radius:12px;
  padding:16px;
}
.sharecard h4 { margin:0 0 8px; font-size:16px; }
.sharecard p { margin:4px 0 0; color:var(--muted); }

/* stage image block */
.stage-art {
  border:1px solid #273045; background:#0f1420; border-radius:12px;
  padding:12px; display:flex; align-items:center; justify-content:center;
}
.stage-art img { max-width:100%; height:auto; border-radius:10px; }

/* buttons row inside results */
.actions-row { display:flex; flex-wrap:wrap; gap:10px; }

/* form input */
.input {
  width:100%; background:#0f1420; border:1px solid #273045; color:var(--ink);
  border-radius:10px; padding:12px 14px; font-size:16px;
}
.input:focus { outline:2px solid var(--brand); outline-offset:2px; }

/* ===== Results hierarchy & meter ===== */
.result-header .stage-title{
  font-size: 34px;
  line-height: 1.15;
  margin: 8px 0 6px;
}
@media (max-width:640px){
  .result-header .stage-title{ font-size: 26px; }
}

.score-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin: 4px 0 10px;
}
.score-pill{
  background:#1b2234;
  color:#eaeef9;
  border:1px solid #273045;
  border-radius:999px;
  padding:6px 12px;
  font-weight:600;
}

/* Progress meter */
.meter{
  background:#0f1420;
  border:1px solid #273045;
  border-radius:999px;
  height:48px;               /* taller to accommodate large score text */
  overflow:hidden;           /* prevents any end-cap artifacts */
  position: relative;        /* for absolute positioning of score text */
}
.meter-fill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, var(--warn), var(--brand));
  transition: width .6s ease;
}
.meter-score{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 1;
}
