@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #07100d;
  --bg2: #0d1a15;
  --panel: #111f19;
  --panel2: #162820;
  --panel3: #1c3229;
  --text: #f0ede3;
  --muted: #9aada3;
  --faint: #4a6459;
  --line: #1e3329;
  --gold: #e8b84b;
  --gold2: #f5d07a;
  --gold-dim: rgba(232,184,75,0.12);
  --green: #5a9e6f;
  --green2: #7bc48a;
  --danger: #e07070;
  --shadow: 0 24px 60px rgba(0,0,0,0.4);
  --shadow-sm: 0 8px 24px rgba(0,0,0,0.25);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

body.light {
  --bg: #f2ede0;
  --bg2: #ede7d8;
  --panel: #ffffff;
  --panel2: #f7f2e6;
  --panel3: #ede7d6;
  --text: #111810;
  --muted: #5a6b5f;
  --faint: #9aada3;
  --line: #ddd6c5;
  --gold: #a0720a;
  --gold2: #c49020;
  --gold-dim: rgba(160,114,10,0.1);
  --green: #2e7a45;
  --green2: #3a9454;
  --danger: #c04040;
  --shadow: 0 24px 60px rgba(0,0,0,0.1);
  --shadow-sm: 0 8px 24px rgba(0,0,0,0.08);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--panel3); border-radius: 3px; }

/* ── HEADER ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  background: rgba(7,16,13,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
body.light .app-header { background: rgba(242,237,224,0.90); }

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gold-dim);
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: -0.5px;
}

.brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.1;
}
.brand-tagline {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--gold); }

/* ── TABS ── */
.top-tabs {
  position: sticky;
  top: 77px;
  z-index: 90;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 36px;
  background: rgba(7,16,13,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.top-tabs::-webkit-scrollbar { display: none; }
body.light .top-tabs { background: rgba(242,237,224,0.95); }

/* fade indicator for overflow */
.top-tabs::after {
  content: '';
  position: sticky;
  right: 0;
  width: 60px;
  flex-shrink: 0;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
}
body.light .top-tabs::after { background: linear-gradient(to right, transparent, var(--bg2)); }

.tab {
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.tab:hover { color: var(--text); border-color: var(--faint); }
.tab.active {
  background: var(--gold);
  color: #1a0f00;
  border-color: var(--gold);
  font-weight: 600;
}

/* ── SHELL ── */
.shell {
  padding: 32px 36px 80px;
  max-width: 1280px;
  margin: 0 auto;
}

.view { display: none; }
.active-view { display: block; animation: fadeUp 0.35s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── EYEBROW ── */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

/* ── SECTION TITLE ── */
.section-title { margin-bottom: 28px; }
.section-title h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 10px;
}
.section-title .lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 700px;
  line-height: 1.7;
}

/* ── CARDS ── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 14px 0 6px;
}
.card p { color: var(--muted); line-height: 1.7; }

/* ── HERO ── */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel3) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(232,184,75,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--text);
}
.hero .lead { color: var(--muted); font-size: 1rem; max-width: 600px; line-height: 1.7; }

.hero-badge {
  text-align: center;
  background: var(--gold-dim);
  border: 1px solid rgba(232,184,75,0.3);
  border-radius: var(--radius-sm);
  padding: 20px 28px;
  min-width: 200px;
}
.hero-badge span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.1em; }
.hero-badge strong { display: block; color: var(--gold); font-family: 'Playfair Display', serif; font-size: 1.1rem; line-height: 1.4; }

/* ── GRIDS ── */
.grid { display: grid; gap: 18px; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mini-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
}
.mini-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.mini-card h3 { font-family: 'Playfair Display', serif; font-size: 1rem; margin-bottom: 8px; color: var(--text); }
.mini-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; margin-bottom: 14px; }

.soft-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.soft-card h4 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.soft-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

/* ── BUTTONS ── */
.primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: #1a0f00;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 12px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 10px;
}
.primary:hover { background: var(--gold2); transform: translateY(-1px); }
.primary:active { transform: scale(0.98); }
.primary.small { padding: 9px 16px; font-size: 0.82rem; }

/* ── FORM ELEMENTS ── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }

label { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }

input[type="number"],
input[type="text"],
select {
  width: 100%;
  margin-top: 6px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-xs);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}
input:focus, select:focus { border-color: var(--gold); }
input:invalid { border-color: var(--danger); }

/* ── QUIZ ── */
.quiz-stack { display: grid; gap: 22px; margin-bottom: 18px; }

.question-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.question-card h4 {
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
}

.option-list { display: grid; gap: 8px; }

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.92rem;
  line-height: 1.5;
}
.option:hover { border-color: var(--faint); background: var(--panel3); }
.option:has(input:checked) { border-color: var(--gold); background: var(--gold-dim); }
.option input { display: none; }
.option-letter { font-weight: 700; color: var(--gold); min-width: 22px; font-size: 0.85rem; }

/* ── RESULTS ── */
.result-box {
  margin-top: 20px;
  border: 1px solid var(--line);
  background: var(--panel2);
  border-radius: var(--radius-sm);
  padding: 24px;
  animation: fadeUp 0.3s ease;
}
.result-box:empty { display: none; }
.result-box h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin-bottom: 14px; color: var(--text); }
.result-box h4 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); margin: 14px 0 6px; }
.result-box p { color: var(--muted); font-size: 0.92rem; line-height: 1.7; }

.result-score-bar {
  height: 10px;
  background: var(--panel3);
  border-radius: 5px;
  overflow: hidden;
  margin: 14px 0 6px;
  border: 1px solid var(--line);
}
.result-score-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 0.8s ease;
}

.compact { font-size: 1rem; }

/* ── PERSONALISED SCORE INDICATORS ── */
.score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.score-item { text-align: center; }
.score-item-bar { height: 60px; display: flex; align-items: flex-end; }
.score-item-fill { width: 100%; border-radius: 4px 4px 0 0; transition: height 0.7s ease; min-height: 4px; }
.score-item-label { font-size: 0.68rem; color: var(--muted); margin-top: 4px; line-height: 1.2; }

/* ── ACCORDION ── */
.accordion { display: grid; gap: 10px; margin: 22px 0; }

.acc-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
  transition: border-color 0.2s;
}
.acc-item.open { border-color: var(--faint); }

.acc-head {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 16px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.acc-head::after { content: '+'; font-size: 1.2rem; color: var(--gold); transition: transform 0.2s; }
.acc-item.open .acc-head::after { transform: rotate(45deg); }

.acc-body { display: none; padding: 0 20px 18px; border-top: 1px solid var(--line); }
.acc-item.open .acc-body { display: block; }
.acc-body p { color: var(--muted); font-size: 0.9rem; margin: 12px 0; line-height: 1.7; }

/* ── METRICS ── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.metric span { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.metric strong { display: block; color: var(--gold); font-family: 'Playfair Display', serif; font-size: 1.4rem; }

/* ── TABLE ── */
.table-wrap {
  overflow: auto;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table { border-collapse: collapse; width: 100%; min-width: 700px; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: right; font-size: 0.88rem; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--gold); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: var(--panel2); }
tbody tr:hover { background: var(--panel3); }
tbody tr:last-child td { border-bottom: 0; }

/* ── SUBTABS ── */
.subtabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

.subtab {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius-xs);
  padding: 9px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.subtab:hover { color: var(--text); border-color: var(--faint); }
.subtab.active { background: var(--gold-dim); color: var(--gold); border-color: rgba(232,184,75,0.4); }

.subview { display: none; }
.active-subview { display: block; animation: fadeUp 0.25s ease; }

/* ── CANVAS ── */
canvas {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-top: 16px;
  display: block;
}

/* ── PILLS ── */
.pill {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(232,184,75,0.3);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 4px;
}
.pill-green { background: rgba(90,158,111,0.15); color: var(--green2); border-color: rgba(90,158,111,0.3); }
.pill-muted { background: var(--panel3); color: var(--muted); border-color: var(--line); }

/* ── TWO-COL ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── MONEY TYPE ANIMAL CARDS ── */
.animal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
}
.animal-card:hover { border-color: var(--faint); transform: translateY(-3px); }
.animal-emoji { font-size: 2.2rem; margin-bottom: 10px; display: block; }
.animal-card h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; margin-bottom: 8px; color: var(--text); }
.animal-card p { color: var(--muted); font-size: 0.85rem; line-height: 1.65; margin-bottom: 10px; }
.animal-card .challenge-box {
  background: var(--gold-dim);
  border: 1px solid rgba(232,184,75,0.2);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--gold);
}

/* ── ROADMAP ── */
.roadmap-phases { display: grid; gap: 0; }
.phase {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0;
  position: relative;
}
.phase:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 50px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.phase-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 2px solid var(--gold);
  display: grid;
  place-items: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
  margin-top: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.phase-content { padding: 0 0 32px 20px; }
.phase-content h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; margin-bottom: 6px; color: var(--text); }
.phase-content p { color: var(--muted); font-size: 0.9rem; line-height: 1.65; }

/* ── PLATFORM GUIDE ── */
.platform-badge {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(232,184,75,0.3);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ── NUMBERED LISTS ── */
.numbered { padding-left: 20px; color: var(--muted); }
.numbered li { padding: 6px 0; font-size: 0.9rem; line-height: 1.6; }

/* ── MINI LISTS ── */
.mini-list { padding-left: 18px; color: var(--muted); margin: 6px 0; }
.mini-list li { font-size: 0.88rem; padding: 3px 0; }

/* ── MISSION RESULT ── */
.mission-statement {
  background: linear-gradient(135deg, var(--panel2), var(--panel3));
  border: 1px solid rgba(232,184,75,0.25);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-top: 20px;
  animation: fadeUp 0.3s ease;
}
.mission-statement h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 14px;
}
.mission-statement p { color: var(--text); font-size: 0.97rem; line-height: 1.8; }
.mission-statement strong { color: var(--gold2); }

/* ── VALIDATION MESSAGES ── */
.error-msg { color: var(--danger); font-size: 0.82rem; margin-top: 6px; }

/* ── LEARNING HUB ── */
.content-type-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  transition: border-color 0.2s;
}
.content-type-card:hover { border-color: var(--faint); }
.content-icon { font-size: 1.6rem; margin-bottom: 12px; }
.content-type-card h3 { font-family: 'Playfair Display', serif; font-size: 1rem; margin-bottom: 8px; color: var(--text); }
.content-type-card p { color: var(--muted); font-size: 0.86rem; line-height: 1.6; margin-bottom: 12px; }
.coming-soon {
  display: inline-block;
  background: var(--panel3);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── CHECKLIST ── */
.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.checklist li::before {
  content: '→';
  color: var(--gold);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── PRINT RESULT BUTTON ── */
.print-result-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel3);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius-xs);
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.2s;
}
.print-result-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .app-header { padding: 14px 20px; }
  .top-tabs { top: 73px; padding: 8px 20px; }
  .shell { padding: 20px 20px 80px; }
  .card { padding: 20px; border-radius: 16px; }
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .hero-badge { min-width: auto; }
  .cards-2, .cards-3, .form-grid, .metric-grid, .two-col { grid-template-columns: 1fr; }
  .brand-tagline { display: none; }
  .metric strong { font-size: 1.2rem; }
  table { font-size: 0.82rem; }
  th, td { padding: 10px 12px; }
  .score-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
}

@media (max-width: 480px) {
  .logo-mark { width: 38px; height: 38px; font-size: 0.85rem; }
  .brand-name { font-size: 0.95rem; }
}
