/* =========================================================
   Catalogue reference components
   ---------------------------------------------------------
   Loaded by the categories and collections views only, through
   their own $pageStyles entry. Everything lives under the
   isolated .smp-page root and reuses the app.css public tokens,
   the tone palette ([data-tone]) and the legacy button, tag and
   card classes. No other page is affected.

   Brand note: the shared public tokens now carry the exact
   reference values, so this file uses them directly. Fills and
   large decorative heading accents use --accent; small text on
   light surfaces uses the contrast-checked --accent-text token.
   ========================================================= */

/* Section links carry a small arrow; without an explicit size the
   SVG falls back to its 300x150 default. */
.smp-page .sec-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.smp-page .sec-link svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---------- Page heroes ---------- */

.smp-page .smp-khero,
.smp-page .smp-chero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  padding: 56px 0 28px;
}

.smp-page .smp-chero {
  padding-bottom: 32px;
}

.smp-page .smp-h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.smp-page .smp-chero .smp-h1 {
  font-size: clamp(48px, 8vw, 104px);
}

.smp-page .smp-h1 em {
  font-style: normal;
  color: var(--accent);
}

.smp-page .smp-lede {
  max-width: 560px;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(16px, 1.6vw, 19px);
}

.smp-page .smp-kstats {
  display: flex;
  gap: 28px;
}

.smp-page .smp-kstats div {
  text-align: right;
}

.smp-page .smp-kstats b {
  display: block;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.smp-page .smp-kstats span {
  color: var(--muted);
  font-size: 13px;
}

.smp-page .smp-stackmark {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.28em;
}

.smp-page .smp-stackmark i {
  display: block;
  width: 0.6em;
  height: 0.6em;
  margin-left: -0.18em;
  border: 2px solid var(--bg);
  border-radius: 0.16em;
}

.smp-page .smp-stackmark i:nth-child(1) {
  background: var(--accent);
  transform: rotate(-10deg);
}

.smp-page .smp-stackmark i:nth-child(2) {
  background: var(--hi);
  transform: rotate(4deg);
}

.smp-page .smp-stackmark i:nth-child(3) {
  background: #2f5bff;
  transform: rotate(14deg);
}

/* ---------- Sticky finder and segmented controls ---------- */

.smp-page .smp-ctoolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 0 24px;
  border-top: 1px solid var(--line);
}

.smp-page .smp-csearch {
  display: flex;
  min-width: 260px;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

.smp-page .smp-csearch svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.smp-page .smp-csearch input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.smp-page .smp-finder {
  position: sticky;
  top: 64px;
  z-index: 20;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.smp-page .smp-finder__row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.smp-page .smp-kfind {
  display: flex;
  min-width: 220px;
  height: 48px;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--edge);
}

.smp-page .smp-kfind svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
}

.smp-page .smp-kfind input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.smp-page .smp-seg {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
}

.smp-page .smp-seg > a,
.smp-page .smp-seg > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.smp-page .smp-seg > a[aria-current="page"],
.smp-page .smp-seg > button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.smp-page .smp-seg svg {
  width: 16px;
  height: 16px;
}

/* ---------- Biggest categories ---------- */

.smp-page .smp-bento {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}

.smp-page .smp-bento__card {
  position: relative;
  display: flex;
  min-height: 180px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(140deg, var(--tone-b, var(--accent)), color-mix(in srgb, var(--tone-b, var(--accent)) 52%, #000000));
  color: #ffffff;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.smp-page .smp-bento__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.smp-page .smp-bento__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
}

.smp-page .smp-bento__card > * {
  position: relative;
}

.smp-page .smp-bento__card:first-child {
  grid-row: span 2;
  min-height: 376px;
}

.smp-page .smp-bento__emoji {
  position: absolute;
  right: 18px;
  top: 14px;
  font-size: 64px;
  line-height: 1;
  transform: rotate(8deg);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
}

.smp-page .smp-bento__card:first-child .smp-bento__emoji {
  right: 24px;
  top: 24px;
  font-size: 120px;
}

.smp-page .smp-bento__rank {
  position: absolute;
  left: 20px;
  top: 18px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.smp-page .smp-bento h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.smp-page .smp-bento__card:first-child h3 {
  font-size: clamp(30px, 3.6vw, 44px);
}

.smp-page .smp-bento__card:not(:first-child) h3 {
  max-width: 78%;
}

.smp-page .smp-bento h3 a {
  color: #ffffff;
}

.smp-page .smp-bento__meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  opacity: 0.92;
}

/* ---------- Category cards ---------- */

.smp-page .smp-kgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.smp-page .smp-kc {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.smp-page .smp-kc__top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.smp-page .smp-kc__ico {
  display: grid;
  width: 52px;
  height: 52px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--tone-a, var(--surface-2));
  font-size: 26px;
  line-height: 1;
}

.smp-page .smp-kc h3 {
  margin: 0 0 3px;
  font-size: 18px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.smp-page .smp-kc h3 a {
  position: relative;
  z-index: 2;
}

.smp-page .smp-kc__count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.smp-page .smp-kc__count b {
  color: var(--ink);
}

.smp-page .smp-kc__topics {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.smp-page .smp-kc__bar {
  height: 4px;
  margin-top: auto;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.smp-page .smp-kc__bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--tone-b, var(--accent));
}

/* Ten honest steps instead of an inline width, because the site CSP
   allows no inline style attributes. */
.smp-page .smp-kc__bar .smp-w1 { width: 10%; }
.smp-page .smp-kc__bar .smp-w2 { width: 20%; }
.smp-page .smp-kc__bar .smp-w3 { width: 30%; }
.smp-page .smp-kc__bar .smp-w4 { width: 40%; }
.smp-page .smp-kc__bar .smp-w5 { width: 50%; }
.smp-page .smp-kc__bar .smp-w6 { width: 60%; }
.smp-page .smp-kc__bar .smp-w7 { width: 70%; }
.smp-page .smp-kc__bar .smp-w8 { width: 80%; }
.smp-page .smp-kc__bar .smp-w9 { width: 90%; }
.smp-page .smp-kc__bar .smp-w10 { width: 100%; }

.smp-page .smp-kgrid.is-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}

.smp-page .smp-kgrid.is-list .smp-kc {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  transform: none !important;
  box-shadow: none !important;
}

.smp-page .smp-kgrid.is-list .smp-kc:last-child {
  border-bottom: 0;
}

.smp-page .smp-kgrid.is-list .smp-kc__top {
  flex: 0 0 320px;
  align-items: center;
}

.smp-page .smp-kgrid.is-list .smp-kc__ico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 20px;
}

.smp-page .smp-kgrid.is-list .smp-kc__topics {
  flex: 1;
}

.smp-page .smp-kgrid.is-list .smp-kc__bar {
  display: none;
}

/* ---------- Topic strip ---------- */

.smp-page .smp-topic-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.smp-page .smp-topic {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.smp-page .smp-topic__ico {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 22px;
  line-height: 1;
}

.smp-page .smp-topic b {
  display: block;
  line-height: 1.2;
}

.smp-page .smp-topic span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ---------- Featured collection ---------- */

.smp-page .smp-featured {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--inverse-bg);
  color: var(--inverse-ink);
  overflow: hidden;
}

.smp-page .smp-featured__art {
  position: relative;
  min-height: 340px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 42%, #ffffff));
  overflow: hidden;
}

.smp-page .smp-featured__tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 36px;
  transform: rotate(-8deg) scale(1.15);
}

.smp-page .smp-featured__tiles .fav,
.smp-page .smp-featured__tiles .smp-tile {
  display: grid;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.35);
  font-size: clamp(20px, 3vw, 34px);
  overflow: hidden;
}

.smp-page .smp-featured__tiles img {
  object-fit: cover;
}

.smp-page .smp-featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(24px, 4vw, 44px);
}

.smp-page .smp-featured__body h2 {
  margin: 0;
  color: var(--inverse-ink);
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.smp-page .smp-featured__body p {
  margin: 0;
  color: var(--inverse-muted);
  font-size: 16px;
}

.smp-page .smp-featured .eyebrow {
  color: var(--hi);
}

.smp-page .smp-fmeta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--inverse-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.smp-page .smp-featured .btn-ghost {
  border-color: color-mix(in srgb, var(--inverse-ink) 30%, transparent);
  background: transparent;
  color: var(--inverse-ink);
}

.smp-page .smp-featured .btn-ghost:hover {
  background: color-mix(in srgb, var(--inverse-ink) 12%, transparent);
}

/* ---------- Collection cards ---------- */

.smp-page .smp-cgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.smp-page .smp-cc {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
}

.smp-page .smp-cc__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
}

.smp-page .smp-cc__thumb {
  position: absolute;
  display: grid;
  width: 58%;
  aspect-ratio: 16 / 10;
  place-items: center;
  border: 3px solid var(--surface);
  border-radius: 10px;
  background: var(--tone-b, var(--surface-3));
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.smp-page .smp-cc__thumb--a {
  left: 6%;
  top: 20%;
  transform: rotate(-8deg);
}

.smp-page .smp-cc__thumb--b {
  left: 22%;
  top: 12%;
  z-index: 1;
  transform: rotate(2deg);
}

.smp-page .smp-cc__thumb--c {
  right: 6%;
  top: 22%;
  z-index: 2;
  transform: rotate(9deg);
}

.smp-page .smp-cc:hover .smp-cc__thumb--a {
  transform: rotate(-14deg) translateX(-8%);
}

.smp-page .smp-cc:hover .smp-cc__thumb--c {
  transform: rotate(15deg) translateX(8%);
}

.smp-page .smp-cc__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.smp-page .smp-cc__letter {
  font-size: clamp(18px, 2.4vw, 26px);
  line-height: 1;
}

.smp-page .smp-cc__count {
  position: absolute;
  z-index: 3;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.smp-page .smp-cc__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 0 6px 6px;
}

.smp-page .smp-cc h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.smp-page .smp-cc h3 a {
  position: relative;
  z-index: 2;
}

.smp-page .smp-cc p {
  display: -webkit-box;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.smp-page .smp-cc__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* ---------- Closing bands ---------- */

.smp-page .smp-suggest {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--r-lg);
  background: var(--accent);
  /* Ink on the orange band keeps body copy at 5.6:1; the white
     accent-ink token only clears large text. */
  color: #17140f;
  overflow: hidden;
}

.smp-page .smp-curate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: clamp(24px, 4vw, 44px);
  border: 1.5px solid var(--edge);
  border-radius: var(--r-lg);
  background: var(--hi);
  color: var(--hi-ink);
  box-shadow: 6px 6px 0 var(--edge);
}

.smp-page .smp-suggest::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(23, 20, 15, 0.16) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
}

.smp-page .smp-suggest > * {
  position: relative;
  min-width: 0;
}

.smp-page .smp-suggest h2,
.smp-page .smp-curate h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.smp-page .smp-suggest h2 {
  color: #17140f;
}

.smp-page .smp-suggest p {
  max-width: 560px;
  margin: 0;
  font-size: 16px;
}

.smp-page .smp-curate p {
  max-width: 560px;
  margin: 0;
  font-size: 16px;
}

.smp-page .smp-band-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.smp-page .smp-suggest .btn-ink,
.smp-page .smp-curate .btn-ink {
  background: #17140f;
  color: #ffffff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.smp-page .smp-suggest .btn-plain {
  border: 1.5px solid rgba(23, 20, 15, 0.45);
  background: transparent;
  color: #17140f;
}

.smp-page .smp-suggest .btn-plain:hover {
  border-color: rgba(23, 20, 15, 0.75);
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .smp-page .smp-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .smp-page .smp-bento__card:first-child {
    grid-column: span 2;
    grid-row: auto;
    min-height: 240px;
  }

  .smp-page .smp-featured {
    grid-template-columns: minmax(0, 1fr);
  }

  .smp-page .smp-featured__art {
    min-height: 220px;
  }
}

@media (max-width: 860px) {
  .smp-page .smp-khero,
  .smp-page .smp-chero {
    grid-template-columns: minmax(0, 1fr);
  }

  .smp-page .smp-kstats div {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .smp-page .smp-suggest,
  .smp-page .smp-curate {
    grid-template-columns: minmax(0, 1fr);
  }

  .smp-page .smp-kgrid.is-list .smp-kc {
    flex-direction: column;
    align-items: flex-start;
  }

  .smp-page .smp-kgrid.is-list .smp-kc__top {
    flex: none;
  }
}

@media (max-width: 640px) {
  .smp-page .smp-kfind {
    min-width: 100%;
  }

  .smp-page .smp-csearch {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .smp-page .smp-bento {
    grid-template-columns: minmax(0, 1fr);
  }

  .smp-page .smp-bento__card:first-child {
    grid-column: auto;
  }

  .smp-page .smp-bento__card {
    min-height: 160px;
  }
}
