/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V5 */
/* Hallmark · genre: editorial · macrostructure: Ecosystem Index (20) · design-system: design.md
 * tone: technical-utilitarian · theme: custom "Instrument" · nav: N13 · footer: Ft4
 * stamp: designed-as-app · all pages share this layer (append-only to main.css)
 * contrast: pass (40–41) · honest: pass (46) · chrome: pass (47) · tokens: pass (48)
 * mobile: pass (34, 49, 50–57) · slop: pass (42–45) · icons: pass (30)
 *
 * Instrument panel layer. Overrides the retired playful/Hum visual language
 * in main.css without touching a single selector name the JS depends on.
 * Every colour and font below references a token from tokens.css.
 */

/* ======================================================================
   1 · BASE — register, not app
   ====================================================================== */

html { overflow-x: clip; }
body { overflow-x: clip; }

body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-style: normal;            /* roman headers only — gate 38a */
  letter-spacing: var(--tracking-display);
  line-height: 1.06;
  text-wrap: balance;
  overflow-wrap: anywhere;       /* gate 51 */
  min-width: 0;
  color: var(--color-ink);
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 0;
  /* no transition on the ring — it appears instantly (gate 15) */
}

.mono-label,
.sidegroup__label,
.railhead__note,
.page-head__eyebrow,
.tool-label,
.band-sort,
.band-head .count {
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-ink-soft);
  font-variant-numeric: tabular-nums;
}

.tabular-nums { font-variant-numeric: tabular-nums; }

/* ======================================================================
   2 · N13 — inline ⌘K search pill, squared, full-width register bar
   ====================================================================== */

.nav-pill {
  position: sticky;
  top: 0;
  left: auto;
  transform: none;
  z-index: var(--z-sticky-nav);
  display: flex;
  align-items: center;          /* gate 36 */
  gap: var(--space-md);
  width: 100%;
  max-width: none;
  min-height: var(--nav-h);
  margin: 0;
  padding: var(--space-xs) var(--gutter);
  background: var(--color-paper);
  border: 0;
  border-bottom: var(--rule-1);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-heading);
  letter-spacing: -0.01em;
  color: var(--color-ink);
  white-space: nowrap;
}

.brand__mark {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  color: var(--color-accent);
  animation: none;              /* kill the 4s infinite logo pulse */
  transform: none;
}
.brand:hover .brand__mark { animation: none; transform: none; }
.brand:hover { color: var(--color-ink); }

/* the search field itself becomes the inline ⌘K pill trigger */
.nav-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 460px;
  margin-inline-start: var(--space-md);
}
.nav-search .search { align-items: center; }
.nav-search .search input {
  width: 100%;
  min-height: 40px;
  padding: 0 calc(var(--space-xl) * 2) 0 var(--space-md);
  background: var(--color-paper-2);
  border: var(--rule-1);
  border-radius: 0;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 400;
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}
.nav-search .search input::placeholder { color: var(--color-ink-soft); opacity: 1; }
.nav-search .search input:hover { background: var(--color-paper-3); border-color: var(--color-ink-soft); }
.nav-search .search input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; background: var(--color-paper-2); }

/* the ⌘K hint sits inside the field, right-aligned — real kbd, real shortcut */
.search__glyph {
  right: var(--space-sm);
  color: var(--color-ink-soft);
  display: inline-flex;
  gap: var(--space-2xs);
}
.search__glyph .icon-search { display: none; }
.search__glyph::after {
  content: "⌘K";
  font-family: var(--font-label);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  border: var(--rule-1);
  padding: 2px 6px;
}

.menu-toggle {
  width: 40px;
  height: 40px;
  flex: none;
  border: var(--rule-1);
  border-radius: 0;
  background: var(--color-paper-2);
  color: var(--color-ink);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.menu-toggle:hover { background: var(--color-paper-3); }
.menu-toggle .icon-menu { width: 18px; height: 18px; }

/* N13 spotlight — grouped, keyboard-navigable results */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-short) var(--ease-out), visibility var(--dur-short) var(--ease-out);
}
.cmdk.is-open { opacity: 1; visibility: visible; }
.cmdk__backdrop { position: absolute; inset: 0; background: var(--color-scrim); }
.cmdk__panel {
  position: absolute;
  top: 12vh;
  left: 50%;
  width: min(600px, calc(100vw - 2 * var(--gutter)));
  background: var(--color-paper-2);
  border: var(--rule-1);
  border-radius: 0;
  box-shadow: var(--shadow-card);
  transform: translateX(-50%) translateY(-8px);
  transition: transform var(--dur-short) var(--ease-out);
}
.cmdk.is-open .cmdk__panel { transform: translateX(-50%) translateY(0); }
.cmdk__field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-bottom: var(--rule-1);
}
.cmdk__field input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--hit);
  background: transparent;
  border: 0;
  color: var(--color-ink);
  font: inherit;
  font-family: var(--font-body);
  font-size: var(--text-body);
}
.cmdk__field input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.cmdk__field kbd,
.cmdk__foot kbd {
  font-family: var(--font-label);
  font-size: var(--text-label);
  color: var(--color-ink-soft);
  border: var(--rule-1);
  padding: 2px 6px;
}
.cmdk__results { max-height: 52vh; overflow-y: auto; padding: var(--space-xs) 0; }
.cmdk__group {
  padding: var(--space-sm) var(--space-md) var(--space-2xs);
  font-family: var(--font-label);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-ink-soft);
}
.cmdk__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  min-height: var(--hit);
  padding: 0 var(--space-md);
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-body-sm);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.cmdk__item:hover { background: var(--color-paper-3); }
.cmdk__item.is-active {
  background: var(--color-paper-3);
  border-left-color: var(--color-accent);
  color: var(--color-ink);
}
.cmdk__item:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.cmdk__item small { margin-inline-start: auto; color: var(--color-ink-soft); font-family: var(--font-label); font-size: var(--text-label); }
.cmdk__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-top: var(--rule-1);
  color: var(--color-ink-soft);
  font-family: var(--font-label);
  font-size: var(--text-label);
}
body.cmdk-open { overflow: hidden; }

/* ======================================================================
   3 · SHELL — hairline rules, sticky pinned section heads
   ====================================================================== */

.shell {
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--space-xl) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
}

.sidebar { display: none; }
@media (min-width: 64rem) and (pointer: fine) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); align-items: start; }
  .sidebar {
    display: block;
    position: sticky;
    top: calc(var(--banner-height) + var(--space-lg));
    border-right: var(--rule-1);
    padding-inline-end: var(--space-md);
  }
  .menu-toggle { display: none; }
  .drawer, .drawer-scrim { display: none; }
}

.sidegroup { margin-block-end: var(--space-lg); }
.sidegroup__label { margin: 0 0 var(--space-xs); padding: 0; opacity: 1; }
.sidegroup a,
.sidegroup button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-sm);
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink-2);
  font: inherit;
  font-size: var(--text-body-sm);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.sidegroup a:hover, .sidegroup button:hover { background: var(--color-paper-2); color: var(--color-ink); transform: none; }
.sidegroup a svg { width: 16px; height: 16px; color: var(--color-ink-soft); }
.sidegroup a:hover svg { color: var(--color-ink-2); }
.sidegroup button[aria-pressed="true"],
.sidegroup a[aria-current="page"] {
  background: var(--color-paper-2);
  border-left-color: var(--color-accent);
  color: var(--color-ink);
  font-weight: 600;
}
.sidegroup a[aria-current="page"] svg { color: var(--color-accent); }

/* drawers become flat register panels */
.drawer-scrim { background: var(--color-scrim); z-index: var(--z-modal); }
.drawer {
  background: var(--color-paper-2);
  border-right: var(--rule-1);
  border-radius: 0;
  box-shadow: none;
  z-index: calc(var(--z-modal) + 1);
  transition: transform var(--dur-short) var(--ease-out);
}
.drawer__close { border: var(--rule-1); border-radius: 0; background: var(--color-paper-3); }
.drawer__close:hover { background: var(--color-paper-3); }

/* ======================================================================
   4 · HERO — instrument masthead, left-biased, real data only
   ====================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  margin: 0 0 var(--space-xl);
  padding: var(--space-md) 0 var(--space-xl);   /* bottom ≥ 1.3× top — gate 44 */
  border-bottom: var(--rule-1);
  align-items: start;
}
.hero__copy { min-width: 0; padding: 0; }
.hero__eyebrow { margin: 0 0 var(--space-sm); color: var(--color-accent); }
.hero__title {
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.25rem);
  line-height: 1.04;
  max-width: 20ch;
  margin: 0 0 var(--space-md);
  text-transform: none;
}
.hero__title .hl {
  font-style: normal;
  color: var(--color-accent);
  background: none;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.hero__sub { color: var(--color-ink-2); font-size: var(--text-body); max-width: 56ch; }
.hero__count { color: var(--color-ink-soft); font-size: var(--text-body-sm); margin-block-start: var(--space-md); font-family: var(--font-label); }
.count-big {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 1.2vw, 1.9rem);
  color: var(--color-ink);
  background: none;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; margin-block-start: var(--space-lg); }

/* status LED — functional: reports live backend state, no infinite pulse */
.status-led {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-label);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-ink-2);
}
.status-led::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--color-accent);
  border-radius: 0;
}
.status-led[data-state="offline"]::before { background: var(--color-ink-soft); }

/* the featured tile: a real catalog row, not a tilted card */
.hero__tile {
  max-width: none;
  margin: 0;
  transform: none;
  border-top: var(--rule-1);
  transition: none;
}
.hero__tile:hover { transform: none; }
@media (min-width: 56rem) {
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-xl); }
  .hero__tile { margin: 0; border-top: 0; border-left: var(--rule-1); padding-inline-start: var(--space-lg); }
}

/* stat strip — real numbers from the API, never invented */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  border-block: var(--rule-1);
  margin-block-end: var(--space-xl);
}
.stat-strip > div { padding: var(--space-md) var(--space-lg); border-right: var(--rule-1); min-width: 0; }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip b { display: block; font-family: var(--font-label); font-size: var(--text-xl); font-weight: 500; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.stat-strip span { font-family: var(--font-label); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink-soft); }

/* ======================================================================
   5 · CATEGORY INDEX — tabular rows, not pill chips
   ====================================================================== */

.rail--fallback { margin-block-end: var(--space-xl); }
.category-links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-top: var(--rule-1); }
.category-link {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--hit);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 0;
  border-bottom: var(--rule-1);
  border-radius: 0;
  color: var(--color-ink);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.category-link:hover { background: var(--color-paper-2); transform: none; border-color: var(--color-rule); }
.category-link strong { font-family: var(--font-display); font-size: var(--text-heading); font-weight: 700; }
.category-link span { color: var(--color-ink-2); font-size: var(--text-body-sm); }
.category-link::after { content: "→"; font-family: var(--font-label); color: var(--color-ink-soft); }
.category-link:hover::after { color: var(--color-accent); }
@media (max-width: 40rem) {
  .category-link { grid-template-columns: minmax(0, 1fr) auto; }
  .category-link span { grid-column: 1 / -1; }
}

/* chips / filters → square tabular tabs, one hover effect only */
.chips, .chip-row { gap: var(--space-2xs); margin-block-end: var(--space-md); }
.chip, .filter-btn, .seg__btn, .band-top {
  min-height: var(--hit);
  padding: 0 var(--space-md);
  border: var(--rule-1);
  border-radius: 0;
  background: var(--color-paper-2);
  color: var(--color-ink-2);
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.chip:hover, .filter-btn:hover, .band-top:hover { background: var(--color-paper-3); color: var(--color-ink); transform: none; }
.chip:active, .filter-btn:active { transform: none; }
.chip--on, .seg__btn[aria-checked="true"] {
  background: var(--color-paper-3);
  border-color: var(--color-accent);
  border-left: 2px solid var(--color-accent);
  color: var(--color-ink);
}
.chip--on:hover, .seg__btn[aria-checked="true"]:hover { background: var(--color-paper-3); color: var(--color-ink); }
.seg__btn:hover { border-color: var(--color-ink-soft); }
.filter-dot { fill: var(--color-accent); border-radius: 0; }
.filter-drawer { background: var(--color-paper-2); border-left: var(--rule-1); border-radius: 0; box-shadow: none; }
.filter-scrim { background: var(--color-scrim); }
.filter-drawer h2 { font-family: var(--font-display); }

/* switches → square checkbox register */
.switch__track { border-radius: 0; border: var(--rule-1); background: var(--color-paper-3); }
.switch__knob { border-radius: 0; box-shadow: none; background: var(--color-ink-2); }
.switch[aria-checked="true"] .switch__track { background: var(--color-accent); }

/* ======================================================================
   6 · CTA VOICE — outlined square slab + typographic link
   ====================================================================== */

.btn {
  --btn-face: transparent;
  --btn-ink: var(--color-ink);
  --btn-edge: var(--color-accent);
  --btn-cast: transparent;
  --btn-line: var(--color-accent);
  --btn-border: var(--color-accent);
  --btn-inner: transparent;
  display: inline-flex;
  align-items: center;           /* gate 36 */
  justify-content: center;
  gap: 0.5em;
  min-height: var(--hit);
  padding: 0 var(--space-lg);
  border: 1px solid var(--color-accent);
  border-radius: 0;
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--text-body-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;           /* gate 49 */
  cursor: pointer;
  position: relative;
  isolation: isolate;
  box-shadow: none;
  transform: none;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-paper-3); color: var(--color-ink); transform: none; box-shadow: none; }
.btn:active { background: var(--color-paper-2); transform: none; box-shadow: none; transition-duration: 70ms; }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }
.btn__arrow { transition: none; }
.btn:hover .btn__arrow { transform: none; }

/* primary CTA keeps the accent border; secondary is a typographic link */
.btn--outline { border-color: var(--color-rule); background: transparent; }
.btn--outline:hover { border-color: var(--color-ink-2); background: var(--color-paper-2); }
.btn--soft, .btn--ink, .btn--cyan, .btn--coral, .btn--download {
  --btn-face: transparent;
  --btn-ink: var(--color-ink);
  --btn-edge: var(--color-accent);
  --btn-cast: transparent;
  border-color: var(--color-rule);
  background: transparent;
  box-shadow: none;
}
.btn--soft:hover, .btn--ink:hover, .btn--cyan:hover, .btn--coral:hover, .btn--download:hover {
  background: var(--color-paper-2); border-color: var(--color-ink-2); box-shadow: none; transform: none;
}
.btn--download { min-height: var(--hit); padding: 0 var(--space-lg); font-size: var(--text-body-sm); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.btn--download .btn__arrow { width: 16px; height: 16px; transition: none; }
.btn--download:hover .btn__arrow { transform: none; }
.btn--sm { min-height: var(--hit); padding: 0 var(--space-md); font-size: var(--text-label); }
.btn--lg { min-height: var(--hit); padding: 0 var(--space-lg); font-size: var(--text-body-sm); }

/* loading / error / success — functional, silent, no celebration */
.btn.is-loading { color: transparent; overflow: hidden; }
.btn.is-loading::before { content: none; }        /* kill the sheen sweep */
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  background: none;
  border: 2px solid var(--color-rule);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
.btn.is-done { --btn-face: transparent; --btn-edge: var(--color-accent); --btn-ink: var(--color-ink); animation: none; }
.btn.is-error { --btn-face: transparent; --btn-edge: var(--color-bad); --btn-ink: var(--color-ink); border-color: var(--color-bad); }
.star-burst { display: none; }                    /* no celebratory burst */

/* typographic link CTA (C3) */
.railhead a, .link-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--hit);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-ink-2);
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-micro) var(--ease-out);
}
.railhead a:hover, .link-button:hover { color: var(--color-accent); background: transparent; }
.railhead a .icon-chev { width: 14px; height: 14px; }

/* progress meter — functional motion, single hue */
.dl-meter { height: 4px; border-radius: 0; background: var(--color-paper-3); overflow: hidden; }
.dl-meter__bar { width: 4%; border-radius: 0; background: var(--color-accent); transition: width 260ms var(--ease-out); }
.dl-meter--done .dl-meter__bar { background: var(--color-ok); }
.dl-meter--fail .dl-meter__bar { background: var(--color-bad); }

/* ======================================================================
   7 · CATALOG CARDS — tabular rows with hairline seams
   ====================================================================== */

.catalog-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), minmax(0, 1fr))); gap: var(--space-md); }

.card {
  border: var(--rule-1);
  border-radius: 0;
  background: var(--color-paper-2);
  box-shadow: none;
  overflow: hidden;
  color: var(--color-ink);
  animation: none;                                /* no staggered card-in */
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.card:hover { transform: none; box-shadow: none; background: var(--color-paper-3); border-color: var(--color-ink-soft); }
.card:hover .card__media img { transform: none; }
.card:active { transform: none; }
.card.no-key { --tint: var(--color-rule); background: var(--color-paper); filter: none; }
.card.no-key .card__media img { opacity: 0.35; filter: grayscale(1); }
.card.no-key .card__type,
.card.no-key .card__name,
.card.no-key .card__by,
.card.no-key .card__rating { color: var(--color-ink-soft); }
.card.no-key .card__type::before { background: var(--color-ink-soft); }
.card.no-key:hover { transform: none; box-shadow: none; background: var(--color-paper); }

.card__media { aspect-ratio: 16 / 9; background: var(--color-paper-3); }
.card__media img { transition: none; }
.card__price {
  right: var(--space-xs);
  bottom: var(--space-xs);
  background: var(--color-paper);
  border: var(--rule-1);
  border-radius: 0;
  color: var(--color-ink);
  font-family: var(--font-label);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: 2px var(--space-xs);
}
.card__price svg { fill: var(--color-accent); }
.fresh-tag { border-radius: 0; padding: 2px var(--space-xs); font-family: var(--font-label); letter-spacing: var(--tracking-label); }
.fresh-tag--new { background: var(--color-accent); color: var(--color-accent-ink); }
.fresh-tag--updated { background: var(--color-paper-3); color: var(--color-ink); border: var(--rule-1); }
.card__body { gap: var(--space-2xs); padding: var(--space-md); }
.card__type { font-family: var(--font-label); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink-soft); }
.card__type::before { width: 6px; height: 6px; border-radius: 0; background: var(--tint, var(--color-rule)); }
.card__name { font-family: var(--font-display); font-weight: 700; font-size: var(--text-heading); }
.card__by { color: var(--color-ink-2); }
.card__rating { color: var(--color-ink-soft); }
.card__rating .stars { color: var(--color-accent); }

/* skeleton — static, no infinite sweep */
.skel { pointer-events: none; }
.skel .card__media, .skel .card__name, .skel .card__by { border-radius: 0; background: var(--color-paper-3); color: transparent; }
.skel .card__media::after, .skel .card__name::after, .skel .card__by::after { content: none; animation: none; }

/* rails — S3 sticky pinned head, offset beneath the nav (gate 56) */
.rail { margin-block-end: var(--space-2xl); }
.railhead {
  position: sticky;
  top: var(--banner-height);
  z-index: var(--z-sticky);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
  margin: 0 0 var(--space-md);
  padding: var(--space-sm) 0;
  background: var(--color-paper);
  border-bottom: var(--rule-1);
}
.railhead__title { font-size: var(--text-xl); line-height: 1.1; }
.railhead__note { white-space: nowrap; }
.product-row {
  grid-auto-columns: minmax(0, 16rem);
  gap: var(--space-md);
  overflow-x: auto;
  padding-block-end: var(--space-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--color-rule) transparent;
}

/* ======================================================================
   8 · BANDS / PAGE HEADS — stacked heads, uneven rhythm
   ====================================================================== */

.page-head { margin: 0 0 var(--space-lg); padding-block-end: var(--space-md); border-bottom: var(--rule-1); }
.page-head h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem); line-height: 1.06; margin-block: var(--space-2xs); }
.page-head__sub { color: var(--color-ink-2); font-size: var(--text-body-sm); max-width: 65ch; }
.creator-search { max-width: 24rem; margin-block: var(--space-md); }

.band {
  border-block: var(--rule-1);
  padding-block: var(--space-lg) var(--space-2xl);   /* deliberately uneven */
  margin-block: var(--space-xl) var(--space-2xl);
  background: transparent;
}
.band--pear, .band--cyan { background: transparent; }
.band-flash { animation: none; }
.band-head h1, .band-head h2 { font-size: var(--text-xl); line-height: 1.1; }
.band-head .count { color: var(--color-ink-soft); }

.search-hero { gap: var(--space-2xs); margin-block-end: var(--space-md); }
.search-hero__box input,
.keys-check__field input,
input[type="search"], input[type="text"], input[type="url"], select, textarea {
  min-height: var(--hit);
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);            /* width never shifts — gate 39 */
  border-radius: 0;
  color: var(--color-ink);
  font: inherit;
  font-size: var(--text-body-sm);
  padding: 0 var(--space-md);
  outline: 2px solid transparent;                  /* reserve geometry */
  outline-offset: 1px;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
input:hover, select:hover, textarea:hover { border-color: var(--color-ink-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus); border-color: var(--color-rule); }
input::placeholder { color: var(--color-ink-soft); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.search input { background: var(--color-paper-2); border: var(--rule-1); border-radius: 0; }
.search input:hover { background: var(--color-paper-3); }
.search input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }

/* ======================================================================
   9 · DETAIL / WORKBENCH SURFACES
   ====================================================================== */

.product-intro { gap: var(--space-xl); margin-block-end: var(--space-xl); }
@media (min-width: 64rem) {
  .product-intro { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}
.product-intro h1 { font-size: clamp(1.85rem, 1.3rem + 1.9vw, 2.9rem); line-height: 1.06; }
.product-intro__by { color: var(--color-ink-2); }
.product-intro__by a { color: var(--color-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.product-intro__by a:hover { color: var(--color-ink); }
.tag { border: var(--rule-1); border-radius: 0; background: var(--color-paper-2); color: var(--color-ink-2); font-family: var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.gallery__panorama, .panorama-strip { border: var(--rule-1); border-radius: 0; background: var(--color-paper-3); box-shadow: none; }
.gallery__track { transition: transform var(--dur-long) var(--ease-out); }
.gallery__arrow {
  width: 40px; height: 40px;
  border: var(--rule-1);
  border-radius: 0;
  background: var(--color-paper-2);
  box-shadow: none;
  backdrop-filter: none;
  transform: translateY(-50%);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.gallery__arrow:hover { background: var(--color-paper-3); transform: translateY(-50%); }
.gallery__arrow:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.gallery__count { border: var(--rule-1); border-radius: 0; background: var(--color-paper-2); color: var(--color-ink); backdrop-filter: none; }
.panorama-strip::after { background: none; }
.panorama-strip figcaption { border: var(--rule-1); border-radius: 0; background: var(--color-paper-2); backdrop-filter: none; }

.callout, .callout--download {
  border: var(--rule-1);
  border-radius: 0;
  background: var(--color-paper-2);
  padding: var(--space-lg);
  overflow: visible;
}
.callout--download { grid-template-columns: minmax(0, 1fr); }
.callout--download::after { content: none; }        /* kill the radial mint bloom */
.callout__icon { width: 40px; height: 40px; border: var(--rule-1); border-radius: 0; background: var(--color-paper-3); color: var(--color-accent); box-shadow: none; }
.callout--download h2 { font-family: var(--font-display); font-size: var(--text-lg); }
.callout__sub, .callout__note { color: var(--color-ink-2); }
.callout--download .btn { grid-column: auto; justify-self: start; }

.specs { border-top: var(--rule-1); margin-block-start: 0; }
.specs div { padding-block: var(--space-sm); border-bottom: var(--rule-1); font-size: var(--text-body-sm); }
.specs dt { color: var(--color-ink-soft); font-family: var(--font-label); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; font-weight: 500; }
.specs dd { color: var(--color-ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.product-about__label { font-family: var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink-soft); opacity: 1; }
.rawtext { max-width: 65ch; color: var(--color-ink-2); }

.video__thumb { border: var(--rule-1); border-radius: 0; }
.video__thumb img { transition: none; }
.video:hover .video__thumb img { transform: none; }
.video:hover .video__title { color: var(--color-accent); }

.creator-card {
  align-items: flex-start;
  gap: var(--space-xs);
  border: var(--rule-1);
  border-radius: 0;
  background: var(--color-paper-2);
  box-shadow: none;
  animation: none;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.creator-card:hover { transform: none; box-shadow: none; background: var(--color-paper-3); }
.creator-card__avatar { width: 40px; height: 40px; border: var(--rule-1); border-radius: 0; background: var(--color-paper-3); color: var(--color-accent); }
.creator-card__name { font-family: var(--font-display); font-weight: 700; }
.creator-card__meta { font-family: var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink-soft); }

.empty { grid-column: 1 / -1; border: var(--rule-1); border-radius: 0; background: var(--color-paper-2); box-shadow: none; padding: var(--space-xl); }
.empty__title { font-family: var(--font-display); font-weight: 700; }
.panel__note { color: var(--color-ink-2); }

/* keys / workbench panels */
.keys-tabs { margin-block-end: var(--space-sm); }
.keys-tab__n { border-radius: 0; background: var(--color-paper-3); font-family: var(--font-label); }
.keys-recent__item + .keys-recent__item { border-top: var(--rule-1); }
.keys-recent__thumb { border: var(--rule-1); border-radius: 0; }
.keys-recent__item a:hover .keys-recent__title { color: var(--color-accent); }
.keys-recent__meta { color: var(--color-ink-soft); }
.keys-check__result--ok { color: var(--color-ok); }
.keys-check__result--no { color: var(--color-bad); }
.keys-recent__count { color: var(--color-accent); }

.uk {
  border: var(--rule-1);
  border-radius: 0;
  background: var(--color-paper-2);
  box-shadow: none;
  padding: var(--space-lg);
}
.uk::before { content: none; }                    /* kill the gradient top rule */
.uk__title { font-family: var(--font-display); }
.uk__state { border: var(--rule-1); border-radius: 0; color: var(--color-ink-2); font-family: var(--font-label); }
.uk__state[data-state="loaded"] { color: var(--color-ok); border-color: var(--color-accent); }
.uk__state[data-state="loading"] { color: var(--color-accent); }
.uk__state[data-state="error"] { color: var(--color-bad); border-color: var(--color-bad); }
.uk__stats > div { background: var(--color-paper); border: var(--rule-1); border-radius: 0; }
.uk__stats dt { font-family: var(--font-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink-soft); }
.uk__stats dd { font-family: var(--font-label); font-weight: 500; font-variant-numeric: tabular-nums; }
.uk__msg--ok { color: var(--color-ok); }
.uk__msg--err { color: var(--color-bad); }

/* toasts — silent, only for failures and invisible effects */
.toast-region { z-index: var(--z-toast); }
.toast {
  border: var(--rule-1);
  border-left: 2px solid var(--color-accent);
  border-radius: 0;
  background: var(--color-paper-2);
  color: var(--color-ink);
  box-shadow: none;
  animation: none;
  font-family: var(--font-label);
  font-size: var(--text-body-sm);
}

/* ======================================================================
   10 · FT4 — dense colophon footer
   ====================================================================== */

.footer {
  margin-block-start: var(--space-3xl);
  border-top: var(--rule-1);
  padding: var(--space-lg) 0 calc(var(--space-xl) + env(safe-area-inset-bottom));
}
.footer__inner { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gutter); display: block; }
.footer__statement {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.55;
  max-width: 65ch;
  color: var(--color-ink-2);
  margin: 0 0 var(--space-sm);
}
.footer__statement .accent { color: var(--color-accent); }
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  align-items: center;
  font-family: var(--font-label);
  font-size: var(--text-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-ink-soft);
}
.footer__meta a { text-decoration: underline; text-underline-offset: 2px; }
.footer__meta a:hover { color: var(--color-accent); }

/* ======================================================================
   11 · MOTION — no reveals, reduced-motion collapse
   ====================================================================== */

.reveal { opacity: 1; transform: none; animation: none; }
.band-flash, .done-pop { animation: none; }
.brand__mark { animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
  }
  .reveal, .card, .creator-card, .toast, .star-burst,
  .btn.is-done, .band-flash, .brand__mark { animation: none !important; }
  .btn.is-loading::after { animation: spin 900ms linear infinite !important; } /* functional loader survives */
  .gallery__track, .drawer, .filter-drawer, .dl-meter__bar { transition: none !important; }
  .hero__tile, .hero__tile:hover { transform: none !important; }
}

/* ======================================================================
   12 · RESPONSIVE — 320 / 375 / 414 / 768 px
   ====================================================================== */

@media (max-width: 55.99rem) {
  /* main.css:164 pins the old floating pill to left/right gutters with
     width:auto — that clips the register bar on phones. Re-assert the full-
     width sticky bar with equal media-query specificity, later in cascade. */
  .nav-pill {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    transform: none;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: var(--space-xs);
    padding: var(--space-xs) var(--gutter);
  }
  .brand { flex: 0 0 auto; }
  .nav-search { order: 3; flex: 1 1 100%; max-width: none; margin-inline-start: 0; min-width: 0; }
  .nav-search .search input { width: 100%; min-width: 0; }
  .shell { padding-top: var(--space-lg); }
  /* gate 51 requires overflow-wrap:anywhere on DISPLAY headers only.
     On body copy it breaks words mid-glyph ("mash-u / ps"), which reads as
     clipped text. Let prose wrap at word boundaries instead. */
  .hero__title { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
  .hero__copy, .hero__sub, .hero__count { max-width: 100%; min-width: 0; overflow-wrap: normal; }
  .hero__sub, .hero__count { font-size: var(--text-body-sm); }
  .callout--download { grid-template-columns: minmax(0, 1fr); }
  .callout__icon { width: 40px; height: 40px; }
  .gallery__arrow { width: 40px; height: 40px; }
  .gallery__arrow--prev { left: var(--space-sm); }
  .gallery__arrow--next { right: var(--space-sm); }
  .panorama-strip { aspect-ratio: auto; height: auto; cursor: default; }
  .panorama-strip img { width: 100%; height: auto; max-width: 100%; object-fit: contain; }
  .gallery__slide img { object-fit: contain; background: var(--color-paper-3); }
  #detail-main img, #detail-main video { max-width: 100%; }
  #detail-main { overflow-x: clip; }
  .videos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), minmax(0, 1fr))); }
  .product-intro { gap: var(--space-lg); }
  .product-intro h1 { font-size: clamp(1.6rem, 1.2rem + 2.4vw, 2.1rem); }
  /* 100vw includes the scrollbar gutter; 100% of the fixed .cmdk wrapper
     does not, so the closed panel never sticks 4px past the viewport. */
  .cmdk__panel { top: 0; height: 100dvh; width: 100%; }
  .cmdk__results { max-height: none; }
}

@media (max-width: 40rem) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero__title { font-size: clamp(1.8rem, 1.2rem + 3vw, 2.4rem); }
  /* Stack the CTA row on phones — two nowrap slabs side by side can kiss the
     right gutter at 320–375 px. Explicit column removes the ambiguity. */
  .hero__actions { flex-direction: column; align-items: stretch; gap: var(--space-sm); }
  .hero__actions .btn { width: 100%; justify-content: flex-start; }
  .category-link { grid-template-columns: minmax(0, 1fr) auto; }
  .stat-strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-strip > div { border-bottom: var(--rule-1); }
  .cmdk__foot { gap: var(--space-sm); }
  .btn { padding: 0 var(--space-md); }
  .footer__meta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 22.5rem) {
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
}
