/* Wet Palette. A tiny watercolour studio: unbleached rag paper, one black pen line that wobbles,
   a wordmark that is still wet, and the pigments as the only colour. Everything that frames a
   control is drawn in the same ink as the drawings. */

@font-face {
  font-family: "Shantell Sans";
  src: url("fonts/shantell-sans-full.woff2") format("woff2-variations"), url("fonts/shantell-sans-full.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nothing You Could Do";
  src: url("fonts/nothing-you-could-do.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/fragment-mono.woff2") format("woff2");
  font-display: swap;
}

:root {
  --paper: #f3f0e8;      /* the bare sheet, as the paper model reflects it (set again from JS) */
  --paper-2: #ebe6da;    /* the same paper in shade, for wells and slips */
  --paper-3: #e0d9ca;
  --ink: #171513;        /* the pen */
  --ink-2: #4a4540;
  --ink-3: #6b645c;
  --wash: rgb(247 214 62 / 45%); /* a stroke of hansa yellow, for selection */
  --pigment: #0b5f88;    /* the brush's current pigment, set from JS */
  --hand: "Shantell Sans", "Comic Neue", "Segoe Print", system-ui, sans-serif;
  --script: "Nothing You Could Do", "Segoe Print", "Bradley Hand", cursive;
  --mono: "Fragment Mono", ui-monospace, monospace;
  --pad: clamp(1rem, 2.6vw, 2.5rem);
  --tray: 7.6rem;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --plain: "INFM" 0, "BNCE" 0, "SPAC" 0;
  --loose: "INFM" 60, "BNCE" 30, "SPAC" 0;
  --wild: "INFM" 100, "BNCE" 60, "SPAC" 0;
  color-scheme: light;
  scrollbar-color: var(--ink) var(--paper-2);
}

* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 400 1.0625rem/1.55 var(--hand);
  font-variation-settings: var(--plain);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--wash); color: var(--ink); }
::-webkit-scrollbar { width: 12px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--paper-2); border-radius: 8px 5px 9px 6px; }
:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 10px 7px 11px 8px; }
a { color: inherit; text-underline-offset: 0.24em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
code, pre, kbd { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; }

.col { padding-inline: var(--pad); max-width: 84rem; margin-inline: auto; width: 100%; }

/* The inked frame. Any element with .inked (or one of the controls below) gets a border drawn by a
   pen: a plain CSS border, nudged by noise. On hover it boils, three drawings of the same line. */
.inked, .tool, .pair, .meet-card, .rail, .ramp, .loupe, .fail {
  position: relative;
  isolation: isolate;
}
.inked::before, .tool::before, .pair::before, .rail::before, .ramp::before, .loupe::before, .fail::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 2px solid var(--ink);
  border-radius: 16px 11px 18px 10px / 11px 17px 10px 15px;
  background: var(--fill, transparent);
  filter: url(#ink-0);
  pointer-events: none;
  transition: background-color 180ms var(--ease);
}
@keyframes boil { 0% { filter: url(#ink-0); } 33% { filter: url(#ink-1); } 66% { filter: url(#ink-2); } }

/* The sheet ------------------------------------------------------------------------------ */
.sheet { height: 100vh; height: 100svh; min-height: 36rem; display: flex; flex-direction: column; background: var(--paper); }
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--paper) center / cover no-repeat; }
.stage.is-still { background-image: url("still.jpg"); }
#paper { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: none; outline: none; transition: opacity 260ms var(--ease); }
#paper:focus-visible { box-shadow: inset 0 0 0 2.5px var(--ink), inset 0 0 0 6px var(--paper); }
.stage.is-picking #paper { cursor: crosshair; }
.stage.is-turning #paper { opacity: 0; transition-duration: 160ms; }

/* Printed in ink on the sheet, so it multiplies into the paper. */
.masthead { position: absolute; top: clamp(0.8rem, 2.2vw, 1.8rem); left: var(--pad); width: min(23rem, 34vw); pointer-events: none; mix-blend-mode: multiply; z-index: 2; }
.mark { margin: 0 0 0 -0.35rem; color: var(--ink); line-height: 0; }
.mark .wordmark { width: clamp(13rem, 21vw, 21rem); height: auto; display: block; overflow: visible; }
.wordmark .drip path, .wordmark .drip circle { transform-box: fill-box; }
.wordmark .drip { transform-origin: 50% 0; animation: drip 2.6s var(--ease) both; animation-delay: calc(0.5s + var(--k) * 0.35s); }
@keyframes drip { from { transform: scaleY(0.15); } }
.script { margin: -0.5rem 0 0 0.4rem; font: 400 clamp(1.15rem, 1.5vw, 1.45rem)/1.1 var(--script); rotate: -3deg; transform-origin: 0 50%; }
.thesis { margin: 0.9rem 0 0; font: 450 1rem/1.4 var(--hand); font-variation-settings: var(--plain); max-width: 20rem; text-wrap: pretty; color: var(--ink); }
.post-link { pointer-events: auto; display: inline-flex; align-items: center; gap: 0.6rem; margin-top: 0.9rem; padding: 0.35rem 0.1rem; text-decoration: none; font: 650 1rem/1.2 var(--hand); font-variation-settings: var(--loose); mix-blend-mode: normal; }
.post-link svg { width: 2.2rem; height: auto; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: rotate 380ms var(--spring), translate 380ms var(--spring); }
.post-link span { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 6' preserveAspectRatio='none'%3E%3Cpath d='M1 3.6C20 2 38 4.6 60 3.2S100 2.4 119 3.8' fill='none' stroke='%23171513' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 0 100% / 100% 0.4rem no-repeat; padding-bottom: 0.3rem; }
.post-link:hover svg { rotate: -8deg; translate: 0 -2px; }
.post-link:hover span { background-size: 100% 0.5rem; }

/* The drawings, as slips of paper you can pick up. */
.drawings { position: absolute; top: clamp(0.8rem, 2.2vw, 1.8rem); right: var(--pad); z-index: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.drawings-label { margin: 0 0.6rem 0 0; font: 400 1.25rem/1 var(--script); rotate: -2deg; }
.drawings-row { display: flex; gap: 0.2rem; }
.dw { position: relative; display: grid; justify-items: center; gap: 0.1rem; width: 4.6rem; padding: 0.35rem 0.2rem 0.3rem; cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.dw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.dw .thumb { width: 3.6rem; height: 2.9rem; overflow: visible; transition: transform 420ms var(--spring); }
.dw .thumb path { fill: none; stroke: var(--ink); stroke-width: 1.6px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.dw .blank { fill: none; stroke: var(--ink-3); stroke-width: 1.4px; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.dw span { font: 520 0.75rem/1 var(--hand); color: var(--ink-2); transition: color 200ms; }
.dw .loop { position: absolute; inset: -0.1rem -0.15rem 0.95rem; width: calc(100% + 0.3rem); height: calc(100% - 0.85rem); overflow: visible; pointer-events: none; }
.dw .loop path { fill: none; stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 520ms var(--ease); }
.dw:hover .thumb { transform: rotate(-5deg) translateY(-2px) scale(1.05); }
.dw:has(input:checked) .loop path { stroke-dashoffset: 0; }
.dw:has(input:checked) span { color: var(--ink); font-weight: 700; }
.dw:has(input:focus-visible) { outline: 2.5px solid var(--ink); outline-offset: 0; }
.dw:active .thumb { transform: scale(0.94); transition-duration: 90ms; }

/* Where they meet: a note card laid on the sheet. */
.meet { position: absolute; left: var(--pad); bottom: 1.2rem; width: min(20rem, 26vw); z-index: 2; rotate: -0.8deg; filter: drop-shadow(0 10px 18px rgb(60 45 25 / 16%)) drop-shadow(0 1px 1px rgb(60 45 25 / 12%)); animation: lay-down 650ms var(--spring) both; }
@keyframes lay-down { from { opacity: 0; transform: translateY(14px) rotate(-2deg); } }
.meet-card { --fill: var(--paper); padding: 0.85rem 1rem 0.9rem; }
.meet-card::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 2px solid var(--ink); border-radius: 16px 11px 18px 10px / 11px 17px 10px 15px; background: var(--paper); filter: url(#ink-1); }
.meet-head { font: 400 1.3rem/1 var(--script); rotate: -2deg; margin-bottom: 0.15rem; }
.meet-pair { margin: 0.2rem 0 0.6rem; font: 800 1.35rem/1.05 var(--hand); font-variation-settings: var(--wild); }
.meet-pair small { display: block; margin-top: 0.25rem; font: 450 0.75rem/1.3 var(--hand); font-variation-settings: var(--plain); color: var(--ink-2); }
.meet-rows { margin: 0; display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 0.5rem; }
.meet-rows div { display: grid; align-content: start; }
.meet-rows dd { margin: 0; }
.meet-rows .chip-face { order: 1; height: 4.4rem; border-radius: 46% 54% 43% 57% / 52% 44% 56% 48%; filter: url(#ink-2); }
.meet-rows .is-paint .chip-face { border-radius: 38% 62% 47% 53% / 55% 41% 59% 45%; }
.meet-rows dt { order: 2; margin-top: 0.4rem; font: 750 0.8125rem/1 var(--hand); font-variation-settings: var(--loose); }
.meet-rows .hex { order: 3; margin-top: 0.2rem; font: 0.6875rem/1.2 var(--mono); }
.meet-rows .off { order: 4; margin-top: 0.12rem; font: 0.6875rem/1.2 var(--mono); color: var(--ink-2); }
.meet-more, .rail-more { display: inline-block; margin-top: 0.7rem; font: 650 0.875rem/1 var(--hand); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.25em; }

/* Your drydown: picked colours as little swatches with a note. */
.rail { position: absolute; right: var(--pad); bottom: 1.2rem; width: 15rem; max-height: min(40%, 21rem); overflow: auto; padding: 0.7rem 0.8rem 0.7rem; z-index: 2; --fill: var(--paper); filter: drop-shadow(0 10px 18px rgb(60 45 25 / 14%)); scrollbar-width: thin; rotate: 0.6deg; }
.rail h2 { font: 400 1.25rem/1 var(--script); rotate: -2deg; padding-bottom: 0.3rem; }
.rail ul { list-style: none; margin: 0; padding: 0; }
.rail li { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 0.6rem; align-items: center; padding: 0.35rem 0; animation: lay-down 450ms var(--spring) both; }
.chip { height: 2.4rem; position: relative; overflow: hidden; border-radius: 48% 52% 41% 59% / 55% 45% 55% 45%; }
.chip.is-wet::after { content: ""; position: absolute; inset: 0; background: linear-gradient(118deg, rgb(255 255 255 / 0%) 30%, rgb(255 255 255 / 42%) 48%, rgb(255 255 255 / 0%) 62%); background-size: 260% 100%; animation: sheen 2.4s linear infinite; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -60% 0; } }
.rail-name { font: 0.75rem/1.25 var(--mono); overflow-wrap: anywhere; }
.rail-name small { display: block; margin-top: 0.15rem; font: 400 0.95rem/1 var(--script); color: var(--ink-2); }
.rail-x { width: 2rem; height: 2rem; display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-3); border-radius: 50%; }
.rail-x:hover { background: var(--paper-2); color: var(--ink); }
.rail-x svg { width: 0.8rem; height: 0.8rem; }

.hint { position: absolute; left: 50%; bottom: 1.1rem; translate: -50% 0; margin: 0; display: flex; align-items: center; gap: 0.5rem; font: 400 1.3rem/1.1 var(--script); pointer-events: none; white-space: nowrap; mix-blend-mode: multiply; animation: fade-up 700ms var(--ease) both; z-index: 1; }
.hint svg { width: 2.4rem; height: 1.6rem; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
@keyframes fade-up { from { opacity: 0; translate: -50% 8px; } }
.brush { position: absolute; top: 0; left: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; opacity: 0; pointer-events: none; transition: opacity 200ms; z-index: 2; }
.brush svg { width: 100%; height: 100%; overflow: visible; }
.brush path { fill: none; stroke: var(--ink); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.brush::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--brush, var(--ink)); }
.brush.is-on { opacity: 0.9; }
.loupe { position: absolute; top: 0; left: 0; display: flex; align-items: center; gap: 0.55rem; padding: 0.35rem 0.7rem 0.35rem 0.35rem; --fill: var(--paper); font: 0.75rem/1 var(--mono); pointer-events: none; white-space: nowrap; z-index: 3; }
.loupe-chip { width: 2rem; height: 2rem; border-radius: 46% 54% 43% 57% / 52% 44% 56% 48%; }

.fail { position: absolute; left: var(--pad); bottom: 1.25rem; max-width: 27rem; margin: 0; padding: 1rem 1.1rem 1.05rem; --fill: var(--paper); font-size: 0.9375rem; line-height: 1.45; z-index: 3; }
.fail b { display: block; font: 800 1.5rem/1.05 var(--hand); font-variation-settings: var(--wild); margin-bottom: 0.45rem; }
.fail p { margin: 0; color: var(--ink-2); }

/* The paint box: wells along the bottom of the sheet. */
.tray { position: relative; flex: none; height: var(--tray); background: var(--paper); display: flex; align-items: center; padding-inline: calc(var(--pad) - 0.4rem) var(--pad); padding-bottom: env(safe-area-inset-bottom); gap: 1rem; z-index: 1; }
.tray::before { content: ""; position: absolute; left: var(--pad); right: var(--pad); top: 0; height: 0; border-top: 2px solid var(--ink); filter: url(#ink-0); pointer-events: none; }
.pans { flex: 1; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; align-items: center; touch-action: pan-x pan-y; padding-block: 0.6rem 0.4rem; }
.pans::-webkit-scrollbar { display: none; }
.pan { position: relative; flex: 1 1 0; min-width: 5.2rem; padding: 0.45rem 0.3rem 0.35rem; cursor: pointer; display: grid; justify-items: center; gap: 0.15rem; -webkit-tap-highlight-color: transparent; }
.pan input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pan canvas { display: block; width: 3rem; height: 3rem; transition: transform 420ms var(--spring); }
.pan-name { font: 560 0.78rem/1.1 var(--hand); color: var(--ink-2); text-align: center; white-space: nowrap; transition: color 200ms; }
.pan-code { font: 0.625rem/1 var(--mono); color: var(--ink-3); }
.pan-code sub { font-size: 0.85em; vertical-align: -0.1em; line-height: 0; }
.pan .well { position: absolute; top: 0.05rem; left: 50%; width: 3.9rem; height: 3.9rem; margin-left: -1.95rem; overflow: visible; pointer-events: none; }
.pan .well path { fill: none; stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 480ms var(--ease); }
.pan:has(input:checked) .well path { stroke-dashoffset: 0; }
.pan:has(input:checked) .pan-name { color: var(--ink); font-weight: 750; }
.pan:hover canvas { transform: scale(1.08) rotate(-6deg); }
.pan:active canvas { transform: scale(0.92); transition-duration: 90ms; }
.pan:has(input:focus-visible) { outline: 2.5px solid var(--ink); outline-offset: -2px; border-radius: 14px; }

.tools { flex: none; display: flex; align-items: center; gap: 0.5rem; }
.modes { display: flex; gap: 0.1rem; padding-right: 0.6rem; margin-right: 0.2rem; position: relative; }
.modes::after { content: ""; position: absolute; right: 0; top: 0.5rem; bottom: 0.5rem; border-right: 2px solid var(--ink); filter: url(#ink-1); }
.mode { position: relative; display: grid; justify-items: center; gap: 0.1rem; width: 3.6rem; padding: 0.35rem 0 0.3rem; cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.mode input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.mode svg { width: 2rem; height: 2rem; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 380ms var(--spring); }
.mode svg .fill { fill: var(--ink); }
.mode span { font: 560 0.78rem/1 var(--hand); color: var(--ink-2); }
.mode::before { content: ""; position: absolute; inset: 0.1rem 0.15rem; border-radius: 48% 52% 45% 55% / 52% 46% 54% 48%; background: var(--paper-2); opacity: 0; scale: 0.7; transition: opacity 200ms, scale 380ms var(--spring); z-index: -1; }
.mode:has(input:checked)::before { opacity: 1; scale: 1; }
.mode:has(input:checked) span { color: var(--ink); font-weight: 750; }
.mode:hover svg { transform: rotate(-8deg) scale(1.08); }
.mode:has(input:focus-visible) { outline: 2.5px solid var(--ink); outline-offset: -1px; }

.tool { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.9rem; padding: 0 1rem 0 0.8rem; background: none; border: 0; font: 650 0.9375rem/1 var(--hand); font-variation-settings: var(--loose); color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform 200ms var(--spring); }
.tool svg { width: 1.45rem; height: 1.45rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { --fill: var(--paper-2); }
.tool:hover::before { animation: boil 480ms steps(1) infinite; }
.tool:active { transform: translateY(1px) scale(0.97); }
.tool:disabled, .pan:has(input:disabled), .mode:has(input:disabled) { opacity: 0.38; cursor: not-allowed; }
.tool:disabled:hover::before { animation: none; }
.tool[aria-pressed="true"], .tool.solid { --fill: var(--ink); color: var(--paper); }
.tool.solid:hover { --fill: #2d2925; }

/* The three mixes ---------------------------------------------------------------------- */
.mix { padding-block: clamp(4.5rem, 9vw, 8rem) clamp(3.5rem, 6vw, 5rem); position: relative; }
.mix::before, .dry::before { content: ""; position: absolute; left: var(--pad); right: var(--pad); top: 0; border-top: 2px solid var(--ink); filter: url(#ink-2); }
.dry { position: relative; }
.mix h2, .dry h2, .how h2 { font: 800 clamp(2.6rem, 6.4vw, 5.4rem)/0.95 var(--hand); font-variation-settings: var(--wild); letter-spacing: -0.02em; }
.mix-head h2 { max-width: 13ch; }
.lede { max-width: 60ch; margin: 1.3rem 0 0; font-size: clamp(1.0625rem, 1.4vw, 1.2rem); line-height: 1.55; text-wrap: pretty; }
.pairs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.pair { min-height: 2.9rem; padding: 0 1.05rem 0 0.8rem; border: 0; background: none; font: 560 0.9375rem/1 var(--hand); cursor: pointer; display: inline-flex; align-items: center; gap: 0.55rem; transition: transform 200ms var(--spring); }
.pair::before { border-width: 1.6px; border-color: var(--ink-3); }
.pair:hover::before { border-color: var(--ink); animation: boil 480ms steps(1) infinite; }
.pair:active { transform: scale(0.97); }
.pair[aria-pressed="true"] { color: var(--paper); }
.pair[aria-pressed="true"]::before { background: var(--ink); border-color: var(--ink); }
.pair i { width: 1.05rem; height: 1.05rem; border-radius: 46% 54% 43% 57% / 52% 44% 56% 48%; margin-right: -0.85rem; box-shadow: 0 0 0 2px var(--paper); }
.pair[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--ink); }
.pair i + i { margin-right: 0.1rem; }

.bands { position: relative; margin-top: 1.75rem; display: grid; grid-template-columns: 15rem 1fr; row-gap: 0.6rem; touch-action: pan-y; }
.band { display: contents; }
.band-label { position: relative; z-index: 1; pointer-events: none; padding: 0.4rem 1rem 0.4rem 0; display: flex; flex-direction: column; gap: 0.25rem; justify-content: center; }
.band-label b { font: 800 1.75rem/0.95 var(--hand); font-variation-settings: var(--wild); }
.band-label span { font-size: 0.875rem; line-height: 1.35; color: var(--ink-2); }
.band-label i { font: normal 0.8125rem/1.2 var(--mono); }
.is-paint .band-label b::after { content: "  the paper\2019s answer"; font: 400 1.05rem/1 var(--script); font-variation-settings: normal; color: var(--ink-2); vertical-align: middle; }
.band-fill { height: clamp(6rem, 13vh, 8.5rem); grid-column: 2; border-radius: 22px 14px 26px 12px / 14px 24px 12px 22px; filter: url(#ink-1); }
.band-label { grid-column: 1; height: clamp(6rem, 13vh, 8.5rem); }
#ratio { position: absolute; top: 0; bottom: 1.9rem; left: 15rem; right: 0; width: auto; height: auto; margin: 0; appearance: none; -webkit-appearance: none; background: none; cursor: ew-resize; grid-column: 2; }
#ratio::-webkit-slider-runnable-track { height: 100%; background: none; }
#ratio::-moz-range-track { height: 100%; background: none; }
#ratio::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: var(--thumb, 20rem); background: var(--ink); border-radius: 3px; box-shadow: 0 0 0 2px var(--paper); }
#ratio::-moz-range-thumb { width: 4px; height: var(--thumb, 20rem); border: 0; border-radius: 3px; background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
#ratio:focus-visible { outline-offset: 2px; }
.scale { grid-column: 2; display: flex; justify-content: space-between; padding-top: 0.2rem; font: 560 0.8125rem/1 var(--hand); color: var(--ink-2); }

.why { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); margin-top: clamp(3.5rem, 7vw, 6rem); align-items: start; }
.why h3 { font: 800 clamp(1.9rem, 3.2vw, 2.7rem)/1 var(--hand); font-variation-settings: var(--wild); letter-spacing: -0.015em; }
.why p { margin: 1rem 0 0; max-width: 62ch; }
.fine { font-size: 0.875rem; color: var(--ink-2); }
.chart { position: relative; margin: 0; padding: 0.9rem 0.9rem 0.6rem; }
.chart::before { content: ""; position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 18px 12px 20px 11px / 12px 19px 11px 17px; filter: url(#ink-0); pointer-events: none; }
#chart-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
#chart-svg text { font: 11px var(--mono); fill: var(--ink-2); }
#chart-svg .label { font: 700 13px var(--hand); fill: var(--ink); }
.chart figcaption { font-size: 0.8125rem; color: var(--ink-2); margin-top: 0.5rem; }
.chart-tip { position: absolute; top: 0; left: 0; padding: 0.45rem 0.6rem; background: var(--ink); color: var(--paper); font: 0.6875rem/1.5 var(--mono); pointer-events: none; white-space: nowrap; border-radius: 10px 7px 11px 8px; }

/* Tokens ------------------------------------------------------------------------------- */
.dry { padding-block: clamp(4.5rem, 8vw, 7rem); }
.source { font-size: 0.9375rem; color: var(--ink-2); max-width: 62ch; margin: 0.9rem 0 0; }
#ramps { margin-top: 2.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
.ramp { padding: 1rem 1.1rem 0.9rem; }
.ramp h3 { font: 800 1.6rem/1 var(--hand); font-variation-settings: var(--wild); display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: baseline; }
.ramp h3 code { font: 400 0.8125rem/1.3 var(--mono); color: var(--ink-2); }
.ramp-note { font: 400 1.1rem/1.2 var(--script); margin: 0.4rem 0 0; }
.steps { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(6.5rem, 1fr); gap: 6px; overflow-x: auto; padding-bottom: 0.3rem; scrollbar-width: thin; }
.step-face { height: 6.2rem; padding: 0.5rem 0.55rem; display: flex; flex-direction: column; justify-content: space-between; font: 0.75rem/1.2 var(--mono); border-radius: 18px 12px 20px 10px / 12px 19px 10px 17px; }
.step-face b { font: 800 1.35rem/0.9 var(--hand); }
.step-meta { display: grid; gap: 0.12rem; padding: 0.45rem 0.15rem 0; font: 0.6875rem/1.35 var(--mono); color: var(--ink-2); }
.step-meta span { display: flex; justify-content: space-between; gap: 0.5rem; white-space: nowrap; }
.step-meta em { font-style: normal; color: var(--ink); }
.step-meta em.is-fail { color: #9c1c22; text-decoration: line-through; text-decoration-thickness: 1px; }
.step.is-missing .step-face { background: repeating-linear-gradient(135deg, transparent 0 7px, rgb(23 21 19 / 9%) 7px 8px); box-shadow: inset 0 0 0 1.5px var(--ink-3); color: var(--ink-3); position: relative; }
.step.is-missing .step-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1px), var(--ink-3) calc(50% - 1px), var(--ink-3) calc(50% + 1px), transparent calc(50% + 1px)); }
.step.is-missing .step-meta { color: var(--ink-3); }

.export { margin-top: 3.5rem; }
.export-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 0.75rem 2rem; padding-bottom: 0.7rem; }
.export-head h3 { font: 800 clamp(2rem, 3.6vw, 3rem)/1 var(--hand); font-variation-settings: var(--wild); }
.export-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.copied { font: 400 1.1rem/1 var(--script); color: var(--ink-2); min-width: 4rem; }
pre { margin: 1.1rem 0 0; padding: 1.1rem 1.25rem; max-height: 26rem; overflow: auto; background: var(--ink); color: #ece7dc; font: 0.8125rem/1.6 var(--mono); tab-size: 2; scrollbar-color: var(--ink-3) var(--ink); border-radius: 18px 12px 20px 11px / 12px 19px 11px 17px; }
pre::selection, pre *::selection { background: rgb(247 214 62 / 55%); color: var(--ink); }

/* The workings: the ink bottle ------------------------------------------------------------ */
.how { background: var(--ink); color: #ece7dc; padding-block: clamp(4.5rem, 8vw, 7rem); --ink-2: #b7afa3; --focus: #ece7dc; }
.how :focus-visible { outline-color: #ece7dc; }
.how ::selection { background: rgb(247 214 62 / 55%); color: var(--ink); }
.how-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2.5rem clamp(1.5rem, 3vw, 3rem); }
.how-grid > h2 { grid-column: 1 / -1; max-width: 14ch; }
.how-list { grid-column: 1 / 8; margin: 0; padding: 0; list-style: none; display: grid; gap: 1.1rem; max-width: 62ch; }
.how-list b { font-weight: 800; font-variation-settings: var(--loose); color: #fff; margin-right: 0.25rem; }
.how-live { grid-column: 8 / -1; margin: 0; display: grid; gap: 0.7rem; align-content: start; font: 0.875rem/1.4 var(--mono); }
.how-live div { border-top: 1.5px solid #4a4540; padding-top: 0.5rem; display: flex; justify-content: space-between; gap: 1rem; }
.how-live dt { font: 600 0.8125rem/1.4 var(--hand); color: var(--ink-2); }
.how-live dd { margin: 0; text-align: right; }
.how-limits { grid-column: 1 / 8; }
.how-limits h3 { font: 800 1.9rem/1 var(--hand); font-variation-settings: var(--wild); }
.how-limits ul { margin: 0.9rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.45rem; max-width: 62ch; }
.how-limits li::marker { color: var(--ink-2); }
.credits { grid-column: 8 / -1; margin: 0; align-self: end; font-size: 0.875rem; color: var(--ink-2); }

@media (max-width: 1180px) {
  .drawings-row { flex-wrap: wrap; justify-content: flex-end; max-width: 25rem; }
  .dw { width: 4.1rem; }
  .meet { width: 18rem; }
  .pan { min-width: 4.6rem; }
}

@media (max-width: 860px) {
  :root { --tray: auto; }
  .masthead { width: calc(100% - 2 * var(--pad)); }
  .mark .wordmark { width: 10.5rem; }
  .script { font-size: 1rem; margin-top: -0.35rem; }
  .thesis, .post-link span { display: none; }
  .post-link { position: absolute; top: 0; right: 0; margin: 0; padding: 0.4rem; }
  .post-link svg { width: 2rem; }
  .drawings { top: auto; bottom: 0.4rem; left: 0; right: 0; align-items: stretch; }
  .drawings-label { display: none; }
  .drawings-row { max-width: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0.2rem var(--pad) 0.1rem; gap: 0; justify-content: flex-start; }
  .drawings-row::-webkit-scrollbar { display: none; }
  .dw { width: 3.9rem; flex: none; }
  .dw .thumb { width: 3rem; height: 2.4rem; }
  .tray { flex-direction: column; height: auto; gap: 0; padding-inline: 0; align-items: stretch; }
  .pans { flex: none; padding-inline: 0.4rem; padding-block: 0.5rem 0.1rem; }
  .pan { flex: 0 0 auto; min-width: 0; width: 4.4rem; }
  .pan canvas { width: 2.6rem; height: 2.6rem; }
  .pan .well { width: 3.4rem; height: 3.4rem; margin-left: -1.7rem; }
  .pan-code { display: none; }
  .pan-name { font-size: 0.72rem; }
  .tools { justify-content: space-between; padding: 0.1rem 0.6rem 0.6rem; gap: 0.25rem; }
  .modes { padding-right: 0.3rem; }
  .mode { width: 3.1rem; }
  .tool { padding: 0 0.7rem 0 0.6rem; font-size: 0.875rem; min-height: 2.75rem; }
  .tool span { white-space: nowrap; }
  .tool .long { display: none; }
  .modes::after { display: none; }
  .meet { left: 0.75rem; right: 0.75rem; bottom: 5.6rem; width: auto; rotate: 0deg; }
  .meet-card { padding: 0.6rem 0.75rem 0.65rem; }
  .meet-head, .meet-more, .meet-pair small, .meet-rows .off { display: none; }
  .meet-pair { font-size: 1.1rem; margin: 0 0 0.4rem; }
  .meet-rows .chip-face { height: 2rem; }
  .meet-rows { gap: 0.4rem; }
  .rail { top: 4.6rem; bottom: auto; left: auto; right: 0.75rem; width: auto; max-width: calc(100% - 1.5rem); padding: 0.4rem; max-height: none; overflow: visible; rotate: 0deg; }
  .rail h2, .rail-name, .rail-more { display: none; }
  .rail ul { display: flex; gap: 0.35rem; }
  .rail li { display: block; position: relative; padding: 0; }
  .rail .chip { width: 2.4rem; height: 2.4rem; }
  .rail-x { position: absolute; top: -0.55rem; right: -0.55rem; width: 1.5rem; height: 1.5rem; background: var(--ink); color: var(--paper); }
  .rail-x:hover { background: var(--ink); color: var(--paper); }
  .rail-x svg { width: 0.55rem; height: 0.55rem; }
  .rail-x::before { content: ""; position: absolute; inset: -0.6rem; }
  .hint { bottom: 5.6rem; font-size: 1.15rem; }
  .why { grid-template-columns: 1fr; }
  .how-list, .how-live, .how-limits, .credits { grid-column: 1 / -1; }
  .bands { grid-template-columns: 1fr; row-gap: 0.2rem; }
  .band-label { grid-column: 1; height: auto; padding: 0.7rem 0 0.3rem; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 0.2rem 0.6rem; }
  .band-label b { font-size: 1.4rem; }
  .band-label span { display: none; }
  .is-paint .band-label b::after { content: none; }
  .band-fill { grid-column: 1; height: 4.5rem; }
  #ratio { left: 0; grid-column: 1; }
  .scale { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .band-fill, .step-face, .chip, .chip-face, .pan canvas, .loupe-chip { forced-color-adjust: none; }
}
