:root {
  --bg: #0b0c10;
  --bg-soft: #14161d;
  --line: #262a35;
  --text: #eef0f6;
  --muted: #9aa2b4;
  --accent: #8b5cf6;
  --radius: 16px;
  --pad: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: light) {
  :root { --bg:#f6f7fb; --bg-soft:#fff; --line:#e2e5ee; --text:#12141a; --muted:#5c6478; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: "";
  position: fixed;
  inset: -30vh -10vw auto;
  height: 70vh;
  background: radial-gradient(50% 60% at 30% 40%, #8b5cf633, transparent 70%),
              radial-gradient(45% 55% at 75% 30%, #14b8a628, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; line-height: 1.2; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 8px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  padding: max(12px, env(safe-area-inset-top)) var(--pad) 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: clamp(18px, 4vw, 24px); letter-spacing: -.02em; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #14b8a6); box-shadow: 0 0 18px #8b5cf6aa; }
.count { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

.search { position: relative; flex: 1 1 220px; min-width: 0; margin-left: auto; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; padding: 11px 14px 11px 38px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px; outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.tags { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tags::-webkit-scrollbar { display: none; }
.tag {
  flex: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.tag:hover { color: var(--text); }
.tag.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tag { display: inline-flex; align-items: center; gap: 7px; }
.tag .swatch { width: 8px; height: 8px; box-shadow: none; }

/* ---------- sections ---------- */
main { flex: 1; position: relative; z-index: 1; padding: var(--pad); }
.section { max-width: 1500px; margin: 0 auto; }
.section + .section { margin-top: clamp(28px, 5vw, 52px); }
.section[hidden] { display: none; }
.head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 0 2px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.head h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(17px, 3.2vw, 21px); letter-spacing: -.02em; }
.head .num { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.head .blurb { flex: 1 1 100%; order: 3; margin: 0; font-size: 14px; color: var(--muted); }
.head .more { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.head .more:hover { text-decoration: underline; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.back {
  display: grid; place-items: center; width: 32px; height: 32px; margin-right: 2px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--bg-soft); font-size: 16px;
}
.back:hover { border-color: var(--accent); }

/* ---------- grid ---------- */
.grid {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1500px;
  display: grid; gap: clamp(14px, 2.5vw, 26px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.cell[hidden] { display: none; }

.card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) 70%, transparent);
  outline: none;
}

.shot {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, #0b0c10), #0b0c10);
  border-bottom: 1px solid var(--line);
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

/* live preview: render the real page at desktop width, scaled to fit the card */
.frame { position: absolute; inset: 0; display: grid; place-items: center; }
.frame iframe {
  position: absolute; top: 0; left: 0;
  width: 1280px; height: 800px; border: 0;
  transform-origin: top left;
  pointer-events: none;
}
.frame.is-live .glyph { opacity: 0; }
.glyph {
  font-size: clamp(40px, 9vw, 64px); font-weight: 700; color: #fff6;
  transition: opacity .4s ease .3s;
}
.open {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 88%, #000); color: #fff;
  opacity: 0; transform: translateY(6px); transition: .22s ease;
}
.card:hover .open, .card:focus-visible .open { opacity: 1; transform: none; }
@media (hover: none) { .open { opacity: 1; transform: none; } }

.meta { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.meta h3 { margin: 0; font-size: 17px; line-height: 1.25; letter-spacing: -.01em; }
.meta p { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.foot code { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.chip { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 12vh 0; }
.empty h2 { margin-bottom: 8px; color: var(--text); }
.empty a { color: var(--accent); text-decoration: underline; }

.bot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 18px var(--pad) max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.bot a:hover { color: var(--text); }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .brand h1 { font-size: 18px; }
  .search { flex-basis: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card:hover { transform: none; }
}
