/* Revision-notes pages (kit/build_notes.py). Same colour tokens as the subject pages. */
:root{
  --paper:#1f1f1f; --surface:#1B1712; --raised:#221C15;
  --ink:#EAE3D0; --ink-2:#B9AF98; --muted:#928872;
  --rule:#332B1F; --rule-soft:#241F18;
  --accent:#C3453A; --accent-soft:#2C1815; --accent-ink:#E4877D;
  --tick:#6E9A79; --tick-soft:#182019;
  --key:#C9A227; --key-soft:#241F12;
  --curve2:#6FA3C7; --curve3:#6E9A79;
  --veil:rgba(31,31,31,.45);
}
:root[data-theme="light"]{
  --paper:#F7F2E7; --surface:#FFFFFF; --raised:#FBF7EC;
  --ink:#241C13; --ink-2:#544935; --muted:#756c56;
  --rule:#E1D8C0; --rule-soft:#ECE4D0;
  --accent:#9C3226; --accent-soft:#F3E3DF; --accent-ink:#7A281F;
  --tick:#3F7350; --tick-soft:#E5F0E7;
  --key:#8A6A00; --key-soft:#FBF3D9;
  --curve2:#2F6690; --curve3:#3F7350;
  --veil:rgba(247,242,231,.45);
}
*{box-sizing:border-box}
html{scrollbar-width:thin; scrollbar-color:var(--accent) var(--paper); scroll-behavior:smooth}
body{margin:0; background:var(--paper); color:var(--ink);
  font-family:"IBM Plex Sans","Segoe UI",Helvetica,Arial,sans-serif; font-size:16px; line-height:1.65;
  -webkit-font-smoothing:antialiased}
a{color:var(--accent-ink)}
:focus-visible{outline:3px solid var(--accent); outline-offset:2px}
.small{font-size:13px; color:var(--muted)}

.topbar{border-bottom:1px dashed var(--rule); padding:18px 28px}
.topbar .inner{max-width:1200px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:16px}
a.home{font-size:20px; font-weight:600; color:var(--muted); text-decoration:none}
a.home:hover{color:var(--accent-ink)}
a.home .mark{color:var(--accent-ink); font-style:italic; font-family:"Fraunces",Georgia,serif}
.crumbs{font-size:12.5px; color:var(--muted); margin-top:4px}
.crumbs a{color:var(--muted); text-decoration:none}
.crumbs a:hover{color:var(--accent-ink); text-decoration:underline}
.ghost{padding:9px 16px; font:inherit; font-size:13px; font-weight:600; border:1.5px solid var(--accent);
  border-radius:999px; background:var(--raised); color:var(--ink-2); cursor:pointer; flex:none}
.ghost:hover{color:var(--accent-ink); background:var(--accent-soft)}

.notes-main{max-width:1200px; margin:0 auto; padding:28px 28px 80px}
.head h1{font-family:"Fraunces",Georgia,serif; font-weight:600; font-size:36px; line-height:1.15; margin:0 0 8px;
  letter-spacing:-.015em}
.head .h1-sub{display:block; font-size:16px; font-family:"IBM Plex Sans",sans-serif; font-weight:600;
  color:var(--accent-ink); letter-spacing:.06em; text-transform:uppercase; margin-top:6px}
.head .sub{margin:0 0 26px; color:var(--muted); font-size:13.5px}

.layout{display:grid; grid-template-columns:230px minmax(0,1fr); gap:44px; align-items:start}
.toc{position:sticky; top:20px; font-size:13.5px; border-left:2px solid var(--rule); padding-left:16px}
.toc-h{margin:0 0 8px; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); font-weight:600}
.toc ol{margin:0 0 16px; padding:0; list-style:none}
.toc li{margin:0 0 7px; line-height:1.35}
.toc a{color:var(--ink-2); text-decoration:none}
.toc a:hover{color:var(--accent-ink)}
.practise-mini{font-weight:600; font-size:13px}
.note{max-width:760px; min-width:0}

.note h2{font-family:"Fraunces",Georgia,serif; font-weight:600; font-size:25px; line-height:1.25; margin:42px 0 12px;
  padding-top:6px; scroll-margin-top:16px}
.note h3{font-size:17px; margin:24px 0 8px}
.note p{margin:0 0 14px}
.note ul, .note ol{margin:0 0 14px; padding-left:22px}
.note li{margin:0 0 6px}
.note strong{color:var(--ink)}

.key, .formula, .tip, .trap, .focus, .practise{border-radius:6px; padding:14px 18px; margin:18px 0}
.key{background:var(--key-soft); border-left:4px solid var(--key)}
.key::before{content:"Learn this definition"; display:block; font-size:11px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--key); margin-bottom:4px}
.formula{background:var(--raised); border:1px solid var(--rule); font-size:17px}
.formula::before{content:"Formula"; display:block; font-size:11px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); margin-bottom:6px}
.formula .eq{font-family:"IBM Plex Mono",monospace; font-size:16px; color:var(--ink); white-space:normal}
.tip{background:var(--tick-soft); border-left:4px solid var(--tick)}
.tip::before{content:"Exam tip"; display:block; font-size:11px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--tick); margin-bottom:4px}
.trap{background:var(--accent-soft); border-left:4px solid var(--accent)}
.trap::before{content:"Common mistake"; display:block; font-size:11px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--accent-ink); margin-bottom:4px}
.key p:last-child, .formula p:last-child, .tip p:last-child, .trap p:last-child{margin-bottom:0}
.worked, .method{border-radius:6px; padding:14px 18px; margin:18px 0; background:var(--raised); border:1px solid var(--rule)}
.worked::before, .method::before{display:block; font-size:11px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); margin-bottom:6px}
.worked::before{content:"Worked example"}
.method{border-left:4px solid var(--curve2)}
.method::before{content:"Method"; color:var(--curve2)}
.worked p:last-child, .method p:last-child, .method ol:last-child{margin-bottom:0}
.note caption{caption-side:top; text-align:left; font-weight:600; padding:2px 0 6px; color:var(--ink)}
.note tr.tot td{border-top:2px solid var(--ink-2)}
.note table.entries td{font-size:14px}
.note td.num{white-space:nowrap}
.note table.ledger{font-size:14px}
.note table.ledger td, .note table.ledger th{padding:6px 8px}
.note table.ledger .crs{border-left:3px double var(--ink-2)}

.focus{background:var(--surface); border:1px solid var(--rule); margin-top:0}
.focus h2{font-family:"IBM Plex Sans",sans-serif; font-size:12px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); margin:0 0 8px; padding:0}
.focus ul{margin:0 0 6px; padding-left:20px; font-size:14.5px}
.focus .small{margin:0}

.note table{border-collapse:collapse; margin:10px 0 18px; font-size:14.5px; width:100%}
.note th, .note td{border:1px solid var(--rule); padding:7px 10px; text-align:left; vertical-align:top}
.note th{background:var(--raised); font-weight:600}
.note .wide{overflow-x:auto; margin:10px 0 18px}
.note .wide table{min-width:600px; margin:0}
.note .wide td:first-child{min-width:160px}
.note td.num, .note th.num{text-align:right; font-variant-numeric:tabular-nums}

figure.diagram{margin:20px 0; padding:16px; background:var(--surface); border:1px solid var(--rule); border-radius:6px}
figure.diagram svg{display:block; width:100%; max-width:520px; height:auto; margin:0 auto; overflow:visible}
figure.diagram figcaption{margin-top:10px; font-size:13.5px; color:var(--ink-2); text-align:center}
svg .ax{stroke:var(--ink-2); stroke-width:1.6; fill:none}
svg .c1{stroke:var(--accent-ink); stroke-width:2.6; fill:none}
svg .c2{stroke:var(--curve2); stroke-width:2.6; fill:none}
svg .c3{stroke:var(--curve3); stroke-width:2.6; fill:none}
svg .guide{stroke:var(--muted); stroke-width:1.2; stroke-dasharray:4 4; fill:none}
svg .area{fill:var(--accent); opacity:.25}
svg .area2{fill:var(--curve2); opacity:.25}
svg text{fill:var(--ink); font-family:"IBM Plex Sans",sans-serif; font-size:13px}
svg text.m{fill:var(--muted); font-size:12px}
svg text.l1{fill:var(--accent-ink); font-weight:600}
svg text.l2{fill:var(--curve2); font-weight:600}
svg text.l3{fill:var(--curve3); font-weight:600}
svg .dot{fill:var(--ink)}
svg path.arrowhead{fill:var(--ink); stroke:none}
svg path.arrowhead.l1{fill:var(--accent-ink)}
svg path.arrowhead.l2{fill:var(--curve2)}
svg path.arrowhead.l3{fill:var(--curve3)}

details.check{border:1px solid var(--rule); border-radius:6px; margin:10px 0; background:var(--surface)}
details.check > summary{cursor:pointer; padding:11px 16px; font-weight:600; list-style:none}
details.check > summary::-webkit-details-marker{display:none}
details.check > summary::before{content:"Q"; display:inline-block; width:1.6em; color:var(--accent-ink);
  font-family:"Fraunces",Georgia,serif}
details.check[open] > summary{border-bottom:1px dashed var(--rule)}
details.check > div{padding:12px 16px 4px}
details.check > div::before{content:"Answer"; display:block; font-size:11px; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--tick); margin-bottom:4px}

.practise{background:var(--accent-soft); border:1px solid var(--accent); margin-top:40px}
.practise h2{margin-top:0; font-size:22px}
.btn{display:inline-block; padding:11px 22px; border-radius:999px; background:var(--accent); color:#fff;
  font-weight:600; text-decoration:none}
.btn:hover{background:var(--accent-ink)}
.pager{display:flex; justify-content:space-between; gap:16px; margin-top:28px}
.pager a{display:flex; flex-direction:column; max-width:48%; padding:12px 16px; border:1px solid var(--rule);
  border-radius:6px; text-decoration:none; color:var(--ink); font-weight:600; font-size:14.5px; background:var(--surface)}
.pager a span{font-size:12px; color:var(--muted); font-weight:500}
.pager a.next{text-align:right; margin-left:auto}
.pager a:hover{border-color:var(--accent)}

.index .lede{max-width:720px; color:var(--ink-2); font-size:16.5px}
.index .unit h2{font-family:"Fraunces",Georgia,serif; font-weight:600; font-size:21px; margin:30px 0 8px}
.index ul{list-style:none; margin:0; padding:0; max-width:760px}
.index li{display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px dashed var(--rule)}
.index li a{color:var(--ink); text-decoration:none; font-weight:600}
.index li a:hover{color:var(--accent-ink)}
.index .n{display:inline-block; min-width:4em; color:var(--muted); font-family:"IBM Plex Mono",monospace;
  font-size:12px; font-weight:500}
.index .mins{color:var(--muted); font-size:13px; white-space:nowrap}

.foot{border-top:1px dashed var(--rule); padding:20px 28px 40px; text-align:center; font-size:13px; color:var(--muted)}
.foot a{color:var(--muted)}

@media (max-width:860px){
  .layout{grid-template-columns:1fr; gap:10px}
  .toc{position:static; border-left:0; padding:12px 14px; background:var(--surface); border:1px solid var(--rule); border-radius:6px}
  .head h1{font-size:28px}
  .notes-main{padding:20px 16px 60px}
  .topbar{padding:14px 16px}
}
@media print{
  .topbar, .toc, .pager, .foot, .ghost, .practise .btn{display:none!important}
  details.check{break-inside:avoid}
  details.check > div{display:block}
}

/* site-wide /notes/ page: pick a subject (sticky notes; paper colours stay the same in both themes) */
.hub .lvl-row{margin-top:34px}
.hub .lvl-row h2{font-family:"Fraunces",Georgia,serif; font-weight:600; font-size:22px; margin:0 0 18px}
.stickies{display:grid; grid-template-columns:repeat(3, minmax(0, 220px)); gap:34px 30px}
.sticky{--rot:-1.6deg; position:relative; display:flex; flex-direction:column; aspect-ratio:1/1; padding:30px 20px 18px;
  color:#2B2318; text-decoration:none; transform:rotate(var(--rot)); filter:saturate(.6);
  /* muted paper: the colour seen through a veil of the page background */
  background:linear-gradient(var(--veil), var(--veil)), var(--bg, var(--pc));
  box-shadow:0 1px 1px rgba(0,0,0,.12), 0 10px 18px -8px rgba(0,0,0,.45);
  transition:transform .18s ease, box-shadow .18s ease}
.stickies > :nth-child(2){--rot:1.4deg}
.stickies > :nth-child(3){--rot:-.8deg}
/* curled bottom-right corner */
.sticky::after{content:""; position:absolute; right:0; bottom:0; width:34px; height:34px;
  background:linear-gradient(135deg, rgba(0,0,0,0) 48%, rgba(0,0,0,.12) 50%, rgba(255,255,255,.55) 58%, rgba(0,0,0,.05) 100%);
  border-top-left-radius:2px}
/* decorations */
.sticky.d-tape::before{content:""; position:absolute; top:-11px; left:50%; width:78px; height:24px; margin-left:-39px;
  background:rgba(236,232,214,.62); box-shadow:0 1px 2px rgba(0,0,0,.12); transform:rotate(-3deg)}
.sticky.d-pin::before{content:""; position:absolute; top:-7px; left:50%; width:18px; height:18px; margin-left:-9px; border-radius:50%;
  background:radial-gradient(circle at 35% 35%, #F5807A 0, #C9302C 55%, #8E1C19 100%); box-shadow:2px 3px 3px rgba(0,0,0,.35)}
.sticky .st-lvl{font-size:11.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; opacity:.7}
.sticky .st-name{font-family:"Fraunces",Georgia,serif; font-weight:600; font-size:27px; line-height:1.1; margin-top:4px}
.sticky .st-code{font-family:"IBM Plex Mono",monospace; font-size:13px; opacity:.7}
.sticky .st-cnt{margin-top:auto; font-weight:600; font-size:14px}
a.sticky:hover, a.sticky:focus-visible{transform:rotate(0) translateY(-5px);
  box-shadow:0 2px 2px rgba(0,0,0,.12), 0 18px 26px -10px rgba(0,0,0,.5)}
a.sticky:focus-visible{outline:3px solid var(--accent); outline-offset:4px}
.sticky.soon > span{opacity:.7}
.sticky.soon .st-cnt{font-weight:500; font-style:italic}
/* papers */
.p-yellow{--pc:#F7DC6F}
.p-orange{--pc:#F6B654}
.p-pink{--pc:#F29BBF}
.p-blue{--pc:#A9D2EC}
.p-green{--pc:#CDE58F}
.p-peach{--pc:#F6CBA4}
.p-kraft{--pc:#CFAF86}
.p-lined{--bg:linear-gradient(90deg, transparent 26px, rgba(214,90,90,.45) 26px, rgba(214,90,90,.45) 27.5px, transparent 27.5px),
  repeating-linear-gradient(180deg, #FBFAF4 0, #FBFAF4 25px, #B9CDE0 25px, #B9CDE0 26px); padding-left:40px}
.p-grid{--bg:linear-gradient(#C9D6E3 1px, transparent 1px) 0 0/18px 18px,
  linear-gradient(90deg, #C9D6E3 1px, transparent 1px) 0 0/18px 18px, #FBFAF4}
@media (max-width:760px){
  .stickies{grid-template-columns:repeat(2, minmax(0, 1fr)); gap:30px 22px}
  .sticky{padding:24px 14px 14px}
  .sticky .st-name{font-size:22px}
}
@media (prefers-reduced-motion:reduce){
  .sticky{transition:none}
}
