/* ══════════════════════════════════════
   TOKENS
══════════════════════════════════════ */
:root {
  --blue:        #2d3fd4;
  --blue-dark:   #1a2db0;
  --blue-deep:   #132490;
  --blue-light:  #eef1fb;
  --orange:      #f47221;
  --orange-dark: #d9610d;
  --yellow:      #f5c400;

  --bg:          #f4f6fb;
  --surface:     #ffffff;
  --surface-2:   #eef1f8;
  --border:      #dde3f0;
  --border-h:    #b8c4df;

  --text:        #0d1b3e;
  --muted:       #5a6a8a;
  --light:       #8fa0bf;

  --success:     #059669;
  --success-bg:  #ecfdf5;
  --success-bd:  #6ee7b7;
  --error:       #dc2626;
  --error-bg:    #fef2f2;
  --warning:     #b45309;
  --warning-bg:  #fffbeb;
  --warning-bd:  #fde68a;

  --physics:     #0891b2;
  --physics-bg:  #ecfeff;
  --physics-bd:  #a5f3fc;
  --chemistry:   #7c3aed;
  --chemistry-bg:#f5f3ff;
  --chemistry-bd:#ddd6fe;
  --biology:     #059669;
  --biology-bg:  #ecfdf5;
  --biology-bd:  #6ee7b7;

  --r-xs: 4px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --nav-h: 66px;
}

/* ══════════════════════════════════════
   RESET & BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
.nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--surface); border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  box-shadow: 0 1px 4px rgba(45,63,212,.06);
}
.nav__logo { font-size: 1.25rem; font-weight: 900; color: var(--blue); letter-spacing: -0.03em; }
.nav__links { display: flex; gap: 0.2rem; list-style: none; align-items: center; }
.nav__links a {
  color: var(--muted); font-size: 0.8rem; font-weight: 500;
  padding: 0.45rem 0.9rem; border-radius: var(--r-sm);
  transition: color .15s, background .15s; white-space: nowrap;
}
.nav__links a:hover  { color: var(--blue); background: var(--blue-light); text-decoration: none; }
.nav__links a.active { color: var(--blue); background: var(--blue-light); font-weight: 700; }
.nav__cta {
  background: var(--orange) !important; color: #fff !important;
  font-weight: 700 !important; font-size: 0.8rem !important;
  padding: 0.5rem 1.25rem !important; border-radius: var(--r-sm) !important;
  box-shadow: 0 3px 10px rgba(244,114,33,.3);
  transition: background .15s, transform .15s !important;
}
.nav__cta:hover { background: var(--orange-dark) !important; transform: translateY(-1px); text-decoration: none !important; }
.nav__hamburger {
  display: none; flex-direction: column; gap: 5px;
  width: 36px; height: 36px; background: none;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  cursor: pointer; padding: 7px 8px;
}
.nav__hamburger span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
.nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(13,27,62,.1); z-index: 199;
  padding: 1rem 1.5rem 1.5rem; flex-direction: column; gap: 0.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: block; color: var(--muted); font-size: 0.9rem; font-weight: 500;
  padding: 0.65rem 0.75rem; border-radius: var(--r-sm); transition: all .15s;
}
.mobile-menu a:hover { background: var(--surface-2); color: var(--blue); text-decoration: none; }
.mobile-menu a.active { background: var(--blue-light); color: var(--blue); font-weight: 700; }
.mobile-menu .mob-cta {
  text-align: center; background: var(--orange) !important; color: #fff !important;
  font-weight: 700 !important; border-radius: var(--r-sm) !important;
  padding: 0.75rem !important; margin-top: 0.5rem;
}

/* ══════════════════════════════════════
   BREADCRUMB
══════════════════════════════════════ */
.breadcrumb {
  max-width: 1120px; margin: 0 auto;
  padding: 1rem 1.75rem 0;
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: var(--light); flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb strong { color: var(--text); font-weight: 700; }

/* ══════════════════════════════════════
   PAGE SHELL
══════════════════════════════════════ */
.page { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1.75rem 5rem; }

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 55%, #3d52e8 100%);
  border-radius: var(--r-lg); padding: 2rem 2.5rem;
  margin-bottom: 1.5rem; position: relative; overflow: hidden;
  animation: fadeUp .45s ease both;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.hero::before { width: 340px; height: 340px; top: -90px; right: -60px; }
.hero::after  { width: 160px; height: 160px; bottom: -50px; right: 220px; }

.hero__inner { position: relative; z-index: 1; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.9); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.25rem 0.8rem; border-radius: 20px; margin-bottom: 0.65rem;
}
.hero__title {
  font-size: 1.9rem; font-weight: 900; color: #fff;
  letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 0.4rem;
}
.hero__title span { color: var(--yellow); }
.hero__sub { color: rgba(255,255,255,.72); font-size: 0.85rem; line-height: 1.6; max-width: 560px; }

/* Overall summary stats in hero */
.hero__stats {
  display: flex; gap: 0.65rem; margin-top: 1.4rem; flex-wrap: wrap;
}
.hero__stat {
  background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-sm); padding: 0.55rem 1rem;
  display: flex; flex-direction: column; gap: 0.1rem;
}
.hero__stat-val { font-size: 1.2rem; font-weight: 900; color: #fff; line-height: 1; }
.hero__stat-val--good { color: #6ee7b7; }
.hero__stat-val--warn { color: var(--yellow); }
.hero__stat-lbl { font-size: 0.6rem; color: rgba(255,255,255,.6); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }

/* Sample data notice */
.sample-notice {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(245,196,0,.18); border: 1px solid rgba(245,196,0,.35);
  color: var(--yellow); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.22rem 0.7rem; border-radius: 20px; margin-top: 1rem;
}

/* ══════════════════════════════════════
   SECTION HEADERS
══════════════════════════════════════ */
.section-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.section-hd__title {
  font-size: 1rem; font-weight: 900; color: var(--text);
  letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.5rem;
}
.section-hd__sub { font-size: 0.75rem; color: var(--light); font-weight: 500; }

/* ══════════════════════════════════════
   OVERALL SUMMARY CARDS (inside sections)
══════════════════════════════════════ */
.summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 2px 10px rgba(45,63,212,.04);
  margin-bottom: 1.25rem;
  animation: fadeUp .45s .06s ease both;
}
.summary-card__head {
  background: linear-gradient(90deg, var(--blue-deep), var(--blue-dark));
  padding: 0.85rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.summary-card__head h2 { font-size: 0.82rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 0.5rem; }
.summary-card__badge {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.85); font-size: 0.65rem; font-weight: 700;
  padding: 0.18rem 0.6rem; border-radius: 20px; letter-spacing: 0.04em;
}
.summary-stats {
  display: grid; grid-template-columns: repeat(6,1fr);
  border-top: 1px solid var(--border);
}
.summary-stat {
  padding: 1rem 1.2rem; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.2rem;
}
.summary-stat:last-child { border-right: none; }
.summary-stat__val { font-size: 1.35rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; color: var(--blue); }
.summary-stat__val--light { color: var(--light); }
.summary-stat__lbl { font-size: 0.63rem; font-weight: 700; color: var(--light); text-transform: uppercase; letter-spacing: 0.07em; }

/* ══════════════════════════════════════
   SUBJECT CARDS GRID
══════════════════════════════════════ */
.subject-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem;
  margin-bottom: 2.5rem;
}

.subject-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 2px 8px rgba(45,63,212,.04);
  transition: box-shadow .15s, transform .15s;
  animation: fadeUp .45s .1s ease both;
}
.subject-card:hover { box-shadow: 0 6px 22px rgba(45,63,212,.09); transform: translateY(-2px); }

/* coloured top border per subject */
.subject-card--physics   { border-top: 3px solid var(--physics); }
.subject-card--chemistry { border-top: 3px solid var(--chemistry); }
.subject-card--biology   { border-top: 3px solid var(--biology); }

/* card header */
.subject-card__head {
  padding: 1rem 1.25rem 0.75rem;
  display: flex; align-items: center; gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.subject-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.subject-icon--physics   { background: var(--physics-bg); }
.subject-icon--chemistry { background: var(--chemistry-bg); }
.subject-icon--biology   { background: var(--biology-bg); }

.subject-card__name { font-size: 0.9rem; font-weight: 900; color: var(--text); }
.subject-card__type { font-size: 0.68rem; color: var(--light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* subject chip */
.subject-chip {
  margin-left: auto; flex-shrink: 0;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.18rem 0.55rem; border-radius: 20px;
}
.subject-chip--physics   { background: var(--physics-bg); color: var(--physics); border: 1px solid var(--physics-bd); }
.subject-chip--chemistry { background: var(--chemistry-bg); color: var(--chemistry); border: 1px solid var(--chemistry-bd); }
.subject-chip--biology   { background: var(--biology-bg); color: var(--biology); border: 1px solid var(--biology-bd); }

/* stat rows inside subject card */
.subject-card__stats { padding: 0.75rem 1.25rem; }
.subject-stat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.42rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.subject-stat:last-of-type { border-bottom: none; }
.subject-stat__lbl { color: var(--muted); font-weight: 500; }
.subject-stat__val { font-weight: 800; color: var(--text); }
.subject-stat__val--physics   { color: var(--physics); }
.subject-stat__val--chemistry { color: var(--chemistry); }
.subject-stat__val--biology   { color: var(--biology); }

/* accuracy mini-bar */
.subject-acc-wrap {
  padding: 0 1.25rem 0.85rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.subject-acc-bar {
  flex: 1; height: 5px; background: var(--surface-2); border-radius: 4px; overflow: hidden;
}
.subject-acc-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }
.subject-acc-fill--physics   { background: var(--physics); }
.subject-acc-fill--chemistry { background: var(--chemistry); }
.subject-acc-fill--biology   { background: var(--biology); }
.subject-acc-pct { font-size: 0.72rem; font-weight: 800; color: var(--muted); white-space: nowrap; }

/* card footer with links */
.subject-card__foot {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  background: var(--surface-2);
}
.btn-subject-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 700;
  padding: 0.42rem 0.85rem; border-radius: var(--r-sm);
  transition: background .15s, color .15s; flex: 1;
  justify-content: center; white-space: nowrap;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--muted);
}
.btn-subject-link:hover { text-decoration: none; }
.btn-subject-link--physics:hover   { border-color: var(--physics); color: var(--physics); background: var(--physics-bg); }
.btn-subject-link--chemistry:hover { border-color: var(--chemistry); color: var(--chemistry); background: var(--chemistry-bg); }
.btn-subject-link--biology:hover   { border-color: var(--biology); color: var(--biology); background: var(--biology-bg); }

/* ══════════════════════════════════════
   SECTION DIVIDER
══════════════════════════════════════ */
.section-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0.5rem 0 1.5rem;
}
.section-divider__line { flex: 1; height: 1px; background: var(--border); }
.section-divider__label {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.09em;
  text-transform: uppercase; padding: 0.3rem 1rem; border-radius: 20px;
  background: var(--blue-light); color: var(--blue); border: 1px solid #c7d2f8;
  white-space: nowrap;
}

/* ══════════════════════════════════════
   EMPTY / NOT-YET STATE
══════════════════════════════════════ */
.not-attempted {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 0.6rem 0.85rem;
  font-size: 0.75rem; color: var(--light); font-weight: 500;
  display: flex; align-items: center; gap: 0.4rem;
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border); background: var(--surface); padding: 1.5rem 2.5rem;
}
.footer__inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; font-size: 0.775rem; color: var(--muted);
}
.footer__inner strong { color: var(--blue); font-weight: 800; }

/* ══════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .subject-grid { grid-template-columns: 1fr 1fr; }
  .summary-stats { grid-template-columns: repeat(3,1fr); }
  .summary-stat:nth-child(3) { border-right: none; }
}

@media (max-width: 680px) {
  .nav { padding: 0 1rem; }
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
  .page { padding: 1rem 1rem 4rem; }
  .breadcrumb { padding: 0.75rem 1rem 0; }
  .footer { padding: 1.25rem 1rem; }

  /* ── Hero ── */
  .hero { padding: 1.4rem 1.1rem; }
  .hero__title { font-size: 1.45rem; }
  .hero__sub { font-size: 0.82rem; }

  /* Hero stats: 2 per row, flex-wrap handles the rest */
  .hero__stats { gap: 0.5rem; margin-top: 1rem; }
  .hero__stat {
    flex: 1 1 calc(33% - 0.5rem);  /* 3 per row on portrait phones */
    min-width: 80px;
    padding: 0.5rem 0.65rem;
    text-align: center;
    align-items: center;
  }
  .hero__stat-val { font-size: 1.05rem; }
  .hero__stat-lbl { font-size: 0.55rem; }

  /* ── Summary stats: 2 columns ── */
  .summary-stats { grid-template-columns: repeat(2,1fr); }
  .summary-stat:nth-child(2) { border-right: none; }
  .summary-stat:nth-child(3) { border-right: 1px solid var(--border); border-top: 1px solid var(--border); }
  .summary-stat:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }
  .summary-stat:nth-child(5) { border-top: 1px solid var(--border); }
  .summary-stat:nth-child(6) { border-top: 1px solid var(--border); border-right: none; }
  .summary-stat { padding: 0.75rem 1rem; }
  .summary-stat__val { font-size: 1.15rem; }

  /* ── Subject grid: single column on mobile ── */
  .subject-grid { grid-template-columns: 1fr; gap: 0.75rem; }

  /* Subject card head: prevent chip from being pushed off ── */
  .subject-card__head { padding: 0.85rem 1rem 0.7rem; gap: 0.6rem; }
  .subject-icon { width: 32px; height: 32px; font-size: 0.95rem; }
  .subject-card__name { font-size: 0.85rem; }
  .subject-card__type { font-size: 0.62rem; }
  .subject-chip { display: none; } /* hide redundant chip — name is visible */

  /* Subject stats: tighter */
  .subject-card__stats { padding: 0.6rem 1rem; }
  .subject-stat { font-size: 0.78rem; padding: 0.38rem 0; }

  /* Accuracy bar */
  .subject-acc-wrap { padding: 0 1rem 0.75rem; }

  /* Footer buttons: stack vertically */
  .subject-card__foot { padding: 0.65rem 1rem; flex-direction: column; gap: 0.45rem; }
  .btn-subject-link { flex: none; width: 100%; }
}

/* Very small phones (360px and below) */
@media (max-width: 380px) {
  .hero__stat { flex: 1 1 calc(50% - 0.5rem); } /* 2 per row on tiny phones */
  .hero__title { font-size: 1.3rem; }
}
