/* ==========================================================================
   Physics Bytes — theme tokens + a few shared components
   Layout & typography are done with Tailwind utilities inside each HTML page.
   Light / dark colours switch automatically through the CSS variables below
   (toggle adds/removes the "dark" class on <html>).
   ========================================================================== */
:root {
  --page: #ffffff;
  --ink: #000000;      /* black text in light mode */
  --muted: #475569;
  --card: #f8fafc;
  --line: #e2e8f0;
  --soft: #f1f5f9;
  --accent: #2563eb;
}
html.dark {
  --page: #050816;
  --ink: #ffffff;      /* white text in dark mode */
  --muted: #a8b3d1;
  --card: #0a1124;
  --line: #1b2547;
  --soft: #0f1832;
  --accent: #60a5fa;
}

html { color-scheme: light; scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
html, body { margin: 0; padding: 0; }
html.dark { color-scheme: dark; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

/* Paper pages: fixed A4 sheets shared by model and sample papers. */
[data-paper] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
[data-paper], .paper {
  font-family: 'Calibri', 'Segoe UI', sans-serif !important;
  line-height: 1.55 !important;
  letter-spacing: normal !important;
}
[data-paper] :not(mjx-container):not(mjx-container *),
.paper :not(mjx-container):not(mjx-container *) {
  font-family: 'Calibri', 'Segoe UI', sans-serif !important;
  line-height: 1.55 !important;
  letter-spacing: normal !important;
}

.paper {
  width: 210mm !important;
  max-width: 210mm !important;
  min-width: 210mm !important;
  min-height: 297mm !important;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 15mm;
  overflow-wrap: anywhere;
  border: 1px solid #d5dbe5;
  border-radius: 4px;
  background: #fff !important;
  color: #111827 !important;
  box-shadow: 0 10px 32px rgba(15, 23, 42, .14);
  --page: #fff;
  --ink: #111827;
  --muted: #334155;
  --card: #fff;
  --line: #cbd5e1;
  --soft: #f1f5f9;
  --accent: #2563eb;
}
.paper-section { width: 100% !important; max-width: 80rem !important; }

.paper-head h2,
.paper-head h2 * {
  font-size: 28px !important;
  font-weight: 700 !important;
}
.paper .paper-head h2 { font-size: 28px !important; }

.paper .paper-head {
  text-align: center;
  padding-bottom: 1.1rem;
  border-bottom: 2px solid var(--line);
  margin-bottom: 1.5rem;
}

.paper .paper-head,
.paper .paper-head *,
.paper p,
.paper li,
.paper span,
.paper .opts,
.paper .ansbox,
.paper .gen-inst {
  font-size: 18px !important;
  font-weight: 400 !important;
}

.paper .section-label,
.paper .qline .section-label,
.paper .section-label b,
.paper .section-label strong,
.paper .q > p > b,
.paper .q > p > strong,
.paper .ansbox b,
.paper .ansbox strong {
  font-weight: 700 !important;
}

.paper .gen-inst {
  margin-bottom: 10px;
  line-height: 1.55;
  font-style: normal !important;
}

.paper .gen-inst b,
.paper .gen-inst strong,
.paper .section-label b,
.paper .section-label strong {
  font-weight: 700 !important;
}

.paper .paper-head .text-xs,
.paper .paper-head .text-sm,
.paper .paper-head .text-base {
  font-style: normal !important;
}

.paper .or-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0.5rem 0;
  text-align: center;
}

.paper .or-divider span {
  display: inline-block;
  font-weight: 700 !important;
  font-size: 16px !important;
  letter-spacing: 0.06em;
}

.paper-instructions {
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.06);
  padding: 1.25rem 1.5rem 1rem;
  margin: 1.5rem 0 0;
}

.paper-instructions-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.paper-instructions ol {
  margin: 0;
  padding-left: 1.6rem;
  list-style: decimal;
  font-size: 18px;
}

.paper-instructions li {
  margin: 0.5rem 0;
  line-height: 1.6;
  font-size: 18px;
}

body, body * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}
body img { -webkit-user-drag: none; }
body > *:first-child:not(#site-header):not([data-chapter-strip]) {
  display: none !important;
}
::selection { background: var(--accent); color: #fff; }
.hi { font-family: 'Noto Sans Devanagari', 'Inter', sans-serif; }
.logo-text { font-family: 'Arial Black', 'Arial Bold', Impact, sans-serif; font-weight: 900; letter-spacing: .075em; }
.site-logo { line-height: 1; }
.logo-atom-icon { width: 1.4rem; height: 1.4rem; flex: none; overflow: visible; }
.logo-atom-orbits { animation: logo-atom-spin 11s linear infinite; transform-box: fill-box; transform-origin: center; will-change: transform; }
.logo--site .logo-text { font-size: clamp(.98rem, 5.1vw, 2.35rem); }
.logo--drawer .logo-text { font-size: clamp(1rem, 5vw, 1.45rem); }
.logo--footer .logo-text { font-size: clamp(1.22rem, 6vw, 1.85rem); }
@media (min-width: 640px) {
  .logo--site .logo-atom-icon { width: 1.8rem; height: 1.8rem; }
  .logo--drawer .logo-atom-icon { width: 1.5rem; height: 1.5rem; }
  .logo--footer .logo-atom-icon { width: 1.6rem; height: 1.6rem; }
}
@keyframes logo-atom-spin { to { transform: rotate(360deg); } }

/* Compact matte pictograms: solid colours and offset geometry, not gloss. */
.icon-3d { display: inline-grid; place-items: center; width: 1.55rem; height: 1.55rem; flex: none; color: #3b82f6; background: transparent; }
.icon-3d svg { width: 1.4rem; height: 1.4rem; overflow: visible; }
.icon-3d-sm { width: 1.25rem; height: 1.25rem; }
.icon-3d-sm svg { width: 1.15rem; height: 1.15rem; }
.icon-3d--cyan { color: #0891b2; }
.icon-3d--violet { color: #8b5cf6; }
.icon-3d--orange { color: #f97316; }
.icon-3d--green { color: #16a34a; }
.icon-3d--rose { color: #f43f5e; }
.icon-3d--amber { color: #d97706; }
.icon-3d--teal { color: #0d9488; }
.icon-3d-inline { width: 1.3rem; height: 1.3rem; filter: none; }
.strip-dot { width: .35rem; height: .35rem; flex: none; border-radius: 50%; background: #3b82f6; }
.header-icon-3d svg { width: 1.3rem; height: 1.3rem; filter: none; }
main svg:not(.social-icon) { filter: none; }

/* ---------- Original-colour social icons ---------- */
.social-3d { box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -6px 10px rgba(0,0,0,.22), 0 9px 18px rgba(2,6,23,.3); transition: transform .2s, box-shadow .2s, border-color .2s; }
.social-3d:hover { transform: translateY(-2px) scale(1.06); }
.social-icon { width: 1.65rem; height: 1.65rem; display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.social-inline { display: inline-grid; place-items: center; width: 2.15rem; height: 2.15rem; flex: none; }
.social-inline .social-icon { width: 1.8rem; height: 1.8rem; }
.video-pending { flex: none; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.course-topics { margin-top: 1.25rem; border-top: 1px solid var(--line); }
.course-topic { padding: 1.05rem .15rem 1.15rem; border-bottom: 1px solid var(--line); }
.course-topic-title { display: flex; align-items: baseline; gap: .75rem; font-size: 1rem; font-weight: 600; line-height: 1.6; }
.course-topic-number { flex: none; color: var(--accent); font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.course-topic-note { margin: .35rem 0 0 2.15rem; color: var(--muted); font-size: .85rem; line-height: 1.7; }
.course-count { color: var(--muted); font-size: .9rem; }

/* ---------- Header / drawer ---------- */
html.dark .i-moon, html:not(.dark) .i-sun { display: none; }
.drawer { transform: translateX(-100%); visibility: hidden; transition: transform .35s cubic-bezier(.22,.8,.2,1), visibility .35s; }
.drawer.open { transform: none; visibility: visible; }
.overlay { opacity: 0; pointer-events: none; transition: opacity .3s; }
.overlay.open { opacity: 1; pointer-events: auto; }
body.no-scroll { overflow: hidden; }
.grp[data-open="true"] > div:first-child .chev { transform: rotate(180deg); }

/* ---------- Shared components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; transition: border-color .2s, translate .2s; }
.fotd-equation { white-space: nowrap; font-size: clamp(1rem, 4.4vw, 3.75rem); }
a.card:hover, .card-hover:hover { border-color: var(--accent); translate: 0 -3px; }
.tag { font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.typing-cursor { display: inline-block; width: .08em; height: 1em; margin-left: .08em; background: currentColor; vertical-align: -0.08em; animation: typing-blink 1s steps(1) infinite; }
@keyframes typing-blink { 50% { opacity: 0; } }
.unit { display: inline-block; margin-top: .85rem; font-size: .75rem; padding: .2rem .6rem; border-radius: .45rem; background: var(--soft); color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 9999px; padding: .7rem 1.35rem; font-size: .875rem; font-weight: 600; border: 1px solid var(--line); transition: opacity .2s, border-color .2s; }
.btn-solid { background: var(--ink); color: var(--page); border-color: var(--ink); }
.btn-solid:hover { opacity: .85; }
.btn-line:hover { border-color: var(--ink); }

.chip { border: 1px solid var(--line); border-radius: 9999px; padding: .45rem 1rem; font-size: .85rem; font-weight: 500; color: var(--muted); background: transparent; cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); color: var(--page); border-color: var(--ink); }

/* equations */
.eq { background: var(--soft); border: 1px solid var(--line); border-radius: .75rem; padding: .65rem .9rem; font-family: 'Cambria Math', 'STIX Two Math', Georgia, 'Times New Roman', serif; font-size: 1.05rem; overflow-x: auto; white-space: nowrap; color: var(--ink); }
.fx { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.fx span { color: var(--muted); }
.fx b { font-family: 'Cambria Math', 'STIX Two Math', Georgia, 'Times New Roman', serif; font-weight: 500; font-size: 1rem; text-align: right; }

/* derivations */
.dt > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; }
.dt > summary::-webkit-details-marker { display: none; }
.dt > summary::after { content: '+'; font-size: 1.5rem; line-height: 1; color: var(--muted); transition: transform .25s; }
.dt[open] > summary::after { transform: rotate(45deg); color: var(--accent); }
.dt[open] { border-color: var(--accent); }
.dt-body { padding: 0 1.25rem 1.5rem; }
.steps { counter-reset: s; display: grid; gap: 1.1rem; }
.steps > li { counter-increment: s; position: relative; padding-left: 2.5rem; color: var(--muted); line-height: 1.7; font-size: .95rem; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: .05rem; width: 1.65rem; height: 1.65rem; border-radius: 9999px; background: var(--soft); border: 1px solid var(--line); color: var(--ink); font-size: .75rem; font-weight: 600; display: grid; place-items: center; }
.steps .eq { margin-top: .55rem; }

/* list rows (videos, PYQs, books) */
.list-box { border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: var(--card); }
.lrow { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.lrow:last-child { border-bottom: 0; }
a.lrow:hover { background: var(--soft); }
.lrow .n { width: 1.75rem; flex: none; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.lrow .t { flex: 1; min-width: 0; font-weight: 500; }
.lrow .s { color: var(--muted); font-size: .8rem; }
.lrow .g { flex: none; color: var(--accent); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.lrow .g:hover { text-decoration: underline; }
.lrow-top { align-items: flex-start; }
.btn.btn-sm { padding: .5rem 1rem; }

/* Definition pages read like long-form articles, without cards or indents. */
.qa-chapter { padding: 0; margin: 0 0 3.5rem; background: none; border: 0; border-radius: 0; min-width: 0; }
.qa-ch-head { margin-bottom: 1.75rem; padding: 0 0 .9rem; border-bottom: 1px solid var(--line); }
.qa-ch-label { margin-bottom: .45rem; font-size: .8rem; color: var(--muted); }
.qa-ch-head h2 { font-size: clamp(1.4rem, 4vw, 1.85rem); font-weight: 700; line-height: 1.4; letter-spacing: -.025em; }
.qa-list > article { margin: 0 0 1.8rem; padding: 0; border: 0; }
.qa-q { display: block; font-size: 1.04rem; font-weight: 650; line-height: 1.7; color: var(--ink); }
.qa-q .qn { margin-right: .35rem; color: var(--ink); font: inherit; }
.qa-a { margin: .65rem 0 0; color: var(--ink); font-family: Georgia, 'Times New Roman', serif; font-size: 1.09rem; line-height: 1.9; overflow-wrap: anywhere; }
.qa-a .answer-label { font-weight: 700; margin-right: .35rem; }
.qa-a b, .qa-a strong { color: var(--ink); }
.qa-a ul { list-style: disc; padding-left: 1.3rem; margin: .5rem 0; }
.qa-a ol { list-style: decimal; padding-left: 1.35rem; margin: .5rem 0; }
.qa-a li { margin: .25rem 0; }
.qa-a .eq { margin: .75rem 0; padding: .5rem 0; border: 0; border-radius: 0; background: none; font-size: 1rem; white-space: normal; }
.definition-page main > section:first-child > div { max-width: 48rem; margin-inline: auto; }
.definition-page main > section:first-child h1 { font-size: clamp(1.8rem, 5.5vw, 2.8rem); line-height: 1.2; }
.definition-page [data-class-tabs] { row-gap: .65rem; }
.definition-page [data-class-tabs] .chip { padding: .25rem .25rem; margin-right: .7rem; font-size: .82rem; border: 0; border-radius: 0; background: none; color: var(--muted); }
.definition-page [data-class-tabs] .is-on { color: var(--ink); text-decoration: underline; text-underline-offset: .35rem; }
.definition-page input[type="search"] { border-radius: .25rem; background: var(--page); }
.definition-page [data-about] { max-width: 48rem; }
main .relative > svg:not(.social-icon) { color: #3b82f6; width: 1rem; height: 1rem; }
a[data-unavailable] { opacity: .55; cursor: not-allowed; }
.page-context { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.page-context h2 { font-size: 1.1rem; font-weight: 650; }
.page-context p { margin-top: .6rem; color: var(--muted); font-size: .92rem; line-height: 1.85; }
[hidden] { display: none !important; }
/* syllabus + accordion readability on mobile */
.dt > summary { padding: 1rem 1.1rem; }
.dt-body { padding: 0 1.1rem 1.25rem; }
@media (max-width: 640px) {
  .qa-q { font-size: 1rem; }
  .qa-a { font-size: 1.06rem; line-height: 1.85; }
  .dt > summary { padding: .9rem .85rem; gap: .6rem; }
  .dt-body { padding: 0 .85rem 1rem; }
  .lrow { padding: .8rem .75rem; gap: .6rem; }
  .lrow .t { font-size: .92rem; line-height: 1.6; }
}

/* exam-paper look (sample paper + solutions) */
.paper { font-family: 'Calibri', 'Segoe UI', sans-serif; background: var(--page); }
.paper .paper-head { text-align: center; padding-bottom: 1.25rem; border-bottom: 3px double var(--line); margin-bottom: 1.75rem; }
.paper .q { margin-top: 1.9rem; }
.paper .qline { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.paper .section-label { display: block; flex: 1 1 auto; font-weight: 700; }
.paper .section-label { text-align: center; }
.paper .qm { flex: none; font-weight: 700 !important; white-space: nowrap; }
.paper .opts { margin: .6rem 0 0 1.3rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .9rem; }
.paper .ansbox { margin-top: .9rem; background: var(--soft); border-left: 3px solid var(--accent); border-radius: .5rem; padding: 1rem 1.15rem; color: var(--muted); line-height: 1.8; }
.paper .ansbox b, .paper .ansbox strong { color: var(--ink); }
.paper .ansbox .eq { margin-top: .55rem; }
.paper .ansbox ul { list-style: disc; padding-left: 1.3rem; margin: .4rem 0; }
.paper .ansbox ol { list-style: decimal; padding-left: 1.4rem; margin: .4rem 0; }
@media (max-width: 640px) {
  .paper-section {
    width: 100% !important;
    max-width: 100% !important;
  }
  .paper { min-height: 297mm !important; padding: 15mm !important; }
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { width: 210mm; min-height: 297mm; margin: 0 !important; background: #fff !important; }
  body * { visibility: hidden !important; }
  [data-paper], [data-paper] * { visibility: visible !important; }
  [data-paper] {
    position: absolute !important;
    inset: 0 auto auto 0 !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 210mm !important;
    overflow: visible !important;
    margin: 0 !important;
  }
  .paper {
    width: 210mm !important;
    max-width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 15mm !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #000 !important;
    background: #fff !important;
  }
  .paper-actions, .paper-actions *, .paper + * { display: none !important; }
  .paper .ansbox { color: #111 !important; background: #f3f4f6 !important; }
  .paper .q, .paper-instructions, .paper .ansbox { break-inside: avoid; }
}

/* legal / long-form text */
.prose-pb h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; margin: 2.25rem 0 .6rem; }
.prose-pb p, .prose-pb li { color: var(--muted); line-height: 1.8; }
.prose-pb p { margin: .6rem 0; }
.prose-pb ul { list-style: disc; padding-left: 1.25rem; margin: .6rem 0; }
.prose-pb a { color: var(--accent); text-decoration: underline; }
.prose-pb strong { color: var(--ink); }

/* ---------- Home banner slider (16:9) ---------- */
.banner { container-type: inline-size; }
.slides { position: absolute; inset: 0; display: flex; transition: transform .8s cubic-bezier(.22,.8,.2,1); will-change: transform; }
.slide { flex: 0 0 100%; min-width: 0; position: relative; overflow: hidden; color: #fff; display: block; }
.dot { height: .5rem; width: .5rem; border-radius: 9999px; background: rgba(255,255,255,.4); border: 0; padding: 0; cursor: pointer; transition: width .35s, background-color .35s; }
.dot.active { width: 2.25rem; background: #fff; }
.b-eyebrow { font-size: clamp(.5rem, 1.7cqw, 1.05rem); font-weight: 600; letter-spacing: .26em; text-transform: uppercase; opacity: .8; }
.b-title { font-size: clamp(1.1rem, 6cqw, 3.9rem); font-weight: 900; line-height: 1.04; letter-spacing: -.02em; }
.b-sub { font-size: clamp(.62rem, 2cqw, 1.25rem); opacity: .82; line-height: 1.5; }
.b-btn { display: inline-flex; align-items: center; gap: .4em; font-size: clamp(.6rem, 1.8cqw, 1.05rem); font-weight: 700; padding: .7em 1.5em; border-radius: 9999px; background: #fff; color: #0a1020; }
@container (max-width: 520px) { .b-sub, .b-btn { display: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin-slow { animation: spin 28s linear infinite; transform-box: fill-box; transform-origin: center; }

/* ---------- Continuous quote marquee ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee var(--dur, 80s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee.rev .marquee-track { animation-direction: reverse; }
.marquee-set { display: flex; flex: none; gap: 1rem; padding-right: 1rem; }
.mq-ticker .marquee-set { gap: 0; padding-right: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Scroll reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease, translate .2s, border-color .2s; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .logo-atom-orbits { animation: none; }
}
