
:root {
  --primary: #2d5ab4;
  --primary-dark: #21448c;
  --success: #1f8b5f;
  --accent: #ffb347;
  --text: #1f2b44;
  --text-secondary: #5f6f87;
  --muted: #6b7891;
  --bg: #f6f9ff;
  --card: #ffffff;
  --border: #dfe7f5;
  --border-light: #e6edf8;
  --shadow: rgba(31, 63, 117, 0.32);
}

html[data-theme="dark"] {
  --primary: #4a7bd8;
  --primary-dark: #3a5fa8;
  --success: #2ba373;
  --accent: #ffc966;
  --text: #e4e6eb;
  --text-secondary: #b0b8c4;
  --muted: #a0a8b8;
  --bg: #1a1d24;
  --card: #242a33;
  --border: #3a3f47;
  --border-light: #2c3139;
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Space Grotesk", sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
  transition: 2.5s;
}

/* Fade-in Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

a {
  text-decoration: none;
  color: inherit;
}

/* Animation utility classes */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
  opacity: 0;
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-scale {
  opacity: 0;
  animation: fadeInScale 0.6s ease-out forwards;
  pointer-events: auto;
}

/* Subject card specific animation */
.subject-card.animate-fade-in-scale {
  cursor: pointer;
  pointer-events: auto;
}

/* Slower drag animation for topic cards */
.topic-card.animate-fade-in-scale {
  animation: fadeInScale 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Staggered animations with delays */
.animate-stagger-1 { animation-delay: 0.1s; }
.animate-stagger-2 { animation-delay: 0.2s; }
.animate-stagger-3 { animation-delay: 0.3s; }
.animate-stagger-4 { animation-delay: 0.4s; }
.animate-stagger-5 { animation-delay: 0.5s; }

.nav {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-bottom: 1px solid rgba(230, 237, 248, 0.3);
  position: sticky;
  z-index: 1000;
  top: 0;
  border-radius: 14px;
  border: 2px solid var(--primary);
  backdrop-filter: blur(14px);
  animation: fadeInDown 0.6s ease-out;
}

.logo {
  font-size: 24px;
  font-family: "DM Serif Display", serif;
  font-weight: 800;
  letter-spacing: -0.25px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo::before {
  content: "\f518";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary), var(--success));
  color: var(--card);
  box-shadow: 0 10px 24px -14px var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a {
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.nav-links a.active {
  color: var(--primary);
  border-color: var(--primary);
  transition: .6s;
}

.nav-links a:hover {
  color: var(--primary);
}

.btn {
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 12px;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease, background .15s ease;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--card);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.35);
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--card);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.35);
}

.btn.success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success) 100%);
  color: var(--card);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.35);
}

.btn.icon-btn{
  padding: 10px 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 42px;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  scale: 1.02;
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.4);
}

main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 40px;
}

@media (max-width: 1024px) {
  main {
    padding: 0 24px 32px;
  }

  .nav {
    padding: 16px 24px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
    padding: 42px 26px 32px;
    min-height: 0;
    height: auto;
    gap: 18px;
  }

  .hero-text h1 {
    font-size: 42px;
    width: auto;
    max-width: 11ch;
  }

  .hero-text {
    margin-top: 0;
  }

  .hero-text p {
    margin-top: 0;
    max-width: 34ch;
  }

  .hero-illustration {
    justify-content: center;
    align-items: flex-end;
  }

  .hero-illustration .blob {
    display: block;
    position: absolute;
    inset: auto 6% 4% 6%;
    border-radius: 36px;
    background: radial-gradient(circle at 50% 35%, rgba(45, 90, 180, 0.16), rgba(45, 90, 180, 0.02) 68%);
    z-index: 0;
  }

  .hero-illustration img {
    width: min(430px, 100%);
    height: auto;
    margin: 0;
    margin-top: 0;
    transform: none;
    mix-blend-mode: normal;
    filter: brightness(1.04) saturate(1.02);
  }
}

@media (max-width: 768px) {
  main {
    padding: 0 20px 28px;
  }

  .nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo theme"
      "links links";
    align-items: center;
    gap: 14px 12px;
    padding: 14px 18px;
    border-radius: 18px;
  }

  .logo {
    grid-area: logo;
    justify-self: start;
    font-size: 20px;
  }

  .logo::before {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .nav-links {
    grid-area: links;
    gap: 10px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    padding: 6px;
    border-radius: 18px;
    background: rgba(45, 90, 180, 0.07);
  }

  .nav-links a {
    min-height: 42px;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border-bottom: none;
    font-size: 14px;
    text-align: center;
  }

  .nav-links a.active {
    background: var(--card);
    border-color: transparent;
    box-shadow: 0 10px 22px -18px var(--shadow);
  }

  .nav .btn.icon-btn {
    grid-area: theme;
    justify-self: end;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 14px;
    box-shadow: 0 14px 28px -20px rgba(0, 0, 0, 0.35);
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 30px 20px 22px;
    min-height: 0;
    gap: 20px;
  }

  .hero-text h1 {
    width: auto;
    max-width: 10ch;
    font-size: clamp(2.2rem, 8vw, 3rem);
    line-height: 1.04;
    margin-bottom: 10px;
  }

  .hero-text p {
    font-size: 15px;
    margin-top: 0;
    max-width: 38ch;
    line-height: 1.72;
  }

  .hero-illustration {
    position: relative;
    justify-content: center;
    align-items: flex-end;
    min-height: 260px;
    margin-top: 0;
    padding-top: 6px;
  }

  .hero-illustration .blob {
    inset: auto 4% 2% 4%;
    border-radius: 34px;
    opacity: 0.95;
  }

  .hero-illustration img {
    width: min(420px, 96%);
    height: auto;
    margin: 0 auto;
    display: block;
    transform: none;
    mix-blend-mode: normal;
    filter: brightness(1.05) saturate(1.03);
  }

  .section-header h2 {
    font-size: 24px;
  }

  .subject-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
  }

  .subject-card {
    padding: 14px 16px;
    min-height: 64px;
  }

  .subject-card .icon-circle {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .syllabus {
    gap: 14px;
    padding: 16px 0 14px;
  }

  .syllabus-card {
    padding: 18px;
    min-height: 200px;
  }

  .syllabus-illus {
    height: 120px;
    font-size: 44px;
    margin-bottom: 4px;
  }

  .syllabus-card .card-heading {
    font-size: 18px;
  }

  .syllabus-card .btn {
    width: 120px;
    padding: 10px 14px;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  main {
    padding: 0 16px 24px;
  }

  .nav {
    gap: 12px 10px;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .logo {
    font-size: 18px;
  }

  .logo::before {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .nav-links {
    gap: 8px;
    padding: 5px;
    border-radius: 16px;
    font-size: 14px;
  }

  .nav-links a {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 13px;
    line-height: 1.2;
  }

  .nav .btn.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .hero {
    padding: 24px 16px 18px;
    min-height: 0;
    gap: 16px;
  }

  .hero-text h1 {
    font-size: clamp(2rem, 9vw, 2.5rem);
    line-height: 1.06;
    margin-bottom: 8px;
  }

  .hero-text p {
    font-size: 14px;
    margin-top: 0;
    line-height: 1.7;
    max-width: 100%;
  }

  .hero-illustration {
    min-height: 220px;
    padding-top: 0;
  }

  .hero-illustration .blob {
    inset: auto 2% 2% 2%;
    border-radius: 28px;
  }

  .hero-illustration img {
    width: min(350px, 100%);
    margin: 0 auto;
  }

  .section-header {
    margin-bottom: 6px;
  }

  .section-header h2 {
    font-size: 22px;
    margin-bottom: 0;
  }

  .subject-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 10px;
  }

  .subject-card {
    padding: 12px 14px;
    min-height: 60px;
    font-size: 13px;
  }

  .subject-card .icon-circle {
    width: 32px;
    height: 32px;
    font-size: 14px;
    gap: 10px;
  }

  .divider {
    margin: 6px 0 16px;
  }

  .syllabus {
    gap: 12px;
    padding: 12px 0;
    margin-top: 16px;
  }

  .syllabus-card {
    padding: 16px;
    min-height: 0;
  }

  .syllabus-illus {
    height: 100px;
    font-size: 36px;
    margin-bottom: 0;
  }

  .syllabus-card .card-heading {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .syllabus-card p {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .syllabus-card .btn {
    width: 100%;
    padding: 11px 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0 14px 20px;
  }

  .nav {
    padding: 10px 14px;
    border-radius: 10px;
  }

  .logo {
    font-size: 16px;
  }

  .logo::before {
    width: 26px;
    height: 26px;
  }

  .nav-links {
    gap: 12px;
    font-size: 12px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    padding: 8px 10px;
  }

  .hero {
    padding: 20px 14px 16px;
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero-text h1 {
    font-size: clamp(1.85rem, 10vw, 2.2rem);
    line-height: 1.08;
    margin-bottom: 8px;
  }

  .hero-text p {
    font-size: 13px;
    margin-top: 0;
    max-width: 100%;
    line-height: 1.65;
  }

  .hero-illustration {
    min-height: 185px;
    margin-top: 0;
  }

  .hero-illustration .blob {
    inset: auto 0 0 0;
    border-radius: 24px;
    opacity: 0.75;
  }

  .hero-illustration img {
    width: min(300px, 100%);
    height: auto;
    margin: 0 auto;
  }

  .section-header h2 {
    font-size: 20px;
  }

  .subject-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
  }

  .subject-card {
    padding: 10px 12px;
    min-height: 56px;
    font-size: 12px;
    gap: 8px;
  }

  .subject-card .icon-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .syllabus {
    gap: 10px;
    margin-top: 12px;
  }

  .syllabus-card {
    padding: 14px;
  }

  .syllabus-illus {
    height: 80px;
    font-size: 28px;
  }

  .syllabus-card .card-heading {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .syllabus-card p {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .syllabus-card .btn {
    width: 100%;
    padding: 10px 10px;
    font-size: 11px;
    height: auto;
  }

  #examSection {
    width: min(340px, 92vw);
    padding: 24px 20px;
    border-radius: 18px;
    max-height: 80vh;
  }

  .exam-title {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .exam-subtitle {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .exam-buttons {
    gap: 10px;
    margin-bottom: 14px;
  }

  .exam-btn {
    padding: 12px 14px;
    min-height: 56px;
    gap: 12px;
    border-radius: 12px;
  }

  .exam-btn .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .exam-btn .btn-label {
    font-size: 13px;
  }

  .exam-btn .btn-desc {
    font-size: 11px;
  }

  .view-all-btn {
    padding: 12px 14px;
    font-size: 12px;
    gap: 6px;
  }

  .view-all-btn i {
    font-size: 11px;
  }

  .exam-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .contact-container {
    padding: 32px 14px;
    gap: 28px;
  }

  .contact-title {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .contact-subtitle {
    font-size: 13px;
  }

  .contact-methods {
    gap: 12px;
  }

  .contact-card {
    padding: 16px;
    gap: 12px;
  }

  .contact-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .contact-content h3 {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .contact-content p {
    font-size: 12px;
  }

  .contact-arrow {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  footer {
    margin-top: 40px;
  }
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  padding: 50px 42px 40px;
  overflow: hidden;
  background: var(--bg);
  border-radius: 0;
  height: 70vh;
}

.hero-text h1 {
  font-size: 50px;
  line-height: 1;
  font-weight: 700;
  font-family: "DM Serif Display", serif;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  width: 740px;
}

.hero-text .accent {
  color: var(--primary);
}

.hero-text p {
  margin-top: -7px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 520px;
}

.search-bar {
  margin-top: 26px;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px -26px var(--shadow);
  padding: 12px 12px 12px 14px;
  max-width: 500px;
  gap: 12px;
}

.search-bar i {
  color: var(--muted);
  font-size: 16px;
}

.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 15px;
  color: var(--text);
  background: var(--card);
}

.search-bar input::placeholder {
  color: var(--muted);
}

.search-bar .btn {
  height: 44px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
}

.hero-illustration {
  /* position: relative; */
  display: flex;
  /* justify-content: flex-end; */
}

/* .hero-illustration .blob {
  position: absolute;
  right: -10%;
  top: -8%;
  width: 130%;
  height: 30%;
  background: var(--bg);
  border-radius: 46%;
  z-index: 0;
} */

.hero-illustration img {
  /* position: relative; */
  width: 500px;
  z-index: 999;
  height: 600px;
  transform: translateY(-40px);
  mix-blend-mode: multiply;
  margin-left: -150px;
  filter: brightness(100%);
  margin-top: -70px;
}

.subjects-section {
  margin-top: 28px;
  padding: 26px 0 10px;
  border-top: 1px solid var(--border-light);
}

.section-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  animation: fadeIn 0.6s ease-out;
}

.subject-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 12px 28px -24px var(--shadow);
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(245,248,255,0.92));
  min-height: 70px;
  opacity: 0;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  transition: 1.2s;
}

.subject-card.animate-fade-in-scale {
  animation: fadeInScale 0.6s ease-out forwards;
  pointer-events: auto;
}

.subject-card.animate-fade-in-scale:nth-child(1) { animation-delay: 0.1s; }
.subject-card.animate-fade-in-scale:nth-child(2) { animation-delay: 0.15s; }
.subject-card.animate-fade-in-scale:nth-child(3) { animation-delay: 0.2s; }
.subject-card.animate-fade-in-scale:nth-child(4) { animation-delay: 0.25s; }
.subject-card.animate-fade-in-scale:nth-child(5) { animation-delay: 0.3s; }
.subject-card.animate-fade-in-scale:nth-child(6) { animation-delay: 0.35s; }
.subject-card.animate-fade-in-scale:nth-child(7) { animation-delay: 0.4s; }
.subject-card.animate-fade-in-scale:nth-child(8) { animation-delay: 0.45s; }
.subject-card.animate-fade-in-scale:nth-child(9) { animation-delay: 0.5s; }
.subject-card.animate-fade-in-scale:nth-child(10) { animation-delay: 0.55s; }
.subject-card.animate-fade-in-scale:nth-child(11) { animation-delay: 0.6s; }
.subject-card.animate-fade-in-scale:nth-child(12) { animation-delay: 0.65s; }

.subject-card .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffffff, #eef3ff);
  color: var(--primary);
  box-shadow: 0 12px 24px -16px var(--shadow);
  border: 1px solid var(--border-light);
  font-size: 18px;
  z-index: 1;
}

html[data-theme="dark"] .subject-card .icon-circle {
  background: var(--card);  
  border: 1px solid var(--border);
}
#subjects { scroll-margin-top: 80px; }


.subject-card.math {
  background: linear-gradient(135deg, #fff3df, #ffe8ca);
}

.subject-card.eng {
  background: linear-gradient(135deg, #e9f1ff, #dde9ff);
}

.subject-card.bio {
  background: linear-gradient(135deg, #ecf7f1, #dcefe5);
}

.subject-card.chem {
  background: linear-gradient(135deg, #eef5ff, #e3eefc);
}

.subject-card.phy {
  background: linear-gradient(135deg, #e8f0ff, #dbe8ff);
}

.subject-card.acc {
  background: linear-gradient(135deg, #fef4e2, #ffe7c7);
}

.subject-card.lit {
  background: linear-gradient(135deg, #f4f1ff, #e8e3ff);
}

.subject-card.eco {
  background: linear-gradient(135deg, #eaf6ff, #d9eefe);
}

.subject-card.govt {
  background: linear-gradient(135deg, #f1f6ff, #e3ecff);
}

.subject-card.civic {
  background: linear-gradient(135deg, #f0f8ff, #e1f2ff);
}

.subject-card.mkt {
  background: linear-gradient(135deg, #fff3e8, #ffe5d3);
}

.subject-card.com {
  background: linear-gradient(135deg, #f3f7ff, #e6ecf9);
}

.subject-card.crs {
  background: linear-gradient(135deg, #f4f1ff, #e9e4ff);
}

.subject-card.chem .icon-circle {
  color: #f07f2f;
}

.subject-card.math .icon-circle {
  color: #c16c1d;
}

.subject-card.eng .icon-circle {
  color: #2c5fbf;
}

.subject-card.bio .icon-circle {
  color: #1f8b5f;
}

.subject-card.phy .icon-circle {
  color: #2a5eb7;
}

.subject-card.acc .icon-circle {
  color: #d87b1f;
}

.subject-card.lit .icon-circle {
  color: #5a3bb0;
}

.subject-card.eco .icon-circle {
  color: #2f7fbf;
}

.subject-card.govt .icon-circle {
  color: #2f5b9b;
}

.subject-card.civic .icon-circle {
  color: #2f8fb0;
}

.subject-card.mkt .icon-circle {
  color: #d06228;
}

.subject-card.com .icon-circle {
  color: #375c9e;
}

.subject-card.crs .icon-circle {
  color: #6b3faa;
}



.subject-card {
  transition: scale 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease !important;
}

.subject-card:hover,
.subject-card:focus {
  scale: 1.1;
  box-shadow: 0 20px 48px -12px var(--shadow) !important;
}

html[data-theme="dark"] .subject-card:hover,
html[data-theme="dark"] .subject-card:focus {
  border-color: var(--primary);
}

html[data-theme="dark"] .subject-card.math,
html[data-theme="dark"] .subject-card.eng,
html[data-theme="dark"] .subject-card.bio,
html[data-theme="dark"] .subject-card.chem,
html[data-theme="dark"] .subject-card.phy,
html[data-theme="dark"] .subject-card.acc,
html[data-theme="dark"] .subject-card.lit,
html[data-theme="dark"] .subject-card.eco,
html[data-theme="dark"] .subject-card.govt,
html[data-theme="dark"] .subject-card.civic,
html[data-theme="dark"] .subject-card.mkt,
html[data-theme="dark"] .subject-card.com,
html[data-theme="dark"] .subject-card.crs {
  background: var(--card);
  /* color: var(--primary); */
}

.subject-card span {
  position: relative;
  z-index: 1;
}

.syllabus {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding: 22px 0 20px;
  border-top: 1px solid var(--border-light);
}

.syllabus-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 16px 40px -28px var(--shadow);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  align-items: flex-start;
  opacity: 0;
}

.syllabus-card.animate-fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.syllabus-card.animate-fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.syllabus-card.animate-fade-in-up:nth-child(3) { animation-delay: 0.3s; }

.syllabus-illus {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  margin-bottom: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 14px 36px -26px var(--shadow);
  position: relative;
  overflow: hidden;
  color: var(--text);
}


.illus-jamb {
  background: linear-gradient(135deg, #d1e1fc, #a6c6fa);
  color: #1f5eb5;
}

.illus-waec {
  background: linear-gradient(135deg, #d6e5f8, #ffebaa);
  color: #c6841a;
}

.illus-neco {
  background: linear-gradient(135deg, #defdec, #c3f3d9);
  color: #1f8b5f;
}

.syllabus-illus i {
  opacity: 0.25;
}

.syllabus-card.jamb {
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
 
}

.syllabus-card.waec {
  background: linear-gradient(180deg, #ffffff 0%, #f4f6fb 100%);
 
}

.syllabus-card.neco {
  background: linear-gradient(180deg, #ffffff 0%, #eef9f3 100%);
  
}
html[data-theme="dark"] .syllabus-card.jamb ,
html[data-theme="dark"] .syllabus-card.waec,
html[data-theme="dark"] .syllabus-card.neco {
    background: linear-gradient(  var(--primary-dark));
    background: var(--card);
  color: var(--card);
  /* background: linear-gradient(145deg, var(--primary), var(--success)); */
}
/* html[data-theme="dark"] .illus-jamb ,
html[data-theme="dark"] .illus-waec,
html[data-theme="dark"] .illus-neco {
 background: var(--card);
  background: linear-gradient(  var(--primary-dark));
} */

.syllabus-card .card-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.syllabus-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.syllabus-card .btn {
  width: 140px;
  justify-content: center;
}

.syllabus-card.jamb .btn{
  background:#2f62d1;
  /* border:2px solid #2b57bc; */
  color: white;
}

.syllabus-card.waec .btn{
  background:#d48c24;
  /* border:2px solid #bd7a1f; */
  color: white;
}

.syllabus-card.neco .btn{
  background:#1f8b5f;
  /* border:2px solid #19764f; */
  color: white;
}

.divider {
  height: 1px;
  background: var(--border-light);
  width: 100%;
  margin: 8px 0 20px;
}

footer {
  margin-top: 60px;
  padding: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.contact-section {
  scroll-margin-top: 80px;
}

.contact-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.contact-header {
  text-align: center;
  margin-bottom: 20px;
}

.contact-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.contact-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 20px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  text-decoration: none;
  color: inherit;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  
}

.contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

html[data-theme="dark"] .contact-card::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
}

.contact-card:hover {
  border-color: var(--primary);
  background: var(--card);
  transform: translateY(-4px);
  box-shadow: 0 20px 48px -16px var(--shadow);
}

.contact-card:hover .contact-arrow {
  transform: translateX(4px);
}

.contact-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: var(--bg);
  color: var(--primary);
}

.contact-card.whatsapp-card .contact-icon {
  background: var(--bg);
  color: #25d366;
}

.contact-content {
  flex: 1;
  min-width: 0;
}

.contact-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.contact-content p {
  font-size: 14px;
  color: var(--text-secondary);
  word-break: break-word;
}

.contact-arrow {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.contact-card.whatsapp-card:hover .contact-arrow {
  background: var(--bg);
  color: #25d366;
}

.contact-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

/* Exam pop-up */
#examSection {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  width: min(420px, 90vw);
  max-height: 85vh;
  background: var(--card);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 40px 120px -40px var(--shadow), 0 0 1px var(--border);
  border: 1px solid var(--border);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#examSection::-webkit-scrollbar {
  width: 6px;
}

#examSection::-webkit-scrollbar-track {
  background: transparent;
}

#examSection::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

#examSection::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1100;
  backdrop-filter: blur(5px);
}

#examSection[style*="display: block"] {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

#examSection[style*="display: block"] ~ .overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Exam Section Title */
.exam-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}

.exam-subtitle {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Exam Buttons Grid */
.exam-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.exam-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  min-height: 64px;
}

.exam-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.exam-btn:hover {
  border-color: var(--primary);
  background: var(--card);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -18px var(--shadow);
}

.exam-btn:active {
  transform: translateY(0);
  background: linear-gradient(135deg, rgba(3, 31, 63, 0.9) 0%, rgba(4, 32, 73, 0.7) 100%);
  color:#7a96da ;
  text-decoration-color: #1f3f7550;
}

.exam-btn .btn-label:active{
  color: white
}

.exam-btn .btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--bg);
  color: var(--primary);
}

.exam-btn .btn-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  flex: 1;
}

.exam-btn .btn-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.exam-btn .btn-desc {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* Exam Button Variants */
.exam-btn.jamb-btn:hover .btn-icon {
  background: linear-gradient(135deg, #2f62d1 0%, #2456b2 100%);
  color: white;
}

.exam-btn.waec-btn:hover .btn-icon {
  background: linear-gradient(135deg, #d48c24 0%, #c27a1f 100%);
  color: white;
}

.exam-btn.neco-btn:hover .btn-icon {
  background: linear-gradient(135deg, #1f8b5f 0%, #176048 100%);
  color: white;
}

/* Divider */
.exam-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* View All Topics Button */
.view-all-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--card);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 16px 40px -20px var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.view-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px -16px var(--shadow);
  filter: brightness(1.06);
}

.view-all-btn:active {
  transform: translateY(0);
}

.view-all-btn i {
  font-size: 12px;
  transition: transform 0.25s ease;
}

.view-all-btn:hover i {
  transform: translateX(2px);
}

/* Close Button */
.exam-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px -10px var(--shadow);
  z-index: 10;
}

.exam-close:hover {
  background: var(--primary);
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 12px 24px -8px var(--shadow);
  color: var(--card);
}

.exam-close:active {
  transform: scale(1.04) rotate(90deg);
}

/* ================= Dark theme refinements ================= */
html[data-theme="dark"] {
  --bg: #0f141d;
  --card: #171c25;
  --border: #2a303a;
  --border-light: #242a33;
  --text: #e5e7eb;
  --text-secondary: #b6bfcc;
  --muted: #96a0b3;
  --shadow: rgba(0,0,0,0.6);
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] .nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 28px -24px rgba(0,0,0,0.7);
}

html[data-theme="dark"] .hero {
  background: radial-gradient(circle at 15% 20%, rgba(74,123,216,0.12), transparent 35%), radial-gradient(circle at 85% 10%, rgba(43,132,92,0.12), transparent 30%), linear-gradient(180deg, #111622 0%, #0f141d 100%);
  box-shadow: none;
}

html[data-theme="dark"] .hero-text h1 { color: var(--text); }
html[data-theme="dark"] .hero-text p { color: var(--text-secondary); }

html[data-theme="dark"] .subject-card {
  border: 1px solid var(--border);
  box-shadow: 0 16px 34px -22px rgba(0,0,0,0.65);
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

html[data-theme="dark"] .subject-card .icon-circle {
  background: var(--card);
}

html[data-theme="dark"] .syllabus-card {
  background: linear-gradient(180deg, rgba(23,28,36,0.98) 0%, rgba(17,22,31,0.96) 100%);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 18px 44px -26px rgba(0,0,0,0.7);
}

html[data-theme="dark"] .syllabus-card .card-heading { color: var(--text); }
html[data-theme="dark"] .syllabus-card p { color: var(--text-secondary); }

html[data-theme="dark"] .btn,
html[data-theme="dark"] .btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--card);
  box-shadow: 0 16px 34px -18px rgba(0,0,0,0.6);
}

html[data-theme="dark"] .btn.success {
  background: linear-gradient(135deg, var(--success) 0%, color-mix(in srgb, var(--success) 70%, #0f5a3a 30%));
  color: var(--card);
  box-shadow: 0 16px 34px -18px rgba(0,0,0,0.6);
}

html[data-theme="dark"] footer {
  background: var(--card);
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* Hero image brightness fix */
.hero-illustration img {
  mix-blend-mode: normal !important;
  filter: brightness(1.12) saturate(1.04) !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .hero-illustration img {
  filter: brightness(1.16) saturate(1.06) !important;
}

/* ================= Topics Page Styles ================= */
.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 56px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 30px 30px 26px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 12px 32px -18px var(--shadow);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto -5% -35% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 90, 180, 0.12) 0%, rgba(45, 90, 180, 0) 68%);
  pointer-events: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 700;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--primary-dark);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(45, 90, 180, 0.08);
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #5f8eff);
  box-shadow: 0 0 0 6px rgba(45, 90, 180, 0.08);
}

.page-title {
  margin: 20px 0 12px;
  font-family: "DM Serif Display", serif;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-subtitle {
  max-width: 640px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.topic-card {
  position: relative;
  min-height: 220px;
  padding: 22px 22px 58px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 12px 32px -18px var(--shadow);
  cursor: pointer;
  transition: scale 0.5s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  outline: none;
  opacity: 0;
}

.topic-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top right, rgba(45, 90, 180, 0.06), transparent 34%);
  pointer-events: none;
}

.topic-card:hover,
.topic-card:focus-visible {
  scale: 1.04;
  border-color: var(--primary);
  box-shadow: 0 16px 48px -12px var(--shadow);
}

.topic-meta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.topic-bullet {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6694ff);
  flex-shrink: 0;
}

.topic-title {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-size: 1.14rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.topic-description {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.72;
}

.study-now {
  position: absolute;
  right: 18px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(45, 90, 180, 0.1);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.study-now::after {
  content: "->";
  font-size: 0.9rem;
}

.topic-card:hover .study-now {
  background: var(--primary);
  color: var(--card);
}

@media (max-width: 1024px) {
  .page-shell {
    padding: 32px 0 48px;
  }

  .hero-panel {
    padding: 26px 26px 24px;
  }

  .page-title {
    font-size: clamp(2rem, 6vw, 3.2rem);
  }

  .topics-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .page-shell {
    width: min(100% - 24px, 1120px);
    padding: 24px 0 38px;
  }

  .hero-panel {
    padding: 22px 18px 20px;
    border-radius: 22px;
  }

  .page-title {
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    margin: 16px 0 10px;
  }

  .page-subtitle {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .topics-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 20px;
  }

  .topic-card {
    min-height: 200px;
    padding: 18px 18px 50px;
    border-radius: 20px;
  }

  .topic-title {
    font-size: 1.04rem;
  }

  .topic-description {
    font-size: 0.88rem;
  }

  .study-now {
    right: 14px;
    bottom: 12px;
    padding: 8px 10px;
    font-size: 0.76rem;
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0 32px;
  }

  .hero-panel {
    padding: 20px 16px 18px;
    border-radius: 20px;
  }

  .back-link {
    font-size: 0.86rem;
    margin-bottom: 14px;
  }

  .eyebrow {
    padding: 8px 12px;
    font-size: 0.68rem;
  }

  .page-title {
    font-size: clamp(1.6rem, 10vw, 2.2rem);
    margin: 14px 0 8px;
  }

  .page-subtitle {
    font-size: 0.88rem;
    line-height: 1.6;
  }

  .topics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
  }

  .topic-card {
    min-height: 180px;
    padding: 16px 16px 46px;
    border-radius: 18px;
  }

  .topic-meta {
    margin-bottom: 12px;
    font-size: 0.72rem;
  }

  .topic-title {
    font-size: 0.98rem;
    margin-bottom: 10px;
  }

  .topic-description {
    font-size: 0.84rem;
    line-height: 1.6;
  }

  .study-now {
    right: 12px;
    bottom: 10px;
    padding: 7px 10px;
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: min(100% - 16px, 1120px);
    padding: 18px 0 28px;
  }

  .hero-panel {
    padding: 18px 14px 16px;
    border-radius: 18px;
  }

  .back-link {
    font-size: 0.80rem;
    margin-bottom: 12px;
  }

  .eyebrow {
    padding: 7px 10px;
    font-size: 0.64rem;
  }

  .eyebrow-dot {
    width: 8px;
    height: 8px;
  }

  .page-title {
    font-size: clamp(1.4rem, 12vw, 1.9rem);
    margin: 12px 0 8px;
  }

  .page-subtitle {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .topics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .topic-card {
    min-height: 160px;
    padding: 14px 14px 44px;
    border-radius: 16px;
  }

  .topic-meta {
    margin-bottom: 10px;
    font-size: 0.68rem;
  }

  .topic-bullet {
    width: 9px;
    height: 9px;
  }

  .topic-title {
    font-size: 0.92rem;
    margin-bottom: 8px;
  }

  .topic-description {
    font-size: 0.80rem;
    line-height: 1.5;
  }

  .study-now {
    right: 10px;
    bottom: 8px;
    padding: 6px 8px;
    font-size: 0.68rem;
  }
}

html[data-theme="dark"] .hero-panel {
  background: linear-gradient(180deg, rgba(36, 42, 51, 0.98) 0%, rgba(24, 29, 38, 0.96) 100%);
  border-color: var(--border);
  box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .topic-card {
  background: linear-gradient(180deg, rgba(36, 42, 51, 0.95) 0%, rgba(24, 29, 38, 0.93) 100%);
  border-color: var(--border);
  box-shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .topic-card:hover {
  border-color: var(--primary);
}

html[data-theme="dark"] .topic-card::before {
  background: radial-gradient(circle at top right, rgba(74, 123, 216, 0.08), transparent 34%);
}

/* ================= Content Page Styles ================= */
.content-main {
  width: 100%;
}

.content-page-shell {
  width: min(1180px, calc(100% - 40px));
}

.content-hero-panel {
  margin-bottom: 24px;
}

.content-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
  gap: 20px;
  align-items: end;
  margin-top: 18px;
}

.content-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.content-focus-card,
.textbook-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 250, 255, 0.98) 100%);
  box-shadow: 0 16px 36px -22px var(--shadow);
}

.content-focus-card {
  padding: 22px 22px 20px;
}

.content-focus-card::before,
.textbook-card::before,
.content-note::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #6b97ff 55%, rgba(107, 151, 255, 0.2));
}

.focus-label,
.side-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.content-focus-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.8;
}

.content-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.content-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.textbook-card {
  padding: 20px 18px 18px;
}

.chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-link,
.chapter-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 16px;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.45;
}

.chapter-link {
  color: var(--text);
  background: rgba(45, 90, 180, 0.06);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chapter-link::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #5f8eff);
  flex-shrink: 0;
}

.chapter-link:hover,
.chapter-link:focus-visible {
  transform: translateX(4px);
  border-color: rgba(45, 90, 180, 0.18);
  background: rgba(45, 90, 180, 0.1);
}

.chapter-empty {
  color: var(--muted);
  background: rgba(45, 90, 180, 0.04);
}

.study-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.study-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(45, 90, 180, 0.08);
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 700;
}

.content-display {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content-note {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
  box-shadow: 0 20px 44px -28px var(--shadow);
}

.note-header {
  padding: 34px 34px 24px;
  border-bottom: 1px solid var(--border-light);
  background:
    linear-gradient(180deg, rgba(45, 90, 180, 0.06) 0%, rgba(45, 90, 180, 0) 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 255, 0.98));
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.note-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(45, 90, 180, 0.1);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.note-chip.is-outline {
  background: transparent;
  border: 1px solid rgba(45, 90, 180, 0.16);
  color: var(--text);
}

.note-chip.is-soft {
  background: rgba(31, 139, 95, 0.1);
  color: #176748;
}

.note-title {
  margin: 0 0 12px;
  font-family: "DM Serif Display", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text);
}

.note-summary {
  margin: 0;
  max-width: 66ch;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.note-body {
  display: grid;
  gap: 18px;
  padding: 28px 34px 34px;
}

.note-section {
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 22px 22px 20px;
  background: rgba(255, 255, 255, 0.72);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.section-index {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(45, 90, 180, 0.14), rgba(107, 151, 255, 0.08));
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.note-section h3 {
  margin: 0;
  font-family: "DM Serif Display", serif;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--text);
}

.note-list {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 12px;
}

.note-list li {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.85;
}

.note-list li::marker {
  color: var(--primary);
}

.note-section.is-formulas .note-list li {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

html[data-theme="dark"] .content-focus-card,
html[data-theme="dark"] .textbook-card,
html[data-theme="dark"] .content-note {
  background: linear-gradient(180deg, rgba(36, 42, 51, 0.97) 0%, rgba(24, 29, 38, 0.96) 100%);
  border-color: var(--border);
  box-shadow: 0 20px 44px -28px rgba(0, 0, 0, 0.72);
}

html[data-theme="dark"] .note-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(74, 123, 216, 0.12) 0%, rgba(74, 123, 216, 0) 100%),
    linear-gradient(180deg, rgba(36, 42, 51, 0.97) 0%, rgba(24, 29, 38, 0.96) 100%);
}

html[data-theme="dark"] .note-section {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .chapter-link {
  background: rgba(74, 123, 216, 0.12);
}

html[data-theme="dark"] .chapter-link:hover,
html[data-theme="dark"] .chapter-link:focus-visible {
  border-color: rgba(74, 123, 216, 0.3);
  background: rgba(74, 123, 216, 0.18);
}

html[data-theme="dark"] .chapter-empty {
  background: rgba(74, 123, 216, 0.08);
}

html[data-theme="dark"] .study-pill {
  background: rgba(74, 123, 216, 0.14);
}

html[data-theme="dark"] .note-chip.is-outline {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .note-chip.is-soft {
  background: rgba(31, 139, 95, 0.18);
  color: #8ce0b8;
}

@media (max-width: 1100px) {
  .content-hero-grid,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .content-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .content-page-shell {
    width: min(100% - 24px, 1180px);
  }

  .content-focus-card,
  .textbook-card,
  .note-header,
  .note-body,
  .note-section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .note-header {
    padding-top: 28px;
    padding-bottom: 20px;
  }

  .note-title {
    font-size: clamp(1.7rem, 7vw, 2.4rem);
  }

  .content-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .content-page-shell {
    width: min(100% - 18px, 1180px);
  }

  .content-hero-grid {
    gap: 14px;
  }

  .content-kicker,
  .focus-label,
  .side-label {
    font-size: 0.72rem;
  }

  .note-meta {
    gap: 8px;
  }

  .note-chip,
  .study-pill {
    font-size: 0.76rem;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-index {
    width: 38px;
    height: 38px;
  }

  .note-section h3 {
    font-size: 1.15rem;
  }

  .note-list li {
    font-size: 0.92rem;
    line-height: 1.75;
  }
}

/* ================= Mobile Hero Refinement ================= */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
    padding: 34px 20px 10px;
    min-height: 0;
    height: auto;
    border-radius: 28px;
    background:
      radial-gradient(circle at 16% 14%, rgba(45, 90, 180, 0.12), transparent 28%),
      radial-gradient(circle at 82% 16%, rgba(31, 139, 95, 0.1), transparent 24%),
      linear-gradient(180deg, var(--bg) 0%, rgba(255, 255, 255, 0.02) 100%);
  }

  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-text h1 {
    width: auto;
    max-width: 12ch;
    margin: 0 auto 12px;
    font-size: clamp(2.35rem, 8vw, 3.2rem);
    line-height: 1.02;
  }

  .hero-text p {
    margin: 0 auto;
    max-width: 33ch;
    font-size: 0.98rem;
    line-height: 1.78;
  }

  .hero-illustration {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    min-height: 290px;
    padding-top: 6px;
    margin-top: 0;
  }

  .hero-illustration .blob {
    position: absolute;
    inset: auto 2% 0;
    height: 85%;
    border-radius: 34px 34px 22px 22px;
    background: radial-gradient(circle at 50% 30%, rgba(45, 90, 180, 0.18), rgba(45, 90, 180, 0.05) 58%, transparent 76%);
    opacity: 1;
    z-index: 0;
  }

  .hero-illustration img {
    position: relative;
    z-index: 1;
    width: min(430px, 104%);
    max-width: 100%;
    height: auto;
    margin: 0 auto -6px;
    transform: none;
    mix-blend-mode: normal;
    filter: brightness(1.06) saturate(1.04);
  }
}

@media (max-width: 520px) {
  .hero {
    gap: 18px;
    padding: 28px 16px 8px;
    border-radius: 24px;
  }

  .hero-text h1 {
    max-width: 11ch;
    font-size: clamp(2rem, 10vw, 2.55rem);
  }

  .hero-text p {
    max-width: 31ch;
    font-size: 0.92rem;
    line-height: 1.72;
  }

  .hero-illustration {
    min-height: 232px;
  }

  .hero-illustration .blob {
    inset: auto 0 0;
    height: 82%;
    border-radius: 28px 28px 18px 18px;
  }

  .hero-illustration img {
    width: min(360px, 110%);
    margin-bottom: -4px;
  }
}

@media (max-width: 400px) {
  .hero {
    padding: 24px 14px 6px;
  }

  .hero-text h1 {
    font-size: clamp(1.8rem, 10.5vw, 2.2rem);
    max-width: 10ch;
  }

  .hero-text p {
    font-size: 0.88rem;
    max-width: 29ch;
  }

  .hero-illustration {
    min-height: 210px;
  }

  .hero-illustration img {
    width: min(320px, 112%);
  }
}
