/* ============================================================
   Mac app icons (icons.onemoreupdate.com).
   Tokens follow www/assets/site.css (canon: server/public/assets/
   tokens.css). Self-contained: no external requests.
   ============================================================ */

@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url('/assets/fonts/nunito-800.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 900; font-display: swap; src: url('/assets/fonts/nunito-900.woff2') format('woff2'); }

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f1efeb;
  --border: #e4e1da;
  --border-strong: #d2cec5;
  --text: #2a2418;
  --text-2: #6d6759;
  --text-3: #9b947f;
  --accent: #d31f0f;
  --ok: #3a8a27;
  --ok-bg: #eef7e9;
  --ok-border: #cbe6bd;
  --link: #2f66c4;
  --link-hover: #234f9c;
  --ring: rgba(82,154,224,.45);
  --font-display: 'Nunito', -apple-system, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius-s: 6px; --radius-m: 10px; --radius-l: 14px; --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(42,36,24,.06);
  --shadow-2: 0 2px 8px rgba(42,36,24,.08);
  --shadow-3: 0 12px 40px rgba(42,36,24,.18);
  --grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncB type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncA type='linear' slope='0' intercept='0.04'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a26;
    --surface: #1d2331;
    --surface-2: #242b3c;
    --border: #2f374a;
    --border-strong: #3d465c;
    --text: #e9ebf1;
    --text-2: #a4abbd;
    --text-3: #6f7789;
    --accent: #f0503f;
    --ok: #7fd062;
    --ok-bg: #1d2e21;
    --ok-border: #31502f;
    --link: #74a8e8;
    --link-hover: #9dc1f0;
    --ring: rgba(82,154,224,.5);
    --shadow-1: 0 1px 2px rgba(0,0,0,.3);
    --shadow-2: 0 2px 8px rgba(0,0,0,.35);
    --shadow-3: 0 12px 40px rgba(0,0,0,.5);
    --grain-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='2'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncB type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncA type='linear' slope='0' intercept='0.08'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.6 var(--font-body);
  color: var(--text);
  background: var(--grain-image) left top / 80px 80px repeat var(--bg);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-weight: 900; font-size: clamp(32px, 5.5vw, 52px); }
h2 { font-weight: 800; font-size: clamp(22px, 3vw, 28px); }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

/* header */
.top { border-bottom: 1px solid var(--border); }
.top-row { display: flex; align-items: center; min-height: 64px; }
.brand { display: block; line-height: 0; }
.brand img { display: block; width: auto; height: 46px; }
.brand:hover { color: var(--text); text-decoration: none; }
.top-link { font-size: 14.5px; font-weight: 600; color: var(--text-2); }

/* hero */
.hero { padding-top: 44px; padding-bottom: 0; }
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); }
.lead { font-size: 17px; color: var(--text-2); max-width: 880px; margin: 0; }
.note {
  margin: 28px 0 0;
  max-width: 640px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
}
.note blockquote { margin: 0 0 6px; }
.note figcaption { font-size: 14px; color: var(--text-2); }

/* use it */
.use { padding-top: 48px; padding-bottom: 48px; }
.use-grid { display: grid; gap: 20px 40px; }
.use-grid > div { min-width: 0; }
@media (min-width: 860px) { .use-grid { grid-template-columns: 1fr 1fr; } }
.url-pattern {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  vertical-align: bottom;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 6px 10px;
}
.url-pattern em { font-style: normal; color: var(--accent); white-space: nowrap; }
.cmd {
  margin: 0 0 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 14px/1 var(--font-display);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn.is-copied { color: var(--ok); border-color: var(--ok-border); background: var(--ok-bg); }

/* toolbar */
.browse { padding-top: 20px; padding-bottom: 8px; }
.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 0;
  background: var(--grain-image) left top / 80px 80px repeat var(--bg);
}
.search { position: relative; flex: 1 1 280px; }
.search input {
  width: 100%;
  font: 16px var(--font-body);
  color: var(--text);
  padding: 11px 40px 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
}
.search input::placeholder { color: var(--text-3); }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 12px var(--font-mono); color: var(--text-3);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px;
}
.count { min-width: 72px; }
.sizes {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
}
.sizes-label { padding: 0 6px 0 8px; }
.size {
  font: 600 13px var(--font-mono);
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 6px 9px;
  cursor: pointer;
}
.size:hover { color: var(--text); background: var(--surface-2); }
.size[aria-checked="true"] { color: var(--surface); background: var(--text); }

/* grid */
.grid {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
}
@media (max-width: 420px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  min-width: 0;
  padding: 18px 12px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s ease, transform .15s ease;
}
.card { position: relative; }
.card[hidden] { display: none; }
.flag {
  position: absolute; top: 6px; right: 6px;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  color: var(--text-3);
  border-radius: var(--radius-s);
}
.flag:hover { color: var(--accent); background: var(--surface-2); }
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.card img { width: 64px; height: 64px; margin-bottom: 10px; }
.card h3 { font-size: 15px; font-weight: 800; margin: 0 0 2px; max-width: 100%; overflow-wrap: anywhere; }
.vendor { font-size: 13px; color: var(--text-2); margin: 0; min-height: 1.4em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bundle { font-size: 11.5px; line-height: 1.4; color: var(--text-3); margin: 4px 0 12px; max-width: 100%; overflow-wrap: anywhere; }
.actions { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.act {
  font: 600 12.5px var(--font-body);
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  padding: 4px 6px;
  cursor: pointer;
}
.act:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.act-copy { flex: 1 1 auto; padding: 6px; color: var(--link); border-color: var(--border); }
.act-dl { padding: 6px 8px; }
.act-copy.is-copied { color: var(--ok); border-color: var(--ok-border); background: var(--ok-bg); }
.empty { padding: 40px 0; text-align: center; color: var(--text-2); }

/* footer */
.foot { border-top: 1px solid var(--border); padding: 28px 0 40px; }
.foot p { max-width: 720px; }

/* copy confirmation */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 20;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 12px);
  opacity: 0; pointer-events: none;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--surface);
  background: var(--text);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .card, .toast { transition: none; }
  .card:hover { transform: none; }
}

@media (max-width: 560px) {
  .url-pattern { white-space: normal; overflow-wrap: anywhere; }
}
