@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,700&family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Backgrounds ── */
  --bg:       #F8F7F3;
  --surface:  #FFFFFF;
  --elevated: #F2F1ED;

  /* ── Navy (primary) ── */
  --navy:       #0C1F3F;
  --navy-light: #14305A;
  --navy-dim:   rgba(12,31,63,0.07);

  /* ── Gold (accent — use sparingly) ── */
  --gold:       #8B6B14;
  --gold-light: #A07B1A;
  --gold-dim:   rgba(139,107,20,0.09);

  /* ── Text ── */
  --text-1: #0D0D1A;
  --text-2: #4C4B64;
  --text-3: #8A8A9E;

  /* ── Status ── */
  --green:        #166534;
  --green-bg:     #F0FDF4;
  --green-border: rgba(22,101,52,0.18);
  --red:          #991B1B;
  --red-bg:       #FEF2F2;
  --red-border:   rgba(153,27,27,0.18);
  --blue:         #1E40AF;
  --blue-bg:      #EFF6FF;
  --blue-border:  rgba(30,64,175,0.18);
  --orange:       #9A3412;
  --orange-bg:    #FFF7ED;
  --orange-border:rgba(154,52,18,0.18);

  /* ── Borders & shadows ── */
  --border:        #E4E3DF;
  --border-subtle: #EDECEA;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 12px 40px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.07), 0 30px 80px rgba(0,0,0,0.10);

  /* ── Radii ── */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:  12px;
  --r-xl:  24px;
  --r-full: 9999px;
}

/* ── Base ───────────────────────────────────── */

html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
  color: var(--text-1);
}

h1 { font-size: clamp(2rem,4.5vw,3.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem,3vw,2.25rem); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }

p   { line-height: 1.7; color: var(--text-2); }
a   { color: inherit; text-decoration: none; }
em  { font-style: italic; }

/* ── Layout ─────────────────────────────────── */

.container    { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.container-sm { max-width: 760px;  margin: 0 auto; padding: 0 48px; }
section { padding: 100px 0; }

/* ── Keyframes ──────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── NAV ────────────────────────────────────── */

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 68px; padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(248,247,243,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.2s, background 0.2s;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Playfair Display', serif;
  font-weight: 700; font-size: 1.1rem;
  color: var(--navy); letter-spacing: -0.01em;
}

.nav-logo-mark {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--navy); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.9375rem; font-weight: 700;
}

.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }

.nav-links a {
  padding: 6px 14px; border-radius: var(--r-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover, .nav-links a[style*="var(--text-1)"] {
  color: var(--navy); background: var(--navy-dim);
}

.nav-actions { display: flex; align-items: center; gap: 8px; }

/* ── BUTTONS ────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.15s; white-space: nowrap;
  border-radius: var(--r-md); letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--navy); color: #FFFFFF;
  padding: 12px 24px; font-size: 0.9375rem;
}
.btn-primary:hover {
  background: var(--navy-light);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border);
  padding: 11px 22px; font-size: 0.9375rem;
}
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-dim); }

.btn-sm { padding: 7px 16px; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn-lg { padding: 15px 32px; font-size: 1rem; }

/* ── LABEL + TAGS ───────────────────────────── */

.label {
  display: inline-block;
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold);
}

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em;
}

.tag-gold   { color: var(--gold);   background: var(--gold-dim);   border: 1px solid rgba(139,107,20,0.18); }
.tag-green  { color: var(--green);  background: var(--green-bg);   border: 1px solid var(--green-border); }
.tag-red    { color: var(--red);    background: var(--red-bg);     border: 1px solid var(--red-border); }
.tag-blue   { color: var(--blue);   background: var(--blue-bg);    border: 1px solid var(--blue-border); }
.tag-muted  { color: var(--text-3); background: var(--elevated);   border: 1px solid var(--border); }
.tag-navy   { color: var(--navy);   background: var(--navy-dim);   border: 1px solid rgba(12,31,63,0.15); }

/* ── PROGRESS TRACK ─────────────────────────── */

.progress-track { width: 100%; height: 3px; background: var(--border); border-radius: var(--r-full); overflow: hidden; }
.progress-fill  { height: 100%; background: var(--navy); border-radius: var(--r-full); transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

/* ── HERO ───────────────────────────────────── */

.hero {
  padding-top: 148px; padding-bottom: 100px;
  position: relative; overflow: hidden;
  background: var(--bg);
}

.hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: var(--border);
}


.hero-content {
  position: relative;
  max-width: 760px;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold);
  margin-bottom: 24px;
}
.hero-eyebrow::before {
  content: ''; display: block;
  width: 28px; height: 1.5px; background: var(--gold);
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
  margin-bottom: 24px; color: var(--text-1);
}

.hero h1 em {
  font-style: italic; color: var(--navy);
}

.hero-sub {
  font-size: 1.0625rem; color: var(--text-2);
  max-width: 520px; line-height: 1.75; margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── STATS BAR ──────────────────────────────── */

.stats-bar {
  margin-top: 64px;
  display: flex; align-items: stretch;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  overflow: hidden; max-width: 680px;
}

.stat-item { flex: 1; padding: 20px 28px; }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.875rem; font-weight: 700;
  color: var(--navy); line-height: 1; margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-value span { color: var(--gold); }
.stat-label { font-size: 0.75rem; color: var(--text-3); font-weight: 500; line-height: 1.4; }
.stat-divider { width: 1px; background: var(--border); flex-shrink: 0; }

/* ── SECTION HEADERS ────────────────────────── */

.section-header { text-align: center; max-width: 580px; margin: 0 auto 64px; }
.section-header .label { margin-bottom: 12px; }
.section-header h2 { margin-bottom: 14px; }
.section-header p  { font-size: 1rem; color: var(--text-2); line-height: 1.7; }

/* ── STEPS GRID ─────────────────────────────── */

.steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.step-card {
  padding: 36px 28px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.15s;
}
.step-card:last-child { border-right: none; }
.step-card:hover { background: var(--bg); }
.step-connector { display: none; }

.step-number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.9375rem; font-weight: 700; margin-bottom: 18px;
}

.step-card h3 { font-size: 1rem; margin-bottom: 8px; }
.step-card p  { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; }

/* ── FEATURES GRID ──────────────────────────── */

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }

.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 32px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.feature-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.feature-icon-gold  { background: var(--gold-dim);  color: var(--gold); }
.feature-icon-blue  { background: var(--blue-bg);   color: var(--blue); }
.feature-icon-green { background: var(--green-bg);  color: var(--green); }
.feature-icon-navy  { background: var(--navy-dim);  color: var(--navy); }

.feature-card h3 { font-size: 1rem; margin-bottom: 10px; }
.feature-card p  { font-size: 0.875rem; line-height: 1.7; }

/* ── CTA BANNER ─────────────────────────────── */

.cta-banner {
  background: var(--navy); border-radius: var(--r-xl);
  padding: 72px 60px; text-align: center;
}
.cta-banner .label { color: rgba(255,255,255,0.45); }
.cta-banner h2 { color: #FFFFFF; margin-bottom: 16px; }
.cta-banner p  { color: rgba(255,255,255,0.6); max-width: 480px; margin: 0 auto 36px; font-size: 1.0625rem; }
.cta-banner .btn-primary { background: #FFFFFF; color: var(--navy); }
.cta-banner .btn-primary:hover { background: var(--bg); box-shadow: var(--shadow-md); }

/* ── FOOTER ─────────────────────────────────── */

footer { background: var(--navy); padding: 52px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; }

footer .nav-logo { color: #FFFFFF; }
footer .nav-logo-mark { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.15); }

.footer-links { display: flex; gap: 4px; list-style: none; }
.footer-links a {
  font-size: 0.8125rem; color: rgba(255,255,255,0.45);
  padding: 6px 12px; border-radius: var(--r-sm);
  transition: color 0.15s;
}
.footer-links a:hover { color: rgba(255,255,255,0.85); }
.footer-copy { font-size: 0.8125rem; color: rgba(255,255,255,0.3); }

/* ── QUIZ ───────────────────────────────────── */

.quiz-page { min-height: 100vh; padding-top: 68px; display: flex; flex-direction: column; background: var(--bg); }

.quiz-header {
  padding: 0; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.quiz-header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 48px;
}
.quiz-step-label { font-size: 0.8125rem; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.quiz-progress { flex: 1; max-width: 400px; }

.quiz-body { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 56px 20px 80px; }

.quiz-card { width: 100%; max-width: 660px; animation: fadeUp 0.3s ease-out; }

.quiz-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 48px; box-shadow: var(--shadow-md);
}

.quiz-step-num {
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 10px;
}

.quiz-question {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 700; color: var(--text-1); line-height: 1.3; margin-bottom: 8px;
}

.quiz-subtitle { font-size: 0.9375rem; color: var(--text-3); margin-bottom: 32px; line-height: 1.5; }

/* Options */
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 10px; margin-bottom: 32px; }
.options-grid-2 { grid-template-columns: repeat(2, 1fr); }

.option-card {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px; cursor: pointer;
  transition: all 0.15s; display: flex; align-items: center; gap: 12px;
}
.option-card:hover   { border-color: var(--navy); background: var(--navy-dim); }
.option-card.selected { border-color: var(--navy); background: var(--navy-dim); }
.option-card.selected .option-icon { background: var(--navy); color: #FFFFFF; }

.option-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--elevated); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; flex-shrink: 0; transition: all 0.15s; font-style: normal;
}

.option-label    { font-size: 0.9375rem; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.option-sublabel { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }

/* Checkboxes */
.checkbox-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }

.checkbox-card {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r-md);
  padding: 14px 18px; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 12px;
}
.checkbox-card:hover   { border-color: var(--navy); background: var(--navy-dim); }
.checkbox-card.checked { border-color: var(--navy); background: var(--navy-dim); }

.checkbox-box {
  width: 20px; height: 20px; border-radius: 4px; border: 2px solid var(--border);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; transition: all 0.15s; color: #FFFFFF;
}
.checkbox-card.checked .checkbox-box { background: var(--navy); border-color: var(--navy); }

/* Sliders */
.sliders-group { display: flex; flex-direction: column; gap: 28px; margin-bottom: 32px; }
.slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.slider-label  { font-size: 0.9375rem; font-weight: 500; color: var(--text-1); }
.slider-value  {
  font-size: 0.8125rem; font-weight: 700; color: var(--navy);
  background: var(--navy-dim); padding: 2px 10px; border-radius: var(--r-full); min-width: 48px; text-align: center;
}
.slider-labels { display: flex; justify-content: space-between; margin-top: 8px; }
.slider-labels span { font-size: 0.75rem; color: var(--text-3); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--border); border-radius: var(--r-full);
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--navy); cursor: pointer;
  box-shadow: 0 2px 6px rgba(12,31,63,0.25);
  border: 2px solid #FFFFFF; transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--navy); cursor: pointer; border: 2px solid #FFFFFF; }

/* Quiz nav */
.quiz-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; border-top: 1px solid var(--border-subtle);
}

/* ── RESULTS ────────────────────────────────── */

.results-page { padding-top: 68px; min-height: 100vh; background: var(--bg); }

.results-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 64px 0 52px;
}

.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 40px;
  margin-bottom: 32px; box-shadow: var(--shadow-sm);
}

.profile-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.profile-name { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.sw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px; }

.sw-card { padding: 20px; border-radius: var(--r-lg); }
.sw-card.strength { background: var(--green-bg);  border: 1px solid var(--green-border); }
.sw-card.weakness { background: var(--gold-dim);   border: 1px solid rgba(139,107,20,0.18); }

.sw-card h4 {
  font-family: 'Playfair Display', serif;
  font-size: 0.875rem; font-weight: 700; margin-bottom: 12px;
}
.sw-card.strength h4 { color: var(--green); }
.sw-card.weakness h4 { color: var(--gold); }

.sw-items { display: flex; flex-direction: column; gap: 8px; }
.sw-item  { font-size: 0.875rem; color: var(--text-2); display: flex; align-items: flex-start; gap: 9px; line-height: 1.5; }
.sw-dot   { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; margin-top: 8px; }
.sw-card.strength .sw-dot { background: var(--green); }
.sw-card.weakness .sw-dot { background: var(--gold); }

/* Learning path */
.learning-path { display: flex; flex-direction: column; gap: 10px; }

.module-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 24px;
  display: flex; align-items: center; gap: 20px;
  transition: all 0.15s; cursor: pointer; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-xs);
}
.module-card:hover { border-color: var(--navy); transform: translateX(3px); box-shadow: var(--shadow-sm); }

.module-rank {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.rank-1     { background: rgba(12,31,63,0.15); color: var(--navy); }
.rank-2     { background: rgba(12,31,63,0.10); color: var(--navy); }
.rank-3     { background: rgba(12,31,63,0.07); color: var(--navy-light); }
.rank-other { background: var(--elevated); color: var(--text-3); }

.module-info { flex: 1; }
.module-name { font-size: 1rem; font-weight: 600; margin-bottom: 3px; }
.module-desc { font-size: 0.875rem; color: var(--text-2); }
.module-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* ── CASES ──────────────────────────────────── */

.cases-page { padding-top: 68px; min-height: 100vh; background: var(--bg); }

.cases-header {
  padding: 60px 0 44px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  background: var(--surface);
}

.cases-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.cases-filters { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-btn {
  padding: 7px 16px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-family: 'Inter', sans-serif;
}
.filter-btn:hover   { border-color: var(--navy); color: var(--navy); }
.filter-btn.active  { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }

.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.case-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; box-shadow: var(--shadow-xs);
}
.case-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.case-card-top { padding: 24px; flex: 1; }

.case-difficulty-bar { height: 3px; width: 100%; margin-bottom: 20px; }
.diff-easy   { background: var(--green); }
.diff-medium { background: var(--gold); }
.diff-hard   { background: var(--red); }

.case-title   {
  font-family: 'Playfair Display', serif;
  font-size: 1.0625rem; font-weight: 700; margin-bottom: 5px; line-height: 1.3;
}
.case-company { font-size: 0.8125rem; color: var(--text-3); margin-bottom: 12px; }
.case-tags    { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }

.case-card-footer {
  padding: 13px 24px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
}
.case-meta { font-size: 0.8125rem; color: var(--text-3); display: flex; align-items: center; gap: 5px; }

/* ── DASHBOARD ──────────────────────────────── */

.dashboard-page { padding-top: 68px; min-height: 100vh; background: var(--bg); }

.dashboard-header {
  padding: 52px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  background: var(--surface);
}
.dashboard-welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.d-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.d-grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.d-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }

.d-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-xs);
}
.d-card-lg { padding: 26px; }
.d-card-title {
  font-size: 0.75rem; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 14px;
}

.metric-big {
  font-family: 'Playfair Display', serif;
  font-size: 2.25rem; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1; margin-bottom: 4px; color: var(--navy);
}
.metric-sub    { font-size: 0.8rem; color: var(--text-3); font-weight: 500; }
.metric-change { font-size: 0.8125rem; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.change-up   { color: var(--green); }
.change-down { color: var(--red); }

/* Heatmap */
.heatmap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.heatmap-cell {
  aspect-ratio: 1; border-radius: var(--r-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: default; transition: transform 0.15s; padding: 4px;
}
.heatmap-cell:hover { transform: scale(1.06); }

.heat-name  { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; line-height: 1.2; }
.heat-count { font-size: 0.875rem; font-weight: 700; }

.heat-0 { background: var(--elevated); color: var(--text-3); }
.heat-1 { background: rgba(12,31,63,0.08); color: var(--navy); }
.heat-2 { background: rgba(12,31,63,0.18); color: var(--navy); }
.heat-3 { background: rgba(12,31,63,0.35); color: #FFFFFF; }
.heat-4 { background: rgba(12,31,63,0.60); color: #FFFFFF; }
.heat-5 { background: var(--navy); color: #FFFFFF; }

/* Mini bar chart */
.mini-chart { display: flex; align-items: flex-end; gap: 5px; height: 72px; margin-top: 12px; }
.bar-col    { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-fill   { width: 100%; border-radius: 3px 3px 0 0; background: var(--navy-dim); border: 1px solid rgba(12,31,63,0.12); transition: background 0.2s; min-height: 4px; }
.bar-fill:hover { background: rgba(12,31,63,0.15); }
.bar-fill.bar-active { background: rgba(12,31,63,0.25); border-color: rgba(12,31,63,0.2); }
.bar-label-x { font-size: 0.65rem; color: var(--text-3); }

/* Rank */
.rank-display { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px 0; }
.rank-number  {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem; font-weight: 700; letter-spacing: -0.04em; color: var(--navy); line-height: 1;
}
.rank-of         { font-size: 0.875rem; color: var(--text-2); }
.rank-percentile { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }

/* Progress rows */
.progress-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.progress-row-item { display: flex; flex-direction: column; gap: 6px; }
.progress-row-header { display: flex; justify-content: space-between; font-size: 0.875rem; }
.progress-row-label  { font-weight: 500; }
.progress-row-val    { color: var(--text-2); }

/* Maths ring */
.maths-stats { display: flex; align-items: center; gap: 20px; margin-top: 8px; }
.maths-ring  { position: relative; width: 80px; height: 80px; flex-shrink: 0; }
.maths-ring svg { transform: rotate(-90deg); }
.maths-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; color: var(--navy); }
.maths-breakdown { flex: 1; }
.maths-line      { display: flex; justify-content: space-between; font-size: 0.8125rem; margin-bottom: 4px; }
.maths-line-label { color: var(--text-2); }
.maths-line-val   { font-weight: 600; }

/* Leaderboard */
.leaderboard { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--bg); border-radius: var(--r-md); border: 1px solid var(--border);
}
.lb-row.lb-me { background: var(--navy-dim); border-color: rgba(12,31,63,0.18); }
.lb-rank  { font-size: 0.8125rem; font-weight: 700; color: var(--text-3); width: 24px; }
.lb-name  { font-size: 0.875rem; font-weight: 500; flex: 1; }
.lb-score { font-size: 0.875rem; font-weight: 700; color: var(--navy); }
.lb-cases { font-size: 0.8rem; color: var(--text-3); }

/* ── UTILITIES ──────────────────────────────── */

.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-2); }
.text-sm      { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }
.hidden       { display: none !important; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }

/* ── RESPONSIVE ─────────────────────────────── */

@media (max-width: 1024px) {
  .steps-grid   { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .d-grid-4    { grid-template-columns: repeat(2, 1fr); }
  .d-grid-main { grid-template-columns: 1fr; }
  .d-grid-3    { grid-template-columns: repeat(2, 1fr); }
  .step-card   { border-bottom: 1px solid var(--border); border-right: none; }
  .step-card:nth-child(odd) { border-right: 1px solid var(--border); }
  .step-card:nth-last-child(-n+2) { border-bottom: none; }
  .step-card:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .container, .container-sm { padding: 0 20px; }
  section { padding: 72px 0; }
  .nav-links { display: none; }
  .hero { padding-top: 120px; padding-bottom: 72px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid    { grid-template-columns: 1fr; border: none; gap: 12px; }
  .step-card     { border: 1px solid var(--border) !important; border-radius: var(--r-lg); }
  .step-connector { display: none; }
  .stats-bar     { flex-direction: column; max-width: 100%; }
  .stat-divider  { width: 100%; height: 1px; }
  .sw-grid       { grid-template-columns: 1fr; }
  .d-grid-4      { grid-template-columns: 1fr 1fr; }
  .d-grid-3      { grid-template-columns: 1fr; }
  .cta-banner    { padding: 44px 28px; }
  .cases-header  { padding: 40px 0 32px; }
  .quiz-step     { padding: 32px 24px; }
  .options-grid-2 { grid-template-columns: 1fr; }
  .quiz-header-inner { padding: 16px 20px; }
}

@media (max-width: 480px) {
  .d-grid-4 { grid-template-columns: 1fr; }
}

/* ── FOCUS RINGS ────────────────────────────────── */

:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 2px;
}

.btn:focus-visible        { outline-offset: 3px; }
input:focus-visible       { outline: 2px solid var(--navy); outline-offset: 0; border-radius: var(--r-sm); }
.filter-btn:focus-visible { outline-offset: 3px; }
.option-card:focus-visible,
.checkbox-card:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: var(--r-md);
}

/* ── MOBILE NAV ─────────────────────────────────── */

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-1);
  transition: background 0.15s;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}
.nav-hamburger:hover       { background: var(--navy-dim); }
.nav-hamburger:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.nav-mobile-panel {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 998;
  padding: 16px 20px 40px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.15s ease;
}
.nav-mobile-panel.open { display: block; }

.nav-mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.nav-mobile-links li a {
  display: block;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-1);
  transition: background 0.15s, color 0.15s;
}
.nav-mobile-links li a:hover,
.nav-mobile-links li a:focus-visible {
  background: var(--navy-dim);
  color: var(--navy);
}

.nav-mobile-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.nav-mobile-auth { display: flex; flex-direction: column; gap: 8px; }
.nav-mobile-auth .btn { width: 100%; justify-content: center; }

.nav-mobile-username {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 8px 16px 4px;
}

@media (max-width: 768px) {
  .nav-hamburger  { display: flex; }
  .nav-actions    { display: none; }
}

/* ── SCROLL-TO-TOP BUTTON ───────────────────────── */

.scroll-top-btn {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 900;
}
.scroll-top-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.scroll-top-btn.visible { display: flex; }

/* ── DASHBOARD EMPTY STATE ──────────────────────── */

.dashboard-empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 56px 48px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.dashboard-empty-inner { max-width: 520px; margin: 0 auto; }
.dashboard-empty-icon  { font-size: 2.5rem; margin-bottom: 20px; }
.dashboard-empty-state h2 { margin-bottom: 12px; }
.dashboard-empty-state > .dashboard-empty-inner > p {
  color: var(--text-2); margin-bottom: 32px;
}

.empty-steps {
  display: flex; flex-direction: column; gap: 10px;
  text-align: left; margin-bottom: 28px;
}
.empty-step {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.empty-step:hover { border-color: var(--navy); box-shadow: var(--shadow-sm); }
.empty-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; flex-shrink: 0;
}
.empty-step-body { flex: 1; }
.empty-step-title { font-weight: 600; font-size: 0.9375rem; margin-bottom: 2px; }
.empty-step-desc  { font-size: 0.8125rem; color: var(--text-3); }

@media (max-width: 768px) {
  .dashboard-empty-state { padding: 36px 24px; }
}

/* ── REDUCED MOTION ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
