/* ════════════ RESET & BASE ════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  top: 0;
}

/* override the HTML `hidden` attribute. */
[hidden] { display: none !important; }

:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface2: #f1f4ef;
  --primary: #0d6b4e;
  --primary-light: #34a380;
  --primary-dark: #094e38;
  --accent: #d4a017;
  --accent-dark: #b0860a;
  --text1: #111c17;
  --text2: #4b5c51;
  --text3: #8a9690;
  --easy: #10b981;
  --medium: #d97706;
  --hard: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.08);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --emerald-soft: rgba(13,107,78,0.08);
  --gold-soft: rgba(212,160,23,0.14);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text1);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ════════════ TOP BAR ════════════ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  display: flex; align-items: center;
  padding: 0 2rem; height: 68px;
  gap: 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
  font-size: 1.35rem; font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--primary), var(--accent-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.logo span { font-weight: 400; }

.topbar nav {
  display: flex; gap: 0.35rem;
  flex: 1; justify-content: center;
}

.topbar nav button {
  background: transparent; border: none;
  padding: 0.55rem 1.05rem;
  font-size: 0.92rem; font-weight: 600;
  color: var(--text2); cursor: pointer;
  border-radius: 10px;
  transition: var(--transition);
}
.topbar nav button:hover {
  color: var(--primary);
  background: var(--emerald-soft);
}
.topbar nav button.active {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 16px rgba(13,107,78,0.28);
}
.topbar nav button:active { transform: scale(0.96); }

.search-wrap input {
  border: 1.5px solid #e2e7e0;
  border-radius: 22px;
  padding: 0.5rem 1rem 0.5rem 2.4rem;
  font-size: 0.88rem;
  width: 210px;
  background: var(--surface2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a9690' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 14px center no-repeat;
  transition: var(--transition);
  color: var(--text1);
}
.search-wrap input::placeholder { color: var(--text3); }
.search-wrap input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13,107,78,0.12);
  width: 260px;
}

/* ════════════ HERO ════════════ */
.hero-section {
  position: relative; overflow: hidden;
  text-align: center;
  padding: 4.5rem 2rem 3.75rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 58%, var(--primary-light) 130%);
  color: white;
  border-radius: 0 0 2.25rem 2.25rem;
  margin-bottom: 2.25rem;
}
.hero-section::before, .hero-section::after {
  content: ''; position: absolute;
  border-radius: 50%;
  background: rgba(212,160,23,0.14);
  filter: blur(44px);
  pointer-events: none;
}
.hero-section::before { width: 240px; height: 240px; top: -90px; left: -70px; animation: blobFloat 10s ease-in-out infinite; }
.hero-section::after { width: 300px; height: 300px; bottom: -130px; right: -90px; animation: blobFloat 12s ease-in-out infinite reverse; }
.hero-section h1, .hero-section p { position: relative; z-index: 1; }
.hero-section h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.6rem; letter-spacing: -0.4px; animation: fadeSlideUp 0.5s ease; }
.hero-section .hero-accent {
  background: linear-gradient(90deg, var(--accent), #f6d16a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-section p { font-size: 1.1rem; opacity: 0.9; max-width: 640px; margin: 0 auto; line-height: 1.6; animation: fadeSlideUp 0.5s ease 0.1s backwards; }
.hero-stats {
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
  margin-top: 1.75rem; position: relative; z-index: 1;
  animation: fadeSlideUp 0.5s ease 0.2s backwards;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat b { display: block; font-size: 1.6rem; color: var(--accent); letter-spacing: -0.2px; }
.hero-stats .stat span { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.7px; opacity: 0.85; }

/* ── SCIENCE OPT-IN TOGGLE ── */
.science-toggle {
  display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer;
  margin-top: 1.25rem; position: relative; z-index: 1;
  font-size: 0.9rem; font-weight: 600; color: var(--text1);
  background: var(--surface); border: 1px solid rgba(13,107,78,0.25);
  padding: 0.55rem 1rem; border-radius: 999px; box-shadow: var(--shadow);
  animation: fadeSlideUp 0.5s ease 0.25s backwards; user-select: none;
}
.science-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.science-toggle .toggle-track {
  width: 40px; height: 22px; border-radius: 999px; background: var(--text3);
  position: relative; transition: background 0.25s ease; flex: none;
}
.science-toggle .toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.science-toggle input:checked + .toggle-track { background: var(--primary); }
.science-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.science-toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.science-toggle .toggle-label { line-height: 1.3; }

@keyframes blobFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-22px) scale(1.06); }
}

#mainContent { animation: fadeIn 0.25s ease; }

/* ════════════ HOME SUBJECT GRID ════════════ */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 1.1rem; padding: 0 1.25rem; max-width: 1100px; margin: 0 auto;
}

.subject-card {
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius);
  padding: 1.6rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative; overflow: hidden;
}
.subject-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s ease;
}
.subject-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.subject-card:hover::before { transform: scaleX(1); }
.subject-card .icon {
  font-size: 1.5rem; display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 16px;
  background: rgba(255,255,255,0.14);
  margin-bottom: 0.9rem;
  transition: transform 0.3s ease;
}
.subject-card:hover .icon { transform: scale(1.1) rotate(-5deg); }
.subject-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.35rem; color: #fff; letter-spacing: -0.2px; }
.subject-card p { font-size: 0.88rem; color: rgba(255,255,255,0.88); line-height: 1.55; }

/* ════════════ BREADCRUMB ════════════ */
.breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1.1rem 1.5rem; font-size: 0.88rem;
  flex-wrap: wrap;
}
.breadcrumb button {
  background: transparent; border: none; color: var(--primary); cursor: pointer;
  font-size: 0.88rem; font-weight: 600;
  padding: 0.25rem 0.4rem; border-radius: 6px;
  transition: var(--transition);
}
.breadcrumb button:hover { background: var(--emerald-soft); }
.breadcrumb span { color: var(--text3); }

/* ════════════ SECTION HEADER ════════════ */
.section-header {
  padding: 0.5rem 1.5rem 1.25rem; text-align: center;
}
.section-header h2 { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.2px; }
.section-header p { color: var(--text2); font-size: 0.95rem; margin-top: 0.2rem; }

/* ════════════ CATEGORY GRID ════════════ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem; padding: 0 1.5rem; max-width: 1050px; margin: 0 auto;
}
.cat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative; overflow: hidden;
}
.cat-card::after {
  content: '→'; position: absolute; right: 1.1rem; bottom: 0.9rem;
  font-size: 1.2rem; color: var(--text3);
  opacity: 0; transform: translateX(-8px);
  transition: var(--transition);
}
.cat-card:hover::after { opacity: 1; transform: translateX(0); color: var(--primary); }
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.cat-card .count { font-size: 0.84rem; color: var(--text2); }

/* ════════════ TOPIC LIST ════════════ */
.topic-list { max-width: 850px; margin: 0 auto; padding: 0 1.5rem 2.25rem; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.5rem 0 1rem;
}
.page-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}
.page-btn:hover { background: var(--primary-dark); }
.page-info { color: var(--text2); font-weight: 600; font-size: 0.92rem; }
.topic-row {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.05rem 1.25rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow);
  border: 1px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative; overflow: hidden;
}
.topic-row:hover { transform: translateX(5px); box-shadow: var(--shadow-lg); border-color: rgba(13,107,78,0.12); }
.tname { font-weight: 700; font-size: 0.96rem; display: block; margin-bottom: 0.15rem; letter-spacing: -0.1px; }
.tdesc { font-size: 0.84rem; color: var(--text2); display: block; }
.tmeta { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; margin-left: 1rem; }
.viewed-badge { font-size: .72rem; font-weight: 700; color: var(--primary); background: var(--emerald-soft); padding: .18rem .55rem; border-radius: 10px; margin-left: .35rem; vertical-align: middle; }

.difficulty {
  display: inline-block; padding: 0.22rem 0.65rem;
  border-radius: 20px; font-size: 0.73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.difficulty.easy { background: rgba(16,185,129,0.12); color: var(--easy); }
.difficulty.medium { background: rgba(217,119,6,0.12); color: #b0860a; }
.difficulty.hard { background: rgba(220,38,38,0.10); color: var(--hard); }

/* ════════════ TOPIC DETAIL ════════════ */
.detail-panel { max-width: 850px; margin: 0 auto; padding: 1.5rem; }
.detail-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.detail-header h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.2px; }

.ai-explanation {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.6rem;
  line-height: 1.75;
  box-shadow: var(--shadow);
  font-size: 0.97rem;
}
.ai-explanation strong { color: var(--primary-dark); }
.ai-explanation code {
  background: var(--emerald-soft);
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
}

.step-box {
  background: linear-gradient(135deg, #f2f8f4, #e7f2eb);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem; margin: 1rem 0;
}
.step-box .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: white;
  width: 26px; height: 26px;
  border-radius: 50%; font-size: 0.78rem; font-weight: 700;
  margin-right: 0.6rem; flex-shrink: 0;
}

.example-box {
  background: rgba(212,160,23,0.06);
  border: 1px solid rgba(212,160,23,0.22);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; margin: 1rem 0;
}
.example-box::before { content: '✏️ Example'; font-weight: 700; font-size: 0.88rem; display: block; margin-bottom: 0.55rem; color: var(--accent-dark); }

.warning-box {
  background: rgba(220,38,38,0.05);
  border: 1px solid rgba(220,38,38,0.18);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem; margin: 1rem 0;
}
.warning-box::before { content: '⚠️ ACT Trap'; font-weight: 700; font-size: 0.88rem; display: block; margin-bottom: 0.55rem; color: var(--hard); }

.formula-box {
  background: var(--emerald-soft);
  border: 1px dashed rgba(13,107,78,0.32);
  border-radius: var(--radius-sm);
  padding: 1rem; margin: 1rem 0;
  text-align: center; font-size: 1.15rem;
}
.formula-box::before { content: '📐 Formula'; font-weight: 700; font-size: 0.88rem; display: block; margin-bottom: 0.55rem; color: var(--primary); text-align: left; }

/* ════════════ TABS ════════════ */
.detail-tabs {
  display: flex; gap: 0;
  max-width: 850px; margin: 1.5rem auto 0;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.tab-btn {
  flex: 1; padding: 0.8rem; border: none;
  background: transparent; font-size: 0.92rem; font-weight: 600;
  color: var(--text2); cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.tab-btn::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--primary);
  transform: scaleX(0); transition: transform 0.3s ease;
}
.tab-btn:hover { color: var(--text1); background: var(--surface2); }
.tab-btn.active { color: var(--primary); }
.tab-btn.active::after { transform: scaleX(1); }

.tab-panel { display: none; max-width: 850px; margin: 0 auto; padding: 1.5rem; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); animation: fadeIn 0.25s ease; }
.tab-panel.active { display: block; }

/* ════════════ TEST UI ════════════ */
.test-config { text-align: center; padding: 2.25rem; }
.test-config h4 { font-size: 1.15rem; margin-bottom: 1.1rem; font-weight: 700; }
.config-row { margin-bottom: 0.9rem; }
.config-row label { font-size: 0.95rem; color: var(--text2); font-weight: 500; }
.config-row input {
  padding: 0.45rem 0.7rem; border: 1.5px solid #dde3db;
  border-radius: 8px; width: 110px; font-size: 0.95rem;
  background: var(--surface2); color: var(--text1);
  transition: var(--transition);
}
.config-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,107,78,0.10); }

.questions-list { display: flex; flex-direction: column; gap: 1rem; }
.question-card {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.35rem;
  border: 1px solid #e6ebe5;
  transition: var(--transition);
}
.question-card.answered { border-left: 3px solid var(--primary); }
.q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.q-num { font-weight: 700; font-size: 0.88rem; color: var(--primary); }
.q-text { font-weight: 500; margin-bottom: 0.85rem; font-size: 0.97rem; }
.options { display: flex; flex-direction: column; gap: 0.5rem; }
.option {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
}
.option:hover { background: rgba(13,107,78,0.05); border-color: rgba(13,107,78,0.18); }
.option.selected { background: rgba(13,107,78,0.10); border-color: var(--primary); }
.option input { accent-color: var(--primary); }
.correct-option { background: rgba(16,185,129,0.10) !important; border-color: var(--easy) !important; }
.wrong-option { background: rgba(220,38,38,0.08) !important; border-color: var(--hard) !important; }

.test-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.test-header h3 { flex: 1; font-weight: 700; }
.answered-count { font-size: 0.82rem; font-weight: 700; color: var(--text2); background: var(--surface2); border: 1px solid #dde3db; padding: 0.35rem 0.8rem; border-radius: 20px; }
.result-badge { font-size: 0.78rem; font-weight: 800; padding: 0.18rem 0.6rem; border-radius: 10px; }
.result-badge.correct { background: rgba(16,185,129,0.14); color: var(--easy); }
.result-badge.wrong { background: rgba(220,38,38,0.12); color: var(--hard); }
.q-explanation { margin-top: 0.85rem; padding: 0.85rem; background: rgba(13,107,78,0.05); border-radius: 8px; font-size: 0.88rem; color: var(--text2); }
.score-panel { text-align: center; padding: 1.25rem; font-size: 1.15rem; }
.score-pct {
  display: inline-block; margin-left: 0.75rem;
  background: var(--gold-soft); color: var(--accent-dark);
  font-weight: 800; font-size: 0.88rem;
  padding: 0.28rem 0.8rem; border-radius: 20px;
}
.q-topic { font-size: 0.73rem; font-weight: 700; color: var(--primary-dark); background: var(--emerald-soft); padding: 0.18rem 0.55rem; border-radius: 10px; }
.flag-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  line-height: 1;
}
.flag-btn.flagged {
  background: rgba(212,160,23,0.15);
}
.nav-dot.flagged {
  border-color: var(--accent);
  background: rgba(212,160,23,0.12);
  color: var(--accent-dark);
}
.flag-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-dark);
  background: rgba(212,160,23,0.18);
  padding: 0.14rem 0.5rem;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ════════════ ACT-STYLE TEST UI ════════════ */
.act-test-shell { max-width: 760px; margin: 0 auto; }
.navigator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 7px; margin: 1.1rem 0 1.35rem;
  padding: 0.85rem;
  background: var(--surface2);
  border: 1px solid #dde3db;
  border-radius: var(--radius-sm);
}
.nav-dot {
  min-height: 32px; aspect-ratio: 1;
  border: 1.5px solid #d3dbd5; border-radius: 50%;
  background: #fff; color: var(--text2);
  font-size: 0.75rem; font-weight: 800; cursor: pointer;
  transition: var(--transition);
}
.nav-dot:hover { border-color: var(--primary); color: var(--primary); }
.nav-dot.answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.nav-dot.current { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(212,160,23,0.32); color: var(--accent-dark); }
.nav-dot.current.answered { color: #fff; }
.act-question {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.6rem; margin-bottom: 1.1rem;
  animation: fadeSlideUp 0.25s ease;
}
.act-options { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.1rem; }
.act-option {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 1.05rem; border-radius: 9px;
  border: 1.5px solid #e2e7e0; background: #fff;
  font-size: 0.94rem; cursor: pointer; text-align: left;
  transition: var(--transition);
}
button.act-option:hover { border-color: var(--primary); background: var(--surface2); }
.act-option .letter {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800;
  background: var(--surface2); color: var(--text2);
  border: 1.5px solid #d3dbd5;
  transition: var(--transition);
}
.act-option.selected { border-color: var(--primary); background: var(--emerald-soft); }
.act-option.selected .letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.act-option.correct { border-color: var(--easy); background: rgba(16,185,129,0.10); }
.act-option.correct .letter { background: var(--easy); border-color: var(--easy); color: #fff; }
.act-option.wrong { border-color: var(--hard); background: rgba(220,38,38,0.08); }
.act-option.wrong .letter { background: var(--hard); border-color: var(--hard); color: #fff; }
.act-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.1rem; }
.act-nav button {
  padding: 0.65rem 1.5rem; border-radius: 9px; border: 1.5px solid #d3dbd5;
  background: var(--surface); color: var(--text1); font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.act-nav button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.act-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.preset-row { display: flex; gap: 0.55rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.1rem; }
.preset-btn {
  padding: 0.6rem 1.1rem; border-radius: 9px;
  border: 1.5px solid var(--primary); background: var(--emerald-soft);
  color: var(--primary-dark); font-weight: 700; font-size: 0.84rem; cursor: pointer;
  transition: var(--transition);
}
.preset-btn:hover { background: var(--primary); color: #fff; }
.preset-btn:active { transform: scale(0.96); }

/* ════════════ STEP ANIMATOR ════════════ */
.step-animator {
  max-width: 850px; margin: 0 auto; padding: 0 1.5rem;
}
.step-controls {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.7rem 1rem; margin: 1rem 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #e6ebe5;
  position: sticky; top: 80px; z-index: 50;
}
.step-btn {
  padding: 0.42rem 0.85rem; border-radius: 8px;
  border: 1.5px solid #dde3db; background: var(--surface2);
  color: var(--text1); font-weight: 700; font-size: 0.84rem;
  cursor: pointer; transition: var(--transition);
}
.step-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.step-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.step-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.step-btn.primary:hover { background: var(--primary-dark); }
.step-counter { font-weight: 800; font-size: 0.88rem; color: var(--text2); margin: 0 0.35rem; min-width: 50px; text-align: center; }
.step-speed {
  padding: 0.35rem 0.6rem; border-radius: 6px;
  border: 1.5px solid #dde3db; background: var(--surface2);
  color: var(--text1); font-size: 0.84rem; font-weight: 600;
  cursor: pointer;
}
.step-label { font-size: 0.78rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

.ai-explanation.animating .step-box {
  opacity: 0.28; filter: blur(0.6px);
  transition: opacity 0.45s ease, filter 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
  border-left: 4px solid transparent !important;
  background: transparent !important;
}
.ai-explanation.animating .step-box.active-step {
  opacity: 1; filter: blur(0);
  border-left: 4px solid var(--accent) !important;
  box-shadow: 0 0 0 5px rgba(212,160,23,0.16), var(--shadow);
  background: #fff !important;
}

/* ════════════ FOOTER ════════════ */
.site-footer {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: rgba(255,255,255,0.88);
  margin-top: 3.5rem; padding: 3rem 2rem 1.75rem;
}
.footer-cols {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem; justify-content: center; flex-wrap: wrap;
  max-width: 1050px; margin: 0 auto;
}
.footer-col h5 {
  color: var(--accent); margin-bottom: 0.75rem;
  font-size: 0.88rem; letter-spacing: 1px; text-transform: uppercase; font-weight: 700;
}
.footer-col a {
  display: block; color: rgba(255,255,255,0.82);
  text-decoration: none; padding: 0.18rem 0; font-size: 0.9rem;
  transition: color 0.2s ease;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-about p { font-size: 0.88rem; max-width: 320px; line-height: 1.65; }

/* ════════════ BUTTONS ════════════ */
.start-test-btn, .submit-test-btn, .retry-btn, .back-btn, .yt-btn {
  display: inline-block;
  padding: 0.65rem 1.6rem;
  border: none; border-radius: 10px;
  font-size: 0.92rem; font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative; overflow: hidden;
  text-decoration: none;
}
.start-test-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; margin-top: 1.1rem;
}
.start-test-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(13,107,78,0.3); }
.submit-test-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white; display: block; margin: 1.75rem auto 0;
}
.submit-test-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,160,23,0.35); }
.retry-btn {
  background: var(--surface2); color: var(--text1);
  border: 1.5px solid #dde3db; margin-left: 1rem;
}
.retry-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--emerald-soft); }
.back-btn {
  background: var(--emerald-soft); color: var(--primary);
  margin: 0 1.5rem 0.75rem; font-weight: 600;
}
.back-btn:hover { background: rgba(13,107,78,0.14); }
.yt-btn {
  color: white !important; font-size: 0.84rem !important;
  margin-right: 0.5rem; margin-bottom: 0.55rem; font-weight: 600;
}
.yt-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ════════════ ANIMATIONS ════════════ */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ripple {
  to { transform: scale(3); opacity: 0; }
}

.clickable { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(13,107,78,0.22);
  pointer-events: none;
  transform: scale(0);
  animation: ripple 0.6s ease-out forwards;
}

/* Staggered fade-in for list items */
.topic-row, .cat-card, .subject-card {
  animation: fadeSlideUp 0.45s ease forwards;
}
.topic-row:nth-child(2), .cat-card:nth-child(2), .subject-card:nth-child(2) { animation-delay: 0.04s; }
.topic-row:nth-child(3), .cat-card:nth-child(3), .subject-card:nth-child(3) { animation-delay: 0.08s; }
.topic-row:nth-child(4), .cat-card:nth-child(4), .subject-card:nth-child(4) { animation-delay: 0.12s; }
.topic-row:nth-child(5), .cat-card:nth-child(5), .subject-card:nth-child(5) { animation-delay: 0.16s; }
.topic-row:nth-child(6), .cat-card:nth-child(6), .subject-card:nth-child(6) { animation-delay: 0.2s; }
.topic-row:nth-child(7), .cat-card:nth-child(7), .subject-card:nth-child(7) { animation-delay: 0.24s; }
.topic-row:nth-child(8), .cat-card:nth-child(8), .subject-card:nth-child(8) { animation-delay: 0.28s; }

/* ════════════ SEARCH RESULTS ════════════ */
.no-results { text-align: center; padding: 3.5rem; color: var(--text2); }
.no-results h3 { margin-bottom: 0.55rem; }
mark { background: rgba(13,107,78,0.16); color: var(--primary-dark); padding: 0.12rem 0.28rem; border-radius: 4px; }

/* ════════════ TIMER ════════════ */
.timer {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 1.15rem;
  color: var(--primary); background: rgba(13,107,78,0.08);
  padding: 0.35rem 0.9rem; border-radius: 9px;
}
.timer.warn {
  color: var(--hard); background: rgba(220,38,38,0.10);
  animation: pulse 1s ease infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.pause-btn {
  background: var(--surface2);
  color: var(--primary-dark);
  border: 1.5px solid #dde3db;
  border-radius: 9px;
  padding: 0.35rem 0.9rem;
  font-weight: 800;
  cursor: pointer;
}
.pause-btn:hover { background: var(--emerald-soft); }

/* ════════════ PAST TESTS GRID ════════════ */
.past-tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem; padding: 0 1.5rem; max-width: 1050px; margin: 0 auto 2rem;
}
.past-test-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid #e6ebe5;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.past-test-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.past-test-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.35rem; letter-spacing: -0.1px; }
.past-test-card p { font-size: 0.84rem; color: var(--text2); line-height: 1.5; }
.past-test-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.past-test-actions .yt-btn { margin: 0; }

/* ════════════ HAMBURGER & DRAWER NAV (mobile) ════════════ */
.hamburger {
  display: none;
  background: transparent; border: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px;
  padding: 0;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--primary-dark); border-radius: 2px;
  margin: 4.5px auto;
  transition: var(--transition);
}
.search-toggle {
  display: none;
  background: transparent; border: none; cursor: pointer;
  font-size: 1.1rem; padding: 0.4rem; border-radius: 8px;
  transition: var(--transition);
}
.search-toggle:hover { background: var(--emerald-soft); }
.nav-overlay { display: none; }

/* ════════════ LOADING STATE ════════════ */
.loading-state {
  text-align: center; padding: 5rem 2rem; color: var(--text2);
  font-size: 1.05rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.loading-state::before {
  content: ''; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--emerald-soft); border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════ ANALYTICS DASHBOARD ════════════ */
.analytics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem; padding: 0 1.5rem; max-width: 1050px; margin: 0 auto;
}
.analytics-card {
  background: var(--surface); border: 1px solid #e6ebe5; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem 1.5rem;
}
.analytics-card h4 {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text3); font-weight: 700; margin-bottom: 1rem;
}
.kpi-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; }
.kpi b { font-size: 1.6rem; color: var(--primary); letter-spacing: -0.5px; }
.kpi span { font-size: 0.78rem; color: var(--text3); }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.analytics-table th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text3); padding: 0.4rem 0.5rem; border-bottom: 1px solid #e6ebe5;
}
.analytics-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid #f0f3ee; }
.analytics-table tr:last-child td { border-bottom: none; }
.analytics-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.dim { color: var(--text3); font-size: 0.82rem; }

/* ════════════ DATA TABLES (question prompts) ════════════ */
.read-passage {
  display: block; margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 0.9rem; border-left: 3px solid var(--primary);
  background: var(--surface2); border-radius: 8px; line-height: 1.6;
  font-size: 0.9rem;
}
.data-table {
  width: 100%; border-collapse: collapse; margin: 0.6rem 0;
  font-size: 0.86rem; background: var(--surface);
  border-radius: 8px; overflow: hidden;
}
.data-table th, .data-table td {
  border: 1px solid #e2e7e0; padding: 0.45rem 0.7rem; text-align: left;
}
.data-table th { background: var(--emerald-soft); color: var(--primary-dark); font-weight: 700; }
.data-table tr:nth-child(even) td { background: var(--surface2); }

/* ════════════ ACT FIGURES (inline SVG) ════════════ */
.act-figure {
  margin: 0.9rem auto; max-width: 420px; text-align: center;
}
.act-figure figcaption {
  font-size: 0.82rem; color: var(--text3); margin-top: 0.25rem;
}
.act-fig {
  display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto;
}
.act-fig-shape { max-width: 300px; }
.act-fig .fig-grid { stroke: var(--emerald-soft); stroke-width: 1; }
.act-fig .fig-axis { stroke: var(--text3); stroke-width: 1.4; fill: var(--text3); }
.act-fig .fig-line { stroke: var(--primary); stroke-width: 2.4; fill: none; }
.act-fig .fig-line.fig-muted { stroke: var(--text3); }
.act-fig .fig-line.fig-dashed { stroke-dasharray: 6 5; }
.act-fig .fig-line.fig-dim { stroke: var(--text2); }
.act-fig .fig-point { fill: var(--accent); stroke: var(--surface); stroke-width: 1; }
.act-fig .fig-shade { fill: var(--primary-light); fill-opacity: 0.18; stroke: none; }
.act-fig .fig-shape { fill: var(--emerald-soft); stroke: var(--primary); stroke-width: 2.2; }
.act-fig .fig-bar { fill: var(--primary-light); stroke: var(--primary); stroke-width: 1.2; }
.act-fig .fig-bar.gold { fill: var(--accent); stroke: var(--accent-dark); }
.act-fig .fig-tick, .act-fig .fig-label { font-family: 'Inter', sans-serif; }
.act-fig .fig-tick { font-size: 11px; fill: var(--text3); }
.act-fig .fig-label { font-size: 12px; fill: var(--text1); font-weight: 600; }
.act-fig .fig-tick-line { stroke: var(--text3); stroke-width: 1; }
.act-fig .fig-filled { fill: var(--primary); stroke: var(--primary); }
.act-fig .fig-arrow { fill: var(--text3); }
.act-cube-top { fill: var(--emerald-soft); stroke: var(--primary); stroke-width: 1.4; }
.act-cube-side { fill: var(--primary-light); fill-opacity: 0.4; stroke: var(--primary); stroke-width: 1.4; }
.act-figure .act-fig { border: 1px solid rgba(13,107,78,0.12); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }

/* ════════════ FOOTER BOTTOM / SUPPORT ════════════ */
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  max-width: 1050px; margin: 2.25rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.8); font-size: 0.88rem;
}
.support-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white; border: none; border-radius: 24px;
  padding: 0.55rem 1.4rem; font-size: 0.88rem; font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.support-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(212,160,23,0.4); }

/* ════════════ MODALS ════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(9, 30, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}
.modal {
  position: relative;
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px; padding: 2rem 2rem 1.75rem;
  animation: fadeSlideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal h3 { font-size: 1.25rem; letter-spacing: -0.3px; margin-bottom: 0.5rem; }
.modal > p { font-size: 0.9rem; color: var(--text2); margin-bottom: 1.25rem; }
.modal-close {
  position: absolute; top: 0.85rem; right: 0.9rem;
  background: transparent; border: none; cursor: pointer;
  font-size: 1.05rem; color: var(--text3);
  width: 32px; height: 32px; border-radius: 8px; transition: var(--transition);
}
.modal-close:hover { background: var(--surface2); color: var(--text1); }
.support-links { display: flex; flex-direction: column; gap: 0.6rem; }
.support-link {
  display: flex; align-items: center; justify-content: center;
  padding: 0.7rem 1rem; border-radius: 10px;
  font-weight: 700; font-size: 0.92rem; text-decoration: none;
  transition: var(--transition);
}
.support-link.bmc { background: #ffdd00; color: #1a1a1a; }
.support-link.bmc:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255,221,0,0.4); }
.support-link.paypal { background: #003087; color: #fff; }
.support-link.paypal:hover { background: #0a3fa5; transform: translateY(-1px); }
.support-card { display: flex; flex-direction: column; gap: 0.5rem; }
.support-card .donation-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.85rem 1.2rem; border-radius: 12px;
  font-size: 0.95rem; font-weight: 700; letter-spacing: 0.2px;
  text-decoration: none; color: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  position: relative; overflow: hidden;
}
.support-card .donation-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.16); }
.support-card .donation-btn:active { transform: translateY(0) scale(0.98); }
.support-card .donation-btn.bmc { background: linear-gradient(135deg, #ffdd00, #f5c400); color: #1a1a1a; }
.support-card .donation-btn.bmc:hover { box-shadow: 0 8px 20px rgba(255,221,0,0.4); }
.support-card .donation-btn.paypal { background: linear-gradient(135deg, #003087, #0070e0); }
.support-card .donation-btn .dn-ico {
  font-size: 1.15rem; line-height: 1; display: inline-flex;
}
.modal-note { margin-top: 1.25rem; font-size: 0.8rem; color: var(--text3); margin-bottom: 0 !important; }

body.no-scroll { overflow: hidden; }

/* ════════════ RESPONSIVE ════════════ */
@media (max-width: 768px) {
  .topbar { padding: 0 1rem; height: 60px; flex-wrap: nowrap; gap: 0.5rem; }
  .logo { margin-right: auto; font-size: 1.15rem; }
  .hamburger { display: block; }
  .hamburger span { margin-left: auto; margin-right: auto; }
  .topbar nav {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(78vw, 300px); z-index: 250;
    flex-direction: column; align-items: stretch;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 4.75rem 1rem 1.5rem;
    gap: 0.25rem;
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }
  .topbar nav.open { transform: translateX(0); }
  .topbar nav button {
    padding: 0.85rem 1rem; font-size: 0.95rem; text-align: left;
    width: 100%; border-radius: 10px;
  }
  .nav-overlay {
    display: block; position: fixed; inset: 0; z-index: 240;
    background: rgba(9, 30, 20, 0.5);
    opacity: 0; transition: opacity 0.25s ease;
  }
  .nav-overlay.show { opacity: 1; }
  .search-wrap { display: flex; align-items: center; gap: 0.4rem; position: relative; }
  .search-toggle { display: block; }
  .search-wrap input, .search-wrap input:focus {
    position: fixed; top: 70px; right: 1rem; z-index: 245;
    width: 0; padding: 0; opacity: 0; border: none;
    pointer-events: none;
  }
  .search-wrap.search-open input,
  .search-wrap.search-open input:focus {
    width: min(72vw, 320px); opacity: 1;
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    pointer-events: auto;
    border: 1.5px solid #e2e7e0;
    box-shadow: var(--shadow-lg);
  }
  .hero-section h1 { font-size: 1.7rem; }
  .hero-section { padding: 2.5rem 1.25rem 2.75rem; border-radius: 0 0 1.75rem 1.75rem; }
  .subject-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .cat-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .topic-list { padding: 0 1rem; }
  .footer-cols { grid-template-columns: 1fr; gap: 1.75rem; }
  .past-tests-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .analytics-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .study-plan-card { margin: 1.5rem 1rem 0; padding: 1.5rem; }
  .footer-bottom { margin: 1.75rem auto 0; padding-top: 1.25rem; }
}

@media (max-width: 480px) {
  .hero-stats { gap: 1.5rem; }
  .waitlist-form input { min-width: 100%; }
}

/* ════════════ ACCESSIBILITY ════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-section { animation: none; }
}
