/* ============================================================================
   SUPER FEELS WHOLESALE — components
   Everything below is built from the variables in tokens.css. Mobile first:
   retail buyers open this on a phone, standing in a store.
   ========================================================================== */

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img, video, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: var(--lh-tight); letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: var(--bd); margin: var(--s-6) 0; }

main { flex: 1 0 auto; }

.sr {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: var(--s-3) var(--s-5); font-size: 13px;
}
.skip:focus { left: var(--s-2); top: var(--s-2); }

:focus-visible { outline: 2px solid var(--o); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); width: 100%; }
.wrap--narrow { max-width: 780px; }
.section { padding-block: var(--sec); }
.section--tight { padding-block: clamp(44px, 5vw, 72px); }

/* Background alternation, the way the main site separates bands. */
.bg-paper { background: var(--paper); }
.bg-cream { background: var(--cream); }
.bg-ink   { background: var(--ink); color: #fff; }
.bg-sand  { background: var(--sand); }

/* ── Shared type ──────────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--o-deep);
}
.bg-ink .eyebrow { color: var(--o-soft); }

.sec-h {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.page-h {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-head);
}

.dek {
  color: var(--ink-2);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
}
.bg-ink .dek { color: rgba(255, 255, 255, .72); }

/* The main site's asymmetric section head, with its 56px orange rule. */
.shead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-5) var(--s-7);
  align-items: end;
  margin-bottom: clamp(28px, 3.4vw, 52px);
}
.shead::after {
  content: '';
  grid-column: 1 / -1;
  height: 2px;
  background: var(--o);
  width: 56px;
  order: -1;
}
.shead__h { font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: var(--ls-head); margin-top: var(--s-3); }
.shead__d { color: var(--ink-2); font-size: clamp(.98rem, 1.3vw, 1.08rem); margin-top: var(--s-3); max-width: 52ch; }

.muted { color: var(--ink-3); }
.mono-meta {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ── Buttons: hard corners, inverting hover ───────────────────────────────── */
.btn {
  --bg: var(--o); --fg: #fff; --bd-c: var(--o);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 26px;
  border: 1px solid var(--bd-c);
  background: var(--bg); color: var(--fg);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: var(--fs-btn);
  font-weight: 600;
  letter-spacing: var(--ls-btn);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t-base) var(--ease-ff), color var(--t-base) var(--ease-ff);
}
.btn--solid:hover { background: #fff; color: var(--o); }
.btn--ghost { --bg: transparent; --fg: var(--ink); --bd-c: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--light { --bg: #fff; --fg: var(--ink); --bd-c: #fff; }
.btn--light:hover { background: transparent; color: #fff; border-color: #fff; }
.btn--mute { --bg: var(--hair); --fg: var(--ink-2); --bd-c: var(--hair); }
.btn--mute:hover { background: transparent; }
.btn--danger { --bg: var(--danger); --fg: #fff; --bd-c: var(--danger); }
.btn--danger:hover { background: transparent; color: var(--danger); }
.btn--wide { width: 100%; }
.btn--lg { min-height: 56px; font-size: 13px; }
.btn--sm { min-height: 36px; padding: 0 var(--s-4); font-size: var(--fs-label); }
.btn[disabled], .btn[aria-disabled='true'] {
  opacity: .45; cursor: not-allowed; pointer-events: none;
}
.btn__spinner {
  width: 13px; height: 13px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: var(--radius-pill); animation: spin .7s linear infinite; display: none;
}
.btn.is-busy .btn__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.tlink {
  font-family: var(--mono);
  font-size: var(--fs-btn);
  font-weight: 600;
  letter-spacing: var(--ls-btn);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--o-deep);
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: color var(--t-base), border-color var(--t-base);
}
.tlink:hover { color: var(--ink); }
.bg-ink .tlink { color: var(--o-soft); }

/* ── Header ───────────────────────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 120;
  background: var(--paper);
  border-bottom: var(--bd);
}
.hdr__in {
  max-width: 1720px; margin: 0 auto;
  padding-inline: clamp(16px, 3vw, 34px);
  min-height: var(--hdr-h);
  display: flex; align-items: center; gap: var(--s-5);
}
/* The lockup is a near-square badge (roughly 1.11:1), not a horizontal
   wordmark, so it is sized by height to sit inside the 66px header rather than
   by width. `width: auto` keeps the ratio if the artwork is ever replaced. */
.hdr__logo { display: flex; gap: var(--s-3); text-decoration: none; flex: 0 0 auto; align-items: center; }
.hdr__mark { height: 48px; width: auto; display: block; }
.hdr__label {
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--ink-3); border-left: var(--bd); padding-left: var(--s-3);
  align-self: center;
}
@media (max-width: 900px) { .hdr__mark { height: 40px; } }
.hdr__spacer { flex: 1 1 auto; }
.hdr__nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.hdr__link {
  display: flex; align-items: center; height: var(--hdr-h);
  text-decoration: none;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: var(--ls-label); text-transform: uppercase; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.hdr__link:hover { color: var(--o); }
.hdr__link.is-active { color: var(--o); border-color: var(--o); }
.hdr__form { margin: 0; }
.hdr__who {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
  max-width: 22ch; overflow: hidden; text-overflow: ellipsis;
}

/* Header search. Present only on library pages. */
.hdr__search { flex: 1 1 320px; max-width: 420px; display: flex; }
.hdr__search input {
  width: 100%; min-width: 0;
  border: var(--bd); border-radius: var(--radius);
  background: var(--paper-2);
  padding: 10px var(--s-3);
  font: inherit; font-size: 15px;
}
.hdr__search input:focus { outline: none; border-color: var(--o); background: var(--paper); }
.hdr__search button {
  border: var(--bd); border-left: 0; background: var(--ink); color: #fff;
  padding: 0 var(--s-4); cursor: pointer;
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.hdr__search button:hover { background: var(--o); }

.hdr__burger { display: none; background: none; border: 0; padding: 10px 4px; cursor: pointer; }
.hdr__burger span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: var(--t-base); }

@media (max-width: 900px) {
  .hdr__in { flex-wrap: wrap; gap: var(--s-3); padding-block: var(--s-3); }
  .hdr__search { order: 10; flex-basis: 100%; max-width: none; }
  .hdr__nav { gap: var(--s-4); }
  .hdr__link { height: auto; }
  .hdr__who { display: none; }
  .hdr__label { display: none; }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ft {
  background: var(--ink); color: #fff;
  padding: clamp(40px, 5vw, 60px) var(--pad) clamp(28px, 3vw, 40px);
  margin-top: auto;
}
.ft__in {
  max-width: var(--max); margin: 0 auto;
  display: grid; gap: var(--s-6);
  grid-template-columns: 1fr;
}
.ft__logo { display: inline-flex; text-decoration: none; margin-bottom: var(--s-4); }
.ft__logo img { height: 56px; width: auto; display: block; }
.ft__tag { color: rgba(255, 255, 255, .62); font-size: var(--fs-sm); max-width: 40ch; }
.ft__links { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); }
.ft__links a {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .13em;
  text-transform: uppercase; color: rgba(255, 255, 255, .62); text-decoration: none;
}
.ft__links a:hover { color: var(--o-soft); }
.ft__legal {
  max-width: var(--max); margin: var(--s-6) auto 0; padding-top: var(--s-5);
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .1em;
  color: rgba(255, 255, 255, .4);
}
@media (min-width: 760px) {
  .ft__in { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .ft__links { justify-content: flex-end; }
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form { display: grid; gap: var(--s-4); }
.field { display: block; }
.field > label,
.field__label {
  display: block;
  font-family: var(--mono); font-size: var(--fs-label);
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: var(--bd);
  background: var(--paper);
  padding: 13px 14px;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming the page on focus */
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color var(--t-fast);
}
.field textarea { min-height: 120px; resize: vertical; font-size: 15px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B7280' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--o); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea { border-color: var(--danger); background: var(--danger-wash); }
.field.is-valid input,
.field.is-valid select { border-color: var(--hair); }

.field__error {
  display: none;
  margin-top: 6px;
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .06em;
  color: var(--danger);
}
.field.is-invalid .field__error { display: block; }

.field__hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }

.field--check { display: flex; gap: var(--s-3); align-items: flex-start; }
.field--check input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--o); padding: 0; }
.field--check label { font-size: var(--fs-xs); color: var(--ink-2); text-transform: none; letter-spacing: 0; font-family: var(--sans); margin: 0; }
.field--check.is-invalid label { color: var(--danger); }

.form__row { display: grid; gap: var(--s-4); }
@media (min-width: 620px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }

.form__foot { display: grid; gap: var(--s-3); margin-top: var(--s-2); }
.form__alt {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--ink-3); text-align: center;
}
.form__alt a { color: var(--o-deep); text-decoration: none; border-bottom: 1px solid currentColor; }
.form__alt a:hover { color: var(--ink); }

/* ── Switch to the other account path ─────────────────────────────────────── */
/* Returning partners were the largest group hitting the gate, and their route
   in was one line of small uppercase mono under the primary button — read as
   fine print, so they filled the signup form again and hit "already
   registered". This gives that path a rule, a label and a real target, while
   the solid button keeps the primary weight. */
.form__switch {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: var(--bd);
  display: grid;
  gap: var(--s-3);
  justify-items: center;
}
.form__switch p {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  text-align: center;
}
.form__switch .btn { width: 100%; }

/* ── Notices ──────────────────────────────────────────────────────────────── */
.notice {
  border-left: 3px solid var(--o);
  background: var(--o-wash);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.notice--error { border-color: var(--danger); background: var(--danger-wash); color: var(--danger); }
.notice--ok { border-color: var(--ok); background: var(--ok-wash); color: var(--olive); }
.notice strong { display: block; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; margin-bottom: 4px; }

/* ── Gate page ────────────────────────────────────────────────────────────── */
/* Structurally the coming-soon page: one focused column with a form. The
   blurred library sits behind it as evidence of value. */
.gate { position: relative; overflow: hidden; flex: 1 0 auto; display: flex; }

.gate__preview {
  position: absolute; inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Thumbnails only — the full files are never referenced on this page.
     Blurred hard enough to be worthless as an asset, legible enough to read as
     a stocked library. That legibility is the whole reason the preview exists. */
  filter: blur(9px) saturate(.9);
  transform: scale(1.06);
  opacity: .85;
}
.gate__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s-3);
  padding: var(--s-3);
}
.gate__tile {
  aspect-ratio: 4 / 3;
  background: var(--paper-2) center / cover no-repeat;
  border: var(--bd);
}
/* Heavy enough behind the form that the copy stays readable, light enough at
   the edges that the grid shows through. */
.gate__scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(251, 247, 240, .62), rgba(251, 247, 240, .74) 60%, rgba(251, 247, 240, .92)),
    radial-gradient(ellipse at 30% 35%, rgba(251, 247, 240, .93) 0%, rgba(251, 247, 240, .55) 55%, rgba(251, 247, 240, .35) 100%);
}

.gate__in {
  position: relative; z-index: 2;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) var(--pad) clamp(48px, 7vw, 88px);
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (min-width: 940px) {
  .gate__in { grid-template-columns: 1fr minmax(420px, 480px); gap: clamp(40px, 5vw, 80px); }
}

.gate__copy { max-width: 46ch; }
.gate__h {
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: var(--ls-head);
  margin-top: var(--s-4);
}
.gate__h em { font-style: normal; color: var(--o); }
.gate__d { margin-top: var(--s-5); font-size: clamp(1rem, 1.5vw, 1.14rem); color: var(--ink-2); }

.gate__card {
  background: var(--paper);
  border: 4px solid var(--o);   /* the age gate's treatment on the main site */
  padding: clamp(22px, 3.4vw, 34px);
}
.gate__card-h { font-size: 1.35rem; letter-spacing: var(--ls-head); }
.gate__card-d { margin-top: 6px; margin-bottom: var(--s-5); font-size: var(--fs-xs); color: var(--ink-3); }

/* ── Library ──────────────────────────────────────────────────────────────── */
.lib__head {
  border-bottom: var(--bd);
  background: var(--paper);
  padding-block: var(--s-6) var(--s-5);
}
.lib__title { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: baseline; justify-content: space-between; }
.lib__count { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--ink-3); }

/* Category strip. Scrolls horizontally on a phone rather than wrapping to
   four rows and pushing the grid off screen. */
.cats {
  display: flex; gap: var(--s-2);
  overflow-x: auto;
  margin-top: var(--s-5);
  padding-bottom: var(--s-2);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cats::-webkit-scrollbar { height: 3px; }
.cats::-webkit-scrollbar-thumb { background: var(--hair); }
.cat {
  flex: 0 0 auto;
  border: var(--bd);
  background: transparent;
  padding: 9px var(--s-4);
  text-decoration: none;
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--ink-2);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.cat:hover { border-color: var(--ink); }
.cat.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat span { color: var(--ink-4); margin-left: 6px; }
.cat.is-active span { color: rgba(255, 255, 255, .5); }

/* Filter / sort bar */
.toolbar {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  align-items: center; justify-content: space-between;
  padding-block: var(--s-4);
  border-bottom: var(--bd);
}
.toolbar__group { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.toolbar select {
  border: var(--bd); background: var(--paper); border-radius: var(--radius);
  padding: 8px var(--s-3);
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--ink-2);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B7280' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px;
  padding-right: 30px;
}
.toolbar select:focus { outline: none; border-color: var(--o); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: var(--bd); padding: 7px var(--s-3);
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--ink-2); text-decoration: none;
  background: var(--paper-2);
}
.chip a, .chip button { color: var(--ink-3); background: none; border: 0; cursor: pointer; padding: 0; line-height: 1; }
.chip a:hover, .chip button:hover { color: var(--danger); }

/* Asset grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-5);
  padding-block: var(--s-6);
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-4); }
}

.card {
  border: var(--bd);
  background: var(--paper);
  display: flex; flex-direction: column;
  position: relative;
  transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--ink); }
.card.is-selected { border-color: var(--o); box-shadow: var(--shadow-focus); }

.card__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  overflow: hidden;
  display: block;
}
/* `contain`, not `cover`. These are brand assets, and a card is the only place
   most people ever see one before downloading it — a wordmark with its ends
   cropped off, or an ultra-wide shelf banner shown as a magnified slice of its
   middle, is worse than a small preview. The padding keeps artwork off the
   card's own border, and the 4/3 box still gives the grid even rows. */
.card__thumb img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: var(--s-3);
  box-sizing: border-box;
  transition: transform var(--t-slow) var(--ease);
}
.card:hover .card__thumb img { transform: scale(1.03); }

/* Files with no generated preview get a typographic tile rather than a broken
   image — .ai and .eps have no raster preview on most hosts. */
.card__fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--paper-2);
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  letter-spacing: var(--ls-btn); color: var(--ink-4);
}

.card__new {
  position: absolute; top: 0; left: 0;
  background: var(--o); color: #fff;
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 700;
  letter-spacing: var(--ls-label); text-transform: uppercase;
  padding: 5px var(--s-2);
}
.card__pick {
  position: absolute; top: var(--s-2); right: var(--s-2);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--paper); border: var(--bd-ink);
  cursor: pointer;
  z-index: 2;
}
.card__pick input { width: 15px; height: 15px; margin: 0; accent-color: var(--o); cursor: pointer; }

.card__body { padding: var(--s-3) var(--s-4) var(--s-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__name {
  font-size: 1rem; font-weight: 700; line-height: 1.25; letter-spacing: -.005em;
  text-decoration: none;
}
.card__name:hover { color: var(--o-deep); }
.card__meta {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .1em;
  color: var(--ink-3); text-transform: uppercase;
  margin-top: auto; padding-top: var(--s-2);
}
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge {
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  border: var(--bd); color: var(--ink-2);
  padding: 3px 6px; background: var(--paper-2);
  text-decoration: none;
}
a.badge:hover { border-color: var(--o); color: var(--o-deep); }
.badge--o { border-color: var(--o); color: var(--o-deep); background: var(--o-wash); }

/* Selection bar. Sticks to the bottom of the viewport, like the site's mobile
   buy bar, with the same upward shadow. */
.selbar {
  position: sticky; bottom: 0; z-index: 90;
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-bar);
  padding: var(--s-3) var(--pad);
  display: none;
  align-items: center; gap: var(--s-4); flex-wrap: wrap;
  justify-content: space-between;
}
.selbar.is-on { display: flex; }
.selbar__n { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label); text-transform: uppercase; }
.selbar__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* Empty states */
.empty {
  border: 1px dashed var(--hair);
  background: var(--paper-2);
  padding: clamp(36px, 6vw, 72px) var(--s-5);
  text-align: center;
  margin-block: var(--s-6);
}
.empty__h { font-size: 1.2rem; letter-spacing: var(--ls-head); }
.empty__d { margin: var(--s-3) auto 0; max-width: 46ch; color: var(--ink-2); font-size: var(--fs-sm); }
.empty__a { margin-top: var(--s-5); display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; }

/* Pagination */
.pager {
  display: flex; gap: var(--s-2); align-items: center; justify-content: center;
  padding-block: var(--s-6);
  border-top: var(--bd);
}
.pager a, .pager span {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; text-decoration: none;
  border: var(--bd); padding: 9px var(--s-3); color: var(--ink-2);
}
.pager a:hover { border-color: var(--ink); }
.pager .is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .is-off { color: var(--ink-4); border-color: var(--paper-2); }

/* ── Asset detail ─────────────────────────────────────────────────────────── */
.detail { display: grid; gap: clamp(24px, 4vw, 48px); padding-block: var(--s-7); }
@media (min-width: 900px) { .detail { grid-template-columns: 1.15fr 1fr; align-items: start; } }

.detail__preview {
  background: var(--paper-2);
  border: var(--bd);
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  overflow: hidden;
  /* Containing block for the absolutely positioned image below. */
  position: relative;
}

/* The image is taken out of flow on purpose.
   As a centred grid item with `height: 100%`, the percentage had nothing
   definite to resolve against — the row track is auto-sized, and the box's
   own height comes from `aspect-ratio`, not from the track. So the height
   collapsed to auto, the image laid out at its natural ratio at full width,
   and anything taller than 4/3 overflowed a box with `overflow: hidden`.
   A portrait poster rendered as a blank band cut from its middle: the
   "preview is not visible at all" report.
   Absolute positioning resolves the percentages against the padding box,
   whose height IS definite, so `contain` letterboxes inside the frame
   instead of overflowing it — at any aspect ratio. */
.detail__preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--s-4);
  box-sizing: border-box;
}
.detail__h { font-size: clamp(1.5rem, 3.2vw, 2.1rem); letter-spacing: var(--ls-head); margin-top: var(--s-3); }
.detail__desc { margin-top: var(--s-4); color: var(--ink-2); }

.usage {
  margin-top: var(--s-5);
  border-left: 3px solid var(--o);
  background: var(--o-wash);
  padding: var(--s-4);
}
.usage h3 {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--o-deep); margin-bottom: 6px;
}
.usage p { font-size: var(--fs-sm); color: var(--ink-2); }

.files { margin-top: var(--s-6); border-top: var(--bd-ink); }
.file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-3) var(--s-4);
  align-items: center;
  padding: var(--s-4) 0;
  border-bottom: var(--bd);
}
.file__name { font-weight: 700; font-size: var(--fs-sm); word-break: break-word; }
.file__meta {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); margin-top: 3px;
}

/* ── Prose (guidelines) ───────────────────────────────────────────────────── */
.prose { max-width: 68ch; }
.prose h2 {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  letter-spacing: var(--ls-head);
  margin-top: var(--s-7); margin-bottom: var(--s-3);
  padding-top: var(--s-4); border-top: 2px solid var(--o);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.05rem; margin-top: var(--s-5); margin-bottom: var(--s-2); }
.prose p { margin-bottom: var(--s-4); color: var(--ink-2); }
.prose ul { list-style: none; margin-bottom: var(--s-4); }
.prose ul li {
  position: relative; padding-left: var(--s-5); margin-bottom: var(--s-2); color: var(--ink-2);
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 8px; height: 2px; background: var(--o);
}
.prose ol { list-style: decimal; padding-left: var(--s-5); margin-bottom: var(--s-4); color: var(--ink-2); }
.prose ol li { margin-bottom: var(--s-2); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--o-deep); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }

/* ── Message page ─────────────────────────────────────────────────────────── */
.msg { display: grid; place-items: center; padding-block: clamp(60px, 10vw, 140px); text-align: center; }
.msg__in { max-width: 46ch; }
.msg__h { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: var(--ls-head); margin-top: var(--s-4); }
.msg__d { margin-top: var(--s-4); color: var(--ink-2); }
.msg__a { margin-top: var(--s-6); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; left: 50%; bottom: var(--s-6); transform: translateX(-50%);
  z-index: 200; display: grid; gap: var(--s-2); width: min(520px, calc(100vw - 32px));
}
.toast {
  background: var(--ink); color: #fff;
  border-left: 3px solid var(--o);
  padding: var(--s-3) var(--s-4);
  font-size: var(--fs-xs);
  box-shadow: var(--shadow-menu);
  animation: toast-in var(--t-base) var(--ease) both;
}
.toast--error { border-color: var(--danger); }
.toast--ok { border-color: var(--lime); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
