/* ==========================================================================
   The Creative Vault — homepage
   Minimal / clean / bright. Craft bar: Stripe, Linear, Mobbin.

   2026-10 makeover: one coherent pass instead of the earlier patch layers.
   Surfaces are flat with a hairline and lift on approach (directory-grade,
   after the ToolStack/toools references); frosted glass is kept only on the
   chrome content scrolls beneath. Tokens live in tokens.css, chrome in
   chrome.css. No colour is named here except #fff on a deliberate scrim.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--masthead-h) + 28px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--page-wash);
  background-attachment: fixed;
  color: var(--ink);
  font-family: Archivo, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Browser surfaces: the parts we did not draw still carry the design --- */
::selection { background: var(--selection); color: var(--ink); }
:root { accent-color: var(--accent); caret-color: var(--accent); }

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

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: var(--radius-pill);
}
*::-webkit-scrollbar-thumb:hover { background: var(--line-control); }

img { max-width: 100%; display: block; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--accent); }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 620;
  letter-spacing: -0.025em;
  line-height: 1.12;
  text-wrap: balance;
}

p { margin: 0; }

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

/* ==========================================================================
   Section rhythm — more space above a heading than below it
   ========================================================================== */

.section { padding-block: clamp(48px, 7vw, 96px) 0; }

.section-head { margin-bottom: clamp(20px, 2.4vw, 28px); }
.section-head h2 {
  font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 8px;
}
.section-head p { color: var(--ink-2); max-width: var(--measure); font-size: 15.5px; }

.section-head-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
}

.section-foot { margin-top: 18px; }
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}
.text-link .icon { width: 16px; height: 16px; transition: transform var(--fast) var(--ease); }
.text-link:hover .icon { transform: translateX(3px); }

/* ==========================================================================
   Art banner — the artist's own hand, at the top of his own site
   ========================================================================== */

.art-banner {
  position: relative;
  height: clamp(112px, 13vw, 200px);
  overflow: hidden;
  background: var(--bg);
  z-index: 0;
}

.art-banner picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  /* Multiply drops the poster's paper white into the page ground. */
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 34%, rgba(0,0,0,0.35) 74%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 34%, rgba(0,0,0,0.35) 74%, transparent 100%);
}

.art-banner-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: clamp(200px, 30vw, 440px);
  max-width: calc(100% - 36px);
  max-height: calc(100% - 24px);
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 10px rgba(251, 250, 249, 0.82));
}

@media (max-width: 640px) { .art-banner { height: 96px; } }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--btn-line);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 580;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { border-color: var(--line-control); box-shadow: var(--lift-1); }
.btn:active { transform: translateY(1px); box-shadow: none; }

.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 15px; }

/* The gradient's lightest stop clears 4.5:1 against --on-accent. */
.btn-primary {
  --btn-bg: linear-gradient(145deg, var(--accent-btn-a), var(--accent-btn-b));
  --btn-ink: var(--on-accent);
  --btn-line: var(--accent-btn-b);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { filter: brightness(1.07); border-color: var(--accent-btn-b); }

.btn-ghost { --btn-line: transparent; --btn-bg: transparent; color: var(--ink-2); }
.btn-ghost:hover { --btn-bg: var(--surface-sunk); color: var(--ink); box-shadow: none; }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

/* ==========================================================================
   Hero — copy and search on the left, the marks people trust on the right
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(20px, 3.5vw, 48px) 0;
}

.hero h1 {
  font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif;
  font-size: clamp(40px, 6.4vw, 76px);
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.hero h1 span { display: block; }
.hero h1 span + span { color: var(--accent-ink); }

.hero-sub {
  margin-top: 20px;
  font-size: clamp(16px, 1.55vw, 18.5px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 50ch;
  text-wrap: pretty;
}
.hero-sub strong { color: var(--ink); font-weight: 620; }

/* Search is the hero's primary action, so it is the largest control on the
   page and the only one with a filled button. */
.search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 28px;
  max-width: 640px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--lift-2);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--lift-2), 0 0 0 4px var(--accent-wash); }

.search .icon-search {
  position: absolute;
  left: 20px;
  top: 50%;
  translate: 0 -50%;
  width: 19px; height: 19px;
  color: var(--ink-3);
  pointer-events: none;
}
.search:focus-within .icon-search { color: var(--accent-ink); }

.search input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 44px 0 44px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16.5px;
}
.search input:focus { outline: none; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }

.search-key {
  position: absolute;
  right: 118px;
  top: 50%;
  translate: 0 -50%;
  transition: opacity var(--fast) var(--ease);
}
.search .key { min-width: 22px; height: 22px; border-radius: 6px; font-size: 12px; }
.search:focus-within .search-key,
.search:has(#searchClear:not([hidden])) .search-key { opacity: 0; }

.search-clear {
  position: absolute;
  right: 112px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.search-clear:hover { background: var(--surface-sunk); color: var(--ink); }
.search-clear .icon { width: 16px; height: 16px; }
.search-clear[hidden] { display: none; }

.search-go {
  flex: none;
  height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 15px;
  font-weight: 620;
  cursor: pointer;
  transition: transform var(--fast) var(--ease), filter var(--fast) var(--ease);
}
.search-go:hover { filter: brightness(1.15); }
.search-go:active { transform: translateY(1px); }

.quick-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 18px;
  max-width: 680px;
}
.quick-label { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 520;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
              background-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* --- The marks: an arc of real logos, each a door into its details ------ */
.hero-marks { position: relative; min-height: 380px; }
.hero-marks[hidden] { display: none; }

.hero-marks-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 380px;
}

/* Positions trace a loose arc; each mark is offset by its own --x/--y and
   carries its own --s(ize) so the cluster has depth instead of a grid. */
.hero-mark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 72px);
  height: var(--s, 72px);
  translate: -50% -50%;
}
.hero-mark button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--lift-2);
  cursor: pointer;
  transition: transform var(--mid) var(--ease), box-shadow var(--mid) var(--ease), border-color var(--mid) var(--ease);
}
.hero-mark button:hover,
.hero-mark button:focus-visible {
  transform: translateY(-4px) scale(1.06);
  box-shadow: var(--lift-3);
  border-color: var(--accent-line);
}
.hero-mark .logo {
  width: 58%;
  height: 58%;
  padding: 0;
  border: 0;
  border-radius: 22%;
  background: none;
}
.hero-mark .logo[data-fallback="true"] { width: 100%; height: 100%; border-radius: 50%; }
.hero-mark-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  translate: -50% 0;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fast) var(--ease);
  z-index: 3;
}
.hero-mark button:hover + .hero-mark-name,
.hero-mark button:focus-visible + .hero-mark-name { opacity: 1; }

.hero-marks-note {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  width: max-content;
  max-width: 100%;
  font-size: 13.5px;
  color: var(--ink-3);
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-mark { animation: mark-float 7s ease-in-out infinite; animation-delay: var(--d, 0s); }
  /* A target that drifts is harder to hit: the drift stops on approach. */
  .hero-marks-list:hover .hero-mark,
  .hero-marks-list:focus-within .hero-mark { animation-play-state: paused; }
  @keyframes mark-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
  }
  .hero-marks-list.is-entering .hero-mark { animation: mark-in 700ms var(--ease) both, mark-float 7s ease-in-out 700ms infinite; animation-delay: calc(var(--i) * 45ms), calc(700ms + var(--d, 0s)); }
  @keyframes mark-in { from { opacity: 0; transform: translateY(14px) scale(0.86); } to { opacity: 1; transform: none; } }
}

/* --- Bookmark bubble ------------------------------------------------------ */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  padding: 12px 40px 12px 16px;
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  rotate: -1.1deg;
  transition: rotate var(--mid) var(--ease);
}
.tip:hover { rotate: 0deg; }
.tip[hidden] { display: none; }
.tip::after {
  content: "";
  position: absolute;
  left: 30px;
  top: -7px;
  width: 12px;
  height: 12px;
  background: var(--accent-wash);
  border-left: 1px solid var(--accent-line);
  border-top: 1px solid var(--accent-line);
  transform: rotate(45deg);
  border-top-left-radius: 3px;
}
.tip-copy { font-size: 14px; line-height: 1.35; color: var(--accent-ink); }
.tip-copy strong { color: var(--ink); font-weight: 640; }
.tip-keys { display: inline-flex; gap: 4px; flex: none; }
.tip-keys .key { border-color: var(--accent-line); color: var(--accent-ink); background: var(--surface); }
.tip-close {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--accent-ink);
  cursor: pointer;
}
.tip-close:hover { background: var(--accent-line); }
.tip-close .icon { width: 14px; height: 14px; }

/* --- Hero on narrower screens: its own composition, not a squeeze ------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  /* The arc becomes a single overlapping strip above the headline: the
     same recognition, at a phone's scale, without pushing search down. */
  .hero-marks { order: -1; min-height: 0; display: flex; align-items: center; gap: 12px; }
  .hero-marks-list { display: flex; height: auto; }
  .hero-mark { position: relative; left: auto; top: auto; translate: none; width: 40px; height: 40px; margin-right: -8px; animation: none !important; }
  .hero-mark:nth-child(n + 8) { display: none; }
  .hero-mark button { box-shadow: var(--lift-1); border-width: 2px; border-color: var(--bg); }
  .hero-mark-name { display: none; }
  .hero-marks-note { position: static; translate: none; width: auto; text-align: left; margin-left: 14px; font-size: 13px; }
}
@media (max-width: 560px) {
  .hero-marks-note { display: none; }
  .search { padding: 5px; border-radius: 16px; }
  .search input { height: 48px; font-size: 16px; padding-right: 12px; }
  .search-go { height: 48px; padding: 0 16px; }
  .search-key { display: none; }
  .search-clear { right: 92px; }
  .tip-keys { display: none; }
}

/* ==========================================================================
   Weekly Drip — the editorial moment on the page
   ========================================================================== */

.drip-panel {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-wash) 0%, transparent 55%),
    var(--surface);
  box-shadow: var(--lift-1);
}

.drip-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 22px;
}
.drip-logo { width: 64px; height: 64px; object-fit: contain; }
.drip-head h2 {
  font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.drip-head p { margin-top: 6px; color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.drip-stamp { color: var(--ink); font-weight: 600; white-space: nowrap; }
.drip-cta .icon { transition: transform var(--fast) var(--ease); }
.drip-cta:hover .icon { transform: translateX(3px); }

.drip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 14px;
  margin-top: 24px;
}
.drip-grid:empty { display: none; }

.drip-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.drip-item:first-child { grid-row: span 3; }
.drip-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-sunk);
}
.drip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--slow) var(--ease);
}
.drip-item:hover .drip-thumb img { transform: scale(1.035); }
.drip-time {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(10, 10, 12, 0.78);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.drip-play {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.6);
  color: #fff;
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}
.drip-play .icon { width: 26px; height: 26px; stroke: none; }
.drip-item:hover .drip-play,
.drip-item:focus-visible .drip-play { opacity: 1; }
.drip-meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.drip-meta strong { color: var(--accent-ink); font-weight: 650; }
.drip-item h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.drip-item:first-child h3 { font-size: clamp(17px, 1.7vw, 21px); -webkit-line-clamp: 3; line-clamp: 3; }
.drip-item:hover h3 { color: var(--accent-ink); }
.drip-channel { font-size: 13px; color: var(--ink-2); }
.drip-item:not(:first-child) { flex-direction: row; align-items: flex-start; gap: 12px; }
.drip-item:not(:first-child) .drip-thumb { flex: 0 0 42%; }
.drip-item:not(:first-child) .drip-body { min-width: 0; display: grid; gap: 4px; }
.drip-item:first-child .drip-body { display: grid; gap: 6px; }

.drip-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.drip-topics[hidden] { display: none; }
.drip-topics a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 540;
  text-decoration: none;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.drip-topics a:hover { border-color: var(--accent); color: var(--accent-ink); }

@media (max-width: 980px) {
  .drip-grid { grid-template-columns: 1fr 1fr; }
  .drip-item:first-child { grid-row: auto; grid-column: 1 / -1; }
  .drip-item:not(:first-child) { flex-direction: column; }
  .drip-item:not(:first-child) .drip-thumb { flex: none; }
  .drip-item:nth-child(4) { display: none; }
}
@media (max-width: 720px) {
  .drip-head { grid-template-columns: auto minmax(0, 1fr); }
  .drip-cta { grid-column: 1 / -1; justify-self: start; }
  .drip-logo { width: 52px; height: 52px; }
}
@media (max-width: 560px) {
  .drip-head { grid-template-columns: 1fr; gap: 12px; }
  .drip-logo { width: 46px; height: 46px; }
  .drip-grid { grid-template-columns: 1fr; }
  .drip-item:nth-child(4) { display: flex; }
  .drip-item:not(:first-child) { flex-direction: row; }
  .drip-item:not(:first-child) .drip-thumb { flex: 0 0 42%; }
  .drip-cta { justify-self: stretch; }
  .drip-topics { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
}

/* ==========================================================================
   Category colour — four families, never 192 categories (see DESIGN.md)
   ========================================================================== */

.cat-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--dot, var(--line-strong));
  flex: none;
  vertical-align: 0.06em;
}

.family-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--ink-2);
}
.key-item { display: inline-flex; align-items: center; }

/* ==========================================================================
   Category tiles — an icon, a name, a count
   ========================================================================== */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 12px;
}

.category {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  transition: border-color var(--mid) var(--ease), box-shadow var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.category:hover {
  border-color: var(--line-strong);
  box-shadow: var(--lift-2);
  transform: translateY(-3px);
}
.category:focus-within { border-color: var(--accent); }

.category > button {
  appearance: none;
  display: grid;
  justify-items: start;
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 16px 16px 15px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.category > button:focus-visible { outline-offset: -2px; border-radius: 18px; }

.cat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--dot, var(--ink-3)) 11%, var(--surface));
  color: var(--dot, var(--ink-2));
  transition: transform var(--mid) var(--ease);
}
.cat-icon .icon { width: 22px; height: 22px; stroke-width: 1.6; }
.category:hover .cat-icon { transform: scale(1.06) rotate(-3deg); }

.cat-name { font-size: 15px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.25; }
.cat-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.category-learn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.category-learn:hover { background: var(--accent-wash); color: var(--accent-ink); }

@media (max-width: 560px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category > button { padding: 14px; }
  .cat-icon { width: 38px; height: 38px; margin-bottom: 8px; }
  .category-learn { top: 10px; right: 10px; }
}

/* ==========================================================================
   Starter kits — a stack of the marks inside, a name, a count
   ========================================================================== */

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.collection {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 6px;
  padding: 18px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  transition: border-color var(--mid) var(--ease), box-shadow var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.collection:hover { border-color: var(--line-strong); box-shadow: var(--lift-2); transform: translateY(-3px); }
.collection[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--lift-2); }

.collection-marks { display: flex; margin-bottom: 10px; }
.collection-marks .logo {
  width: 38px;
  height: 38px;
  padding: 6px;
  margin-right: -9px;
  border: 2px solid var(--surface);
  border-radius: 11px;
  background: var(--surface-sunk);
  box-shadow: var(--lift-1);
}
.collection-marks .logo .monogram { font-size: 12px; }
.collection:hover .collection-marks .logo:nth-child(2) { transform: translateY(-2px); }
.collection:hover .collection-marks .logo:nth-child(3) { transform: translateY(-4px); }

.collection h3 { font-size: 16px; font-weight: 620; letter-spacing: -0.015em; }
.collection p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.collection-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.collection-count .icon { width: 16px; height: 16px; color: var(--ink-3); transition: transform var(--fast) var(--ease), color var(--fast) var(--ease); }
.collection:hover .collection-count .icon { transform: translateX(3px); color: var(--accent-ink); }

/* ==========================================================================
   Library toolbar — sticky on desktop, a filter panel on phones
   ========================================================================== */

.toolbar {
  position: sticky;
  top: var(--masthead-h);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  margin-bottom: 4px;
  background: linear-gradient(var(--chrome-bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.filter-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-toggle { display: none; }
.filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11.5px;
  font-weight: 700;
}
.filter-count[hidden] { display: none; }

.toolbar-end { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }

.field { position: relative; display: inline-flex; align-items: center; }
.field select {
  appearance: none;
  height: 40px;
  padding: 0 34px 0 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 540;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  max-width: 260px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.field select:hover { border-color: var(--line-control); }
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.field .icon-chev { position: absolute; right: 13px; width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.field[data-active="true"] select { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.field[data-active="true"] .icon-chev { color: var(--bg); }

.result-line { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-line strong { color: var(--ink); font-weight: 650; }

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 2px 0 18px;
}
.active-filters[hidden] { display: none; }
.active-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-wash);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 540;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease);
}
.active-chip span { color: var(--ink-3); font-weight: 500; }
.active-chip .icon { width: 14px; height: 14px; color: var(--accent-ink); }
.active-chip:hover { border-color: var(--accent); }
.active-filters [hidden] { display: none; }

@media (max-width: 760px) {
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .filter-toggle { display: inline-flex; }
  .filter-fields {
    display: none;
    order: 5;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--lift-2);
  }
  .toolbar[data-filters="open"] .filter-fields { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-fields .field, .filter-fields select { width: 100%; max-width: none; }
  .filter-fields .field[data-field="category"] { grid-column: 1 / -1; }
  .filter-fields select { height: 46px; font-size: 15px; }
}

/* ==========================================================================
   Resource cards — the logo is the anchor
   Anatomy (after the ToolStack reference): mark + name + maker in one row,
   a clamped description, then a divided foot with category, price, Visit.
   The name opens the details; Visit leaves for the tool; the heart saves.
   ========================================================================== */

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: border-color var(--mid) var(--ease), box-shadow var(--mid) var(--ease),
              transform var(--mid) var(--ease);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--lift-2); transform: translateY(-3px); }
.card:focus-within { border-color: var(--accent); }

.card-top { display: flex; align-items: center; gap: 13px; padding-right: 34px; min-width: 0; }
.card-head { min-width: 0; }

/* The logo well: one consistent field so every mark reads the same. */
.logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-sunk);
  overflow: hidden;
  transition: transform var(--mid) var(--ease), border-color var(--mid) var(--ease);
}
.card:hover .logo { transform: scale(1.05) rotate(-2deg); }
.logo img { width: 100%; height: 100%; object-fit: contain; filter: var(--logo-tint); }
@media (prefers-reduced-motion: no-preference) {
  .logo img { animation: logo-in 300ms var(--ease) both; }
  @keyframes logo-in { from { opacity: 0; } to { opacity: 1; } }
}
.logo[data-fallback="true"] { background: var(--mono-bg, var(--surface-sunk)); border-color: transparent; }
.logo .monogram {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.03em;
  color: var(--mono-ink, var(--ink-2));
  line-height: 1;
}
:root[data-theme="dark"] .logo[data-fallback="true"] { filter: saturate(0.8) brightness(0.9); }

.card-title {
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
/* Stretched button: the whole card opens the details. Visit and the heart
   sit above it on their own layer. */
.card-open {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.card-open::after { content: ""; position: absolute; inset: 0; border-radius: 18px; z-index: 0; }
.card-open:focus-visible { outline: none; }
.card-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.card:hover .card-open { color: var(--accent-ink); }

.card-company {
  margin-top: 2px;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.55em);
}

.card-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  min-width: 0;
  pointer-events: none;
}
.card-foot > * { pointer-events: auto; }

.cat-tag {
  display: inline-flex;
  align-items: center;
  max-width: 50%;
  height: 26px;
  padding: 0 10px 0 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 540;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none !important;
}
.cat-tag .cat-dot { margin-right: 6px; }

.price {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
  pointer-events: none !important;
}
.price[data-free="true"] { color: var(--free); }
.price[data-tier="Freemium"] { color: var(--fam-tools); }

.card-visit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  margin-left: auto;
  padding: 0 11px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 620;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.card-visit .icon { width: 14px; height: 14px; transition: transform var(--fast) var(--ease); }
.card-visit:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.card-visit:hover .icon { transform: translate(1px, -1px); }

.fav {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.fav:hover { background: var(--surface-sunk); color: var(--ink); }
.fav[aria-pressed="true"] { color: var(--accent); }
.fav[aria-pressed="true"] .icon { fill: var(--accent); }
.fav .icon { width: 18px; height: 18px; }
@media (prefers-reduced-motion: no-preference) {
  .fav.is-popping .icon { animation: fav-pop 380ms var(--ease); }
  @keyframes fav-pop { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }
}

/* Placeholder shapes while the data file arrives. */
.card-skeleton {
  height: 188px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent) no-repeat,
    var(--surface-sunk);
  background-size: 50% 100%, auto;
  background-position: -50% 0, 0 0;
}
@media (prefers-reduced-motion: no-preference) {
  .card-skeleton { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { to { background-position: 150% 0, 0 0; } }
}

/* ==========================================================================
   View toggle — thumbnails or list
   ========================================================================== */

.view-toggle {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.view-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.view-btn .icon { width: 17px; height: 17px; }
.view-btn:hover { color: var(--ink); }
.view-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--lift-1); }

/* --- List view: the same markup re-laid as rows ------------------------ */
.resource-grid[data-view="list"] {
  display: block;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}
.resource-grid[data-view="list"] .card {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.8fr) 330px 34px;
  grid-template-areas: "top desc foot fav";
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  transform: none;
  box-shadow: none;
}
.resource-grid[data-view="list"] .card:last-child { border-bottom: 0; }
.resource-grid[data-view="list"] .card:hover { background: var(--surface-sunk); transform: none; box-shadow: none; }
.resource-grid[data-view="list"] .card-top { grid-area: top; padding-right: 0; }
.resource-grid[data-view="list"] .logo { width: 40px; height: 40px; padding: 7px; border-radius: 11px; }
.resource-grid[data-view="list"] .card:hover .logo { transform: none; }
.resource-grid[data-view="list"] .card-title { font-size: 14.5px; }
.resource-grid[data-view="list"] .card-company { font-size: 12.5px; }
.resource-grid[data-view="list"] .card-desc { grid-area: desc; font-size: 13.5px; min-height: 0; }
.resource-grid[data-view="list"] .card-foot { grid-area: foot; padding: 0; margin: 0; border: 0; }
.resource-grid[data-view="list"] .fav { grid-area: fav; position: relative; top: auto; right: auto; }
.resource-grid[data-view="list"] .card-open::after { border-radius: 0; }

@media (max-width: 1080px) {
  .resource-grid[data-view="list"] .card {
    grid-template-columns: minmax(0, 1fr) 320px 34px;
    grid-template-areas: "top foot fav";
  }
  .resource-grid[data-view="list"] .card-desc { display: none; }
}
@media (max-width: 720px) {
  .resource-grid[data-view="list"] .card {
    grid-template-columns: minmax(0, 1fr) 34px;
    grid-template-areas: "top fav" "foot foot";
    gap: 10px;
  }
  .resource-grid[data-view="list"] .cat-tag { max-width: 46%; }
}
@media (max-width: 640px) {
  .resource-grid { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 16px; }
  .card-skeleton:nth-child(n + 3) { display: none; }
}

/* ==========================================================================
   Load more / empty / error
   ========================================================================== */

.load-more {
  display: grid;
  place-items: center;
  gap: 10px;
  padding-block: 36px 0;
  text-align: center;
}
.load-more p { font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.load-more[hidden] { display: none; }

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
}
.empty-icon { width: 30px; height: 30px; color: var(--ink-3); margin-bottom: 6px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 10px; max-width: 52ch; }
.empty[hidden] { display: none; }

.load-error {
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-wash);
  color: var(--ink);
  font-size: 14.5px;
}
.load-error[hidden] { display: none; }

/* ==========================================================================
   Offline PDF — a document you can take with you
   ========================================================================== */

.offline-band {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  overflow: hidden;
}

.offline-doc { position: relative; height: 250px; }
.offline-doc-page {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  align-content: start;
  gap: 12px;
  width: 172px;
  height: 228px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--lift-3);
  translate: -50% -50%;
  rotate: -4deg;
  transition: rotate var(--slow) var(--ease), translate var(--slow) var(--ease);
}
.offline-doc-back { rotate: 6deg; translate: -38% -52%; background: var(--surface-sunk); box-shadow: var(--lift-1); }
.offline-band:hover .offline-doc-page:not(.offline-doc-back) { rotate: -1deg; translate: -54% -54%; }
.offline-doc-page img { width: 32px; height: 32px; }
.offline-doc-page strong {
  font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.offline-doc-lines { display: grid; gap: 7px; }
.offline-doc-lines i { display: block; height: 5px; border-radius: 3px; background: var(--line); }
.offline-doc-lines i:nth-child(2) { width: 80%; }
.offline-doc-lines i:nth-child(4) { width: 64%; }
.offline-doc-page em {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--accent-btn-b);
  color: var(--on-accent);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.offline-copy h2 {
  font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.offline-copy p { margin-top: 10px; color: var(--ink-2); font-size: 15.5px; max-width: 54ch; }
.offline-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 20px 0 24px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--ink-2);
}
.offline-facts strong {
  display: block;
  font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .offline-band { grid-template-columns: 1fr; }
  .offline-doc { height: 210px; }
  .offline-doc-page { width: 146px; height: 192px; }
  .offline-band .btn-primary { width: 100%; }
}

/* ==========================================================================
   Guides + submit
   ========================================================================== */

.seo-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.seo-link-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 580;
  text-decoration: none;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.seo-link-grid a .icon { width: 16px; height: 16px; color: var(--ink-3); transition: transform var(--fast) var(--ease), color var(--fast) var(--ease); }
.seo-link-grid a:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--lift-1); }
.seo-link-grid a:hover .icon { color: var(--accent-ink); transform: translateX(3px); }

.submit-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: 24px;
  background: var(--surface-invert);
  color: var(--on-invert);
}
.submit-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: var(--accent-wash); }
.submit-band h2 {
  font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.submit-band p { color: color-mix(in srgb, var(--on-invert) 76%, transparent); font-size: 15px; max-width: 56ch; }

@media (max-width: 760px) {
  .submit-band { grid-template-columns: 1fr; justify-items: start; }
  .submit-avatar { width: 64px; height: 64px; }
  .submit-band .btn { width: 100%; }
}

/* ==========================================================================
   Detail dialog
   ========================================================================== */

.modal {
  width: min(640px, calc(100vw - 24px));
  max-height: min(86vh, 800px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--lift-3);
  overflow: hidden;
}
.modal::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: modal-in 320ms var(--ease); }
  .modal[open]::backdrop { animation: fade-in 240ms var(--ease); }
  .modal.is-closing { animation: modal-out 180ms var(--ease) forwards; }
  @keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
  @keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(0.985); } }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}

.modal-body { padding: 26px 26px 0; overflow-y: auto; max-height: min(86vh, 800px); }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.modal-close:hover { background: var(--surface-sunk); color: var(--ink); }
.modal-close .icon { width: 17px; height: 17px; }

.modal-head { display: flex; gap: 16px; align-items: center; padding-right: 48px; }
.modal-head .logo { width: 72px; height: 72px; padding: 12px; border-radius: 18px; }
.modal-head h2 { font-family: "Bricolage Grotesque", Archivo, system-ui, sans-serif; font-size: 26px; font-weight: 700; letter-spacing: -0.035em; }
.modal-head .card-company { font-size: 14px; margin-top: 4px; }

.modal-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }

.modal-desc {
  margin-top: 16px;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: var(--measure);
}

.spec { margin: 22px 0 0; border-top: 1px solid var(--line); }
.spec > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.spec dt { color: var(--ink-3); }
.spec dd { margin: 0; color: var(--ink); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunk);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 520;
}
.tag[data-free="true"] { background: var(--free-wash); color: var(--free); font-weight: 650; }

.modal-related { margin-top: 22px; }
.modal-related h3 { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.modal-related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.related-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-item:hover { border-color: var(--line-strong); }
.related-item .logo { width: 30px; height: 30px; padding: 5px; border-radius: 8px; }
.related-item .logo .monogram { font-size: 11px; }

/* Actions stay in reach however long the description runs. */
.modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  margin: 24px -26px 0;
  padding: 16px 26px 20px;
  background: linear-gradient(transparent, var(--surface) 30%);
}
.modal-actions .btn-primary { flex: 1; min-height: 48px; font-size: 15px; }
.modal-actions .fav-wide[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); }
.modal-actions .fav-wide[aria-pressed="true"] .icon { fill: var(--accent); stroke: var(--accent); }

@media (max-width: 560px) {
  .modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .modal-body { max-height: 92vh; padding: 22px 18px 0; }
  .modal-actions { margin-inline: -18px; padding-inline: 18px; }
  .spec > div { grid-template-columns: 1fr; gap: 3px; }
  @media (prefers-reduced-motion: no-preference) {
    .modal[open] { animation: sheet-in 340ms var(--ease); }
    @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  }
}

/* ==========================================================================
   Motion — one authored moment, from an already-visible default
   ========================================================================== */

/* Nothing is hidden unless JS is running and the visitor allows motion. */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); }

/* Animations, not transitions: a card inserted and revealed in the same
   frame has no previous style to transition from. */
.js-reveal .reveal.is-in {
  animation: reveal-in var(--slow) var(--ease) both;
  animation-delay: var(--reveal-delay, 0ms);
}
@keyframes reveal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
/* Results already on screen when they arrive show briskly, no queue. */
.js-reveal .reveal.is-in.is-instant { animation-duration: 240ms; animation-delay: 0ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   Themes — the few places a surface needs more than its tokens
   ========================================================================== */

@media (prefers-reduced-transparency: reduce) {
  .toolbar, .modal { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* The banner is graphite on white paper: multiply drops the paper into a
   light page; on dark, invert first and screen out the black. */
:root[data-theme="dark"] .art-banner picture > img { filter: invert(1); mix-blend-mode: screen; opacity: 0.45; }
:root[data-theme="dark"] .art-banner-logo { filter: invert(1) hue-rotate(180deg) saturate(1.35) brightness(1.05); }
:root[data-theme="medium"] .art-banner picture > img { opacity: 0.82; }

/* On dark, cards separate by hairline more than by shadow. */
:root[data-theme="dark"] .card:hover,
:root[data-theme="dark"] .category:hover,
:root[data-theme="dark"] .collection:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
:root[data-theme="dark"] .hero-mark button { background: var(--surface-sunk); }
:root[data-theme="dark"] .submit-band { background: var(--surface-sunk); border: 1px solid var(--line-strong); }

/* cv-secondary-logo.png has no light variant (see chrome.css): on dark it
   keeps the paper chip it was drawn for, here as in the masthead. */
:root[data-theme="dark"] .offline-doc-page img,
:root[data-theme="dark"] .footer-brand .brand-mark { background: #f2efe9; border-radius: 8px; padding: 3px; }
