/* ============================================================
   PERSONA — MBTI Profiler
   Design tokens, layout, components, responsive
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0a14;
  --bg-2: #0f0f1f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ececf1;
  --text-dim: #a4a4b8;
  --text-muted: #6f6f86;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --good: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --grad: linear-gradient(135deg, #a78bfa 0%, #22d3ee 50%, #f472b6 100%);
  --grad-soft: linear-gradient(135deg, rgba(167, 139, 250, 0.18), rgba(34, 211, 238, 0.18));
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --glow: 0 0 60px rgba(167, 139, 250, 0.35);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --blur: blur(22px);
  --tap: 44px;
}

[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-2: #eceefa;
  --surface: rgba(255, 255, 255, 0.7);
  --surface-2: rgba(255, 255, 255, 0.9);
  --border: rgba(20, 20, 40, 0.08);
  --border-strong: rgba(20, 20, 40, 0.18);
  --text: #1a1a2e;
  --text-dim: #4a4a66;
  --text-muted: #8888a0;
  --accent: #7c3aed;
  --accent-2: #0891b2;
  --accent-3: #db2777;
  --shadow: 0 20px 50px -25px rgba(60, 60, 130, 0.35);
  --glow: 0 0 60px rgba(124, 58, 237, 0.25);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}
h1, h2, h3 { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Background orbs ---------- */
.bg-orbs {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55;
  animation: drift 22s ease-in-out infinite;
}
.orb-1 { width: 480px; height: 480px; background: #a78bfa; top: -120px; left: -120px; }
.orb-2 { width: 380px; height: 380px; background: #22d3ee; top: 30%; right: -80px; animation-delay: -7s; }
.orb-3 { width: 420px; height: 420px; background: #f472b6; bottom: -120px; left: 30%; animation-delay: -14s; }
[data-theme="light"] .orb { opacity: 0.28; }
@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}

/* ---------- Glass surface ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 16px; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 16px;
  margin: 16px auto 0; max-width: 1200px;
  border-radius: 999px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  color: white; font-weight: 800;
  box-shadow: var(--glow);
}
.brand-name { font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; }
.nav { display: flex; gap: 4px; margin-left: 20px; flex: 1; }
.nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 0.92rem;
  color: var(--text-dim); transition: all 0.2s;
}
.nav a:hover, .nav a.active { background: var(--surface-2); color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.xp-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600;
}
.xp-icon { color: var(--warn); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: transform 0.2s, background 0.2s;
}
.icon-btn:hover { transform: translateY(-1px); background: var(--surface); }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem;
  min-height: var(--tap);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; min-height: 32px; font-size: 0.85rem; }
.btn-primary {
  background: var(--grad); color: white;
  box-shadow: 0 10px 30px -10px rgba(167, 139, 250, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(167, 139, 250, 0.9); }
.btn-ghost {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.arrow { transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(4px); }

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }
.view { display: none; animation: fadeUp 0.5s ease; }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.section { margin-top: 80px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 8px 0 10px; }
.section-sub { color: var(--text-dim); font-size: 1.02rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-2);
  padding: 4px 10px; border-radius: 999px;
  background: var(--grad-soft);
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-text-2 { background: linear-gradient(135deg, #f472b6, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- Hero ---------- */
.hero { padding: 60px 0 40px; text-align: center; }
.hero-inner { max-width: 860px; margin: 0 auto; }
.hero-title { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 800; margin-top: 18px; }
.hero-sub { color: var(--text-dim); font-size: clamp(1rem, 1.6vw, 1.2rem); margin: 22px auto 36px; max-width: 640px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  margin-top: 60px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
}
.hero-stats > div {
  padding: 14px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; min-width: 100px;
}
.hero-stats strong { font-family: 'Space Grotesk'; font-size: 1.6rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats span { color: var(--text-dim); font-size: 0.82rem; letter-spacing: 0.04em; }

/* ---------- Dimension grid ---------- */
.dim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.dim-card {
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
.dim-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.dim-card .dim-letters {
  font-family: 'Space Grotesk'; font-size: 1.6rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dim-card h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.dim-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- Types grid ---------- */
.types-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.types-grid.full { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.type-card {
  position: relative;
  padding: 22px 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  text-align: left;
}
.type-card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--type-color, var(--grad-soft));
  opacity: 0; transition: opacity 0.3s;
}
.type-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.type-card:hover::before { opacity: 0.18; }
.type-card > * { position: relative; z-index: 1; }
.type-card .type-letters {
  font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.5rem;
  background: var(--type-color, var(--grad)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.type-card .type-icon { font-size: 1.3rem; margin-bottom: 8px; }
.type-card h4 { font-family: 'Space Grotesk'; font-size: 1.05rem; margin: 4px 0; }
.type-card p { color: var(--text-dim); font-size: 0.85rem; line-height: 1.45; }
.type-card .type-group {
  display: inline-block; font-size: 0.7rem; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-dim);
  margin-top: 10px; letter-spacing: 0.04em;
}

/* ---------- CTA ---------- */
.cta-section { margin-top: 80px; }
.cta-card {
  padding: 50px 30px; text-align: center;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.12), rgba(34, 211, 238, 0.12)) !important;
}
.cta-card h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta-card p { color: var(--text-dim); margin: 14px 0 26px; }

/* ---------- Assessment ---------- */
.assessment-shell { max-width: 760px; margin: 0 auto; }
.assessment-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.assessment-meta h2 { font-size: 1.6rem; margin-top: 6px; }
.progress-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress-bar {
  flex: 1; height: 8px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.progress-bar span {
  display: block; height: 100%; width: 0%;
  background: var(--grad); border-radius: 999px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.6);
}
.progress-pct { font-size: 0.85rem; color: var(--text-dim); min-width: 42px; text-align: right; }
.question-card {
  padding: 36px 28px; min-height: 280px;
  display: flex; flex-direction: column; gap: 26px;
  animation: slideIn 0.35s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.question-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem); font-weight: 500; line-height: 1.4;
}
.likert { display: grid; gap: 10px; }
.likert-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.98rem; font-weight: 500;
  text-align: left;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  min-height: var(--tap);
}
.likert-btn:hover { transform: translateX(4px); border-color: var(--border-strong); }
.likert-btn.selected {
  background: var(--grad-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.3);
}
.dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.pos-2 { background: #34d399; box-shadow: 0 0 12px #34d399; }
.pos-1 { background: #6ee7b7; }
.pos-0 { background: #94a3b8; }
.neg-1 { background: #fda4af; }
.neg-2 { background: #f87171; box-shadow: 0 0 12px #f87171; }
.assessment-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.auto-save { font-size: 0.82rem; color: var(--good); opacity: 0.8; }

/* ---------- Results ---------- */
.results-shell { max-width: 1100px; margin: 0 auto; }
.result-hero {
  padding: 36px 28px; text-align: center;
  background: linear-gradient(140deg, rgba(167,139,250,.18), rgba(34,211,238,.12), rgba(244,114,182,.14)) !important;
  position: relative; overflow: hidden;
}
.result-hero .type-big {
  font-family: 'Space Grotesk'; font-size: clamp(3.5rem, 10vw, 6rem); font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -0.04em;
  filter: drop-shadow(0 0 40px rgba(167,139,250,0.5));
}
.result-hero .type-nick { font-size: 1.3rem; color: var(--text); font-weight: 600; margin-top: 4px; }
.result-hero .type-overview { color: var(--text-dim); margin: 16px auto 0; max-width: 560px; }
.result-hero .type-icon { font-size: 2.5rem; margin-bottom: 8px; }
.result-grid {
  display: grid; gap: 18px; margin-top: 22px;
  grid-template-columns: 1fr 1fr;
}
.card { padding: 24px; }
.card h3 { font-size: 1.1rem; margin-bottom: 12px; }
.trait-bars { display: flex; flex-direction: column; gap: 16px; }
.trait-row { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 10px; align-items: center; font-size: 0.9rem; }
.trait-row .left, .trait-row .right { font-weight: 600; }
.trait-row .left { color: var(--text-dim); }
.trait-row .right { color: var(--accent); text-align: right; }
.trait-row.flipped .left { color: var(--accent); }
.trait-row.flipped .right { color: var(--text-dim); }
.trait-track {
  position: relative; height: 8px; border-radius: 999px;
  background: var(--surface-2);
}
.trait-track .marker {
  position: absolute; top: 50%;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.7);
  transition: left 1s cubic-bezier(.4,0,.2,1);
}
.trait-track .center { position: absolute; top: 0; left: 50%; bottom: 0; width: 1px; background: var(--border-strong); }
.insights-card { margin-top: 18px; }
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.tab {
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim);
  transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad); color: white; border-color: transparent; }
.tab-body { animation: fadeUp 0.3s ease; min-height: 80px; }
.tab-body ul { padding-left: 18px; margin: 0; }
.tab-body li { margin-bottom: 6px; color: var(--text-dim); }
.tab-body p { color: var(--text-dim); }
.compat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.compat-pill {
  padding: 14px 12px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  text-align: center;
}
.compat-pill .ct {
  font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.15rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.compat-pill .cn { font-size: 0.78rem; color: var(--text-dim); }
.compat-pill .cs { font-size: 0.85rem; margin-top: 4px; color: var(--good); font-weight: 600; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }

/* ---------- Compatibility view ---------- */
.compat-shell { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.compat-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.picker { padding: 18px; }
.picker label { font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.picker select {
  margin-top: 10px; width: 100%;
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  font-family: inherit; font-size: 1rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.compat-result {
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center;
}
.compat-score {
  font-family: 'Space Grotesk'; font-size: 3rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.compat-label { font-weight: 600; font-size: 1.1rem; }
.compat-pair { display: flex; align-items: center; gap: 16px; }
.compat-pair .pt {
  font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.5rem;
  padding: 10px 18px; border-radius: var(--radius);
  background: var(--grad-soft);
}
.compat-pair .conn { font-size: 1.5rem; color: var(--accent); }
.compat-tip { color: var(--text-dim); max-width: 500px; }
.compat-matrix {
  display: grid; gap: 2px;
  grid-template-columns: 30px repeat(16, 1fr);
  font-size: 0.62rem;
  overflow-x: auto;
}
.compat-matrix .mc { padding: 5px 2px; text-align: center; border-radius: 4px; min-height: 22px; display: grid; place-items: center; }
.compat-matrix .mc.head { background: var(--surface-2); color: var(--text-dim); font-weight: 600; }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; }
.filter-bar button {
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim);
}
.filter-bar button.active { background: var(--grad); color: white; border-color: transparent; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; animation: fadeUp 0.25s ease; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(8px); }
.modal-card {
  position: relative; max-width: 720px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  padding: 32px 28px;
}
.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 1.4rem;
}
.modal-card h2 {
  font-size: 2rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-card .nick { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 20px; }
.modal-card .field { margin-top: 18px; }
.modal-card .field h4 {
  font-size: 0.78rem; color: var(--accent-2); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 6px; font-family: 'Inter';
}
.modal-card .field p, .modal-card .field li { color: var(--text-dim); font-size: 0.95rem; }
.modal-card .field ul { padding-left: 18px; margin: 0; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.78rem; }

/* ---------- History / badges ---------- */
.history-shell { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; max-width: 1100px; margin: 0 auto; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.badge {
  text-align: center; padding: 16px 10px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
  opacity: 0.4; filter: grayscale(0.6);
  transition: all 0.3s;
}
.badge.unlocked { opacity: 1; filter: none; background: var(--grad-soft); border-color: var(--accent); }
.badge .b-icon { font-size: 1.6rem; }
.badge .b-name { font-size: 0.78rem; margin-top: 4px; font-weight: 600; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.history-row .h-type { font-family: 'Space Grotesk'; font-weight: 700; font-size: 1.2rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.history-row .h-date { color: var(--text-dim); font-size: 0.85rem; }
.history-empty { color: var(--text-dim); padding: 14px; text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 30px);
  padding: 12px 22px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  backdrop-filter: var(--blur);
  font-size: 0.92rem;
  opacity: 0; pointer-events: none;
  transition: all 0.3s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.82rem; }
.footer p { margin: 4px 0; }
.footer a { color: var(--accent); font-weight: 600; transition: color 0.2s; }
.footer a:hover { color: var(--accent-2); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 64px; left: 16px; right: 16px;
    padding: 12px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }
  .nav-toggle { display: grid; }
  .result-grid, .compat-pickers, .history-shell { grid-template-columns: 1fr; }
  .topbar { margin: 12px; padding: 10px 14px; }
  .brand-name { display: none; }
  main { padding: 16px 14px 60px; }
  .section { margin-top: 60px; }
  .hero { padding: 40px 0 20px; }
  .question-card { padding: 26px 20px; }
  .compat-matrix { font-size: 0.5rem; }
  .compat-matrix .mc { padding: 3px 1px; }
}
@media (max-width: 480px) {
  .xp-pill { padding: 5px 10px; font-size: 0.78rem; }
  .hero-stats > div { padding: 10px 14px; min-width: 80px; }
  .types-grid, .types-grid.full { grid-template-columns: 1fr 1fr; gap: 10px; }
  .type-card { padding: 16px 14px; }
  .tabs { gap: 4px; }
  .tab { padding: 6px 10px; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .orb { animation: none; }
}
