@font-face{font-family:"Bricolage Grotesque";font-weight:200 800;font-style:normal;font-display:swap;src:url(/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-weight:400;font-style:normal;font-display:swap;src:url(/assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-weight:500;font-style:normal;font-display:swap;src:url(/assets/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Sans";font-weight:600;font-style:normal;font-display:swap;src:url(/assets/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-weight:400;font-style:normal;font-display:swap;src:url(/assets/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-weight:500;font-style:normal;font-display:swap;src:url(/assets/fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2")}

/* Layout: one centred column. Catalogue of functions -> function page with lessons -> practice player. */
:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --ink: #17211b;
  --muted: #5b685f;
  --line: #d5dcd6;
  --accent: #1d7a46;
  --accent-ink: #ffffff;
  --accent-soft: #dff1e6;
  --warn-soft: #fff1cc;
  --warn-ink: #6b4b00;
  --bad-soft: #fde4e1;
  --bad-ink: #8a1f14;
  --head: #e8ece8;
  --target: #fff7d6;
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1612; --surface: #172019; --ink: #e8efe9; --muted: #9aa99f; --line: #2c3a30;
    --accent: #52c47f; --accent-ink: #0b1a11; --accent-soft: #1b3325;
    --warn-soft: #3a3010; --warn-ink: #f2d37a; --bad-soft: #3b1b17; --bad-ink: #ffb4a8;
    --head: #1f2b23; --target: #3a3410;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1612; --surface: #172019; --ink: #e8efe9; --muted: #9aa99f; --line: #2c3a30;
  --accent: #52c47f; --accent-ink: #0b1a11; --accent-soft: #1b3325;
  --warn-soft: #3a3010; --warn-ink: #f2d37a; --bad-soft: #3b1b17; --bad-ink: #ffb4a8;
  --head: #1f2b23; --target: #3a3410;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 20px 16px 56px; display: flex; flex-direction: column; gap: 20px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.chips { display: flex; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.chip b { font-weight: 600; }
#view { display: flex; flex-direction: column; gap: 20px; }
.back { font-size: 14px; font-weight: 500; text-decoration: none; }
.back:hover { text-decoration: underline; }

/* catalogue */
.intro h1, .card h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -0.015em; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); max-width: 62ch; }
.controls { display: flex; flex-direction: column; gap: 10px; }
.search { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 12px 14px; font: inherit; font-size: 16px; }
.search:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.jobs { display: flex; flex-wrap: wrap; gap: 8px; }
.jobs button { padding: 6px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.jobs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.summary { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.fcard { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
a.fcard:hover { border-color: var(--accent); }
a.fcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fcard.soon { opacity: .62; }
.ftop { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fname { font-family: var(--font-mono); font-weight: 500; font-size: 18px; }
.lvl { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.use { margin: 0; font-size: 14px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; background: var(--head); border-radius: 4px; padding: 1px 7px; }
.foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); padding-top: 4px; }
.foot .go { color: var(--accent); font-weight: 600; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

/* function page */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.fhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fhead .fname { font-size: 30px; }
.lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lessons li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.lessons li:first-child { border-top: 0; }
.lessons .n { width: 28px; height: 28px; border-radius: 50%; background: var(--head); display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.lessons .t { flex: 1; min-width: 0; }
.lessons .t small { display: block; color: var(--muted); font-size: 13px; }
.lessons li.lockedrow .t { color: var(--muted); }
.btn, button { font: inherit; font-weight: 600; border-radius: 6px; padding: 9px 16px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
.note { background: var(--warn-soft); color: var(--warn-ink); border-radius: 6px; padding: 10px 14px; font-size: 15px; }

/* player */
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.task { margin: 0; max-width: 65ch; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--head); padding: 1px 5px; border-radius: 4px; }
.sheet-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
table.sheet { border-collapse: collapse; width: 100%; min-width: 360px; font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: 5px 10px; height: 32px; min-width: 64px; white-space: nowrap; }
.sheet th { background: var(--head); color: var(--muted); font-weight: 500; text-align: center; }
.sheet th.rowh { min-width: 38px; width: 38px; }
.sheet td.num { text-align: right; }
.sheet td.lbl { font-family: var(--font-body); }
.sheet td.ttl { font-family: var(--font-body); font-weight: 600; color: var(--muted); white-space: nowrap; }
.sheet td.hdr { font-family: var(--font-body); font-weight: 600; background: var(--head); }
.sheet td.target { background: var(--target); outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet td.fillcell { background: var(--target); opacity: .75; }
.sheet td.target.preview, .sheet td.fillcell.preview { color: var(--muted); font-style: italic; }
.sheet td.target.ok, .sheet td.fillcell.ok { background: var(--accent-soft); font-weight: 500; opacity: 1; font-style: normal; color: var(--ink); }
.fbar { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.fbar label { background: var(--head); color: var(--muted); font-family: var(--font-mono); padding: 0 12px; display: flex; align-items: center; font-style: italic; border-right: 1px solid var(--line); }
.fbar input { flex: 1; min-width: 0; border: 0; padding: 12px; font-family: var(--font-mono); font-size: 16px; background: var(--surface); color: var(--ink); }
.fbar:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.fbar input:focus { outline: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.msg { border-radius: 6px; padding: 10px 14px; font-size: 15px; display: none; }
.msg.show { display: block; }
.msg.good { background: var(--accent-soft); }
.msg.bad { background: var(--bad-soft); color: var(--bad-ink); }
.msg.hint { background: var(--warn-soft); color: var(--warn-ink); }
.msg strong { font-weight: 600; }
.hidden { display: none !important; }

/* tabs + shortcut drills */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:focus-visible { outline: 3px solid var(--accent); outline-offset: -2px; }
.key { display: inline-block; font-family: var(--font-mono); font-size: 0.95em; font-weight: 500; min-width: 2em; text-align: center; padding: 2px 9px; background: var(--surface); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; color: var(--ink); }
.plus { color: var(--muted); margin: 0 4px; font-size: 0.9em; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--surface); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.optrow { display: flex; flex-direction: column; gap: 6px; }
.optrow .lab { font-size: 13px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.drill-q { font-family: var(--font-display); font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.pad { border: 2px dashed var(--line); border-radius: 10px; padding: 28px 16px; min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; background: var(--bg); }
.pad:focus { outline: none; border-color: var(--accent); border-style: solid; }
.pad .small { font-size: 14px; color: var(--muted); }
.pad .keys { font-size: 20px; }
.pad.ok { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.pad.no { border-color: var(--bad-ink); border-style: solid; background: var(--bad-soft); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.opts button { justify-content: center; padding: 16px 12px; font-size: 17px; }
.opts button.ok { background: var(--accent-soft); border-color: var(--accent); }
.opts button.no { background: var(--bad-soft); border-color: var(--bad-ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.missed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.missed li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.missed li:first-child { border-top: 0; }
.tabs { overflow-x: auto; }
.tabs a { white-space: nowrap; }
.sd-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sd-streak { display: flex; align-items: baseline; gap: 8px; }
.sd-streak b { font-family: var(--font-display); font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; }
.sd-streak span { color: var(--muted); }
.sd-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; color: var(--muted); }
.timer { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--accent); }
.timer i.low { background: var(--bad-ink); }
.ladder { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.ladder b { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.board li { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 10px 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.board li:first-child { border-top: 0; }
.board li.me { background: var(--accent-soft); border-radius: 6px; }
.board .rk { font-weight: 600; color: var(--muted); }
.board .nm { min-width: 0; overflow-wrap: anywhere; }
.board .vl { font-weight: 600; }
.board li.gap, .board li.emptyrow { display: block; text-align: center; color: var(--muted); padding: 12px; }
.board.blur { filter: blur(5px); user-select: none; pointer-events: none; }
.lbhead { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 8px; }
.pill { font-size: 12px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 8px; margin-left: 6px; font-weight: 600; }

/* ===== site-level additions ===== */
.sheet td.tr { text-align: right; }
.eyebrow.mb { margin-bottom: 6px; }
.ladder.plain { list-style: none; padding-left: 0; }
h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 8px; text-wrap: balance; }
h3 { font-size: 17px; margin: 0 0 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.wrap { gap: 28px; }
.sitenav { display: flex; gap: 4px; flex-wrap: wrap; font-size: 15px; }
.sitenav a { padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-weight: 500; }
.sitenav a:hover { background: var(--head); }
.sitenav a[aria-current="page"] { background: var(--accent-soft); }
header.top { flex-wrap: wrap; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.hero { display: flex; flex-direction: column; gap: 14px; padding: 12px 0 4px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(32px, 6vw, 48px); line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 60ch; }
.hero .row { margin-top: 4px; }
.prose { display: flex; flex-direction: column; gap: 12px; max-width: 68ch; }
.prose p, .prose ul, .prose ol { margin: 0; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
section.block { display: flex; flex-direction: column; gap: 12px; }
.steps3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.steps3 > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.steps3 p { margin: 0; color: var(--muted); font-size: 15px; }
pre.syntax { margin: 0; padding: 14px 16px; background: var(--head); border-radius: 8px; overflow-x: auto; font-family: var(--font-mono); font-size: 15px; }
dl.parts { margin: 0; display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 16px; }
dl.parts dt { font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
dl.parts dd { margin: 0; color: var(--muted); }
.example { display: flex; flex-direction: column; gap: 10px; }
.formula-line { font-family: var(--font-mono); font-size: 14px; background: var(--head); border-radius: 6px; padding: 8px 12px; overflow-x: auto; white-space: nowrap; }
.formula-line b { color: var(--accent); font-weight: 500; }
.sheet td.res { background: var(--accent-soft); font-weight: 500; }
.uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.uses > div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface); }
.uses p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.faq p { margin: 8px 0 0; color: var(--muted); max-width: 66ch; }
.relgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.relgrid a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; text-decoration: none; font-family: var(--font-mono); font-size: 14px; background: var(--surface); }
.relgrid a:hover { border-color: var(--accent); }
.waitlist { background: var(--accent-soft); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.waitlist form { display: flex; gap: 8px; flex-wrap: wrap; }
.waitlist input[type="email"] { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: inherit; background: var(--surface); color: var(--ink); }
.waitlist input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.waitlist p { margin: 0; }
.waitlist .small { font-size: 13px; color: var(--muted); }
.cheat { width: 100%; border-collapse: collapse; font-size: 15px; }
.cheat th, .cheat td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.cheat thead th { border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cheat td.k { white-space: nowrap; }
.cheat small { display: block; color: var(--muted); margin-top: 2px; }
.cheat-wrap { overflow-x: auto; }
.grpname { font-family: var(--font-display); font-size: 20px; margin: 18px 0 4px; }
footer.site { border-top: 1px solid var(--line); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); }
footer.site nav { display: flex; gap: 14px; flex-wrap: wrap; }
footer.site a { color: var(--muted); }
noscript .note { margin: 0; }
@media (max-width: 520px) { dl.parts { grid-template-columns: 1fr; gap: 2px; } dl.parts dd { margin-bottom: 8px; } }
