/* ─── TOKENS ─────────────────────────────────────────────────── */
:root {
  --navy:     #050e2b;
  --navy2:    #0a1640;
  --navy3:    #0f1f50;
  --blue:     #2352e8;
  --blue-lt:  #3d6bff;
  --blue-dim: rgba(35,82,232,0.12);
  --gold:     #f0b429;
  --gold-lt:  #ffd166;
  --gold-dim: rgba(240,180,41,0.12);
  --cream:    #f7f4ef;
  --cream2:   #ede9e2;
  --cream3:   #e0dbd2;
  --ink:      #0d0d14;
  --ink2:     #1e2330;
  --muted:    #8892a4;
  --green:    #22c55e;
  --green-dim:rgba(34,197,94,0.12);
  --red:      #ef4444;
  --red-dim:  rgba(239,68,68,0.12);
  --serif:    'Instrument Serif', Georgia, serif;
  --sans:     'DM Sans', sans-serif;
  --mono:     'DM Mono', monospace;
  --r:        12px;
  --r-lg:     18px;
  --r-xl:     24px;
  --nav-h:    56px;
  --shadow:   0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
}

/* ─── BASE ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  font-family: var(--sans);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  zoom: 1.08;
}

/* ─── NAV ────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
}
.nav-left  { display: flex; align-items: center; gap: 28px; }
.nav-logo  { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.nav-mark  {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.nav-mark svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; }
.nav-name  { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: -0.01em; }
.nav-name em { color: var(--gold); font-style: normal; }

.nav-links { display: flex; gap: 2px; }
.nav-link  {
  padding: 6px 14px; border-radius: 7px;
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.45);
  text-decoration: none; transition: all .2s; white-space: nowrap;
}
.nav-link:hover  { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.06); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }

.nav-right  { display: flex; align-items: center; gap: 12px; }
.nav-badge  {
  font-size: 10px; font-weight: 700; color: var(--gold);
  background: var(--gold-dim); border: 1px solid rgba(240,180,41,0.25);
  padding: 4px 12px; border-radius: 20px; letter-spacing: .06em;
}
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
}

/* ─── PAGE WRAPPER ───────────────────────────────────────────── */
.page { padding-top: var(--nav-h); min-height: 100vh; }

/* ─── SECTION ────────────────────────────────────────────────── */
.section {
  max-width: 1280px; margin: 0 auto;
  padding: 0 28px;
}

/* ─── CARDS ──────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--r);
  border: 1px solid var(--cream2);
  box-shadow: var(--shadow);
}
.card-dark {
  background: var(--navy); border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
}
.card-navy2 {
  background: var(--navy2); border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ─── EYEBROW ────────────────────────────────────────────────── */
.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 6px;
}
.eyebrow-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.eyebrow-blue { color: var(--blue); }
.eyebrow-muted { color: var(--muted); }

/* ─── BADGE ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.badge-gold   { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(240,180,41,0.25); }
.badge-blue   { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(35,82,232,0.2); }
.badge-green  { background: var(--green-dim); color: #16a34a; border: 1px solid rgba(34,197,94,0.25); }
.badge-red    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.badge-cream  { background: var(--cream); color: var(--muted); border: 1px solid var(--cream2); }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  padding: 10px 20px; border-radius: 9px;
  border: none; cursor: pointer; transition: all .2s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--blue); color: #fff;
}
.btn-primary:hover { background: var(--blue-lt); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(35,82,232,0.3); }
.btn-gold {
  background: var(--gold); color: var(--ink);
}
.btn-gold:hover { background: var(--gold-lt); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(240,180,41,0.3); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--cream2);
}
.btn-ghost:hover { background: var(--cream); color: var(--ink); }
.btn-ghost-dark {
  background: transparent; color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost-dark:hover { background: rgba(255,255,255,0.07); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 11px; }
.btn-sm { padding: 7px 14px; font-size: 11px; border-radius: 7px; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

/* ─── PROGRESS BAR ───────────────────────────────────────────── */
.progress-bar {
  height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden;
}
.progress-bar.light { background: var(--cream2); }
.progress-fill {
  height: 100%; border-radius: 2px;
  transition: width .6s cubic-bezier(.16,1,.3,1);
}

/* ─── STAT RING ──────────────────────────────────────────────── */
.stat-ring { position: relative; flex-shrink: 0; }
.stat-ring svg { transform: rotate(-90deg); }
.stat-ring-n {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
}

/* ─── TUTOR BUBBLE ───────────────────────────────────────────── */
.tutor-bubble {
  background: rgba(255,255,255,0.05);
  border-left: 2px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 12px; color: rgba(255,255,255,0.65);
  line-height: 1.75;
}
.tutor-bubble strong { color: #fff; }
.tutor-bubble em { color: var(--gold-lt); font-style: italic; }

/* ─── QUIZ OPTION ────────────────────────────────────────────── */
.m-opt {
  background: var(--cream); border: 1.5px solid var(--cream2);
  border-radius: 9px; padding: 11px 16px;
  font-size: 13px; color: var(--ink); cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start;
  transition: all .15s; font-family: var(--sans); text-align: left; width: 100%;
}
.m-opt:hover:not(:disabled) { background: var(--cream2); border-color: var(--cream3); }
.m-opt:disabled { cursor: default; }
.m-opt.correct { background: #f0fdf4; border-color: #86efac; color: #15803d; }
.m-opt.wrong   { background: #fff1f2; border-color: #fca5a5; color: #be123c; }
.m-let { font-family: var(--mono); font-size: 11px; color: var(--muted); flex-shrink: 0; margin-top: 2px; }

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(5,14,43,0.7); backdrop-filter: blur(4px);
  z-index: 3000; align-items: center; justify-content: center; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--r-lg);
  padding: 28px; max-width: 540px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s cubic-bezier(.16,1,.3,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── EXPLANATION BOX ────────────────────────────────────────── */
.explanation {
  display: none; padding: 14px 16px; margin-top: 8px;
  background: rgba(35,82,232,0.05); border-left: 3px solid var(--blue);
  border-radius: 0 9px 9px 0;
  font-size: 12px; color: #334155; line-height: 1.75;
}
.explanation.show { display: block; }
.explanation strong { color: var(--ink); }

/* ─── DIFFICULTY BADGE ───────────────────────────────────────── */
.diff-easy { font-size: 9px; font-weight: 700; color: #16a34a; }
.diff-med  { font-size: 9px; font-weight: 700; color: #ca8a04; }
.diff-hard { font-size: 9px; font-weight: 700; color: #dc2626; }

/* ─── STATUS DOT ─────────────────────────────────────────────── */
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.loading { background: var(--gold); animation: pulse 1s infinite; }

/* ─── SKELETON ───────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--cream2) 25%, var(--cream3) 50%, var(--cream2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .4s cubic-bezier(.16,1,.3,1) both; }
.fade-up-d1 { animation-delay: .05s; }
.fade-up-d2 { animation-delay: .1s; }
.fade-up-d3 { animation-delay: .15s; }
.fade-up-d4 { animation-delay: .2s; }

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .section { padding: 0 16px; }
}