/* girgit.org — one stylesheet.
   The design language is the girgit app's (platform/packages/ui/src/tokens.css + apps/student/src/DESIGN.md):
   two colours, void and bone; every grey is a mix of the two; surfaces are tonal, never outlined; a hairline only
   divides rows. Corners by kind: chrome 0 · buttons 6 · fields, options, small media 8 · cards, pictures 12 ·
   hero 16 · pills 999. 8px grid. Colour lives in content (diagrams, photos), never in chrome.
   Font: Schibsted Grotesk (SIL OFL). Söhne is used only inside the Rive pieces. */

@font-face { font-family: "Schibsted Grotesk"; src: url("/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/assets/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/assets/fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --void: #0b0b0c;
  --bone: #e9e4d8;
  --lift: #fff;
  color-scheme: dark;

  /* the mix scale: bone stepped into void. The app's reading values for 3–5 (76 / 64 / 52%). Never dim text below 4. */
  --mix-1: color-mix(in srgb, var(--bone) 88%, var(--void));
  --mix-2: color-mix(in srgb, var(--bone) 76%, var(--void));
  --mix-3: color-mix(in srgb, var(--bone) 76%, var(--void));
  --mix-4: color-mix(in srgb, var(--bone) 64%, var(--void));
  --mix-5: color-mix(in srgb, var(--bone) 52%, var(--void));
  --mix-6: color-mix(in srgb, var(--bone) 28%, var(--void));
  --mix-7: color-mix(in srgb, var(--bone) 18%, var(--void));
  --mix-8: color-mix(in srgb, var(--bone) 8%, var(--void));
  --hairline: color-mix(in srgb, var(--bone) 12%, transparent);
  --hairline-strong: color-mix(in srgb, var(--bone) 16%, transparent);
  /* surfaces are neutral: the void lifted with white (dark) or black (light), never with the bone */
  --raised: color-mix(in srgb, var(--lift) 7%, var(--void));
  --raised-2: color-mix(in srgb, var(--lift) 13%, var(--void));
  --error: #e24553;

  /* content colour: for diagrams, charts and the "right / wrong" of an answer. Never for chrome. */
  --c-membrane: #e0a650; --c-nucleus: #9d8cf0; --c-mito: #ef7d63; --c-chloro: #6cc070; --c-er: #5aa8e6;
  --c-golgi: #e6c65a; --c-lyso: #e47fb0; --c-vacuole: #5fc9c4; --c-wall: #a3b86c; --c-ribo: #d9d4c8;
  --c-cyto: #8a95a8; --c-dna: #c49cf5;
  --right: #3fbf8f; --wrong: #e24553;

  --font: "Schibsted Grotesk", "Söhne", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --text-xs: 0.75rem;   --leading-xs: 1rem;
  --text-sm: 0.875rem;  --leading-sm: 1.5rem;
  --text-md: 1rem;      --leading-md: 1.5rem;
  --text-lg: 1.25rem;   --leading-lg: 2rem;
  --text-xl: 1.5rem;    --leading-xl: 2rem;
  --text-2xl: 2rem;     --leading-2xl: 2.5rem;
  --text-3xl: 3rem;     --leading-3xl: 3.5rem;

  /* reading size steps up once on a wide screen */
  --fs-read: 1.0625rem; --lh-read: 1.75rem;

  --margin: 16px;
  --measure: 680px;
  --wide: 960px;
  --head-h: 56px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: 160ms; --t-base: 280ms;
}
@media (min-width: 769px) { :root { --margin: 32px; --fs-read: 1.125rem; --lh-read: 1.875rem; --head-h: 64px; } }

/* Light: the same two colours, swapped. Everything derived follows. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --void: #f3f0e9; --bone: #0b0b0c; --lift: #000; color-scheme: light;
    --c-membrane: #b07418; --c-nucleus: #6a55d6; --c-mito: #cf5236; --c-chloro: #3b8f3f; --c-er: #2a78bb;
    --c-golgi: #a8861a; --c-lyso: #c04a86; --c-vacuole: #23928d; --c-wall: #6f8636; --c-ribo: #57534a; --c-cyto: #5b6577; --c-dna: #8a5ad0;
    --right: #1f8f63; --wrong: #cc2f40; }
}
:root[data-theme="light"] { --void: #f3f0e9; --bone: #0b0b0c; --lift: #000; color-scheme: light;
  --c-membrane: #b07418; --c-nucleus: #6a55d6; --c-mito: #cf5236; --c-chloro: #3b8f3f; --c-er: #2a78bb;
  --c-golgi: #a8861a; --c-lyso: #c04a86; --c-vacuole: #23928d; --c-wall: #6f8636; --c-ribo: #57534a; --c-cyto: #5b6577; --c-dna: #8a5ad0;
  --right: #1f8f63; --wrong: #cc2f40; }
:root[data-theme="dark"] { --void: #0b0b0c; --bone: #e9e4d8; --lift: #fff; color-scheme: dark; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; scroll-padding-top: calc(var(--head-h) + 16px); }
body { margin: 0; background: var(--void); color: var(--bone); font-family: var(--font); font-size: var(--text-md); line-height: var(--leading-md); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--hairline-strong); text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
::selection { background: var(--bone); color: var(--void); }
.sr-only { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }
/* Schibsted Grotesk sets punctuation wide with tabular figures ("2 , 400"), so tnum is only for bare digit columns */
.tnum, .num { font-variant-numeric: normal; }
.dim { color: var(--mix-4); }
.label { font-size: var(--text-xs); line-height: var(--leading-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mix-4); font-weight: 500; }
@media (hover: hover) { :focus-visible { outline: 1px solid var(--bone); outline-offset: 2px; } }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 8px 14px; background: var(--bone); color: var(--void); border-radius: 6px; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- head (chrome: no corners) ---------- */
.head { position: sticky; top: 0; z-index: 20; height: var(--head-h); display: flex; align-items: center; gap: 8px; padding: 0 var(--margin); background: color-mix(in srgb, var(--void) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: var(--text-lg); letter-spacing: -0.02em; margin-right: auto; }
.brand svg { width: 28px; height: 28px; }
.brand .org { color: var(--mix-4); font-weight: 400; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--mix-3); font-size: var(--text-sm); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--bone); background: var(--raised); }
@media (max-width: 768px) { .nav { gap: 2px; } .nav a { padding: 6px 10px; } .brand { font-size: var(--text-md); gap: 8px; } .brand svg { width: 24px; height: 24px; } }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 999px; cursor: pointer; color: var(--bone); }
.icon-btn:hover { background: var(--raised); }
.icon-btn svg { width: 20px; height: 20px; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; pointer-events: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--bone); }

/* ---------- buttons, chips, fields (the app's controls) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--bone); color: var(--void); font-size: var(--text-md); font-weight: 500; cursor: pointer; text-decoration: none; transition: background var(--t-fast); -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--mix-3); }
.btn.quiet { background: var(--raised-2); color: var(--bone); }
.btn.quiet:hover { background: var(--mix-7); }
.btn.small { height: 36px; padding: 0 14px; font-size: var(--text-sm); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--raised-2); color: var(--bone); font-size: var(--text-sm); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.on { background: var(--bone); color: var(--void); }
@media (min-width: 769px) { .chip { height: 36px; padding: 0 16px; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--raised-2); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--mix-3); font-size: var(--text-sm); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bone); color: var(--void); }
.field { height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--raised-2); color: var(--bone); font: inherit; font-size: var(--text-md); outline: none; }
.field::placeholder { color: var(--mix-5); }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--mix-7); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--mix-7); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 999px; background: var(--bone); border: 0; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 999px; background: var(--bone); border: 0; }

/* ---------- page frame ---------- */
.page { padding: 0 var(--margin); }
.wrap { max-width: var(--wide); margin: 0 auto; }
.foot { margin-top: 96px; padding: 32px var(--margin) 48px; border-top: 1px solid var(--hairline); color: var(--mix-4); font-size: var(--text-sm); }
.foot .wrap { display: grid; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { text-decoration: none; color: var(--mix-3); }
.foot a:hover { color: var(--bone); }

/* ---------- home and subject pages ---------- */
.hero-home { padding: 56px 0 40px; display: grid; gap: 16px; }
.hero-home h1 { font-size: var(--text-2xl); line-height: var(--leading-2xl); font-weight: 500; letter-spacing: -0.025em; max-width: 18ch; }
.hero-home p { font-size: var(--text-lg); line-height: var(--leading-lg); color: var(--mix-3); max-width: 38ch; }
@media (min-width: 769px) { .hero-home { padding: 96px 0 64px; } .hero-home h1 { font-size: var(--text-3xl); line-height: var(--leading-3xl); } }
.shelf { margin-top: 40px; }
.shelf-title { display: flex; align-items: baseline; gap: 8px; font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.shelf-title a { text-decoration: none; }
.shelf-title .count { font-size: var(--text-sm); color: var(--mix-4); font-weight: 400; letter-spacing: 0; }
@media (min-width: 769px) { .shelf-title { font-size: var(--text-xl); line-height: var(--leading-xl); } }
.subjects { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .subjects { grid-template-columns: 1fr 1fr; } }
.mode-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; min-height: 88px; padding: 16px; border-radius: 12px; background: var(--raised); text-decoration: none; color: var(--bone); transition: background var(--t-fast); }
a.mode-card:hover { background: var(--raised-2); }
.mode-mark { width: 56px; height: 56px; display: grid; place-items: center; }
.mode-mark svg { width: 32px; height: 32px; }
.mode-name { font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: 500; letter-spacing: -0.015em; }
.mode-line { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-3); }
.chev { width: 16px; height: 16px; color: var(--mix-5); }
.list-group { font-size: var(--text-xs); line-height: var(--leading-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mix-4); font-weight: 500; margin: 24px 0 8px; }
.chapters { list-style: none; padding: 0; margin: 0; }
.chapters li { border-bottom: 1px solid var(--hairline); }
.chapters a, .chapters .soon { display: grid; grid-template-columns: 3ch 1fr auto; gap: 16px; align-items: baseline; padding: 14px 0; text-decoration: none; }
.chapters .n { color: var(--mix-4); }
.chapters .t { font-size: var(--text-md); }
.chapters .soon .t { color: var(--mix-4); }
.chapters .tag { font-size: var(--text-xs); color: var(--mix-4); }
.chapters a .tag { color: var(--void); background: var(--bone); padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.chapters a:hover .t { text-decoration: underline; text-decoration-color: var(--hairline-strong); }
.poster { display: grid; gap: 12px; padding: 16px 16px 14px; border-radius: 16px; background: var(--raised); text-decoration: none; }
.poster img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; }
.poster .mode-name { font-size: var(--text-xl); line-height: var(--leading-xl); letter-spacing: -0.025em; }

/* ---------- chapter layout ---------- */
.chapter { display: grid; grid-template-columns: minmax(0, 1fr); }
.rail { display: none; }
@media (min-width: 1180px) {
  .chapter { grid-template-columns: 220px minmax(0, var(--wide)); gap: 48px; justify-content: center; }
  .rail { display: block; position: sticky; top: calc(var(--head-h) + 24px); align-self: start; max-height: calc(100vh - var(--head-h) - 48px); overflow: auto; padding-bottom: 24px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
}
.toc { list-style: none; padding: 0; margin: 8px 0 0; font-size: var(--text-sm); line-height: 1.35; }
.toc li { margin: 0; }
.toc a { display: grid; grid-template-columns: 3.4em 1fr; padding: 6px 8px; margin-left: -8px; border-radius: 6px; text-decoration: none; color: var(--mix-4); }
.toc a .n { color: var(--mix-5); }
.toc a:hover { color: var(--bone); }
.toc a.on { color: var(--bone); background: var(--raised); }
.toc .sub a { font-size: var(--text-xs); padding: 4px 8px; grid-template-columns: 4.2em 1fr; }

.article { min-width: 0; }
.ch-head { padding: 40px 0 8px; max-width: var(--measure); }
.ch-kicker { font-size: var(--text-sm); color: var(--mix-4); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ch-kicker a { text-decoration: none; }
.ch-kicker a:hover { color: var(--bone); }
.ch-title { font-size: var(--text-2xl); line-height: var(--leading-2xl); font-weight: 500; letter-spacing: -0.025em; }
@media (min-width: 769px) { .ch-head { padding-top: 64px; } .ch-title { font-size: var(--text-3xl); line-height: var(--leading-3xl); letter-spacing: -0.03em; } }
.ch-dek { margin-top: 16px; font-size: var(--text-lg); line-height: var(--leading-lg); color: var(--mix-3); }
.ch-meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.ch-meta span { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--raised); font-size: var(--text-xs); color: var(--mix-3); }
.ch-cover { margin: 32px 0 8px; }
.ch-cover img, .ch-cover video { width: 100%; height: auto; border-radius: 16px; background: var(--raised); }

/* the reading column: text at the measure, figures and widgets may go wide */
.prose { font-size: var(--fs-read); line-height: var(--lh-read); color: var(--mix-1); }
.prose > * { max-width: var(--measure); }
.prose > .wide, .prose > .widget, .prose > .fig.wide, .prose > .gallery, .prose > .timeline { max-width: var(--wide); }
.prose p { margin: 0 0 20px; }
.prose b, .prose strong { font-weight: 500; color: var(--bone); }
.prose .term { font-weight: 500; color: var(--bone); }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 1.25em; }
.prose li { margin: 0 0 8px; }
.prose li::marker { color: var(--mix-5); }
.prose a { text-decoration-color: var(--mix-6); }
.prose a:hover { text-decoration-color: var(--bone); }
.prose sub, .prose sup { line-height: 0; }
.prose h2 { margin: 72px 0 16px; font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: 500; letter-spacing: -0.02em; color: var(--bone); display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: baseline; }
.prose h3 { margin: 48px 0 12px; font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: 500; letter-spacing: -0.015em; color: var(--bone); display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: baseline; }
.prose h4 { margin: 32px 0 8px; font-size: var(--text-md); line-height: var(--leading-md); font-weight: 500; color: var(--bone); }
@media (min-width: 769px) { .prose h2 { font-size: var(--text-2xl); line-height: var(--leading-2xl); margin-top: 96px; } }
.prose h2 .n, .prose h3 .n { color: var(--mix-5); font-weight: 400; }
.prose h2 .n:empty, .prose h3 .n:empty { display: none; }
.prose h2:has(.n:empty), .prose h3:has(.n:empty) { display: block; }
.prose h2 a.hash, .prose h3 a.hash { grid-column: 2; justify-self: start; }
.hash { text-decoration: none; color: inherit; }
.ncert-ref { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 16px; font-size: var(--text-xs); color: var(--mix-4); letter-spacing: 0.02em; }

/* ---------- figures and media ---------- */
.fig { margin: 32px 0; }
.fig img, .fig video { width: 100%; height: auto; border-radius: 12px; background: var(--raised); }
.fig.contain img { object-fit: contain; }
.fig figcaption { margin-top: 10px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-3); }
.fig figcaption .credit, .credit { display: block; margin-top: 2px; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--mix-4); }
.credit a { color: inherit; }
.fig.side { display: grid; gap: 16px; }
@media (min-width: 769px) { .fig.side { grid-template-columns: 240px 1fr; align-items: start; } .fig.side figcaption { margin-top: 0; } }
.gallery { display: grid; gap: 12px; margin: 32px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 769px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } .gallery.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .gallery.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gallery figure { margin: 0; }
.gallery { align-items: start; }
.gallery img, .gallery video { width: 100%; height: auto; border-radius: 12px; background: var(--raised); }
.gallery img { object-position: center bottom; } /* keep the credit strip in view */
.gallery img.portrait { object-position: center top; }

.fig img { height: auto; }
.fig.side img { max-height: 340px; width: auto; max-width: 100%; }
.gallery figcaption { margin-top: 8px; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--mix-3); }
.gallery .credit { margin-top: 2px; }
.zoomable { cursor: zoom-in; }
.vid { position: relative; }
.vid video { width: 100%; border-radius: 12px; background: var(--raised); }
.vid .vid-toggle { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border: 0; border-radius: 999px; display: grid; place-items: center; background: rgba(11, 11, 12, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }
.vid .vid-toggle svg { width: 16px; height: 16px; }
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .86); cursor: zoom-out; animation: fade var(--t-base) var(--ease); }
.lightbox img { max-height: 88vh; width: auto; border-radius: 12px; }
.lightbox p { position: absolute; left: 24px; right: 24px; bottom: 16px; color: #ddd; font-size: var(--text-sm); text-align: center; }
@keyframes fade { from { opacity: 0; } }

/* ---------- cards inside the reading column ---------- */
.card { padding: 16px; border-radius: 12px; background: var(--raised); }
.callout { margin: 32px 0; padding: 16px 18px; border-left: 3px solid var(--bone); border-radius: 0 12px 12px 0; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); color: var(--mix-2); }
.callout .label { display: block; margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }
/* beyond the syllabus: worth knowing, not examined. Tonal, quieter than the text. */
.extra { margin: 32px 0; padding: 16px 18px; border-radius: 12px; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); color: var(--mix-2); }
.extra > .label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.extra > .label::before { content: ""; width: 14px; height: 1px; background: var(--mix-5); }
.extra p { margin: 0 0 12px; } .extra p:last-child { margin-bottom: 0; }
.extra .fig { margin: 12px 0 0; }
/* exam box: the facts NEET asks, in one place per section */
.examfacts { margin: 32px 0; padding: 16px 18px; border-radius: 12px; background: var(--bone); color: var(--void); font-size: var(--text-md); line-height: var(--leading-md); }
.examfacts > .label { color: color-mix(in srgb, var(--void) 60%, var(--bone)); display: block; margin-bottom: 8px; }
.examfacts ul { margin: 0; padding-left: 1.1em; }
.examfacts li { margin: 0 0 6px; } .examfacts li:last-child { margin: 0; }
.examfacts li::marker { color: color-mix(in srgb, var(--void) 45%, var(--bone)); }
.examfacts b, .prose .examfacts b { font-weight: 500; color: var(--void); }
.keybox { margin: 32px 0; padding: 20px; border-radius: 12px; background: var(--raised); }
.keybox h4 { margin: 0 0 10px; }
.keybox ul { margin: 0; }
.keybox li:last-child { margin-bottom: 0; }
.table-wrap { margin: 32px 0; overflow-x: auto; border-radius: 12px; background: var(--raised); }
table.t { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.45; }
table.t th, table.t td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
table.t th { font-weight: 500; color: var(--bone); }
table.t thead th { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mix-4); }
table.t tr:last-child td { border-bottom: 0; }

/* ---------- widgets (interactives) ---------- */
.widget { margin: 40px 0; padding: 16px; border-radius: 16px; background: var(--raised); color: var(--bone); font-size: var(--text-md); line-height: var(--leading-md); }
@media (min-width: 769px) { .widget { padding: 24px; } }
.w-head { display: grid; gap: 4px; margin-bottom: 16px; }
.w-head h3, .w-title { margin: 0 !important; font-size: var(--text-lg) !important; line-height: var(--leading-lg) !important; font-weight: 500; letter-spacing: -0.015em; display: block !important; }
.w-head p, .w-prompt { margin: 0 !important; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-3); }
.w-stage { position: relative; border-radius: 12px; background: var(--void); overflow: hidden; }
.w-stage svg, .w-stage canvas { width: 100%; height: auto; }
.w-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.w-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 12px; font-size: var(--text-sm); color: var(--mix-3); }
.w-row output { color: var(--bone); min-width: 6ch; text-align: right; }
.w-out { margin-top: 12px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-2); min-height: 1.5em; }
.w-out b { color: var(--bone); font-weight: 500; }
.w-foot { margin-top: 12px; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--mix-4); }
.w-split { display: grid; gap: 16px; }
@media (min-width: 769px) { .w-split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.stat { display: grid; gap: 2px; }
.stat .v { font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: 500; letter-spacing: -0.01em; }
.stat .k { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--mix-4); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.stats .stat { padding: 12px; border-radius: 8px; background: var(--raised-2); }

/* guess-then-see: commit to an answer, then the world answers */
.guess-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mix-4); font-weight: 500; }
.guess-tag::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--bone); }

/* options: a quiz answer (the app's .opt) */
.opts { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.opt { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-radius: 8px; background: var(--raised-2); color: var(--bone); text-align: left; font-size: var(--text-md); line-height: 1.4; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background var(--t-fast); }
.opt .k { color: var(--mix-4); font-weight: 500; }
.opt:hover:not([disabled]) { background: var(--mix-7); }
.opt[aria-pressed="true"] { background: var(--mix-6); }
.opt.is-right { background: var(--bone); color: var(--void); }
.opt.is-right .k { color: var(--void); }
.opt.is-wrong { background: color-mix(in srgb, var(--wrong) 22%, var(--raised-2)); }
.opt[disabled] { cursor: default; }
.why { margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: var(--raised-2); font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-2); }
.why b { color: var(--bone); font-weight: 500; }
.why[hidden] { display: none; }

/* quick check (pure HTML, practice.js) */
.quiz { margin: 32px 0; padding: 16px; border-radius: 12px; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); }
.quiz .q { margin: 6px 0 0; color: var(--bone); font-weight: 500; }
.quiz .opts .opt { background: var(--raised-2); }

/* NEET past question */
.neet { margin: 32px 0; padding: 16px; border-radius: 12px; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); }
.neet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.neet-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--bone); color: var(--void); font-size: var(--text-xs); font-weight: 500; letter-spacing: .02em; }
.neet .q { margin: 10px 0 0; color: var(--bone); }
.neet-list, .neet-match { margin-top: 10px; display: grid; gap: 4px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-2); }
.neet-list b, .neet-match b { color: var(--bone); font-weight: 500; margin-right: 4px; }
.neet-match { grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .neet-match { grid-template-columns: 1fr 1.6fr; } }

/* tap-to-sort */
.sort-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.sort-bins { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 640px) { .sort-bins { grid-template-columns: repeat(var(--bins, 3), minmax(0, 1fr)); } }
.sort-bin { display: grid; align-content: start; gap: 8px; min-height: 120px; padding: 12px; border: 0; border-radius: 12px; background: var(--void); text-align: left; cursor: pointer; color: var(--bone); }
.sort-bin .label { margin-bottom: 4px; }
.sort-bin.ready { outline: 1px dashed var(--mix-5); outline-offset: -1px; }
.sort-bin .chip { justify-self: start; cursor: default; }
.chip.is-right { background: color-mix(in srgb, var(--right) 30%, var(--raised-2)); }
.chip.is-wrong { background: color-mix(in srgb, var(--wrong) 30%, var(--raised-2)); }

/* timeline */
.timeline { margin: 40px 0; display: grid; gap: 0; list-style: none; padding: 0; }
.timeline li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--hairline); margin: 0; }
.timeline li:last-child { border-bottom: 0; }
.timeline .yr { font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: 500; letter-spacing: -0.01em; }
.timeline .who { font-weight: 500; color: var(--bone); }
.timeline .what { font-size: var(--text-md); line-height: var(--leading-md); color: var(--mix-2); }
.timeline .tl-body { display: grid; gap: 10px; }
.timeline .tl-pic { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; }
.timeline img { width: 72px; height: 88px; object-fit: cover; border-radius: 8px; background: var(--raised); }
@media (min-width: 769px) { .timeline li { grid-template-columns: 96px minmax(0, 1fr); } .timeline .tl-pic { grid-template-columns: 96px 1fr; } .timeline img { width: 96px; height: 116px; } }

/* reveal */
details.reveal { margin-top: 10px; }
details.reveal summary { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--raised-2); cursor: pointer; font-size: var(--text-sm); list-style: none; }
details.reveal summary::-webkit-details-marker { display: none; }
details.reveal[open] summary { background: var(--bone); color: var(--void); }
details.reveal > div { margin-top: 10px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-2); }

/* the end of a chapter */
.summary-list { counter-reset: s; list-style: none; padding: 0 !important; }
.summary-list li { counter-increment: s; position: relative; padding-left: 2.2em; margin-bottom: 12px; }  /* block, not grid: grid split <sub>/<sup> into cells */
.summary-list li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 0; color: var(--mix-5); font-size: .9em; }
.cite { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-3); }
.cite pre { margin: 8px 0 0; padding: 12px; border-radius: 8px; background: var(--raised-2); white-space: pre-wrap; word-break: break-word; font: inherit; font-size: var(--text-xs); line-height: 1.6; color: var(--mix-2); }
.credits { font-size: var(--text-xs); line-height: 1.6; color: var(--mix-4); }
.credits li { margin-bottom: 4px; }
.next-card { margin-top: 48px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ---------- widgets A (size ladder, sv ratio, microscope): custom elements are inline by default ---------- */
g-size-ladder, g-sv-ratio, g-microscope { display: block; }
:is(g-size-ladder, g-sv-ratio, g-microscope) .w-row output { font-feature-settings: normal; }
.widget .stat .v, .widget .prop-num { font-feature-settings: normal; font-variant-numeric: lining-nums proportional-nums; }

/* common questions: open rows, a hairline between */
.faqs { margin: 16px 0 24px; }
details.faq { border-bottom: 1px solid var(--hairline); }
details.faq summary { padding: 14px 0; cursor: pointer; list-style: none; font-size: var(--text-md); line-height: var(--leading-md); color: var(--bone); font-weight: 500; display: grid; grid-template-columns: 1fr 20px; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--mix-5); text-align: right; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 0 0 16px; font-size: var(--text-md); line-height: var(--leading-md); color: var(--mix-2); }

/* textbook check: where NCERT is wrong, out of date or inconsistent. Three rows: what it says, what we know, what to write. */
.tbcheck { margin: 28px 0; padding: 16px 18px; border-radius: 12px; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); }
.tbcheck > .label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--bone); }
.tbcheck > .label::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c-membrane); }
.tbcheck dl { display: grid; gap: 10px; margin: 0; }
.tbcheck dt { font-size: var(--text-xs); line-height: var(--leading-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mix-4); font-weight: 500; }
.tbcheck dd { margin: 2px 0 0; color: var(--mix-2); }
.tbcheck dd.now { color: var(--bone); }
.tbcheck .src { display: block; margin-top: 4px; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--mix-4); }
.tbcheck .src a { color: inherit; }
@media (min-width: 769px) { .tbcheck dl > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; } .tbcheck dd { margin: 0; } }

/* ---------- keeping the page short: decks and folds ---------- */
/* a deck: one question at a time, swipe or arrows, dots for progress */
.deck { margin: 32px 0; padding: 12px 12px 14px; border-radius: 16px; background: var(--raised); }
.deck-head { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 4px; padding: 0 4px 8px; }
.deck-count { font-size: var(--text-xs); color: var(--mix-4); margin-right: 6px; }
.deck .icon-btn { width: 36px; height: 36px; background: var(--raised-2); }
.deck .icon-btn[disabled] { opacity: .35; cursor: default; }
.deck-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; align-items: start; border-radius: 12px; outline-offset: -1px; }
.deck-track::-webkit-scrollbar { display: none; }
.deck-slide { scroll-snap-align: start; min-width: 0; padding: 0 2px; }
.deck-slide > .quiz, .deck-slide > .neet { margin: 0; background: var(--void); }
.deck-slide .opt { background: var(--raised-2); }
.deck-go { margin-top: 12px; }
.deck-dots { display: flex; justify-content: center; gap: 6px; padding-top: 12px; }
.deck-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--mix-7); transition: width var(--t-fast) var(--ease), background var(--t-fast); }
.deck-dots i.done { background: var(--mix-4); }
.deck-dots i.now { width: 18px; background: var(--bone); }

/* folds: a one-line summary that opens. Textbook checks and asides stay on the page, folded. */
details.tbcheck, details.extra { padding: 0; }
details.tbcheck > summary, details.extra > summary { display: grid; grid-template-columns: 1fr 20px; gap: 2px 12px; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
details.tbcheck > summary::-webkit-details-marker, details.extra > summary::-webkit-details-marker { display: none; }
details.tbcheck > summary::after, details.extra > summary::after { content: "+"; grid-row: 1 / span 2; grid-column: 2; color: var(--mix-5); text-align: right; font-size: var(--text-lg); }
details.tbcheck[open] > summary::after, details.extra[open] > summary::after { content: "–"; }
details.tbcheck > summary .label { display: flex; align-items: center; gap: 8px; color: var(--mix-4); }
details.tbcheck > summary .label::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c-membrane); }
.fold-title { grid-column: 1; color: var(--bone); font-weight: 500; font-size: var(--text-md); line-height: var(--leading-md); }
details.tbcheck > dl, details.extra > .fold-body { padding: 0 18px 16px; }
details.extra > summary .label { display: flex; align-items: center; gap: 8px; }
details.extra > summary .label::before { content: ""; width: 14px; height: 1px; background: var(--mix-5); }
details.credits-wrap > summary { cursor: pointer; font-size: var(--text-sm); color: var(--mix-3); padding: 8px 0; }
details.credits-wrap[open] > summary { margin-bottom: 8px; }

/* phones: galleries stack, each picture whole and full width */
@media (max-width: 640px) { .gallery, .gallery.g2, .gallery.g4 { grid-template-columns: 1fr !important; } }


/* pictures: big between the text, as large as fits the screen. Single figures may use the wide column. */
.prose > .fig:not(.side):not(.ch-cover) { max-width: var(--wide); }
.prose > .fig:not(.side):not(.ch-cover) img { width: auto; max-width: 100%; max-height: 86vh; margin: 0 auto; }
.prose > .fig:not(.side):not(.ch-cover) figcaption { max-width: var(--measure); }
/* a fold for long blocks such as the summary */
details.fold { margin: 16px 0 32px; border-radius: 12px; background: var(--raised); }
details.fold > summary { display: grid; grid-template-columns: 1fr 20px; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; color: var(--bone); font-weight: 500; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; color: var(--mix-5); text-align: right; font-size: var(--text-lg); }
details.fold[open] > summary::after { content: "–"; }
details.fold > summary .dim { font-weight: 400; }
details.fold > .fold-body { padding: 0 18px 8px; }


/* labels ON the picture: a dot on the part, its name beside it. Better retention than a caption underneath. */
.lab-wrap { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; }
.lab-wrap > img { display: block; }
.lab-wrap .lab { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; z-index: 1; pointer-events: none; }
/* a label is a hairline from the exact point to a small card with the name (no dot: user, 2026-11-20).
   Positions: r/l = card to the right/left of the point, t/b = above/below. */
.lab::after { content: ""; position: absolute; background: #f3f0e9; box-shadow: 0 0 0 .5px rgba(11,11,12,.45); }
.lab.r::after { left: 0; top: -.5px; width: 28px; height: 1px; transform-origin: left center; }
.lab.l::after { right: 0; top: -.5px; width: 28px; height: 1px; transform-origin: right center; }
.lab.t::after { bottom: 0; left: -.5px; width: 1px; height: 24px; transform-origin: center bottom; }
.lab.b::after { top: 0; left: -.5px; width: 1px; height: 24px; transform-origin: center top; }
.lab > span { position: absolute; white-space: nowrap; padding: 6px 11px; border-radius: 4px; background: rgba(11,11,12,.76);
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(243,240,233,.16), 0 6px 18px rgba(0,0,0,.28);
  color: #f3f0e9; font-size: 14px; line-height: 18px; font-weight: 500; letter-spacing: .01em; }
.lab.r > span { left: 28px; top: 0; transform: translateY(-50%); }
.lab.l > span { right: 28px; top: 0; transform: translateY(-50%); }
.lab.t > span { bottom: 24px; left: 0; transform: translateX(-50%); }
.lab.b > span { top: 24px; left: 0; transform: translateX(-50%); }
@media (max-width: 640px) {
  .lab > span { font-size: 12.5px; line-height: 16px; padding: 5px 9px; }
  .lab.r::after, .lab.l::after { width: 20px; } .lab.t::after, .lab.b::after { height: 18px; }
  .lab.r > span { left: 20px; } .lab.l > span { right: 20px; } .lab.t > span { bottom: 18px; } .lab.b > span { top: 18px; }
}
/* reveal (site.js adds .labs-anim, then .in when the picture scrolls into view): the line draws out, then the name */
.labs-anim .lab-wrap .lab::after { transform: scaleX(0); transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.labs-anim .lab-wrap .lab.t::after, .labs-anim .lab-wrap .lab.b::after { transform: scaleY(0); }
.labs-anim .lab-wrap .lab > span { opacity: 0; transition: opacity .4s ease .4s; }
.labs-anim .lab-wrap.in .lab::after { transform: none; }
.labs-anim .lab-wrap.in .lab > span { opacity: 1; }
.lab-wrap .lab:nth-of-type(2) { --d: 110ms; }
.lab-wrap .lab:nth-of-type(3) { --d: 220ms; }
.lab-wrap .lab:nth-of-type(4) { --d: 330ms; }
.lab-wrap .lab:nth-of-type(5) { --d: 440ms; }
.lab-wrap .lab:nth-of-type(6) { --d: 550ms; }
.lab-wrap .lab:nth-of-type(7) { --d: 660ms; }
.lab-wrap .lab:nth-of-type(8) { --d: 770ms; }
.lab-wrap .lab:nth-of-type(9) { --d: 880ms; }
.lab-wrap .lab:nth-of-type(10) { --d: 990ms; }
.labs-anim .lab-wrap .lab::after { transition-delay: var(--d, 0ms); }
.labs-anim .lab-wrap .lab > span { transition-delay: calc(var(--d, 0ms) + 300ms); }

/* ---------- concept pages ---------- */
.concept .ch-head { padding-top: 32px; }
@media (min-width: 769px) { .concept .ch-head { padding-top: 48px; } }
/* the top of a lesson: a back link, the progress dots with "8 of 12 · 5 min", the title; then room before the big idea */
.ch-back { margin-bottom: 20px; }
.ch-back a { display: inline-flex; align-items: center; gap: 6px; color: var(--mix-4); }
.ch-back svg { width: 16px; height: 16px; flex: none; }
.c-prog { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 20px; }
.c-step { display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 0; font-size: var(--text-xs); color: var(--mix-4); }
.cdots { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 0; }
.cdots a { display: block; width: 16px; height: 5px; border-radius: 999px; background: var(--mix-7); }
.cdots a.seen { background: var(--mix-4); }
.cdots a[aria-current="page"] { background: var(--bone); width: 28px; }
.cdots .rv a { width: 8px; }
.concept .ch-head { padding-bottom: 0; }
.concept .prose > .bigidea:first-child, .concept .prose > :first-child { margin-top: 40px; }
@media (min-width: 769px) { .concept .prose > :first-child { margin-top: 56px; } }
.bigidea { margin: 8px 0 36px; font-size: var(--text-xl); line-height: var(--leading-xl); letter-spacing: -0.015em; color: var(--bone); font-weight: 500; }
.bigidea .label { display: block; margin-bottom: 10px; letter-spacing: 0.08em; }
@media (min-width: 769px) { .bigidea { font-size: 1.75rem; line-height: 2.375rem; } }
.simple { margin: 0 0 48px; padding: 20px 20px; border-radius: 12px; background: var(--raised); font-size: var(--text-lg); line-height: var(--leading-lg); color: var(--mix-1); }
.simple .label { display: block; margin-bottom: 10px; }
.simple p { margin: 0 0 10px; } .simple p:last-child { margin: 0; }
.analogy { margin: 28px 0; padding: 14px 18px; border-left: 3px solid var(--c-golgi); border-radius: 0 12px 12px 0; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); color: var(--mix-2); }
.analogy .label { display: block; margin-bottom: 4px; }
.analogy p { margin: 0; }
.prose .t { font-weight: 500; color: var(--bone); }  /* a textbook term, explained right after it */
dl.words { margin: 32px 0; padding: 4px 18px; border-radius: 12px; background: var(--raised); }
dl.words > .label { display: block; padding: 12px 0 4px; }
dl.words > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-top: 1px solid var(--hairline); }
dl.words > .label + div { border-top: 0; }
dl.words dt { font-weight: 500; color: var(--bone); font-size: var(--text-md); }
dl.words dd { margin: 0; color: var(--mix-3); font-size: var(--text-sm); line-height: var(--leading-sm); }
@media (min-width: 640px) { dl.words > div { grid-template-columns: 11em 1fr; gap: 16px; } }
.cnav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 56px 0 24px; max-width: var(--measure); }
.cnav a { display: flex; align-items: center; gap: 10px; min-height: 72px; padding: 12px 14px; border-radius: 12px; background: var(--raised); text-decoration: none; color: var(--bone); font-size: var(--text-sm); line-height: 1.35; font-weight: 500; }
.cnav a:hover { background: var(--raised-2); }
.cnav a .label { display: block; margin-bottom: 2px; }
.cnav a svg { width: 18px; height: 18px; flex: none; color: var(--mix-4); }
.cnav-next { justify-content: space-between; text-align: right; }
.cnav-next { background: var(--bone) !important; color: var(--void) !important; }
.cnav-next .label, .cnav-next svg { color: color-mix(in srgb, var(--void) 60%, var(--bone)) !important; }
.ccards { list-style: none; padding: 0 !important; margin: 8px 0 0; display: grid; gap: 8px; max-width: var(--measure); }
.ccards li { margin: 0; }
.ccard { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 11px 14px; min-height: 52px; border-radius: 12px; background: var(--raised); text-decoration: none; color: var(--bone); }
.ccard:hover { background: var(--raised-2); }
.ccard-n { width: 28px; height: 28px; font-size: var(--text-xs) !important; border-radius: 999px; display: grid; place-items: center; background: var(--raised-2); font-weight: 500; font-size: var(--text-sm); }
.ccard.seen .ccard-n { background: var(--bone); color: var(--void); }
.ccard-body { display: grid; gap: 2px; }
.ccard-t { font-size: var(--text-md); line-height: 1.35; font-weight: 500; }
.ccard-l { font-size: var(--text-sm); line-height: 1.4; color: var(--mix-3); }
.ccard-m { font-size: var(--text-xs); color: var(--mix-4); }
.ccard.rv { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline); }
.concept { max-width: var(--wide); margin: 0 auto; }
.concept .ch-head, .concept .prose > * { margin-left: 0; }

/* the exam choice on the landing page */
.tracks { display: grid; gap: 8px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 640px) { .tracks { grid-template-columns: 1fr 1fr; } }
.track { display: grid; gap: 10px; padding: 20px; border-radius: 16px; background: var(--raised); text-decoration: none; color: var(--bone); min-height: 180px; align-content: space-between; }
.track:hover { background: var(--raised-2); }
.track-name { font-size: var(--text-2xl); line-height: var(--leading-2xl); font-weight: 500; letter-spacing: -0.025em; }
.track-line { font-size: var(--text-sm); color: var(--mix-3); }
.track-subj { display: flex; flex-wrap: wrap; gap: 6px; }
.track-subj span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--raised-2); font-size: var(--text-xs); color: var(--mix-2); }
.track-subj svg { width: 14px; height: 14px; }

/* worked example (physics, chemistry, maths) */
.box.example { margin: 28px 0; padding: 16px 18px; border-radius: 12px; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); }
.box.example > :first-child { margin-top: 0; }
.box.example > :last-child { margin-bottom: 0; }
.box.example h4, .box.example .label { margin: 0 0 8px; }
.box.example ol, .box.example ul { margin-bottom: 8px; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

.neet-fig { display: block; margin: 12px 0 4px; max-width: min(100%, 420px); border-radius: 8px; background: #fff; padding: 8px; }
.neet-ofig { display: block; max-width: 220px; margin-bottom: 4px; border-radius: 6px; background: #fff; padding: 4px; }

/* KaTeX draws some accents (the ec arrow) as tiny SVGs: keep the site's img/svg reset off them */
.katex svg { display: block; max-width: none; }

/* maths inside uppercase labels and table heads keeps its own case (π must not become Π) */
table.t thead th .katex, .label .katex { text-transform: none; letter-spacing: 0; }

/* KaTeX's hidden MathML copy is absolutely positioned; without a positioned ancestor it escapes the quiz deck's
   horizontal scroller and widens the page on phones. Keep it inside its formula. */
.katex { position: relative; }
.deck-track { position: relative; }

/* Mobile first: anything hidden stays hidden (.btn sets display), and on touch screens small buttons and sliders
   still give a 44 px target. */
[hidden] { display: none !important; }
@media (pointer: coarse) {
  .btn.small { min-height: 44px; }
  .widget input[type="range"] { min-height: 44px; }
}

/* FAQ questions: a grid made every inline formula its own grid item (no wrapping, page wider than a phone).
   Plain flow with the +/– pinned to the right instead. */
details.faq summary { display: block; position: relative; padding-right: 32px; }
details.faq summary::after { position: absolute; right: 0; top: 14px; }

/* Maths in the site's own type: letters and numbers in formulas use the page font (Schibsted Grotesk) instead of
   KaTeX's Computer-Modern serif, so a formula sits in a sentence without a change of voice. Big operators, radicals,
   stretchy brackets and arrows keep KaTeX's own fonts (their sizes and metrics depend on them). */
body .katex { font-size: 1.06em; }
body .katex .mathnormal, body .katex .mathit { font-family: var(--font); font-style: italic; }
body .katex .mord, body .katex .mrel, body .katex .mbin, body .katex .mpunct, body .katex .minner, body .katex .mopen, body .katex .mclose,
body .katex .mathrm, body .katex .textrm, body .katex .text, body .katex .mathsf, body .katex .mathbf, body .katex .boldsymbol { font-family: var(--font); }
body .katex .mathbf, body .katex .boldsymbol { font-weight: 500; }
body .katex .boldsymbol { font-style: italic; }
body .katex .mop:not(.op-symbol) { font-family: var(--font); }
body .katex .delimsizing, body .katex .op-symbol, body .katex .delimsizing *, body .katex .sqrt > .root, body .katex .amsrm, body .katex .mathcal, body .katex .mathscr, body .katex .mathfrak { font-family: revert-layer; }
body .katex .msupsub { padding-left: 0.06em; }

/* Type scale, calmer (user, 2026-11-15: too many big sizes on one screen). Phone: title 32 · lead 19 · heading 20 ·
   body 17. Desktop: title 48 · lead 22 · heading 26 · body 18. The big idea is a lead line, not a second title;
   "In simple words" reads at body size (its box sets it apart). */
.bigidea { font-size: 1.1875rem; line-height: 1.75rem; letter-spacing: -0.01em; }
.simple { font-size: var(--fs-read); line-height: var(--lh-read); padding: 14px 16px; }
.prose h2 { font-size: 1.25rem; line-height: 1.75rem; margin-top: 56px; }
@media (min-width: 769px) {
  .bigidea { font-size: 1.375rem; line-height: 2rem; }
  .prose h2 { font-size: 1.625rem; line-height: 2.125rem; margin-top: 80px; }
}
/* custom-element widgets are inline by default; a widget is always a block card */
.widget { display: block; }
/* an inline formula wider than its line (set by site.js) scrolls inside itself */
.katex.katex-wide { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: bottom; padding-bottom: 2px; }
/* sorters on phones: bins stack, so keep each one short until it holds something */
@media (max-width: 768px) { .sort-bin { min-height: 72px; } }
/* KaTeX builds ≠, ∉, ↛… by overlaying a private-use glyph from its own font: those overlays keep KaTeX_Main */
body .katex .rlap, body .katex .llap, body .katex .clap, body .katex .rlap *, body .katex .llap *, body .katex .clap * { font-family: KaTeX_Main; font-style: normal; }
/* desktop: interactive diagrams scale to the column; cap their height so a square SVG doesn't fill the screen */
@media (min-width: 769px) { .widget svg[viewBox]:not(button svg):not(.gx-spark) { max-height: 520px; } }

/* a link card from a concept page into a play world (Girgit Run) */
.playcard { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 24px; padding: 12px 16px; border-radius: 12px; background: var(--raised); color: var(--bone); text-decoration: none; }
.playcard:hover { background: var(--raised-2); }
.playcard > span { display: grid; gap: 2px; }
.playcard-k { font-size: var(--text-xs); line-height: var(--leading-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mix-4); font-weight: 500; }
.playcard-t { font-size: var(--text-md); line-height: 1.4; font-weight: 500; }
.playcard svg { width: 18px; height: 18px; flex: none; color: var(--mix-4); }
.playcard + .playcard { margin-top: -16px; }
/* search box in a page hero */
.hero-search { margin-top: 24px; }

/* ---------- deep dive: the optional layer at the end of a concept page ----------
   <section class="deep" id="deep-dive"> <header class="deep-head">…</header> … </section>
   Inside: .whychain (the roots, one "why" per step), .story (anecdote), .remember (mnemonics), .connect, .solve */
.deep { margin: 112px 0 0; }
.deep-head { padding: 24px 20px; border-radius: 16px; background: var(--bone); color: var(--void); }
.deep-head .label { display: block; color: color-mix(in srgb, var(--void) 60%, var(--bone)); }
.prose .deep-head h2 { display: block; margin: 8px 0 8px; color: var(--void); }
.prose .deep-head h2 a.hash { display: none; }
.deep-head p { margin: 0; color: color-mix(in srgb, var(--void) 78%, var(--bone)); font-size: var(--text-md); line-height: var(--leading-md); }
.deep-head ol { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.deep-head ol a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--void) 10%, var(--bone)); color: var(--void); text-decoration: none; font-size: var(--text-sm); }
.deep-head ol a:hover { background: color-mix(in srgb, var(--void) 18%, var(--bone)); }
@media (min-width: 769px) { .deep-head { padding: 32px 32px; } }
.deep > h3:first-of-type { margin-top: 56px; }
.whychain { margin: 24px 0 32px; padding: 0; list-style: none; counter-reset: why; }
.whychain > li { position: relative; margin: 0; padding: 0 0 20px 40px; counter-increment: why; }
.whychain > li::before { content: counter(why); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; background: var(--raised-2); color: var(--bone); font-size: var(--text-xs); font-weight: 500; }
.whychain > li::after { content: ""; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1px; background: var(--hairline-strong); }
.whychain > li:last-child { padding-bottom: 0; } .whychain > li:last-child::after { display: none; }
.whychain .q { display: block; font-weight: 500; color: var(--bone); margin-bottom: 2px; }
.whychain > li:last-child::before { background: var(--bone); color: var(--void); }
.story { margin: 32px 0; padding: 18px 20px; border-radius: 12px; background: var(--raised); font-size: var(--text-md); line-height: var(--leading-md); color: var(--mix-2); }
.story > .label { display: block; margin-bottom: 8px; }
.story p { margin: 0 0 12px; } .story p:last-child { margin-bottom: 0; }
.story .when { color: var(--bone); font-weight: 500; }
.story .fig { margin: 14px 0 0; }
.remember { margin: 32px 0; padding: 16px 18px; border-radius: 12px; background: var(--raised); border-left: 3px solid var(--c-lyso); border-radius: 0 12px 12px 0; }
.remember > .label { display: block; margin-bottom: 4px; }
.remember > p { margin: 0 0 8px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--mix-3); }
.remember dl { margin: 0; }
.remember dl > div { padding: 10px 0; border-top: 1px solid var(--hairline); }
.remember dl > div:first-child { border-top: 0; }
.remember dt { font-weight: 500; color: var(--bone); font-size: var(--text-md); line-height: var(--leading-md); }
.remember dd { margin: 2px 0 0; color: var(--mix-2); font-size: var(--text-sm); line-height: var(--leading-sm); }
.remember dd b { color: var(--bone); font-weight: 500; }
.connect { margin: 32px 0; padding: 4px 18px; border-radius: 12px; background: var(--raised); }
.connect > .label { display: block; padding: 12px 0 4px; }
.connect ul { margin: 0; padding: 0; list-style: none; }
.connect li { margin: 0; padding: 10px 0; border-top: 1px solid var(--hairline); font-size: var(--text-md); line-height: var(--leading-md); color: var(--mix-2); }
.connect > .label + ul > li:first-child { border-top: 0; }
.connect li b { color: var(--bone); font-weight: 500; }
.solve { margin: 32px 0; padding: 18px 20px; border-radius: 12px; background: var(--raised); }
.solve > .label { display: block; margin-bottom: 8px; }
.solve > p { margin: 0 0 10px; }
.deep .sources { margin: 40px 0 0; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--mix-4); }
.deep .sources a { color: inherit; }
.deep .sources ol { margin: 6px 0 0; padding-left: 1.2em; }
