:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #0f766e;
  --accent-soft: #f0fdfa;
  --warn-soft: #fffbeb;
  --warn: #b45309;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #263449;
  --primary: #3b82f6;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --accent: #14b8a6;
  --accent-soft: rgba(20, 184, 166, 0.15);
  --warn-soft: rgba(245, 158, 11, 0.15);
  --warn: #fbbf24;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header */
header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 12px;
}
.brand { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.brand span { color: var(--primary); }
.nav-links { display: flex; gap: 14px; align-items: center; overflow-x: auto; }
.nav-links a { font-size: 0.86rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; }
.theme-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 10px; padding: 6px 10px; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}

/* Hero */
.hero {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 100%);
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.35rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.hero p { color: var(--muted); margin-top: 10px; max-width: 680px; font-size: 0.96rem; }
.search-box {
  margin-top: 18px; max-width: 560px; display: flex; gap: 8px;
}
.search-box input {
  flex: 1; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.92rem;
}
.search-results {
  margin-top: 10px; max-width: 560px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 8px;
  display: none; box-shadow: var(--shadow);
}
.search-results a {
  display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 0.88rem;
}
.search-results a:hover { background: var(--surface-2); text-decoration: none; }

/* Sections & Cards */
main { padding: 26px 0 54px; display: flex; flex-direction: column; gap: 26px; }
.sec-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--primary); }
.card h3 { font-size: 1.04rem; font-weight: 700; margin-bottom: 6px; }
.card p { font-size: 0.86rem; color: var(--muted); }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; background: var(--primary-soft); color: var(--primary);
  margin-bottom: 8px;
}
.pill-teal { background: var(--accent-soft); color: var(--accent); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 5px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}

/* Q&A Accordion */
.qa-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 12px;
}
.qa-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.qa-q { font-weight: 700; font-size: 0.98rem; color: var(--text); }
.qa-a {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 0.9rem; color: var(--text);
}
.qa-a ul, .qa-a ol { padding-left: 20px; margin-top: 6px; }
.qa-a li { margin-bottom: 4px; }
.toggle-btn {
  margin-top: 10px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--primary); font-size: 0.8rem; font-weight: 700; cursor: pointer;
}

/* Clean AdSense Placeholder Slot (Replace with AdSense <ins> after approval) */
.ad-slot {
  border: 1px dashed var(--border); border-radius: 12px; padding: 14px;
  text-align: center; font-size: 0.75rem; color: var(--muted); background: var(--surface-2);
}

/* Breadcrumb & Tables */
.crumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.88rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: var(--surface-2); font-weight: 700; color: var(--muted); }

/* Footer */
footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 26px 0; font-size: 0.84rem; color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; }
@media (max-width: 640px) {
  .nav-links { gap: 10px; }
}

/* === Class 10 Deep Study Notes Enhancements === */
.hero-card h1 { font-size: clamp(1.38rem, 3.4vw, 1.95rem); line-height: 1.25; margin: 6px 0 8px; letter-spacing: -0.02em; }
.link-card { text-decoration: none; color: inherit; display: block; }
.link-card:hover { text-decoration: none; }
.callout {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--primary-soft); border-left: 4px solid var(--primary); font-size: 0.9rem;
}
.callout ul, .clean-list { padding-left: 20px; margin-top: 6px; }
.callout li, .clean-list li { margin-bottom: 5px; font-size: 0.9rem; }
.note-block { padding: 12px 0; border-bottom: 1px solid var(--border); }
.note-block:last-child { border-bottom: none; padding-bottom: 0; }
.note-block h3 { font-size: 1.02rem; margin-bottom: 6px; color: var(--primary); }
.note-block p { font-size: 0.92rem; color: var(--text); }
.note-block ul { padding-left: 20px; margin-top: 6px; font-size: 0.91rem; }
.note-block li { margin-bottom: 4px; }
.stanza-box {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 12px;
}
.stanza-box h3 { font-size: 0.98rem; margin-bottom: 4px; color: var(--text); }
.stanza-ref { font-size: 0.82rem; font-style: italic; color: var(--accent); margin-bottom: 6px; font-weight: 600; }
.stanza-box p:last-child { font-size: 0.91rem; color: var(--text); }
.chapter-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.nav-card {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  color: var(--text); text-decoration: none; box-shadow: var(--shadow);
}
.nav-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.nav-card-right { text-align: right; }
.year-header { margin-bottom: 12px; }
.chip { text-decoration: none; }
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
