/* HotStack — ember identity.
   Near-white ground, warm ink, one signature ember gradient (amber → ember →
   magenta) used sparingly. Space Grotesk display / Inter body / JetBrains
   Mono micro-labels. No inline styles anywhere (CSP); everything lives here.

   Accessibility ground rules baked in below: AA contrast on every text
   token, visible focus everywhere, transform-only entrance animation (axe
   scans mid-animation), full reduced-motion fallback, no horizontal
   overflow down to 320px. */

:root {
  --ground: #fdfcfa;
  --surface: #ffffff;
  --ink: #16130f;
  --ink-2: #57524a;      /* secondary text, 7.2:1 on ground */
  --ink-3: #6b655c;      /* hints/mono labels, 4.9:1 on ground */
  --line: #e9e4dc;
  --line-strong: #d9d2c7;
  --amber: #ffb224;
  --ember: #ff6a3d;
  --magenta: #f0417d;
  --accent: #c53d0c;     /* interactive ember, 5.0:1 on white */
  --grad: linear-gradient(120deg, var(--amber), var(--ember) 55%, var(--magenta));
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --shadow-1: 0 1px 2px rgba(22, 19, 15, 0.05), 0 4px 14px rgba(22, 19, 15, 0.05);
  --shadow-2: 0 2px 4px rgba(22, 19, 15, 0.07), 0 12px 28px rgba(22, 19, 15, 0.09);
  --radius: 10px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: #f3efe8;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  overflow-wrap: anywhere;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------- Micro-label voice: mono, uppercase, tracked ---------- */

.eyebrow,
.side-label,
.section-head .hint,
.feat-eyebrow,
.page-count,
.kbd-hint,
.label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ---------- Header ---------- */

header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 252, 250, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

header.site .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}

.wordmark .word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
}

header.site nav[aria-label='Site'] {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 26px);
}

header.site nav[aria-label='Site'] > a:not(.btn) {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

header.site nav[aria-label='Site'] > a:not(.btn):hover {
  color: var(--accent);
}

header.site nav[aria-label='Site'] > a:not(.btn)[aria-current] {
  text-decoration: underline;
  text-decoration-color: var(--ember);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 0 var(--ember);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn.ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 0 3px 0 0 var(--ember);
}

header.site .btn[aria-current] {
  box-shadow: 0 3px 0 0 var(--ember);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(52rem 30rem at 18% -8%, rgba(255, 178, 36, 0.16), transparent 60%),
    radial-gradient(46rem 28rem at 85% 4%, rgba(240, 65, 125, 0.1), transparent 62%),
    radial-gradient(60rem 34rem at 50% 118%, rgba(255, 106, 61, 0.12), transparent 58%),
    repeating-linear-gradient(to right, rgba(22, 19, 15, 0.028) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, rgba(22, 19, 15, 0.028) 0 1px, transparent 1px 72px),
    var(--ground);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding-top: clamp(56px, 9vw, 110px);
  padding-bottom: clamp(48px, 7vw, 88px);
}

.hero .eyebrow {
  color: var(--accent);
  margin: 0 0 18px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.hero .lede {
  color: var(--ink-2);
  font-size: clamp(16px, 1.6vw, 18.5px);
  max-width: 620px;
  margin: 0 auto 30px;
  text-wrap: pretty;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-1);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.search-wrap:focus-within {
  border-color: var(--ink);
  box-shadow: var(--shadow-2);
}

.search-wrap .glyph {
  flex: none;
  margin-left: 16px;
  color: var(--ink-3);
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16.5px;
  color: var(--ink);
  padding: 15px 12px;
}

.search-wrap input:focus {
  outline: none;
}

.search-wrap input::placeholder {
  color: var(--ink-3);
}

.kbd-hint {
  flex: none;
  margin-right: 14px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  background: var(--ground);
}

.hero .counts {
  margin: 22px 0 0;
  color: var(--ink-2);
  font-size: 14.5px;
}

.hero .counts b {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

/* Floating brand tiles. Decorative (aria-hidden); transform-only motion. */

.hero-tiles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.tile {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-1);
  animation: tile-float 9s ease-in-out infinite alternate;
}

.tile img {
  width: 28px;
  height: 28px;
}

@keyframes tile-float {
  from {
    translate: 0 -7px;
  }
  to {
    translate: 0 7px;
  }
}

/* Staggered positions: left and right thirds, clear of the centre copy.
   Scale uses transform, drift uses translate — they compose, not clobber. */
.tile.t1  { top: 14%; left: 6%;  animation-duration: 8s; }
.tile.t2  { top: 46%; left: 3%;  animation-duration: 10s; animation-delay: -3s; }
.tile.t3  { top: 74%; left: 8%;  animation-duration: 9s;  animation-delay: -6s; }
.tile.t4  { top: 26%; left: 14%; animation-duration: 11s; animation-delay: -2s; transform: scale(0.86); }
.tile.t5  { top: 60%; left: 17%; animation-duration: 8.5s; animation-delay: -5s; }
.tile.t6  { top: 10%; left: 24%; animation-duration: 10.5s; animation-delay: -1s; transform: scale(0.8); }
.tile.t7  { top: 82%; left: 26%; animation-duration: 9.5s; animation-delay: -7s; transform: scale(0.9); }
.tile.t8  { top: 38%; left: 24%; animation-duration: 12s; animation-delay: -4s; transform: scale(0.72); opacity: 0.85; }
.tile.t9  { top: 12%; right: 6%;  animation-duration: 9s;   animation-delay: -2.5s; }
.tile.t10 { top: 44%; right: 3%;  animation-duration: 10s;  animation-delay: -5.5s; }
.tile.t11 { top: 76%; right: 8%;  animation-duration: 8s;   animation-delay: -1.5s; }
.tile.t12 { top: 24%; right: 14%; animation-duration: 11s;  animation-delay: -6.5s; transform: scale(0.86); }
.tile.t13 { top: 62%; right: 16%; animation-duration: 9.5s; animation-delay: -3.5s; }
.tile.t14 { top: 8%;  right: 23%; animation-duration: 10.5s; animation-delay: -8s; transform: scale(0.8); }
.tile.t15 { top: 84%; right: 25%; animation-duration: 8.5s; animation-delay: -4.5s; transform: scale(0.9); }
.tile.t16 { top: 40%; right: 23%; animation-duration: 12s;  animation-delay: -7.5s; transform: scale(0.72); opacity: 0.85; }

@media (max-width: 980px) {
  .tile.t4, .tile.t5, .tile.t6, .tile.t7, .tile.t8,
  .tile.t12, .tile.t13, .tile.t14, .tile.t15, .tile.t16 {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-tiles {
    display: none;
  }
}

/* ---------- Catalogue layout: sidebar + results ---------- */

.cat-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(24px, 3.5vw, 48px);
  padding-top: 36px;
  padding-bottom: 72px;
}

.filters {
  min-width: 0;
}

.side-label {
  color: var(--ink-3);
  margin: 6px 0 12px;
}

.chip-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  transition: background-color 100ms ease, color 100ms ease;
}

.chip-col .chip {
  justify-content: space-between;
}

.chip:hover {
  color: var(--ink);
  background: #f4f0e9;
}

.chip[aria-current] {
  color: var(--ink);
  font-weight: 600;
  background: #f4f0e9;
  border-color: var(--line);
  box-shadow: inset 3px 0 0 0 var(--ember);
}

.chip .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.chip[aria-current] .count {
  color: var(--accent);
}

/* Active publisher filter: a removable chip below the category rail. */
.active-filter {
  margin-top: 12px;
}

.active-filter .pub-clear {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.adv {
  margin-top: 18px;
}

.adv .adv-toggle {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.adv .adv-toggle::-webkit-details-marker {
  display: none;
}

.adv .adv-toggle::after {
  content: '▾';
  margin-left: 2px;
}

.adv[open] .adv-toggle::after {
  content: '▴';
}

.adv .badge {
  background: var(--ember);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  padding: 1px 7px;
}

.adv-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 2px 2px;
}

.side-note {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-3);
}

/* Reset the centered empty state's own margins/color when it hosts the note. */
.no-match .side-note {
  margin: 12px 0 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chip-row .label {
  color: var(--ink-3);
  margin-right: 2px;
}

.chip-row .chip {
  border-color: var(--line);
  background: var(--surface);
  font-size: 13.5px;
  padding: 5px 11px;
}

.chip-row .chip[aria-current] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: none;
}

/* ---------- Section heads ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 34px 0 18px;
}

.cat-main section:first-of-type .section-head {
  margin-top: 0;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0;
}

.section-head .hint {
  color: var(--ink-3);
  font-size: 11.5px;
}

.section-head-text {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
}

/* Three-way sort control, pushed to the right of the results heading. */
.sortbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.sortbar .label {
  color: var(--ink-3);
  font-size: 12px;
  margin-right: 2px;
}

.sortbar .chip {
  border-color: var(--line);
  background: var(--surface);
  font-size: 13px;
  padding: 4px 10px;
}

.sortbar .chip[aria-current] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  box-shadow: none;
}

/* ---------- Cards ---------- */

.rail,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 120ms ease, box-shadow 120ms ease, translate 120ms ease;
  animation: card-rise 380ms ease both;
}

@keyframes card-rise {
  from {
    translate: 0 10px;
  }
  to {
    translate: 0 0;
  }
}

/* Entrance runs once on first server render; not when the client script
   swaps #catalogue in place (it marks the region .swapped). */
#catalogue.swapped .card {
  animation: none;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
  translate: 0 -2px;
}

.card.feat {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
  border: 1px solid transparent;
}

.feat-eyebrow {
  margin: 0;
  color: var(--accent);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.applogo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.applogo img {
  width: 26px;
  height: 26px;
}

.applogo.mono {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-2);
  text-transform: uppercase;
}

/* Card logo that links to the app hub: above the whole-card overlay so it is
   independently clickable, no link chrome — it still reads as the tile. */
.applogo.hublink {
  position: relative;
  z-index: 1;
  text-decoration: none;
}

.applogo.hublink:hover {
  border-color: var(--line-strong);
}

/* ---------- Browse-by-app strip (below the hero) ---------- */

.app-strip {
  margin: 22px 0 4px;
}

.app-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13.5px;
  transition: border-color 120ms ease, color 120ms ease;
}

.app-chip img {
  width: 20px;
  height: 20px;
}

.app-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ---------- App hub page ---------- */

.app-hub-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 14px;
}

.applogo.hub-logo {
  width: 68px;
  height: 68px;
  flex: none;
  border-radius: 16px;
}

.applogo.hub-logo img {
  width: 40px;
  height: 40px;
}

.app-hub h1 {
  margin: 0;
}

.hub-count {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 13px;
}

.hub-note {
  color: var(--ink-2);
  font-size: 14.5px;
  margin: 0 0 22px;
}

.see-all {
  margin: 20px 0 0;
}

.see-all a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.see-all a:hover {
  text-decoration: underline;
}

.card-top > div {
  min-width: 0;
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
}

.card-link {
  color: var(--ink);
  text-decoration: none;
}

/* Whole card clickable without nesting links. */
.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card-link:hover {
  color: var(--accent);
}

.publine {
  margin: 2px 0 0;
  color: var(--ink-3);
  font-size: 12.5px;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Publisher link on a card: lifted above the whole-card `.card-link::after`
   overlay so "everything by this publisher" stays independently clickable. */
.publink {
  position: relative;
  z-index: 1;
  color: inherit;
  text-decoration: none;
}

.publink:hover {
  color: var(--accent);
  text-decoration: underline;
}

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

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kindb {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: #f3efe8;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
}

.tierb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid;
  white-space: nowrap;
}

.tierb.curated {
  color: #8a3406;
  border-color: #f3c9a8;
  background: #fdf1e5;
}

.tierb.community {
  color: #1f5e35;
  border-color: #bcdec7;
  background: #ecf7ef;
}

.tierb.indexed {
  color: var(--ink-2);
  border-color: var(--line-strong);
  background: var(--ground);
}

/* ---------- Notices & empty states ---------- */

.notice {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: #fdf3e3;
  border: 1px solid #ecd3a8;
  border-radius: 8px;
  color: #6b4a08;
  padding: 12px 16px;
  margin: 0 0 20px;
  font-size: 14.5px;
}

.notice .glyph {
  flex: none;
}

.notice .actions {
  margin-left: auto;
}

.notice .retry {
  color: inherit;
  font-weight: 600;
}

.notice.error {
  background: #fbeae6;
  border-color: #eec4b8;
  color: #7c2d12;
}

.no-match {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  text-align: center;
  padding: 48px 24px;
}

.comp-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comp-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}

.comp-list .what {
  color: var(--ink-2);
}

.source-list {
  text-align: left;
  max-width: 640px;
  margin: 18px auto;
}

/* ---------- Pagination ---------- */

.paging {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 30px 0 0;
}

.page-count {
  color: var(--ink-3);
}

/* ---------- Detail page ---------- */

.crumb {
  margin: 26px 0 14px;
  font-size: 14px;
}

.crumb a {
  color: var(--ink-2);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--accent);
}

.detail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 26px;
}

.detail-head .applogo {
  width: 62px;
  height: 62px;
  border-radius: 16px;
}

.detail-head .applogo img {
  width: 34px;
  height: 34px;
}

.detail-head .applogo.mono {
  font-size: 22px;
}

.detail-head > div {
  min-width: 240px;
  flex: 1;
}

.detail-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--ink-2);
  font-size: 14.5px;
}

.meta-line .cats {
  color: var(--ink-3);
}

.meta-line a {
  color: inherit;
  text-decoration: none;
}

.meta-line a:hover {
  text-decoration: underline;
}

.verified {
  color: #1f5e35;
  font-weight: 600;
}

.detail-head .actions {
  margin-left: auto;
}

.detail-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  padding-bottom: 72px;
}

.detail-cols.compact {
  grid-template-columns: minmax(0, 1fr);
}

.detail-cols.compact aside {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 16px;
  align-items: start;
}

.detail-main section {
  margin-bottom: 34px;
}

.detail-main h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}

.detail-main p {
  color: var(--ink-2);
}

.fact-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.kv {
  display: flex;
  gap: 12px;
  font-size: 14.5px;
}

.kv .k {
  flex: none;
  width: 128px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-top: 2px;
}

.kv .v {
  overflow-wrap: anywhere;
  min-width: 0;
}

.config-wrap {
  position: relative;
  margin: 14px 0;
}

pre.config {
  background: #14110d;
  color: #f3efe8;
  border-radius: 10px;
  border: 1px solid #2c261e;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

pre.config code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}

button.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(253, 252, 250, 0.12);
  color: #f3efe8;
  border: 1px solid rgba(253, 252, 250, 0.28);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 11px;
  cursor: pointer;
}

button.copy:hover {
  background: rgba(253, 252, 250, 0.22);
}

/* Per-client install picker: native <details> surfaces (Claude Code / Cursor /
   VS Code / JSON), each usable no-JS; site.js only makes them exclusive-open. */
.install-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.install-opt {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 14px;
}

.install-opt > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.install-opt > summary::-webkit-details-marker {
  display: none;
}

.install-opt > summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--ink-3);
}

.install-opt[open] > summary::after {
  content: '▴';
}

.install-opt .config-wrap {
  margin: 4px 0 12px;
}

.install-opt .btn {
  margin: 4px 0 8px;
}

.fine {
  color: var(--ink-3);
  font-size: 13px;
}

.aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.aside-card h3 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px;
}

.aside-card .kv {
  margin-bottom: 7px;
}

.aside-card .kv .k {
  width: 96px;
}

.prov-note {
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.55;
  margin: 12px 0 0;
}

.labelb {
  display: inline-block;
  background: #f3efe8;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 3px 11px;
}

.labelb.tag {
  background: var(--surface);
}

/* ---------- Add-your-plugin page ---------- */

.page-narrow {
  max-width: 760px;
  padding-bottom: 72px;
}

.page-head {
  padding: 48px 0 8px;
}

.page-head .eyebrow {
  color: var(--accent);
  margin: 0 0 12px;
}

.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4.5vw, 44px);
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 14px;
}

.page-head .lede {
  color: var(--ink-2);
  font-size: 17px;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.steps > li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px 24px 74px;
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 24px;
  top: 26px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
}

.steps h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.steps p {
  color: var(--ink-2);
  font-size: 15px;
}

.docs-link {
  color: var(--ink-2);
}

/* ---------- Footer ---------- */

footer.site {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

footer.site .foot {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 1fr));
  gap: 28px;
  padding-top: 48px;
  padding-bottom: 28px;
}

footer.site .col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

footer.site .col h2 {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 4px;
}

footer.site .col a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
}

footer.site .col a:hover {
  color: var(--accent);
}

footer.site .brand p {
  color: var(--ink-2);
  font-size: 14px;
  margin: 10px 0 0;
  max-width: 320px;
}

footer.site .fine-print {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  padding-bottom: 24px;
}

footer.site .fine-print p {
  color: var(--ink-3);
  font-size: 12.5px;
  margin: 0;
}

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

@media (max-width: 900px) {
  .cat-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .side-label {
    display: none;
  }

  .chip-col {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
  }

  .chip-col .chip {
    flex: none;
    border-color: var(--line);
    background: var(--surface);
    border-radius: 999px;
    padding: 6px 13px;
  }

  .chip-col .chip[aria-current] {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    box-shadow: none;
  }

  .chip-col .chip[aria-current] .count {
    color: #fdd9a0;
  }

  .detail-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  footer.site .foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 901px) {
  .filters {
    position: sticky;
    top: 84px;
    align-self: start;
  }
}

@media (max-width: 520px) {
  header.site nav[aria-label='Site'] > a[href='/docs/plugin-authors/README.md'] {
    display: none;
  }

  /* Keep both nav links operable without horizontal overflow at 320px. */
  .wordmark .mark {
    width: 19px;
    height: 19px;
  }

  .wordmark .word {
    font-size: 17.5px;
  }

  header.site nav[aria-label='Site'] {
    gap: 10px;
  }

  header.site nav[aria-label='Site'] > a:not(.btn) {
    font-size: 14px;
  }

  header.site .btn {
    padding: 8px 11px;
    font-size: 11px;
    letter-spacing: 0.05em;
  }

  .steps > li {
    padding: 22px 20px 22px 58px;
  }

  .steps > li::before {
    left: 18px;
    top: 24px;
  }

  .kv {
    flex-direction: column;
    gap: 2px;
  }

  .kv .k {
    width: auto;
  }

  footer.site .foot {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tile,
  .card {
    animation: none;
  }

  .card:hover {
    translate: none;
  }

  .btn:hover {
    transform: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

/* --- Build with the catalogue: the npm consumption band ------------------- */

.sdk-band {
  margin: 56px 0 8px;
  padding: 40px 0 44px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sdk-band h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 6px;
}

.sdk-band > .shell > .lede {
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 22px;
}

.sdk-cards {
  display: grid;
  /* min(…, 100%) so the minimum never exceeds a 320px viewport minus padding. */
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 16px;
}

.sdk-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ground);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sdk-card h3 {
  font-family: var(--font-mono);
  font-size: 15.5px;
  margin: 0;
}

.sdk-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.sdk-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sdk-version {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 0;
}

.sdk-headline {
  font-weight: 600;
  color: var(--ink);
  margin: 2px 0 0;
}

.sdk-card > p {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}

.sdk-card .config-wrap {
  margin-top: auto;
  padding-top: 10px;
}

pre.sdk-install {
  /* Right padding clears the absolutely-positioned copy button. */
  padding: 12px 128px 12px 14px;
  font-size: 12.5px;
}
