/* ============================================================
   VasmuStudy — Common CSS for Class 12 Physics Chapters
   Shared across chapter1.html – chapter15.html
   ============================================================ */

/* ---------- Reset & Variables ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f8ff;
  --alt: #eaf1fe;
  --card: #fff;
  --ink: #0f172a;
  --muted: #64748b;
  --border: rgba(37, 99, 235, 0.12);
  --sh: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(37, 99, 235, 0.06);
  --serif: "Playfair Display", Georgia, serif;
  --body: "Lora", Georgia, serif;
  --ui: "Inter", system-ui, sans-serif;
  --accent: #2563eb;
  --accent-2: #0891b2;
  --accent-3: #7c3aed;
}

html.dark {
  --bg: #0a1224;
  --alt: #0f1a30;
  --card: #14203a;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.15);
  --sh: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Dark-mode tweaks for content blocks */
html.dark .viz { background: #f8fbff; }
html.dark .def { background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(8,145,178,.08)); }
html.dark .note { background: rgba(8,145,178,.12); }
html.dark .real { background: linear-gradient(135deg,#2a2308,#3a2e0a); border-left-color:#d97706; }
html.dark .real p, html.dark .real ul, html.dark .real li { color:#fcd34d; }
html.dark .real i { color:#fbbf24; }
html.dark .mistake { background: linear-gradient(135deg,#3a0d0d,#4a1414); border-left-color:#dc2626; }
html.dark .mistake p { color:#fca5a5; }
html.dark .mistake i { color:#f87171; }
html.dark .why { background: linear-gradient(135deg,#0c1a3a,#0d1f45); border-left-color:#3b82f6; }
html.dark .why p { color:#93c5fd; }
html.dark .analogy { background: linear-gradient(135deg,#1e0f3d,#26144f); border-left-color:#7c3aed; }
html.dark .analogy p { color:#c4b5fd; }
html.dark .exam { background: linear-gradient(135deg,#0c1a3a,#0d1f45); color:#93c5fd; }
html.dark .trap { background: linear-gradient(135deg,#3a1d08,#4a2610); border-left-color:#ea580c; }
html.dark .trap p { color:#fdba74; }
html.dark .trap i { color:#fb923c; }
html.dark .try { background: linear-gradient(135deg,#082a1d,#0a3527); border-left-color:#059669; }
html.dark .try p, html.dark .try li { color:#6ee7b7; }
html.dark .try i { color:#34d399; }
html.dark .step { background:#0f1a30; }
html.dark .step p { color:#cbd5e1; }
html.dark .sa { background:#14203a; border-color:rgba(59,130,246,.3); }
html.dark .sa button { background:rgba(59,130,246,.15); color:#93c5fd; }
html.dark .sa .b { border-top-color:rgba(59,130,246,.3); }
html.dark .o label { background:#0f1a30; color:#cbd5e1; }
html.dark .o label:hover { background:#1a2540; }
html.dark .q { border-bottom-color: var(--border); }
html.dark .ex { background:rgba(59,130,246,.12); color:#cbd5e1; }
html.dark table { color:#cbd5e1; }
html.dark td { color:#cbd5e1; }
html.dark td:first-child { color:#e2e8f0; }
html.dark .interactive { background:#0f1a30; border-color:rgba(59,130,246,.3); }
html.dark .interactive h4 { color:#93c5fd; }
html.dark .slider-row label { color:#cbd5e1; }
html.dark input[type=range] { background:#1a2540; }
html.dark select { background:#1a2540; color:#cbd5e1; border-color:rgba(59,130,246,.3); }
html.dark .formula-sheet { background:#14203a; }
html.dark .formula-item { background:#0f1a30; border-color:rgba(59,130,246,.2); }
html.dark .formula-item .ftitle { color:#93c5fd; }
html.dark .takeaway { background: linear-gradient(135deg,#0c1a3a,#0a2540); border-left-color:#3b82f6; }
html.dark .takeaway p { color:#93c5fd; }
html.dark .notation { background:#0f1a30; }
html.dark .notation td { color:#cbd5e1; }
html.dark .flow-node { fill:#14203a; stroke:#3b82f6; }
html.dark .flow-node-text { fill:#93c5fd; }
html.dark .flow-arrow { stroke:#3b82f6; }

/* ---------- Base body ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  font-size: 17px;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}

/* ---------- Progress bar ---------- */
.pt { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 999; }
#progress {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2563eb, #0891b2, #3b82f6);
  box-shadow: 0 0 12px rgba(37, 99, 235, .5);
  transition: width .1s linear;
}

/* ============================================================
   HEADER / NAVIGATION  (FIXED — brand logo, name, tag now styled)
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(245, 248, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
}
html.dark .nav { background: rgba(10, 18, 36, .94); }

.ni {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* Brand block: logo + two-line wordmark */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-words {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-name {
  font: 800 20px/1.1 var(--ui);
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-name .accent { color: var(--accent); }
.brand-tag {
  font: 500 10px var(--ui);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Nav links */
.nl {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}
.nl a {
  font: 500 13px var(--ui);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 999px;
  transition: .2s;
  position: relative;
}
.nl a:hover { color: var(--accent); background: rgba(37, 99, 235, .08); }
.nl a.read::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 9px;
  color: #059669;
  font-weight: 900;
}

.theme-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink);
  transition: .2s;
  margin-left: 8px;
}
.theme-btn:hover { border-color: var(--accent); }

/* ---------- Breadcrumb ---------- */
.bc {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 0;
  font: 13px var(--ui);
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bc a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  padding: 70px 24px 78px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(37,99,235,.18), transparent 62%),
    radial-gradient(800px 480px at 95% 10%, rgba(8,145,178,.16), transparent 60%),
    linear-gradient(180deg, var(--card), var(--alt));
  border-bottom: 1px solid var(--border);
}
.hero-particles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero > div { position: relative; z-index: 1; }
.eyebrow {
  display: inline-block;
  font: 700 12px var(--ui);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .22);
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 span {
  background: linear-gradient(120deg, #2563eb, #0891b2, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede { color: var(--muted); max-width: 700px; margin: 0 auto; }

/* ---------- Stats ---------- */
.stats {
  max-width: 1000px;
  margin: -32px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 3;
}
.si {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 28px;
  box-shadow: 0 18px 48px rgba(37, 99, 235, .14);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  text-align: center;
}
.sn {
  font: 800 2rem var(--serif);
  background: linear-gradient(135deg, #2563eb, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}
.sl { font: 600 12px var(--ui); color: var(--muted); }

/* ---------- Section layout ---------- */
.section { padding: 60px 24px; }
.w { max-width: 920px; margin: 0 auto; }
.alt { background: var(--alt); border-block: 1px solid var(--border); }
.sh { margin-bottom: 34px; }
.sh.c { text-align: center; }
.sh h2 { font: 700 clamp(1.6rem, 3.6vw, 2.2rem)/1.2 var(--serif); margin-bottom: 8px; }
.kicker {
  font: 700 12px var(--ui);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

/* ---------- Content card ---------- */
.cc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 32px;
  box-shadow: var(--sh);
  margin-bottom: 20px;
  transition: background .3s;
}
.cc h3 {
  font: 700 1.32rem var(--serif);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.badge {
  font: 800 11px var(--ui);
  color: #fff;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .3);
}
.cc p, .cc li { color: var(--ink); margin-bottom: 12px; line-height: 1.8; opacity: .9; }
.cc ul, .cc ol { padding-left: 24px; }
.cc strong { color: var(--ink); font-weight: 700; }

/* ---------- Info boxes ---------- */
.def, .note, .exam, .real, .mistake, .why, .analogy, .trap, .try, .takeaway {
  border-radius: 0 14px 14px 0;
  padding: 16px 22px;
  margin: 16px 0;
}
.def {
  background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(8,145,178,.04));
  border-left: 4px solid #2563eb;
}
.def i {
  font: 800 11px var(--ui);
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
  font-style: normal;
}
.def p { margin: 0 0 6px; color: var(--ink); }
.def p:last-child { margin-bottom: 0; }

.real { background: linear-gradient(135deg,#fef9c3,#fef3c7); border-left: 4px solid #d97706; }
.real i {
  font: 800 11px var(--ui);
  color: #b45309;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-style: normal;
}
.real i::before { content: "🌍"; font-size: 14px; }
.real p { margin: 0 0 8px; color: #78350f; font-size: 15.5px; }
.real p:last-child { margin-bottom: 0; }
.real ul { margin: 6px 0 0; padding-left: 22px; color: #78350f; font-size: 15.5px; }
.real ul li { margin-bottom: 6px; }

.mistake { background: linear-gradient(135deg,#fee2e2,#fecaca); border-left: 4px solid #dc2626; }
.mistake i {
  font: 800 11px var(--ui);
  color: #991b1b;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-style: normal;
}
.mistake i::before { content: "⚠️"; font-size: 14px; }
.mistake p { margin: 0 0 6px; color: #7f1d1d; font-size: 15.5px; }
.mistake p:last-child { margin-bottom: 0; }

.why { background: linear-gradient(135deg,#dbeafe,#e0f2fe); border-left: 4px solid #2563eb; }
.why i {
  font: 800 11px var(--ui);
  color: #1e40af;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-style: normal;
}
.why i::before { content: "💡"; font-size: 14px; }
.why p { margin: 0; color: #1e3a8a; font-size: 15.5px; }

.analogy { background: linear-gradient(135deg,#f3e8ff,#ede9fe); border-left: 4px solid #7c3aed; }
.analogy i {
  font: 800 11px var(--ui);
  color: #6d28d9;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-style: normal;
}
.analogy i::before { content: "🎯"; font-size: 14px; }
.analogy p { margin: 0; color: #4c1d95; font-size: 15.5px; }

.trap { background: linear-gradient(135deg,#ffedd5,#fed7aa); border-left: 4px solid #ea580c; }
.trap i {
  font: 800 11px var(--ui);
  color: #9a3412;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-style: normal;
}
.trap i::before { content: "🎯"; font-size: 14px; }
.trap p { margin: 0; color: #7c2d12; font-size: 15.5px; }

.try { background: linear-gradient(135deg,#d1fae5,#a7f3d0); border-left: 4px solid #059669; }
.try i {
  font: 800 11px var(--ui);
  color: #065f46;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-style: normal;
}
.try i::before { content: "🧪"; font-size: 14px; }
.try p, .try ul { margin: 0 0 6px; color: #064e3b; font-size: 15.5px; }
.try ul { padding-left: 22px; }
.try li { margin-bottom: 6px; }

.note {
  background: rgba(8, 145, 178, .07);
  border: 1px solid rgba(8, 145, 178, .22);
  border-radius: 14px;
}
.note i {
  font: 800 11px var(--ui);
  color: #0891b2;
  letter-spacing: .12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
  font-style: normal;
}
.note p { margin: 0; }

.exam { background: linear-gradient(135deg,#eff6ff,#f0f9ff); border-left: 4px solid #3b82f6; color: #334155; }

.takeaway {
  background: linear-gradient(135deg,#dbeafe,#e0f2fe);
  border-left: 4px solid #3b82f6;
  margin-top: 24px;
  padding: 14px 20px;
}
.takeaway i {
  font: 800 11px var(--ui);
  color: #1e40af;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-style: normal;
}
.takeaway i::before { content: "🔑"; font-size: 14px; }
.takeaway p { margin: 0; color: #1e3a8a; font-size: 15.5px; font-weight: 500; }

/* ---------- Tables ---------- */
.tw {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin: 18px 0;
  background: var(--card);
}
table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 15px; }
thead {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  font-family: var(--ui);
}
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
td {
  padding: 12px 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.7;
  opacity: .9;
}
td:first-child { font-weight: 700; color: var(--ink); }

/* ---------- Viz / SVG panels ---------- */
.viz {
  background: #f8fbff;
  border: 1.5px solid rgba(37, 99, 235, .18);
  border-radius: 16px;
  padding: 20px 14px;
  margin: 20px 0;
  text-align: center;
  overflow-x: auto;
  position: relative;
}
.viz > b {
  font: 800 11px var(--ui);
  color: var(--accent);
  letter-spacing: .14em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 10px;
}
.viz svg { width: 100%; min-width: 640px; height: auto; display: block; margin: 0 auto; }
.cap { font: italic 13px var(--ui); color: #64748b; margin-top: 12px; }

/* ---------- Animations (common ones) ---------- */
@keyframes dashFlow   { to { stroke-dashoffset: -40; } }
@keyframes pulseCharge{ 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes pulseRing  { 0% { transform: scale(.6); opacity: .85; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes glowPulse  { 0%,100% { filter: drop-shadow(0 0 3px currentColor); } 50% { filter: drop-shadow(0 0 14px currentColor); } }
@keyframes floaty     { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes particleFloat {
  0%   { transform: translate(0,0);      opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .9; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}

.flow-line     { stroke-dasharray: 6 10; animation: dashFlow 2s linear infinite; }
.pulse-charge  { transform-box: fill-box; transform-origin: center; animation: pulseCharge 2.5s ease-in-out infinite; }
.pulse-ring    { transform-box: fill-box; transform-origin: center; animation: pulseRing 3s ease-out infinite; }
.glow-el       { animation: glowPulse 2.5s ease-in-out infinite; }
.floaty        { animation: floaty 5s ease-in-out infinite; }

/* ---------- Hero particles ---------- */
.hero-particles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #3b82f6, #2563eb);
  box-shadow: 0 0 12px rgba(59, 130, 246, .9);
  animation: particleFloat 6s ease-in-out infinite;
}
.hero-particles span:nth-child(1) { top: 20%; left: 12%; --dx:  60px; --dy: -40px; animation-delay: 0s;   }
.hero-particles span:nth-child(2) { top: 60%; left:  8%; --dx:  40px; --dy: -80px; animation-delay: 1.2s; }
.hero-particles span:nth-child(3) { top: 30%; right:15%; --dx: -50px; --dy:  50px; animation-delay: .6s;  }
.hero-particles span:nth-child(4) { top: 75%; right:10%; --dx: -60px; --dy: -30px; animation-delay: 2s;   }
.hero-particles span:nth-child(5) { top: 15%; left: 50%; --dx:  30px; --dy:  60px; animation-delay: 1.6s; }
.hero-particles span:nth-child(6) { top: 80%; left: 40%; --dx: -30px; --dy: -50px; animation-delay: .4s;  }

/* ---------- Interactive simulator ---------- */
.interactive {
  background: var(--card);
  border: 1.5px solid rgba(37, 99, 235, .3);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--sh);
}
.interactive h4 {
  font: 800 15px var(--ui);
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.interactive h4::before { content: "🎮"; font-size: 18px; }
.slider-row { margin-bottom: 16px; }
.slider-row label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 600 14px var(--ui);
  color: var(--ink);
  margin-bottom: 8px;
}
.slider-row label span {
  font-family: var(--ui);
  font-weight: 800;
  color: var(--accent);
  background: rgba(37, 99, 235, .1);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
}
select {
  width: 100%;
  padding: 10px 14px;
  font: 600 14px var(--ui);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  margin-bottom: 16px;
  cursor: pointer;
}
input[type=range] {
  width: 100%;
  height: 6px;
  background: var(--alt);
  border-radius: 999px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .4);
}
input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .4);
}
.sim-output {
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-family: var(--ui);
  color: #1e40af;
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sim-output .lbl { font-size: 12px; font-weight: 600; }
.sim-output strong { font-size: 20px; font-weight: 900; color: var(--accent); display: block; margin-top: 4px; }
html.dark .sim-output { background: linear-gradient(135deg, #0c1a3a, #0a2540); color: #93c5fd; }
html.dark .sim-output strong { color: #60a5fa; }

/* ---------- Formula sheet ---------- */
.formula-sheet {
  background: var(--card);
  border: 1.5px solid rgba(37, 99, 235, .25);
  border-radius: 18px;
  padding: 28px;
  margin: 24px 0;
  box-shadow: var(--sh);
}
.formula-sheet h3 {
  font: 800 18px var(--serif);
  color: var(--accent);
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: .02em;
}
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.formula-item {
  background: var(--alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: .2s;
}
.formula-item:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(37, 99, 235, .15); }
.formula-item .ftitle {
  font: 800 11px var(--ui);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
}
.formula-item .fmath {
  font: 600 15px "Cambria Math", Georgia, serif;
  color: var(--ink);
  line-height: 1.5;
}

/* ---------- Notation key ---------- */
.notation {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin: 20px 0;
}
.notation h4 {
  font: 800 13px var(--ui);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 12px;
}
.notation table { min-width: 100%; font-size: 14px; }
.notation td { padding: 8px 12px; border-bottom: 1px dashed var(--border); }
.notation td:first-child {
  font-family: var(--ui);
  font-weight: 800;
  color: var(--accent);
  width: 80px;
}

/* ---------- Flow diagram ---------- */
.flow-wrap { overflow-x: auto; margin: 20px 0; padding: 10px 0; }
.flow-svg { min-width: 700px; width: 100%; height: auto; }
.flow-node { fill: #fff; stroke: #2563eb; stroke-width: 2; }
.flow-node-text {
  fill: #1e40af;
  font-weight: 700;
  font-family: Inter, Arial;
  font-size: 11px;
  text-anchor: middle;
}
.flow-arrow { stroke: #2563eb; stroke-width: 2; fill: none; }

/* ---------- Solved answers (collapsible) ---------- */
.sa {
  margin: 16px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid rgba(37, 99, 235, .22);
  background: var(--card);
}
.sa button {
  font: 700 14px var(--ui);
  width: 100%;
  text-align: left;
  background: rgba(37, 99, 235, .08);
  color: var(--accent);
  border: 0;
  padding: 14px 20px;
  cursor: pointer;
  transition: .2s;
}
.sa button:hover { background: rgba(37, 99, 235, .14); }
.sa .b { display: none; padding: 18px 22px; border-top: 1px dashed rgba(37, 99, 235, .25); }
.sa.open .b { display: block; }
.sa.open button span { display: inline-block; transform: rotate(90deg); }

.step {
  background: var(--alt);
  border-left: 4px solid #2563eb;
  border-radius: 0 12px 12px 0;
  padding: 12px 18px;
  margin: 10px 0;
}
.step h6 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font: 800 13px var(--ui);
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.step h6 em {
  font-style: normal;
  font-size: 11.5px;
  background: #2563eb;
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.step p { margin: 4px 0; font-size: 15px; color: var(--ink); opacity: .9; }
.fa {
  background: rgba(5, 150, 105, .1);
  border: 1.5px solid rgba(5, 150, 105, .3);
  border-radius: 12px;
  padding: 12px 18px;
  margin-top: 12px;
  font-weight: 600;
  color: #065f46;
}
html.dark .fa { background: rgba(16, 185, 129, .15); color: #6ee7b7; }
.fa::before { content: "✓ "; }
.mt {
  display: inline-block;
  font: 700 12px var(--ui);
  background: rgba(37, 99, 235, .1);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ---------- MCQ / quiz ---------- */
.qf {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--sh);
}
.q { padding: 20px 0; border-bottom: 1px dashed var(--border); }
.q:first-child { padding-top: 0; }
.qt { font-weight: 600; margin-bottom: 12px; color: var(--ink); }
.qt span {
  color: var(--accent);
  font-family: var(--ui);
  font-weight: 800;
  margin-right: 8px;
}
.ar {
  background: rgba(37, 99, 235, .06);
  border-left: 3px solid #2563eb;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 6px 0;
  font-size: 15.5px;
  color: var(--ink);
}
.ar.r { background: rgba(217, 119, 6, .06); border-color: #d97706; }
.ar b {
  font: 800 11px var(--ui);
  text-transform: uppercase;
  display: block;
}
html.dark .ar   { background: rgba(59, 130, 246, .12); }
html.dark .ar.r { background: rgba(217, 119, 6, .12); }

.o { display: grid; gap: 8px; margin-top: 10px; }
.o label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 15px;
  line-height: 1.5;
  transition: .2s;
  color: var(--ink);
}
.o label:hover { border-color: var(--accent); background: rgba(37, 99, 235, .05); }
.o input { accent-color: var(--accent); margin-top: 4px; }
.o .correct { border-color: #059669; background: rgba(5, 150, 105, .08); }
.o .wrong   { border-color: #dc2626; background: rgba(220, 38, 38, .07); }

.ex {
  display: none;
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(37, 99, 235, .07);
  border-left: 3px solid #2563eb;
  border-radius: 0 10px 10px 0;
  font-size: 14.5px;
  color: var(--ink);
}
.ex.show { display: block; }

.act {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.btn {
  font: 600 14px var(--ui);
  padding: 12px 26px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  transition: .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.p {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .3);
}
.btn.p:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(37, 99, 235, .45);
  color: #fff;
}
.score {
  margin-left: auto;
  font: 700 14.5px var(--ui);
  background: var(--alt);
  padding: 10px 20px;
  border-radius: 10px;
  color: var(--ink);
}
.score b { color: var(--accent); }
.rb {
  display: none;
  margin-top: 16px;
  padding: 18px;
  border-radius: 12px;
  font: 15px var(--ui);
  text-align: center;
  background: rgba(37, 99, 235, .1);
  color: #1e40af;
}
.rb.show { display: block; }
html.dark .rb { background: rgba(59, 130, 246, .15); color: #93c5fd; }

/* ============================================================
   FOOTER  (FIXED — .footer-inner, .f-col, .f-brand, .f-tag, etc.)
   ============================================================ */
footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 48px 24px 28px;
  margin-top: 50px;
  font: 14px var(--ui);
}
.footer-inner {
  max-width: none;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.f-col p { color: #94a3b8; font-size: 13px; line-height: 1.7; margin-bottom: 8px; }
.f-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.f-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: contain;
}
.f-brand {
  font: 800 18px/1.1 var(--ui);
  color: #f8fafc;
  letter-spacing: -0.01em;
}
.f-brand .accent { color: #60a5fa; }
.f-tag {
  font: 500 10px var(--ui);
  color: #94a3b8;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 3px;
}
footer h5 {
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 11.5px;
  margin-bottom: 12px;
  font-weight: 700;
}
footer a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 4px 0;
  transition: .2s;
  font-size: 13.5px;
}
footer a:hover { color: #60a5fa; }
.f-quote {
  color: #93c5fd !important;
  font-style: italic;
  font-size: 13px !important;
  margin-top: 10px;
}
.f-bottom {
  text-align: center;
  margin: 20px auto 0;
  color: #94a3b8;
  font-size: 12.5px;
  max-width: 1140px;
}

/* ---------- Back to top ---------- */
#backTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: .3s;
  box-shadow: 0 6px 20px rgba(37, 99, 235, .5);
  z-index: 800;
  font-weight: 900;
}
#backTop.show { opacity: 1; visibility: visible; }
#backTop:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(37, 99, 235, .6); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1.5fr 1fr 1fr; }
}
@media (max-width: 720px) {
  .cc { padding: 22px 18px; }
  .score { margin-left: 0; width: 100%; text-align: center; }
  .section { padding: 48px 16px; }
  #backTop { bottom: 16px; right: 16px; width: 44px; height: 44px; }
  .sim-output { grid-template-columns: 1fr; }
  .brand-tag { display: none; } /* compact header on mobile */
}
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .f-col:first-child { grid-column: 1 / -1; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .bc, .hero-particles, .pt, #backTop, .theme-btn,
  .act, .sa button, .viz svg { display: none !important; }
  .viz { background: #fff; border: 1px solid #ddd; padding: 8px; }
  body { font-size: 11pt; line-height: 1.5; background: #fff; color: #000; }
  .section { padding: 12px 0; page-break-inside: avoid; }
  .cc { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  .hero { padding: 20px 0; background: #fff; border-bottom: 2px solid #333; }
  .formula-sheet { border: 2px solid #2563eb; page-break-inside: avoid; }
  .formula-grid { grid-template-columns: repeat(2, 1fr); }
  .real, .mistake, .why, .analogy, .try, .trap, .takeaway,
  .def, .note, .exam { background: #f8f8f8 !important; page-break-inside: avoid; }
  footer { background: #fff; color: #333; border-top: 1px solid #ccc; }
  .q, .ex { page-break-inside: avoid; }
  .sa .b { display: block !important; border-top: none; padding: 0; }
  .sa button { display: none; }
}