:root {
  --space-half: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --font-sans: 'Rethink Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r-sheet: 20px;
  --r-panel: 14px;
  --r-card: 10px;
  --r-chip: 6px;
  --r-control: 4px;
  --ease: cubic-bezier(.65, 0, .2, 1);
  --t-fast: 160ms;
  --t-base: 280ms;
  --desk: #e8ebee;
  --panel: #f2f4f6;
  --sheet: #ffffff;
  --behind-1: #f8f9fa;
  --behind-2: #f1f3f5;
  --line: #e1e5e9;
  --edge: #d9dee3;
  --ink: #121417;
  --ink-2: #5f6670;
  --ink-3: #8a9199;
  --on-ink: #ffffff;
  --brand-indigo: #3e4179;
  --brand-blue: #000cea;
  --blue: var(--brand-blue);
  --blue-tint: #e8eaff;
  --teal: #03a08f;
  --teal-text: #006f62;
  --teal-tint: #dbf2ed;
  --on-teal: #ffffff;
  --raised: 0 1px 2px #12141714, 0 2px 6px -2px #1214171a;
  --float: 0 1px 2px #12141712, 0 22px 44px -18px #1214173d;
  --brand-edge: #8a9199;
  --brand: var(--ink);
  --brand-hover: #2a2e33;
  --brand-ink: var(--on-ink);
  --brand-deep: var(--panel);
  --bg: var(--sheet);
  --rail: var(--desk);
  --sidebar: var(--desk);
  --surface: var(--panel);
  --card: var(--sheet);
  --hover: #edf0f2;
  --active: var(--blue-tint);
  --border: var(--edge);
  --border-soft: var(--line);
  --text: var(--ink);
  --text-secondary: var(--ink-2);
  --muted: var(--ink-2);
  --accent: var(--blue);
  --accent-hover: var(--brand-hover);
  --accent-ink: var(--on-ink);
  --danger: #cb1029;
  --danger-bg: #fcebed;
  --chip-tint: 18%;
  --chip-ink-weight: 37%;
  --shadow: var(--float);
  --focus-ring: var(--accent);
  --focus-halo: var(--blue-tint);
  --control-hover-border: #b9c1c9;
  --row-hover: color-mix(in srgb, var(--sheet) 55%, transparent);
}
:root[data-theme="dark"] {
  --desk: #0f1113;
  --panel: #20242a;
  --sheet: #181b1f;
  --behind-1: #14171a;
  --behind-2: #111316;
  --line: #2a2f35;
  --edge: #30363d;
  --ink: #f1f3f5;
  --ink-2: #a6adb5;
  --ink-3: #6b737c;
  --on-ink: #121417;
  --blue: #8d9aff;
  --blue-tint: #20254d;
  --teal: #33d0b5;
  --teal-text: #74e8d3;
  --teal-tint: #0d2f29;
  --on-teal: #121417;
  --raised: 0 0 0 1px #ffffff12, 0 2px 6px -2px #00000099;
  --float: 0 0 0 1px #ffffff14, 0 24px 48px -16px #000000b3;
  --brand-edge: #6b737c;
  --brand-hover: #ffffff;
  --hover: #262a30;
  --muted: #8f969f;
  --danger: #ff6265;
  --danger-bg: #37191e;
  --control-hover-border: #4a525b;
}
@font-face {
  font-family: 'Rethink Sans';
  src: url('/assets/rethink-sans.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-padding-top: 6rem; }
html[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--sheet); color: var(--ink); font: 1rem/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--focus-ring); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
code, kbd { font: .85em/1.4 ui-monospace, monospace; }
[hidden], .logo-dark, [data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.skip { position: fixed; left: var(--space-4); top: -5rem; z-index: 20; padding: var(--space-2); background: var(--sheet); }
.skip:focus { top: var(--space-2); }
.masthead { position: sticky; inset-block-start: 0; z-index: 3; background: var(--sheet); border-bottom: 1px solid var(--line); }
.masthead-inner, main { width: min(76rem, 100%); margin-inline: auto; padding-inline: var(--space-8); }
.masthead-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.identity { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 600; text-decoration: none; }
.identity span { padding-left: var(--space-3); border-left: 1px solid var(--edge); }
.identity img { width: 5.625rem; height: auto; }
.appearance { display: flex; gap: var(--space-half); border-radius: var(--r-chip); padding: var(--space-1); background: var(--panel); }
.appearance[hidden] { display: none; }
.appearance button { border: 0; border-radius: var(--r-control); padding: var(--space-1) var(--space-3); background: transparent; color: var(--ink-2); font: 600 .875rem/1.45 var(--font-sans); cursor: pointer; }
.appearance button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: var(--raised); }
.home, .reference { padding-block: clamp(2.5rem, 7vw, 6rem); }
h1 { font-size: clamp(2.75rem, 6vw, 4.5rem); line-height: 1.04; letter-spacing: -.055em; }
.intro { color: var(--ink-2); margin-top: var(--space-4); font-size: clamp(1.05rem, 2vw, 1.35rem); }
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); margin-top: var(--space-12); }
.preview { height: clamp(8rem, 13vw, 11rem); display: flex; align-items: center; justify-content: center; background: var(--panel); border-radius: var(--r-panel); }
.preview > i { width: 2.65rem; height: 3rem; }
.preview > i:first-child { border-radius: var(--r-chip) 0 0 var(--r-chip); }
.preview > i:last-child { border-radius: 0 var(--r-chip) var(--r-chip) 0; }
.sample-sheet { background: var(--sheet); box-shadow: inset 0 0 0 1px var(--line); }
.sample-ink { background: var(--ink); } .sample-blue { background: var(--blue); } .sample-teal { background: var(--teal); }
.stack { width: 7rem; height: 5rem; position: relative; }
.stack i { position: absolute; inset: .1rem .75rem .45rem; border: 1px solid var(--edge); border-radius: var(--r-chip); background: var(--behind-2); }
.stack i:nth-child(2) { inset: .5rem .4rem .1rem; background: var(--behind-1); }
.stack i:nth-child(3) { inset: .95rem 0 -.3rem; background: var(--sheet); box-shadow: var(--raised); }
.topic h2 { font-size: 1.5rem; letter-spacing: -.035em; margin: var(--space-5) 0 var(--space-2); }
.topic h2 a, .section-nav a { text-decoration: none; }
.topic h2 a:hover, .section-nav a:hover { text-decoration: underline; }
.topic ul, .section-nav ul { list-style: none; padding: 0; }
.topic li { padding-block: var(--space-1); }
.topic li a, .section-nav li a { color: var(--ink-2); }
.topic li a:hover, .section-nav li a:hover { color: var(--focus-ring); }
.reference { display: grid; grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr); gap: var(--space-12); }
.section-nav { align-self: start; position: sticky; top: 6rem; display: grid; gap: var(--space-5); font-size: .9375rem; }
.section-nav .category { font-weight: 650; }
.section-nav [aria-current] { color: var(--focus-ring); }
.section-nav ul { display: grid; gap: var(--space-2); margin: var(--space-3) 0 0 var(--space-1); padding-left: var(--space-3); border-left: 1px solid var(--edge); }
.reference article { min-width: 0; }
.reference h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
article section { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--line); }
article h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: -.035em; line-height: 1.1; margin-bottom: var(--space-6); }
article h3 { font-size: 1.2rem; }
.note, figcaption, .comps small, .principles, .timing small { color: var(--ink-2); }
.note { margin-top: var(--space-4); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
th:first-child { padding-left: 0; }
th small, .scale dt span { display: block; font-size: .875rem; font-weight: 400; color: var(--ink-2); }
.tokens th:first-child { width: 47%; }
.swatch { display: inline-block; vertical-align: middle; width: 1.4rem; height: 1.4rem; margin-right: var(--space-2); border: 1px solid var(--edge); border-radius: var(--r-control); background: var(--paint); }
.scale > div { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(0, 2fr); gap: var(--space-6); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); align-items: center; }
.scale dd { overflow-wrap: anywhere; }
.comps, .depth { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.comps > div, .stage, .specimen { padding: var(--space-4); background: var(--panel); border-radius: var(--r-panel); }
.comps h3 { font-size: 1rem; margin-bottom: var(--space-4); }
.comps small { display: block; margin-top: var(--space-3); }
.btn, .field, kbd, .seg span, .tile, .row { border-radius: var(--r-control); }
.btn { display: inline-flex; margin: 0 var(--space-1) var(--space-2) 0; padding: var(--space-2) var(--space-3); background: var(--ink); color: var(--on-ink); font-size: .875rem; font-weight: 600; }
.btn.s, .btn.d { color: var(--ink); background: var(--sheet); box-shadow: var(--raised); }
.btn.d { color: var(--danger); }
.field { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); margin-bottom: var(--space-2); min-height: 2.5rem; background: var(--sheet); color: var(--ink-2); border: 1px solid var(--edge); font-size: .875rem; }
.field.focus { outline: 2px solid var(--focus-ring); box-shadow: 0 0 0 4px var(--focus-halo); }
.field kbd { margin-left: auto; background: var(--panel); white-space: nowrap; padding: 0 var(--space-1); }
.caret { height: 1.1em; width: 2px; background: var(--focus-ring); }
.todo { display: grid; gap: var(--space-2); }
.todo p, .tiles { display: flex; align-items: center; gap: var(--space-2); }
.todo .done { text-decoration: line-through; color: var(--ink-2); }
.check { flex: none; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1px solid var(--ink-3); display: grid; place-items: center; }
.done .check { background: var(--teal); border-color: var(--teal); }
.check svg { width: .75rem; fill: none; stroke: var(--on-teal); stroke-width: 2.5; }
.statuses, .tiles, .seg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.statuses { margin-top: var(--space-4); }
.st, .tile, .row, .seg span { padding: var(--space-1) var(--space-2); font-size: .875rem; }
.st { border: 1px solid var(--edge); border-radius: var(--r-chip); background: var(--sheet); }
.st.making { background: var(--blue-tint); color: var(--blue); } .st.done { background: var(--teal-tint); color: var(--teal-text); }
.tile, .seg { background: var(--sheet); box-shadow: var(--raised); }
.tile.sel { outline: 2px solid var(--focus-ring); }
.rows { display: grid; } .row.on, .seg .on { background: var(--blue-tint); color: var(--blue); font-weight: 600; }
.seg { width: fit-content; padding: var(--space-1); border-radius: var(--r-chip); }
.split { display: grid; gap: var(--space-6); }
.split .todo { max-width: 22rem; margin-top: var(--space-4); }
.data { font-size: .875rem; }
.principles { display: grid; gap: var(--space-2); padding-left: var(--space-5); margin-top: var(--space-4); }
.principles b, figcaption b { color: var(--ink); }
.stage, .specimen { display: grid; place-items: center; min-height: 8rem; }
.stage span { width: 65%; height: 4rem; background: var(--sheet); border-radius: var(--r-card); }
.raised { box-shadow: var(--raised); } .float { box-shadow: var(--float); }
figcaption { margin-top: var(--space-3); font-size: .9375rem; } figcaption b { display: block; }
.nest { position: relative; width: min(18rem, 100%); height: 9.5rem; }
.nest > span { position: absolute; border-radius: var(--r-card); border: 1px solid var(--edge); }
.nest .b2 { inset: 0 1rem 2rem; background: var(--behind-2); }
.nest .b1 { inset: .5rem .5rem 1rem; background: var(--behind-1); }
.nest .front { inset: 1.2rem 0 0; padding: var(--space-4); background: var(--sheet); box-shadow: var(--float); }
.nest small { display: block; color: var(--ink-2); }
.timing > div { display: grid; grid-template-columns: 4rem 4rem 1fr minmax(7rem, 1fr); align-items: center; gap: var(--space-4); padding-block: var(--space-2); }
.timing i { display: block; height: var(--space-2); background: var(--ink-3); border-radius: var(--r-control); }
@media (max-width: 64rem) {
  .comps { grid-template-columns: 1fr; }
}
@media (max-width: 44rem) {
  .masthead-inner, main { padding-inline: var(--space-4); }
  .masthead-inner { min-height: 3.5rem; gap: var(--space-2); }
  .identity { gap: var(--space-2); font-size: .875rem; }
  .identity img { width: 4.25rem; }
  .identity span { padding-left: var(--space-2); }
  .appearance button { padding: var(--space-1) var(--space-2); }
  .topics, .reference, .depth, .scale > div { grid-template-columns: 1fr; }
  .topics { gap: var(--space-10); margin-top: var(--space-8); }
  .home, .reference { padding-block: var(--space-8); }
  .preview { height: 7rem; }
  .reference { gap: var(--space-8); }
  .section-nav { position: static; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
  .section-nav ul { display: none; }
  .scale > div { gap: var(--space-2); }
  .swatch { display: block; margin: 0 0 var(--space-1); }
  .tokens, .data { font-size: .875rem; }
  th, td { padding-inline: var(--space-1); }
  .timing > div { grid-template-columns: 3.5rem 3.5rem 1fr; gap: var(--space-2); }
  .timing small { grid-column: 2 / -1; }
}
@media print {
  .appearance, .section-nav, .skip { display: none; }
  .masthead { position: static; }
  .reference { display: block; }
  .swatch, .preview, .stage, .specimen { print-color-adjust: exact; }
  tr, figure, .comps > div { break-inside: avoid; }
}
