/* Hence — graph paper, fountain-pen ink, a teacher's green pen.
   Display and maths: Latin Modern (the face of printed mathematics). Text: Inter. Annotations: Kalam. */
@font-face { font-family: "LM Display"; font-display: swap; src: url("fonts/LM-Display.woff2") format("woff2"); }
@font-face { font-family: "LM"; font-style: normal; font-display: swap; src: url("fonts/LM-Regular.woff2") format("woff2"); }
@font-face { font-family: "LM"; font-style: italic; font-display: swap; src: url("fonts/LM-Italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 400; font-display: swap; src: url("fonts/Kalam-Regular.woff2") format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 700; font-display: swap; src: url("fonts/Kalam-Bold.woff2") format("woff2"); }

:root {
  --paper: #fbfcfd;
  --grid: #e1ebf4;
  --grid-major: #c6d8e8;
  --ink: #17233f;
  --ink-soft: #4b5672;
  --pen: #0b8a5f;
  --pen-soft: rgba(11,138,95,.12);
  --night: #0b0b0c;
  --max: 1160px;
  --gutter: 24px;
  --cell: 24px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  /* the graph paper: 5 mm cells, a heavier line every 5 cells */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: calc(var(--cell)*5) calc(var(--cell)*5), calc(var(--cell)*5) calc(var(--cell)*5), var(--cell) var(--cell), var(--cell) var(--cell);
  background-position: -1px -1px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.hand { font-family: "Kalam", "Comic Neue", cursive; color: var(--pen); font-weight: 400; }
.math { font-family: "LM", "Latin Modern Roman", "Cambria Math", serif; }
.math i { font-style: italic; }

/* ---------- navigation: index tabs, like the dividers of a ring binder ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(251,252,253,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1.5px solid var(--ink); }
.nav .wrap { display: flex; align-items: flex-end; justify-content: space-between; height: 70.5px; gap: 16px; }
.brand { font-family: "LM Display", "LM", serif; font-size: 32px; letter-spacing: -.01em; text-decoration: none; color: var(--ink); line-height: 1; align-self: center; }
.tabs { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: flex-end; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: block; text-decoration: none; font-size: 15px; color: var(--ink-soft); padding: 9px 16px 8px; border: 1.5px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; white-space: nowrap; margin-bottom: -1.5px; position: relative; }
.tab:hover { color: var(--ink); border-color: var(--grid-major); background: rgba(255,255,255,.6); }
.tab.on { color: var(--ink); font-weight: 600; background: var(--paper); border-color: var(--ink); }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--paper); }
.btn { display: inline-block; border-radius: 6px; padding: 12px 20px; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #24345c; }
.nav ul .btn-primary { color: #fff; }
.btn-ghost, .btn-dark { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); background: rgba(251,252,253,.7); }
.btn-ghost:hover, .btn-dark:hover { background: var(--ink); color: #fff; }
.btn-small { padding: 8px 14px; font-size: 14px; }

/* ---------- hero: a coordinate plane ---------- */
.hero { position: relative; min-height: calc(100vh - 72px); min-height: calc(100svh - 72px); display: flex; align-items: center; overflow: hidden; }
.plane { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
.hero .wrap { position: relative; width: 100%; padding-top: 72px; padding-bottom: 72px; }
.hero h1 { font-family: "LM Display", "LM", serif; font-weight: 400; font-size: clamp(46px, 6.2vw, 88px); line-height: 1.02; letter-spacing: -.015em; margin: 0; max-width: 7.2em; }
.hero .lede { font-size: clamp(18px, 1.5vw, 20px); color: var(--ink-soft); max-width: 27em; margin: 28px 0 36px; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.margin-mark { display: inline-block; font-size: 28px; letter-spacing: 0; transform: rotate(-7deg) translate(.5em, -1.4em); line-height: 1; white-space: nowrap; }
.fn-label { font-family: "Kalam", cursive; }

/* load sequence of the plane: axes, then the curve, then its derivative and the moving tangent */
.plane .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.plane .fade { opacity: 0; }
.plane.ready .draw { animation: draw 1s cubic-bezier(.5,0,.2,1) .15s forwards; }
.plane.ready .draw.slow { animation-duration: 1.9s; animation-delay: .7s; }
.plane.ready .fade { animation: fade .7s ease .9s forwards; }
.plane.ready .fade.late { animation-delay: 2.5s; }
.plane.instant .draw, .plane.instant .fade { animation: none; stroke-dashoffset: 0; opacity: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .plane .draw, .plane .fade { animation: none !important; stroke-dashoffset: 0; opacity: 1; } }

/* ---------- section rhythm ---------- */
section { padding: 120px 0; position: relative; overflow-x: clip; }
h2 { font-family: "LM Display", "LM", serif; font-weight: 400; font-size: clamp(36px, 4.8vw, 60px); line-height: 1.05; letter-spacing: -.01em; margin: 0 0 22px; }
.lede-2 { font-size: 19px; color: var(--ink-soft); max-width: 34em; margin: 0 0 40px; }

/* ---------- the pack, as an object on the desk ---------- */
.pack { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.desk { position: relative; aspect-ratio: 1 / 1.08; }
.desk img { position: absolute; width: 64%; box-shadow: 0 1px 1px rgba(23,35,63,.12), 0 22px 40px -12px rgba(23,35,63,.35); border-radius: 2px; }
.desk .under { right: 2%; top: 6%; transform: rotate(5deg); background: #fff; }
.desk .over { left: 4%; top: 14%; transform: rotate(-4deg); }
.desk .note { position: absolute; left: 0; bottom: 0; font-size: 22px; transform: rotate(-3deg); }
.ticks { list-style: none; padding: 0; margin: 0 0 36px; display: grid; gap: 10px; }
.ticks li { padding-left: 34px; position: relative; }
.ticks li::before { content: "✓"; font-family: "Kalam", cursive; font-weight: 700; color: var(--pen); position: absolute; left: 2px; top: -4px; font-size: 24px; transform: rotate(-8deg); }
.prices { border-top: 1.5px solid var(--ink); margin: 0 0 10px; max-width: 30em; }
.prices div { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--grid-major); }
.prices b { font-weight: 600; white-space: nowrap; }
.prices span { color: var(--ink-soft); font-size: 15px; }
.prices i { flex: 1; border-bottom: 1.5px dotted var(--grid-major); transform: translateY(-4px); min-width: 12px; }
.prices em { font-family: "LM", serif; font-style: normal; font-size: 24px; }
.soon { font-size: 15px; color: var(--ink-soft); margin: 14px 0 28px; }

/* ---------- a strip of real pages ---------- */
.strip { padding: 40px 0 120px; overflow: hidden; }
.strip-track { display: flex; gap: 40px; width: max-content; padding: 0 var(--gutter); will-change: transform; }
.strip figure { margin: 0; width: min(380px, 70vw); }
.strip img { box-shadow: 0 1px 1px rgba(23,35,63,.1), 0 18px 36px -14px rgba(23,35,63,.32); background: #fff; }
.strip figcaption { font-family: "Kalam", cursive; color: var(--pen); font-size: 20px; margin-top: 14px; transform: rotate(-1.5deg); }

/* ---------- who writes this, and the proof ---------- */
.about { display: grid; grid-template-columns: 1fr 1.15fr; gap: 72px; align-items: start; }
.about p { max-width: 34em; }
.sig { font-family: "Kalam", cursive; color: var(--ink); font-size: 34px; margin-top: 8px; transform: rotate(-4deg); display: inline-block; }
.proof { border-left: 2px solid var(--ink); padding: 8px 0 8px 28px; font-family: "LM", serif; font-size: 20px; line-height: 1.55; }
.proof p { margin: 0 0 14px; }
.proof .claim b, .proof .pf { font-weight: 400; font-style: italic; }
.proof ol { margin: 0 0 6px; padding-left: 0; list-style: none; counter-reset: c; }
.proof li { counter-increment: c; padding-left: 2.4em; position: relative; margin-bottom: 12px; }
.proof li::before { content: "(" counter(c, lower-roman) ")"; position: absolute; left: 0; }
.proof .qed { text-align: right; margin: 0; }

/* ---------- free things ---------- */
.free { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.doc { display: grid; grid-template-columns: 150px 1fr; gap: 26px; align-items: start; }
.doc img { box-shadow: 0 1px 1px rgba(23,35,63,.12), 0 16px 30px -12px rgba(23,35,63,.38); transform: rotate(-2deg); }
.doc:nth-child(2) img { transform: rotate(2deg); }
.doc h3 { font-family: "LM Display", "LM", serif; font-weight: 400; font-size: 30px; line-height: 1.1; margin: 0 0 10px; }
.doc p { margin: 0 0 18px; color: var(--ink-soft); font-size: 16px; }
.downloads { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- prose pages ---------- */
.prose { max-width: 760px; margin: 0 auto; padding: 88px var(--gutter) 104px; }
.prose h1 { font-family: "LM Display", "LM", serif; font-weight: 400; font-size: clamp(44px, 6vw, 72px); line-height: 1.02; margin: 0 0 20px; }
.prose .lede { font-size: 21px; color: var(--ink-soft); margin: 0 0 48px; }
.prose h2 { font-size: clamp(30px, 3.4vw, 40px); margin: 56px 0 14px; }
.prose h3 { font-size: 18px; margin: 28px 0 8px; }
.prose p, .prose li { color: #26314d; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose .todo { background: #fff4d6; border-radius: 4px; padding: 1px 6px; color: #7a5200; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 18px; margin: 28px 0; }
.step .n { font-family: "Kalam", cursive; font-weight: 700; font-size: 34px; color: var(--pen); line-height: 1; transform: rotate(-6deg); }
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; }

/* ---------- footer ---------- */
footer { background: var(--paper); border-top: 1px solid var(--grid-major); color: var(--ink-soft); font-size: 14px; padding: 44px 0; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer a { color: var(--ink-soft); text-decoration: none; margin-right: 20px; }
footer a:hover { color: var(--ink); }
footer p { margin: 0 0 6px; }
footer b { color: var(--ink); font-family: "LM Display", serif; font-weight: 400; font-size: 20px; }

/* ---------- reveal (only the hand-written marks; see site.js) ---------- */
.write { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s cubic-bezier(.6,.05,.3,1); }
.write.on { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { .write { clip-path: none; transition: none; } }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  section { padding: 80px 0; }
  .hero { min-height: auto; display: block; }
  .hero .wrap { padding-top: 48px; padding-bottom: 40px; }
  .margin-mark { display: none; }
  .plane { position: relative; height: 360px; }
  .pack, .about, .free { grid-template-columns: 1fr; gap: 48px; }
  .desk { max-width: 460px; }
  .nav .wrap { height: auto; flex-direction: column; align-items: stretch; gap: 6px; padding-top: 10px; }
  .brand { align-self: flex-start; font-size: 28px; }
  .tab { padding: 7px 12px 6px; font-size: 14px; }
}
@media (max-width: 520px) {
  .doc { grid-template-columns: 110px 1fr; gap: 18px; }
  .prices span { display: none; }
}
.proof .more { font-family: "Inter", sans-serif; font-size: 16px; margin-top: 12px; }

/* ---------- the edges of the sheet: grid lines dissolve into dots that grow toward the edge ---------- */
body { position: relative; }
.edges { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.edge { position: absolute; top: 0; bottom: 0; width: 168px; }
.edge.l { left: 0; background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='24'%3E%3Cg fill='%2396afc8'%3E%3Ccircle cx='0' cy='0' r='1.5'/%3E%3Ccircle cx='0' cy='24' r='1.5'/%3E%3Ccircle cx='24' cy='0' r='1.15'/%3E%3Ccircle cx='24' cy='24' r='1.15'/%3E%3Ccircle cx='48' cy='0' r='.85'/%3E%3Ccircle cx='48' cy='24' r='.85'/%3E%3Ccircle cx='72' cy='0' r='.6'/%3E%3Ccircle cx='72' cy='24' r='.6'/%3E%3Ccircle cx='96' cy='0' r='.4'/%3E%3Ccircle cx='96' cy='24' r='.4'/%3E%3C/g%3E%3C/svg%3E") -0.5px -0.5px / 168px 24px repeat-y,
  linear-gradient(to right, var(--paper) 0, var(--paper) 40px, rgba(251,252,253,0) 150px); }
.edge.r { left: var(--edge-r, calc(100% - 168px)); background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='168' height='24'%3E%3Cg fill='%2396afc8'%3E%3Ccircle cx='168' cy='0' r='1.5'/%3E%3Ccircle cx='168' cy='24' r='1.5'/%3E%3Ccircle cx='144' cy='0' r='1.15'/%3E%3Ccircle cx='144' cy='24' r='1.15'/%3E%3Ccircle cx='120' cy='0' r='.85'/%3E%3Ccircle cx='120' cy='24' r='.85'/%3E%3Ccircle cx='96' cy='0' r='.6'/%3E%3Ccircle cx='96' cy='24' r='.6'/%3E%3Ccircle cx='72' cy='0' r='.4'/%3E%3Ccircle cx='72' cy='24' r='.4'/%3E%3C/g%3E%3C/svg%3E") -0.5px -0.5px / 168px 24px repeat-y,
  linear-gradient(to left, var(--paper) 0, var(--paper) 52px, rgba(251,252,253,0) 160px); }
body > *:not(.edges) { position: relative; z-index: 1; }
body > .nav { position: sticky; z-index: 20; }
@media (max-width: 900px) { .edge { width: 72px; transform-origin: left; } .edge.l { background-size: 168px 24px, auto; } .edge.r { left: var(--edge-r, calc(100% - 72px)); background-position: -96.5px -0.5px, 0 0; } }

/* ---------- small IB details ---------- */
.turn-over { position: absolute; right: var(--gutter); bottom: 28px; font-family: "LM", serif; font-style: italic; font-size: 17px; color: var(--ink-soft); text-decoration: none; }
.turn-over:hover { color: var(--ink); }
.defn { margin: 36px 0 0; border: 1.5px solid var(--ink); background: var(--paper); padding: 16px 20px; max-width: 34em; font-family: "LM", serif; font-size: 18px; line-height: 1.5; }
.defn dt { font-style: italic; }
.defn dd { margin: 0 0 10px; }
.defn dd:last-child { margin-bottom: 0; }
.defn-src { font-family: "Inter", sans-serif; font-size: 13px; color: var(--ink-soft); margin: 8px 0 0; }
.ag { position: absolute; left: -64px; top: 2px; font-size: 24px; transform: rotate(-8deg); }
.proof { position: relative; }

/* ---------- the four course doors (home) ---------- */
.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1.5px solid var(--ink); background: var(--paper); }
.door { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 24px; text-decoration: none; border-right: 1px solid var(--grid-major); position: relative; transition: background .2s ease; }
.door:last-child { border-right: 0; }
.door:hover { background: #fff; }
.door::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--c); }
.door-short { font-family: "LM Display", serif; font-size: 40px; line-height: 1; color: var(--c); }
.door .art { width: 100%; height: auto; }
.door-name { font-weight: 600; line-height: 1.35; }
.door-count { font-size: 14px; color: var(--ink-soft); }
.door:hover .door-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- course pages ---------- */
.course-head { padding: 80px 0 40px; position: relative; overflow: hidden; }
.course-head h1 { font-family: "LM Display", "LM", serif; font-weight: 400; font-size: clamp(42px, 5.2vw, 72px); line-height: 1.03; margin: 0 0 20px; max-width: 10em; }
.course-head .lede { font-size: 19px; color: var(--ink-soft); max-width: 32em; margin: 0 0 28px; }
.course-kicker { font-size: 24px; margin: 0 0 6px; transform: rotate(-2deg); display: inline-block; }
.course-art { position: absolute; right: max(var(--gutter), calc((100vw - var(--max)) / 2)); top: 36px; width: min(32vw, 420px); }
.course-art .art { width: 100%; height: auto; }
.papers { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.papers li { border: 1.5px solid var(--ink); background: var(--paper); padding: 8px 14px; display: flex; flex-direction: column; line-height: 1.3; }
.papers b { font-family: "LM", serif; font-weight: 400; font-size: 19px; }
.papers span { font-size: 13px; color: var(--ink-soft); }
.course-count { max-width: 40em; color: var(--ink-soft); font-size: 15px; margin: 0 0 6px; }
.course-count b { color: var(--ink); }
.course-links { font-size: 15px; margin: 0; }
.catalogue { padding-bottom: 100px; }
.topic { padding: 48px 0 8px; }
.topic-head { display: flex; align-items: baseline; gap: 16px; font-size: clamp(28px, 3vw, 38px); margin: 0 0 26px; border-bottom: 1.5px solid var(--c); padding-bottom: 10px; }
.tnum { font-family: "LM Display", serif; color: var(--c); font-size: 1.5em; line-height: .8; }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 44px 32px; }
.poster { display: flex; flex-direction: column; gap: 16px; }
.cover-link { text-decoration: none; display: block; }
.cover { position: relative; background: #fff; background: color-mix(in srgb, var(--c) 6%, #fff); aspect-ratio: 3 / 4; border-left: 10px solid var(--c); padding: 16px 18px 18px; display: flex; flex-direction: column; box-shadow: 0 1px 1px rgba(23,35,63,.12), 0 16px 30px -14px rgba(23,35,63,.38); transform: rotate(-.6deg); transition: transform .25s ease; }
.poster:nth-child(even) .cover { transform: rotate(.7deg); }
.cover-link:hover .cover { transform: rotate(0) translateY(-3px); }
.cover-top { display: flex; justify-content: space-between; align-items: baseline; }
.cover-topic { font-family: "LM", serif; font-style: italic; font-size: 15px; color: var(--c); }
.cover-course { font-size: 12px; font-weight: 600; color: var(--c); border: 1.2px solid var(--c); border-radius: 3px; padding: 1px 6px; }
.cover .art { width: 100%; height: auto; margin: auto 0; }
.cover-title { font-family: "LM Display", serif; font-weight: 400; font-size: 23px; line-height: 1.08; color: var(--ink); margin: 0; }
.stamp { position: absolute; right: 14px; top: 46%; transform: rotate(-14deg); font-family: "LM", serif; font-style: italic; font-size: 19px; color: var(--c); border: 2px solid var(--c); border-radius: 6px; padding: 2px 12px; background: rgba(255,255,255,.88); opacity: .92; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--c); }
.poster-topic { font-size: 13px; color: var(--c); font-weight: 600; margin: 0 0 4px; }

.poster p { margin: 0 0 10px; font-size: 15px; color: var(--ink-soft); }
.state { font-size: 13px; color: var(--ink-soft); display: inline-block; margin-bottom: 12px; }
.state.on { color: #fff; background: var(--c); padding: 3px 9px; border-radius: 3px; font-weight: 600; }
.ask { margin: 64px 0 0; max-width: 34em; }
.ask .hand { font-size: 28px; margin: 0 0 4px; }
.ask p { margin: 0; }
.ask::after { content: ""; display: block; height: 52px; margin-top: 18px; background: repeating-linear-gradient(to bottom, transparent 0 25px, var(--ink-soft) 25px 26px); -webkit-mask: repeating-linear-gradient(to right, #000 0 2px, transparent 2px 6px); mask: repeating-linear-gradient(to right, #000 0 2px, transparent 2px 6px); opacity: .55; }

/* faint drawings behind sections */
.doodle { position: absolute; pointer-events: none; z-index: 0; opacity: .5; }
.doodle * { vector-effect: non-scaling-stroke; }
section > .wrap { position: relative; z-index: 1; }

@media (max-width: 900px) {
  .doors { grid-template-columns: 1fr 1fr; }
  .door:nth-child(2) { border-right: 0; }
  .door:nth-child(-n+2) { border-bottom: 1px solid var(--grid-major); }
  .course-art { position: relative; right: auto; top: auto; width: 60%; max-width: 280px; margin-bottom: 8px; }
  .ag { left: -8px; top: -30px; }
  .turn-over { display: none; }
}
@media (max-width: 520px) { .door { padding: 16px 14px 18px; } .door-short { font-size: 30px; } .door-name { font-size: 14px; } .door-count { font-size: 12px; } }

.doodle .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.doodle.ready .draw { animation: draw 2.4s cubic-bezier(.5,0,.2,1) forwards; }
.doodle.ready .draw.d2 { animation-delay: .8s; }
.doodle.instant .draw, .doodle.instant .draw.d2 { animation: none; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .doodle .draw { stroke-dashoffset: 0; animation: none !important; } }

.topic-key { list-style: none; padding: 0; margin: 0 0 36px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15px; }
.topic-key li { display: flex; align-items: baseline; gap: 8px; }
.topic-key .tnum { font-size: 26px; }
.turn-over { right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); }

/* living drawings */
svg.live { position: absolute; pointer-events: none; z-index: 0; overflow: visible; }
@media (max-width: 900px) { svg.live.wide { display: none; } }

/* a heading boxed like a final answer: a ruled frame and a second one, drawn by hand, slightly off */
.boxed { display: inline-block; position: relative; padding: 10px 22px 14px; border: 1.5px solid var(--ink); background: var(--paper); }
.boxed::after { content: ""; position: absolute; inset: -7px 7px 7px -7px; border: 1.2px solid var(--pen); border-radius: 3px 9px 4px 11px / 10px 3px 9px 4px; transform: rotate(-.6deg); pointer-events: none; }
.note { font-family: "Kalam", cursive; color: var(--pen); font-size: 22px; line-height: 1.2; display: inline-block; transform: rotate(-3deg); }
.note-arrow { display: inline-block; width: 46px; height: 26px; vertical-align: middle; }

/* the principle: one annotated question */
.principle { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.exhibit { position: relative; background: #fff; border: 1.5px solid var(--ink); padding: 28px 30px 26px; font-family: "LM", serif; font-size: 19px; line-height: 1.55; box-shadow: 0 18px 36px -18px rgba(23,35,63,.35); }
.exhibit .qno { font-family: "LM Display", serif; font-size: 30px; color: var(--ink); margin-right: 10px; }
.exhibit .mm { float: right; font-size: 16px; color: var(--ink-soft); }
.exhibit p { margin: 0 0 10px; }
.exhibit .part { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 0 4px; margin: 6px 0; }
.exhibit .part b { font-weight: 400; }
.exhibit .mk { color: var(--ink-soft); }
.exhibit .ct { background: linear-gradient(transparent 62%, rgba(11,138,95,.22) 62%); }
.exhibit .ms { margin-top: 18px; border-left: 2.5px solid var(--pen); background: #f4f8f6; padding: 10px 14px; font-size: 16px; }
.exhibit .ms div { display: flex; justify-content: space-between; gap: 12px; }
.exhibit .ms em { font-style: normal; color: var(--pen); font-family: "Inter", sans-serif; font-weight: 600; font-size: 13px; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.notes li { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: start; }
.notes .note { font-size: 24px; transform: rotate(-4deg); }
.notes p { margin: 0; color: var(--ink-soft); }
.notes p b { color: var(--ink); font-weight: 600; }
.me { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.me p { max-width: 34em; }
@media (max-width: 900px) { .principle, .me { grid-template-columns: 1fr; gap: 40px; } }

#free { padding-bottom: 330px; }
@media (max-width: 900px) { #free { padding-bottom: 80px; } }
