/* Pixel Icons: a wall of words, each beside its pixel icon. Only the icons and their words carry colour. */
@font-face { font-family: "Allo"; src: url("fonts/allo-friendly.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --sunken: #f3f3f3;
  --border: #e6e6e6;
  --text: #161616;
  --muted: #6b6b6b;
  --dark: #161616;
  --ok: #1f7a35;
  --alert: #c4162f;
  --font: "Allo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.05), 0 32px 80px -24px rgba(0, 0, 0, 0.28);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  background-color: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: #b5b5b5; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
code { font-family: var(--mono); font-size: 0.92em; }
kbd {
  font: 500 11px/1 var(--font); padding: 3px 5px; border-radius: 5px;
  background: var(--sunken); border: 1px solid var(--border); color: var(--muted);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; cursor: pointer; text-decoration: none;
  font: 500 14px/1.2 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--sunken); }
.btn.dark { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.btn.dark:hover { background: #333; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 0; background: transparent; cursor: pointer;
  font: 500 16px var(--font); color: var(--muted);
}
.icon-btn:hover { background: var(--sunken); color: var(--text); }
.copy {
  flex: none; border: 0; background: transparent; cursor: pointer; border-radius: 7px;
  padding: 5px 9px; font: 500 12px var(--font); color: var(--muted);
}
.copy:hover { background: var(--sunken); color: var(--text); }
.field {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font: 14px var(--mono); color: var(--text);
}
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* ---------- sheets (dialogs) ---------- */
.sheet {
  padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
}
.sheet::backdrop { background: rgba(30, 30, 30, 0.2); backdrop-filter: blur(2px); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; }
.sheet-head h2 { font-size: 17px; flex: 1; }
dialog.sheet:focus-visible { outline: none; }

/* no match in the library: offer to draw the word */
.lib-empty { padding: 48px 24px; text-align: center; }
.lib-empty p:first-child { font-size: 16px; margin: 0 0 16px; }

/* icon detail */
.detail { width: min(460px, calc(100vw - 24px)); }
.dt-stage { margin: 0 16px; height: 210px; border-radius: 16px; border: 1px solid var(--border); display: grid; place-items: center; background-color: #fff; background-image: radial-gradient(circle, #d9dbe1 0.6px, transparent 0.9px); background-size: 12px 12px; background-position: center; } /* white with a light dotted grid */
.px-grid svg { display: block; image-rendering: pixelated; }
.dt-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px 0; }
.dt-label { width: 72px; flex: none; font-size: 13px; color: var(--muted); }
/* size slider in the icon window: a dark filled track up to the thumb, the value beside it */
.size-slider { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.size-slider input { flex: 1; min-width: 0; height: 20px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.size-slider input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--dark) var(--fill, 42.9%), var(--border) var(--fill, 42.9%)); }
.size-slider input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--border); }
.size-slider input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--dark); }
.size-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.size-slider input::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
.size-slider input:focus-visible { outline: none; }
.size-slider input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(17,17,17,0.15); }
.size-slider output { min-width: 48px; text-align: right; font: 500 13px/1 var(--font); color: var(--text); font-variant-numeric: tabular-nums; }
/* format picker: one segmented row; then Copy and Download side by side; then the code */
.fmt-seg { display: flex; gap: 2px; margin: 16px 16px 0; padding: 3px; border-radius: 12px; background: var(--sunken); }
.fmt-seg button { flex: 1; padding: 8px 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font: 500 13px/1 var(--font); color: var(--muted); }
.fmt-seg button:hover { color: var(--text); }
.fmt-seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 1px var(--border); }
.fmt-seg button:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.dt-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 16px 0; }
.dt-main .btn { justify-content: center; padding: 10px 14px; font-size: 14px; }
.dt-code { margin: 12px 16px 16px; padding: 12px 14px; max-height: 150px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); font-size: 12px; line-height: 1.55; }
.detail:has(.dt-code[hidden]) .dt-main { margin-bottom: 16px; } /* PNG has no code preview, so the buttons close the window */
.link-btn { border: 0; background: none; padding: 6px 8px; border-radius: 8px; font: 500 14px var(--font); color: var(--soft); cursor: pointer; }
.link-btn:hover { color: var(--text); background: var(--sunken); }

/* editor */
.editor-sheet { width: min(1040px, calc(100vw - 24px)); }
.editor-sheet[open] { display: flex; flex-direction: column; }
.ed-docs { display: flex; gap: 4px; }
.ed-docs button {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font: 500 13px var(--font); color: var(--muted);
}
.ed-docs button[aria-current="true"] { background: var(--dark); border-color: var(--dark); color: var(--on-dark); }
.editor {
  overflow-y: auto; padding: 4px 18px 20px;
  display: grid; grid-template-columns: auto minmax(0, 480px) minmax(240px, 1fr); gap: 24px; align-items: start;
}
/* tools: a column of pixel-icon buttons, grouped */
.ed-tools { display: flex; flex-direction: column; gap: 10px; }
.ed-group { display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--border); }
.ed-tools button {
  width: 46px; height: 46px; display: grid; place-items: center; padding: 0;
  border-radius: 9px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted);
}
.ed-tools button svg { width: 32px; height: 32px; }
.ed-tools button:hover { background: var(--surface); color: var(--text); }
.ed-tools button[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
.ed-main { min-width: 0; display: flex; flex-direction: column; align-items: center; }
#ed-canvas {
  display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 1;
  image-rendering: pixelated; touch-action: none; cursor: crosshair;
  border-radius: 6px; border: 2px solid var(--text);
}
#ed-canvas[data-tool="fill"], #ed-canvas[data-tool="pick"] { cursor: cell; }
.ed-tip { margin: 8px 0 12px; font-size: 13px; color: var(--muted); text-align: center; }
/* colours under the grid; the selected one has a ring */
.ed-colours { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 480px; }
.ed-side { display: flex; flex-direction: column; gap: 20px; }
.ed-h { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: 8px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--border); }
.seg button {
  padding: 6px 11px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; background: transparent;
  font: 500 13px var(--font); color: var(--muted);
}
.seg button[aria-checked="true"] { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 1 auto; min-width: 0; }
.swatch {
  width: 28px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.add-colour-wrap { display: inline-flex; }
.add-colour:hover { border-color: var(--text); color: var(--text); }
.add-colour {
  flex: none; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; cursor: pointer;
  border-radius: 8px; border: 1px dashed #b5b5b5; background: transparent; color: var(--muted); font: 18px/1 var(--font);
}
.ed-colours { position: relative; }
.hex-pop {
  position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 3; width: 272px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.hex-title { margin: 0 0 8px; font-size: 13px; font-weight: 500; }
.hex-row { display: flex; gap: 8px; align-items: center; }
.hex-row input[type="color"] { flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: none; cursor: pointer; }
.hex-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.hex-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.hex-row .field { font-size: 15px; text-transform: uppercase; }
.hex-row .field { min-width: 0; flex: 1; }
.hex-row input[type="color"]:hover { box-shadow: 0 0 0 3px var(--sunken); border-color: var(--text); }
.hex-pick { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.hex-err { margin: 6px 0 0; font-size: 12px; color: var(--alert); }
.hex-err:empty { display: none; }
.hex-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.checks { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.checks li { position: relative; padding-left: 16px; margin-bottom: 6px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 2px; }
.checks .ok { color: var(--ok); }
.checks .ok::before { background: var(--ok); }
.checks .err { color: var(--alert); }
.checks .err::before { background: var(--alert); }
.checks .warn { color: var(--muted); }
.checks .warn::before { background: #a3a3a3; }
.ed-preview { display: flex; align-items: flex-end; gap: 14px; }
.ed-preview figure { margin: 0; text-align: center; color: var(--muted); font: 500 12px var(--font); }
.ed-preview svg { display: block; image-rendering: pixelated; margin: 0 auto 4px; }
#ed-name { margin-bottom: 10px; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 920px) {
  .editor { grid-template-columns: auto minmax(0, 480px); justify-content: center; }
  .ed-side { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .editor { grid-template-columns: 1fr; padding: 4px 14px 18px; gap: 14px; }
  .ed-tools { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .ed-group { flex-direction: row; }
  .ed-tools button { width: 42px; height: 42px; }
  .editor-sheet .sheet-head h2 { flex: 0 1 auto; }
  .ed-docs { flex: 1; }
}

/* paste */
.paste { width: min(560px, calc(100vw - 24px)); }
.paste form { padding: 0 18px 18px; }
.paste .sheet-head { padding-left: 0; padding-right: 0; }
.paste .hint { display: block; margin: 0 0 8px; }
.paste textarea { font-size: 12.5px; resize: vertical; }
.paste-error { color: var(--alert); font-size: 13px; min-height: 1.4em; margin: 8px 0; }
.paste-error:empty { min-height: 0; margin: 0; }

/* make an icon */
.make { width: min(460px, calc(100vw - 24px)); }
.mk-form, .mk-status, .make .paste-error, .mk-result { margin-left: 18px; margin-right: 18px; }
.mk-form { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; }
.mk-field { display: flex; flex-direction: column; gap: 6px; }
.mk-field > label:first-child { font-size: 13px; font-weight: 500; }
.mk-field .hint { margin: 2px 0 0; }
.mk-field select.field, #mk-word { font-family: var(--font); font-size: 15px; }
.mk-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mk-check input { margin: 0; accent-color: var(--dark); }
.mk-status { display: flex; align-items: center; gap: 10px; padding: 14px 0 18px; font-size: 14px; }
.mk-status #mk-step { flex: 1; }
.mk-dots { display: inline-flex; gap: 3px; }
.mk-dots i { width: 6px; height: 6px; background: var(--text); animation: mk-blink 0.9s steps(1) infinite; }
.mk-dots i:nth-child(2) { animation-delay: 0.3s; }
.mk-dots i:nth-child(3) { animation-delay: 0.6s; }
@keyframes mk-blink { 50% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) { .mk-dots i { animation: none; } }
.mk-result { padding-bottom: 18px; }
.mk-result .dt-stage { margin: 0 0 12px; }
.mk-idea { margin: 0 0 4px; font-size: 14px; }
.mk-note { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.mk-note:empty { display: none; }
.lib-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 50; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  padding: 9px 14px; border-radius: 10px; background: var(--dark); color: var(--on-dark); font: 500 14px var(--font); box-shadow: var(--shadow);
  transition: opacity 0.15s, transform 0.15s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- page ---------- */
:root { --gutter: clamp(16px, 2.8vw, 40px); --line: #e6e6e6; --line-strong: #cfcfcf; --soft: #6f6f6f; --faint: #9a9a9a; --on-dark: #fff; --glass: rgba(255, 255, 255, 0.92); }
.brand { white-space: nowrap; }
/* still mode: the marquees stop */
:root.still .marquee-track { animation-play-state: paused !important; }
.wrap, .top { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.top { padding-top: clamp(20px, 2.8vw, 40px); padding-bottom: clamp(8px, 1vw, 16px); display: grid; --tag-fs: clamp(18px, 1.75vw, 26px); grid-template-columns: auto minmax(0, calc(var(--tag-fs) * 24)); justify-content: space-between; align-items: center; column-gap: 24px; }
/* two blocks, centred against each other: the logo with the byline under it, and the two-line pitch */
.brand-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2.5px; } /* +0.5px to track the tagline's extra line height */
.brand { justify-self: start; }
.by { justify-self: start; }
/* the one-line pitch sits top right, opposite the name */
.tagline { margin: 0; text-align: right; font-size: var(--tag-fs); line-height: calc(var(--tag-fs) * 1.3 + 0.5px); font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
.tagline span { display: block; }
.tagline .t2 { font-weight: 400; color: var(--faint); }
.tagline { transition: opacity 0.2s ease; }
.tagline.off { opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0s 0.2s; }
/* a soft fade when the pitch changes with the view */
.tagline .swap { animation: tag-in 0.35s ease both; }
.tagline .t2.swap { animation-delay: 0.05s; }
@keyframes tag-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .tagline .swap { animation: none; } }
.brand { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.brand-logo { display: block; width: 120.33px; height: 38px; image-rendering: pixelated; }
/* hover: colour fills the black-and-white logo pixel by pixel, bottom row first, with a little random
   stagger, like bits loading in; on leave the pixels switch off from the top. Each pixel snaps (no fade). */
.brand-logo-wrap { position: relative; display: block; width: 120.33px; height: 38px; }
.brand-fill { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; shape-rendering: crispEdges; }
.brand-fill rect { fill: var(--logo-fill, #ffe580); opacity: 0; transition: opacity 0s linear var(--dr, 0s); }
.brand:hover .brand-fill rect, .brand:focus-visible .brand-fill rect { opacity: 1; transition-delay: var(--d, 0s); }
@media (prefers-reduced-motion: reduce) { .brand-fill rect { transition-delay: 0s !important; } }
.muted { color: var(--soft); }
.label { font-size: clamp(24px, 2.3vw, 32px); font-weight: 600; letter-spacing: -0.02em; }
.solid, .ghost {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--text);
  font: 500 15px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.solid { background: var(--text); color: var(--on-dark); }
.solid:hover { background: #333; }
.ghost { background: transparent; color: var(--text); }
.ghost:hover { background: var(--sunken); }
.ghost kbd { background: transparent; border-color: #ccc; }
.plain { font-size: 15px; padding: 0 6px; }
.link { border: 0; padding: 0; background: none; font: inherit; color: var(--text); text-decoration: underline; text-decoration-color: #b5b5b5; text-underline-offset: 3px; cursor: pointer; }

/* the word wall */
.wall {
  padding: 0 var(--gutter);
  display: flex; flex-direction: column; gap: clamp(16px, 1.8vw, 28px);
  font-size: clamp(30px, min(5.3vw, 8.2vh), 82px); line-height: 1; letter-spacing: -0.025em;
}
.wall-row { display: flex; justify-content: space-between; align-items: center; gap: 0.3em; }
.w { display: inline-flex; align-items: center; gap: 0.34em; white-space: nowrap; }
.w svg, .w .ico { width: 0.93em; height: 0.93em; flex: none; image-rendering: pixelated; }
.w-btn { border: 0; padding: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; }
.w-btn .ico { transition: transform 0.15s ease; }
.w-btn:hover .ico { transform: scale(1.08) rotate(-4deg); }
.wall-type { gap: var(--pair-gap); margin: 0; justify-content: flex-start; }
.wall-type .slot { margin-left: calc(0.34em - var(--pair-gap)); }
/* the field stretches so it sits one word-gap from Coffee and its slot one word-gap from Book, like the other rows */
.wall-type .pill-in { flex: 1 1 0; min-width: 0; }
@media (max-width: 1200px) { .wall-type .trail { display: none; } }
/* marquee rows: bleed to the screen edges, fade out at both ends, pause on hover or focus */
.wall { --pair-gap: 0.62em; }
.wall-row.marquee {
  display: block; overflow: hidden; margin-inline: calc(-1 * var(--gutter));
  /* room above and below so a hovered (scaled, tilted) icon isn't clipped; the negative margin keeps row spacing */
  padding-block: 0.12em; margin-block: -0.12em;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.wall-row.marquee[data-row="1"] .marquee-track { animation-direction: reverse; animation-duration: 54s; }
.wall-row.marquee[data-row="2"] .marquee-track { animation-duration: 44s; }
.wall-row.marquee[data-row="3"] .marquee-track { animation-direction: reverse; animation-duration: 50s; }
.marquee-group { display: flex; align-items: center; gap: var(--pair-gap); padding-right: var(--pair-gap); }
.wall-row.marquee:hover .marquee-track, .wall-row.marquee:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.pill-in {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.2em; padding: 0.1em 0.25em 0.1em var(--pill-x); --pill-x: 0.48em;
  border: 2px solid var(--text); border-radius: 999px; background: var(--surface);
}
/* demo typing in the empty field: words typed and erased with a blinking caret */
.pill-in { position: relative; }
.type-demo {
  position: absolute; left: var(--pill-x); top: 0; bottom: 0; display: none; align-items: center; pointer-events: none;
  font: 300 0.8em/1.15 var(--font); letter-spacing: -0.025em; color: #9a9a9a; white-space: nowrap;
}
.pill-in.demo .type-demo { display: flex; }
.pill-in.demo input::placeholder { color: transparent; }
.type-demo .caret { display: inline-block; width: 2px; height: 0.95em; margin-left: 0.04em; background: var(--text); animation: caret 1s steps(1) infinite; }
.type-demo.busy .caret { animation: none; }
@keyframes caret { 50% { opacity: 0; } }
.pill-in:focus-within { box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.12); }
.pill-in input {
  width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0;
  font: 300 0.8em/1.15 var(--font); letter-spacing: -0.025em; color: var(--text); caret-color: var(--text);
}
.pill-in input::placeholder { color: #9a9a9a; }
/* CTAs that pop up inside the field once a word is typed */
.icon-only { padding: 0; width: 44px; height: 44px; justify-content: center; }
.pill-cta {
  flex: none; display: flex; align-items: center; gap: 8px; letter-spacing: normal;
  opacity: 0; transform: scale(0.85) translateX(8px); transform-origin: right center; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pill-in.has-word .pill-cta { opacity: 1; transform: none; pointer-events: auto; }
.pill-cta { font-size: clamp(14px, 0.24em, 20px); gap: 0.4em; }
.pill-cta .solid { font-size: 1em; padding: 0.7em 1.25em; }
.pill-cta .icon-only { font-size: 1em; width: 2.55em; height: 2.55em; }
.pill-cta .icon-only img { width: 1.15em; height: 1.15em; }
@media (prefers-reduced-motion: reduce) { .pill-cta { transition: opacity 0.18s ease; transform: none; } }
.slot {
  flex: none; width: 0.93em; height: 0.93em; padding: 0; display: grid; place-items: center;
  border: 2px dashed #c4c4c4; border-radius: 0.17em; background: transparent;
  font: inherit; color: #b0b0b0;
}
.slot .q { font-size: 0.41em; }
.slot.found { border: 0; cursor: pointer; }
.slot svg { width: 100%; height: 100%; image-rendering: pixelated; }
.slot { position: relative; }
.puff { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.puff { z-index: 1; }
.puff i { position: absolute; left: 0; top: 0; width: 0.09em; height: 0.09em; }
.puff .smoke { position: absolute; left: 0; top: 0; display: block; line-height: 0; }
.puff .smoke svg { display: block; image-rendering: pixelated; }
.under { margin-top: 56px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; }
/* same size and line height as the tagline, so their first lines sit level */
.brand { line-height: 1.1; }
/* plain text under the name, linking to Jahanvi on X; a grey pill shows on hover.
   The negative margin keeps the text in line with the name above. */
.by {
  display: inline-flex; align-items: center; padding: 4px 0;
  font: 400 17px/1.2 var(--font); color: var(--faint); text-decoration: none; white-space: nowrap;
  transition: color 0.15s ease;
}
/* no pill: on hover the text darkens, a dashed underline appears and the X logo slides in */
.by:hover, .by:focus-visible { color: var(--text); }
/* the X logo slides in on hover */
.by-x { width: 0; height: 14px; margin-left: 0; opacity: 0; flex: none; transition: width 0.18s ease, margin-left 0.18s ease, opacity 0.18s ease; }
.by:hover .by-x, .by:focus-visible .by-x { width: 14px; margin-left: 7px; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .by-x { transition: none; } }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; padding-top: 28px; padding-bottom: max(32px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.lede { margin: 0; font-size: 20px; color: var(--soft); text-wrap: balance; }
.lede a { color: var(--soft); }
.go { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* how it works */
/* About: the note, then the credits */

/* icon table */
.table { display: grid; grid-auto-flow: dense; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: 1fr; }
/* each tile draws its own grid lines (outside right and bottom, inside left and top),
   so the lines end where the tiles end, even when a search leaves only a few */
.table > * { box-shadow: 1px 0 0 0 var(--line), 0 1px 0 0 var(--line), 1px 1px 0 0 var(--line), inset 1px 0 0 0 var(--line), inset 0 1px 0 0 var(--line); }
.cell {
  aspect-ratio: 1; min-width: 0; border: 0;
  background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font: 12px var(--font); color: #8a8a8a; cursor: pointer; padding: 8px;
}
.cell .ico { width: 56px; height: 56px; image-rendering: pixelated; }
.cell:hover { background: var(--surface); color: var(--text); }

/* install rows */
.install .label { display: block; margin-bottom: 16px; }
.row { display: grid; grid-template-columns: 260px minmax(0, 1fr) auto; align-items: center; gap: 32px; padding: clamp(14px, 2.9vh, 30px) 0; border-top: 1px solid var(--line); }
.row.last { border-bottom: 1px solid var(--line); }
.who strong { display: block; font-size: 17px; font-weight: 600; }
.who small { display: block; font-size: 13px; color: #8a8a8a; margin-top: 4px; }
.who small .link { color: inherit; } .who small .link:hover { color: var(--text); }
.cmd { min-width: 0; white-space: normal; overflow-wrap: break-word; text-wrap: balance; font-size: clamp(22px, 3.05vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
/* Claude Code needs two commands in order: each gets its own line, number and Copy button */
.row.steps { row-gap: 14px; }
.row.steps .who { grid-row: span 2; }
.row.steps .cmd { font-size: clamp(20px, 2.3vw, 34px); }
.cmd .step { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: 0.45em; border-radius: 50%; background: #efefef; color: var(--soft); font-size: 0.5em; letter-spacing: 0; vertical-align: 0.35em; }
.cmd .sep { color: var(--soft); }
.install .hint { font-size: 14px; margin-top: 20px; }
main { padding-bottom: clamp(80px, 10vw, 140px); }

@media (prefers-reduced-motion: reduce) { .w-btn .ico { transition: none; } .w-btn:hover .ico { transform: none; } .marquee-track { animation: none; } }

/* ---------- tablets and phones ---------- */
@media (max-width: 1100px) {
  .table { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .row { grid-template-columns: 200px minmax(0, 1fr) auto; gap: 20px; }
}
@media (max-width: 720px) {
  .pill-search input { width: 110px; }
  .pill-dl .pl, .pill-act:not(.keep-label) .pl { display: none; }
  .brand { font-size: 14px; }
  .top { --tag-fs: 14px; grid-template-columns: auto minmax(0, calc(var(--tag-fs) * 15)); }
  .wall { gap: 18px; font-size: clamp(30px, 9vw, 44px); }
  .wall-row { flex-wrap: wrap; justify-content: flex-start; gap: 12px 0.6em; }
  .wall-row.marquee { flex-wrap: nowrap; }
  .marquee-track { animation-duration: 30s; }
  .wall-row.marquee[data-row="1"] .marquee-track { animation-duration: 34s; }
  .wall-row.marquee[data-row="2"] .marquee-track { animation-duration: 28s; }
  .wall-row.marquee[data-row="3"] .marquee-track { animation-duration: 32s; }
  .wall-type .lead, .wall-type .trail { display: none; }
  .wall-type .pill-in { flex: 1 1 0; padding-right: 0.14em; }
  .pill-cta { font-size: 14px; }
  .pill-cta .solid { padding: 0.55em 1em; }
  .pill-cta .icon-only { width: 2.3em; height: 2.3em; }
  .lede { font-size: 17px; }
  .table { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cell .ico { width: 44px; height: 44px; }
  .row { grid-template-columns: 1fr auto; gap: 10px 16px; padding: 22px 0; }
  .row .who { grid-column: 1 / -1; }
  .row.steps .who { grid-row: auto; }
  .cmd { white-space: normal; overflow-wrap: anywhere; font-size: 22px; }
}

/* ---------- one fold: header, a stage that shows one view, and the floating pills ---------- */
html, body { height: 100%; overscroll-behavior: none; }
body { min-height: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.top { flex: none; }
.stage { flex: 1; min-height: 0; position: relative; }
/* each view fills the stage, centres its content, and scrolls inside itself if it can't fit */
.view {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: none;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); outline: none;
}
.view-in { margin-block: auto; width: 100%; }
/* the wall sits close under the header rather than centred */
#view-home .view-in { margin-top: clamp(24px, 8vh, 96px); }
/* the library scrolls under the header, so it starts a little below it rather than centred */
#icons .view-in { margin-top: 0; } /* the top space lives inside the pinned chip row, so the row never travels */

.view:not([hidden]) .view-in { animation: view-in 0.28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
/* About: two independent columns: the note and credits on the left, the drawing grid and its pile on the right */
#how .view-in { display: grid; grid-template-columns: minmax(0, 64ch) minmax(0, 1fr); align-items: start; column-gap: clamp(32px, 5vw, 96px); }
#how .foot { margin-top: clamp(24px, 4vh, 48px); align-items: flex-end; }
.about-make { display: flex; flex-direction: column; align-items: center; } /* the drawing grid sits centred in the space beside the note */
.doodle { grid-area: doodle; }
.doodle { display: flex; flex-direction: column; align-items: center; gap: 16px; user-select: none; -webkit-user-select: none; } /* no stray text selection while drawing */
.doodle-row { display: flex; flex-direction: column; align-items: center; gap: 16px; }
#dd-cv { width: min(360px, 44vh, 100%); height: auto; aspect-ratio: 1; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); cursor: crosshair; touch-action: none; image-rendering: pixelated; }
.dd-sw { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dd-sw button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.dd-sw button[aria-checked="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.dd-sw .eraser { display: grid; place-items: center; background: var(--surface); color: var(--soft); }
.dd-sw .eraser:hover, .dd-sw .eraser[aria-checked="true"] { color: var(--text); }
.dd-acts { display: flex; gap: 8px; }
.dd-acts .solid, .dd-acts .ghost { padding: 10px 18px; font-size: 14px; }
.dd-acts .solid:disabled { opacity: 0.35; cursor: default; }
/* the pile: a layer under the drawing grid down to the bottom of the window (left, top and width set in JS) */
.pile { position: fixed; bottom: 0; z-index: 1; overflow: hidden; touch-action: none; pointer-events: none; }
.pile img { pointer-events: auto; }
.pile img { position: absolute; left: 0; top: 0; cursor: grab; user-select: none; -webkit-user-drag: none; will-change: transform; image-rendering: pixelated; }
.pile img.dragging { cursor: grabbing; }
.pile-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 13px; color: var(--faint); transition: opacity 0.3s ease; }
.pile.has-icons .pile-hint { opacity: 0; }
/* About: a short personal note in soft grey, names and links in full black, signed off */
.note { max-width: 64ch; margin: 0; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.6; color: var(--soft); text-wrap: pretty; }
.note p { margin: 0 0 1em; }
.note p:last-child { margin-bottom: 0; }
.note a { color: var(--text); text-decoration: none; }
.note a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #c4c4c4; }
.credits { margin: 0; display: grid; gap: 10px; font-size: 15px; line-height: 1.4; }
.credits > div { display: grid; grid-template-columns: 96px 1fr; gap: 16px; }
.credits dt { color: var(--faint); }
.credits dd { margin: 0; color: var(--text); }
.credits dd span { color: var(--faint); }
.credits a { color: var(--text); text-decoration: none; }
.credits a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #c4c4c4; }

/* the floating bar: one glass pill holding the section buttons and the motion switch */
.pills {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 2px; padding: 5px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(0, 0, 0, 0.22);
  view-transition-name: pills;
}
/* while views switch, the bar is drawn as its own layer: a blur there would fill the square box behind
   the rounded ends, so it goes solid until the switch is done */
html.switching .pills { -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff; }

.pills { --ease: cubic-bezier(0.32, 0.72, 0, 1); --dur: 0.42s; }
/* the dark highlight slides and stretches to whichever section is open */
.pill-ind {
  position: absolute; top: 5px; left: 0; height: 40px; width: 40px; border-radius: 999px; background: var(--text);
  opacity: 0; transform: translateX(0) scale(0.6); pointer-events: none;
  transition: transform var(--dur) var(--ease), width var(--dur) var(--ease), opacity 0.2s ease;
}
.pill-btn {
  position: relative; z-index: 1; height: 40px; padding: 0 16px; display: inline-grid; place-items: center; place-content: center; overflow: hidden;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 500 15px/1 var(--font); color: var(--text); white-space: nowrap;
  transition: width var(--dur) var(--ease), background 0.15s ease, color 0.25s ease;
}
.pill-btn > * { grid-area: 1 / 1; }
.pi { display: inline-flex; align-items: center; gap: 8px; transition: opacity 0.2s ease, transform var(--dur) var(--ease), filter 0.2s ease; }
.pi .ic { flex: none; }
.pill-btn .x { opacity: 0; transform: scale(0.4) rotate(-90deg); transition: opacity 0.2s ease, transform var(--dur) var(--ease); }
.pill-btn:not([aria-pressed="true"]):hover { background: var(--sunken); }
/* the open section's button shrinks into a round close button */
.pill-btn[aria-pressed="true"] { color: var(--on-dark); }
.pill-btn[aria-pressed="true"] .pi { opacity: 0; transform: scale(0.7); filter: blur(2px); }
.pill-btn[aria-pressed="true"] .x { opacity: 1; transform: none; transition-delay: 0.06s; }
.pill-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* the small switch at the end of the bar: stop the marquees */
.pills .sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
/* section tabs: words only, with a thin divider between them (Use Skill | Library | About).
   Each divider takes no room (it cancels the flex gap it adds) and draws its line in the gap.
   It fades and shrinks away when a tab beside it is hovered, and whenever a section is open. */
.pill-btn[data-view] .pi .ic { display: none; }
.tsep { position: relative; flex: none; align-self: stretch; width: 0; margin-left: -2px; pointer-events: none; }
.tsep::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 20px; margin-top: -10px;
  background: var(--line-strong); transition: opacity 0.2s ease, transform 0.3s var(--ease);
}
.pills:has(.pill-btn[data-view="install"]:hover) .tsep-a::before,
.pills:has(.pill-btn[data-view="icons"]:hover) .tsep::before,
.pills:has(.pill-btn[data-view="how"]:hover) .tsep-b::before,
.pills:has(.pill-btn[data-view][aria-pressed="true"]) .tsep::before { opacity: 0; transform: scaleY(0.2); }
/* the divider before the pause button takes no room either (1px line, margins cancel its width and the
   extra flex gap), so About → pause is spaced like the tabs */
.pills > .sep:not([data-for]) { margin: 0 -1.5px; }
/* the bar's own divider before the pause button fades the same way when About (or the button) is hovered */
.pills:has(.pill-btn[data-view="how"]:hover) > .sep:not([data-for]),
.pills:has(#tog-motion:hover) > .sep:not([data-for]) { background-color: transparent; }
/* hover tooltip over the Library pill: a white pixel speech bubble with a chunky black outline
   (heavier bottom-right) and a stepped tail in the middle pointing at the pill */
/* the tooltip lives in a box whose bottom edge is the bar's top edge; overflow clips it there, so it always
   rises out from behind the bar and sinks back (same in every browser, no clip-path needed) */
.lib-clip { position: absolute; bottom: 100%; left: 0; width: 220px; height: 64px; transform: translateX(-50%); overflow: hidden; pointer-events: none; z-index: 3; }
.lib-badge {
  --p: 2px; --ink: #161616;
  position: absolute; left: 50%; bottom: 12px;
  transform: translate(-50%, 64px); /* hidden: fully below the box, i.e. behind the bar */
  transition: transform 0.38s var(--ease);
  /* the outline follows the bubble + tail shape */
  --outline: drop-shadow(var(--p) 0 0 var(--ink)) drop-shadow(calc(var(--p) * -1) 0 0 var(--ink))
          drop-shadow(0 var(--p) 0 var(--ink)) drop-shadow(0 calc(var(--p) * -1) 0 var(--ink))
          drop-shadow(var(--p) var(--p) 0 var(--ink));
  filter: var(--outline);
}
.lib-badge .tip {
  display: block; padding: 6px 9px 5px; background: #fff; color: var(--ink);
  font: 600 13px/1 var(--font); white-space: nowrap;
  clip-path: polygon(0 var(--p), var(--p) var(--p), var(--p) 0, calc(100% - var(--p)) 0, calc(100% - var(--p)) var(--p), 100% var(--p),
    100% calc(100% - var(--p)), calc(100% - var(--p)) calc(100% - var(--p)), calc(100% - var(--p)) 100%, var(--p) 100%, var(--p) calc(100% - var(--p)), 0 calc(100% - var(--p)));
}
/* stepped tail: 3 pixels, then 2, then 1, hanging off the middle */
.lib-badge::after {
  content: ""; position: absolute; left: calc(50% - var(--p) * 1.5); top: calc(100% - 1px); width: calc(var(--p) * 3); height: calc(var(--p) * 3); background: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 33.34%, 66.67% 33.34%, 66.67% 66.67%, 33.34% 66.67%, 33.34% 100%, 0 100%);
}
.pill-btn[data-view="icons"]:not([aria-pressed="true"]):hover ~ .lib-clip .lib-badge { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .lib-badge { transition: none; } }
.pill-btn.tog { width: 40px; padding: 0; }
.pill-btn.tog svg { width: 18px; height: 18px; }
.pill-btn.tog .on { display: none; }
.pill-btn.tog[aria-pressed="true"] { color: var(--text); }
.pill-btn.tog:hover { background: var(--sunken); } /* grey hover whether the rows are moving or paused */
.pill-btn.tog[aria-pressed="true"] .on { display: block; }
.pill-btn.tog[aria-pressed="true"] .off { display: none; }
/* in the library the bar slims down to its close button and a search pill; the rest fold away */
.pill-search {
  position: relative; z-index: 1; height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px 0 14px; margin-left: 4px; overflow: hidden;
  border-radius: 999px; background: var(--sunken); color: var(--faint); cursor: text; white-space: nowrap;
  transition: width var(--dur) var(--ease), margin var(--dur) var(--ease), opacity 0.2s ease, box-shadow 0.15s ease;
}
.pill-search .ic { flex: none; }
.pill-search input {
  width: 150px; min-width: 0; border: 0; outline: none; background: transparent; padding: 0;
  font: 400 15px/1 var(--font); color: var(--text);
}
.pill-search input::placeholder { color: var(--faint); }
.pill-search input::-webkit-search-cancel-button { display: none; }
.pill-search:focus-within { box-shadow: inset 0 0 0 1px var(--line-strong); }
/* the library items sit a little apart, so each hover pill has room around it */
.pill-cat, .pill-act.first { margin-left: 4px; }
.pill-act { text-decoration: none; }
.pills .icon-pill { padding: 0 12px; } /* round, icon-only links */
.pill-act .stars { display: inline-flex; align-items: center; gap: 4px; margin-left: 2px; padding: 3px 8px; border-radius: 999px; background: var(--sunken); font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
.pill-act .stars svg { color: #e0a82e; }
.pill-dl { text-decoration: none; }
.pills .chev { flex: none; color: var(--faint); transition: transform 0.2s ease; }
.pills [aria-expanded="true"] .chev { transform: rotate(180deg); }
.pills .pill-btn[aria-expanded="true"] { background: var(--sunken); }
.bar-menu.end { transform-origin: bottom right; }
.bar-menu a { text-decoration: none; }
/* the category and download menus open upward from their pills */
.bar-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 2; min-width: 220px; padding: 5px;
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(0, 0, 0, 0.22);
  transform-origin: bottom left; animation: cat-in 0.18s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes cat-in { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.bar-menu [role^="menuitem"] {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 9px 12px; border: 0; border-radius: 11px;
  background: transparent; font: 500 14px/1.2 var(--font); color: var(--text); text-align: left; cursor: pointer;
}
.bar-menu [role^="menuitem"]:hover, .bar-menu [role^="menuitem"]:focus-visible { background: var(--sunken); outline: none; }
.bar-menu [aria-checked="true"], .bar-menu [aria-checked="true"]:hover, .bar-menu [aria-checked="true"]:focus-visible { background: var(--text); color: var(--on-dark); } /* the picked item stays dark, even on hover */
.bar-menu .n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bar-menu [aria-checked="true"] .n { color: rgba(255, 255, 255, 0.6); }
@media (prefers-reduced-motion: reduce) { .bar-menu { animation: none; } }
.pills .gone { width: 0 !important; padding: 0; margin-left: -2px; opacity: 0; pointer-events: none; }
/* everything in the bar folds and unfolds on one curve: width, padding and spacing together, so nothing jumps;
   items fade out quickly as they fold, and fade in a beat after they start to open */
.pills > .pill-btn, .pills > .pill-search, .pills > .sep {
  transition: width var(--dur) var(--ease), padding var(--dur) var(--ease), margin var(--dur) var(--ease),
    opacity 0.24s ease 0.08s, background-color 0.15s ease, color 0.25s ease, box-shadow 0.15s ease;
}
.pills > .gone { transition-delay: 0s; transition-duration: var(--dur), var(--dur), var(--dur), 0.12s, 0.15s, 0.25s, 0.15s; }
.pills .sep.gone { margin: 0 0 0 -2px; }

/* views morph into each other: the old one sinks and fades, the new one rises in */
::view-transition-group(stage) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1); }
::view-transition-old(stage) { animation: 0.2s ease-out both stage-out; }
::view-transition-new(stage) { animation: 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both stage-in; }
::view-transition-old(pills) { display: none; }
::view-transition-new(pills) { animation: none; }
::view-transition-group(pills) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
@keyframes stage-out { to { opacity: 0; transform: scale(0.985); } }
@keyframes stage-in { from { opacity: 0; transform: translateY(12px); } }
.stage { view-transition-name: stage; }
html.vt .view:not([hidden]) .view-in { animation: none; }
@media (prefers-reduced-motion: reduce) { .pill-ind, .pill-btn, .pi, .pill-btn .x { transition: none; } }
@media (prefers-reduced-motion: reduce) { .view:not([hidden]) .view-in { animation: none; } .pill-btn { transition: none; } }

@media (max-width: 720px) {
  #how .view-in { grid-template-columns: minmax(0, 1fr); row-gap: 40px; } /* About stacks: note and credits, then the drawing grid */
  .view { padding-top: 8px; }
  .pill-btn { padding: 0 13px; font-size: 14px; }
  .pi { gap: 6px; }
  .pills .sep { margin: 0 2px; }
}
@media (max-height: 560px) and (min-width: 721px) {
  .tagline { display: none; }
}

/* library: category chips across the top, pinned while the grid scrolls */
.cat-bar { position: sticky; top: 0; z-index: 2; padding: clamp(16px, 3vh, 32px) 0 16px; background: var(--bg); box-shadow: 1px 0 0 var(--bg); } /* also covers the grid's 1px outer line on the right */
/* a soft fade under the pinned row, shown only once the grid is scrolled (icons melt into it, like the hero marquees) */
.cat-bar::after {
  content: ""; position: absolute; left: 0; right: -1px; top: 100%; height: 48px; pointer-events: none;
  /* starts at the bar's own colour (no cut line at its edge), then eases out so it melts away with no band */
  background: linear-gradient(to bottom,
    rgba(250, 250, 250, 1) 0%, rgba(250, 250, 250, 0.9) 10%, rgba(250, 250, 250, 0.74) 22%, rgba(250, 250, 250, 0.55) 36%,
    rgba(250, 250, 250, 0.36) 52%, rgba(250, 250, 250, 0.19) 68%, rgba(250, 250, 250, 0.07) 84%, rgba(250, 250, 250, 0) 100%);
  opacity: 0; transition: opacity 0.35s ease;
}
.cat-bar.scrolled::after { opacity: 1; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer;
  font: 500 14px/1 var(--font); color: var(--text); white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip .n { color: var(--faint); font-variant-numeric: tabular-nums; transition: color 0.15s ease; }
.chip:hover { background: var(--sunken); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.chip[aria-pressed="true"] .n { color: rgba(255, 255, 255, 0.6); }
.chip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- loading state: the wordmark fills pixel by pixel, then glides into the header ---------- */
html.booting body > :not(.boot):not(script) { opacity: 0; }
html.boot-out body > :not(.boot):not(script) { transition: opacity 0.45s ease 0.1s; }
.boot { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; pointer-events: none; }
.boot-logo { position: relative; width: 192px; height: 60.63px; opacity: 0; animation: boot-in 0.2s ease 0.15s forwards; transform-origin: top left; }
.boot-logo img, .boot-fill { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; shape-rendering: crispEdges; }
.boot-fill rect { opacity: 0; animation: boot-px 0s linear forwards; }
@keyframes boot-in { to { opacity: 1; } }
@keyframes boot-px { to { opacity: 1; } }
html.boot-out .boot-logo { transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }
html.boot-out .boot-fill { opacity: 0; transition: opacity 0.35s ease 0.2s; }
