/* Layout: a quiet binder page. One holo stripe, a blurred backdrop of the
   artist's most sought-after card, then a calm grid of cards. Dark only. */
:root {
  --bg: #0f1013;
  --surface: #17181d;
  --raised: #202229;
  --line: #2a2c34;
  --text: #edebe6;
  --muted: #8e9099;
  --accent: #e3bd55;
  --accent-ink: #1a1508;
  --owned: #7fd3a6;
  --scrim: rgba(15, 16, 19, 0.72);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --holo: linear-gradient(90deg, #ff7ac6, #a86cf7, #6d7cf5, #3fb6f2, #3fe0c5, #b6e85a, #f7d34a, #ff9a52, #ff6f91, #ff7ac6);

  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; display: block; }

/* ---------- holo stripe + top bar ---------- */
.holo-strip {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  background: var(--holo);
  background-size: 200% 100%;
  animation: holo 6s linear infinite;
}
@keyframes holo { to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) { .holo-strip { animation: none; } }

.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 11px var(--gutter) 9px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .title {
  flex: 1;
  min-width: 0;
  font: 600 16px/1.2 var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}
.topbar.scrolled .title, .topbar.home .title { opacity: 1; transform: none; }
.top-progress {
  display: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--raised);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.topbar.scrolled:not(.home) .top-progress:not(:empty) { display: inline-block; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
}
.icon-btn:hover { background: var(--raised); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[hidden] { display: none; }

main { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); padding-block: 0 64px; }

/* ---------- artist hero ---------- */
.artist-hero {
  position: relative;
  margin-inline: calc(var(--gutter) * -1);
  padding: 28px var(--gutter) 24px;
  overflow: hidden;
  isolation: isolate;
}
.artist-hero .backdrop {
  position: absolute;
  inset: -40px;
  z-index: -2;
  background-size: cover;
  background-position: center 30%;
  filter: blur(34px) saturate(1.2);
  opacity: 0.55;
  transform: scale(1.1);
}
.artist-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 35%, transparent) 0%, var(--bg) 100%);
}
.hero-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.artist-hero h1 {
  margin: 4px 0 6px;
  font: 700 clamp(32px, 7vw, 56px)/1 var(--font-display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-meta { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.hero-meta span { white-space: nowrap; }
.hero-card {
  width: clamp(92px, 20vw, 150px);
  aspect-ratio: 245 / 342;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(3deg);
  background: var(--raised);
  border: 0;
  padding: 0;
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-credit { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* progress */
.progress-panel {
  max-width: 1180px;
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ring { width: 64px; height: 64px; flex: none; }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.4s ease; }
.progress-text { min-width: 0; }
.progress-count {
  font: 700 26px/1.1 var(--font-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.progress-count span { color: var(--muted); font-weight: 500; }
.progress-label { font-size: 13px; color: var(--muted); }

/* set switch */
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
}
.segmented button {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.tier-switch { max-width: 1180px; margin: 20px auto 0; }
.tier-hint { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }
.tier-hint button { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; }

/* toolbar */
.toolbar {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 58px);
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.toolbar .segmented { flex: 1 1 auto; min-width: 0; max-width: 300px; }
.toolbar .segmented button { padding: 6px 8px; font-size: 13px; }
.select {
  appearance: none;
  -webkit-appearance: none;
  margin-left: auto;
  flex: 0 1 132px;
  min-width: 96px;
  padding: 7px 28px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-size: 13px;
  text-overflow: ellipsis;
}
@media (max-width: 380px) {
  .toolbar .segmented button { padding: 6px 5px; font-size: 12.5px; }
  .select { flex-basis: 112px; min-width: 88px; padding-right: 24px; background-position: right 9px center; }
}
.search {
  flex-basis: 100%;
  display: none;
}
.search.open { display: block; }
.search input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 16px; /* no iOS zoom */
  outline: none;
}
.search input:focus { border-color: var(--accent); }

/* ---------- grid ---------- */
.era { margin-top: 28px; }
.era > h2 {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.set { margin-top: 18px; }
.set-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.set-head h3 { margin: 0; font: 600 17px/1.3 var(--font-display); letter-spacing: -0.01em; min-width: 0; }
.set-head .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.set-head .count.done { color: var(--owned); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 44%), 1fr));
  gap: 18px 14px;
}
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px 18px; } }

.tile { min-width: 0; }
.tile-media { position: relative; }
.tile-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 245 / 342;
  padding: 0;
  border: 0;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.tile-art:hover { transform: translateY(-2px); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.25s, filter 0.25s; }
.tile.missing .tile-art img { opacity: 0.6; filter: grayscale(0.45); }
.tile.partial .tile-art img { opacity: 0.85; }
.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 9px;
}
.placeholder strong { color: var(--text); font-weight: 600; }
.quick {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  color: #fff;
}
.quick svg { width: 18px; height: 18px; }
.tile.collected .quick { background: var(--owned); border-color: var(--owned); color: #0d2419; }
.tile.partial .quick { border-color: var(--owned); }
.tile-info { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; min-width: 0; }
.tile-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-num { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 4px; margin-top: 5px; min-height: 6px; }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.pip.owned { background: var(--owned); }
.pip.gm { border-radius: 1.5px; }
.empty { padding: 56px 0; text-align: center; color: var(--muted); }

/* ---------- layouts: Grid (3 across) and Compact (5 across, pictures only) ---------- */
.era-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.era-head h2 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.era-head .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.era-head .count.done { color: var(--owned); }
.layout-grid .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
.layout-grid .tile-info { margin-top: 6px; gap: 4px; }
.layout-grid .tile-name { font-size: 12.5px; }
.layout-grid .tile-num, .tile-set { font-size: 11px; color: var(--muted); }
.tile-set { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout-grid .quick { width: 30px; height: 30px; right: 6px; bottom: 6px; }
.layout-grid .quick svg { width: 16px; height: 16px; }
.layout-grid .tile-art, .layout-compact .tile-art { border-radius: 6px; }
.layout-compact .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 6px; }
@media (min-width: 640px) {
  .layout-grid .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .layout-compact .grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
.badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--owned);
  color: #0d2419;
  pointer-events: none;
}
.tile.partial .badge { background: var(--bg); border: 2px solid var(--owned); }
.badge svg { width: 11px; height: 11px; }

/* ---------- layout menu and messages ---------- */
.menu {
  position: absolute;
  top: calc(100% - 4px);
  right: var(--gutter);
  z-index: 70;
  display: grid;
  gap: 2px;
  min-width: 230px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.menu button:hover, .menu button:focus-visible { background: var(--raised); }
.menu .check { width: 18px; height: 18px; color: transparent; flex: none; }
.menu [aria-checked="true"] .check { color: var(--accent); }
.menu strong { display: block; font-weight: 600; font-size: 14px; }
.menu small { display: block; color: var(--muted); font-size: 12px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--raised);
  box-shadow: var(--shadow);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- sheet (card detail, set info) ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow);
  animation: rise 0.25s ease;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 20px; padding: 20px 24px 24px; }
}
.grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
@media (min-width: 720px) { .grabber { display: none; } }
.sheet { position: relative; }
.sheet-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--surface); }
.detail { display: grid; gap: 20px; }
@media (min-width: 720px) { .detail { grid-template-columns: 250px 1fr; } }
.detail-art {
  width: min(250px, 70%);
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 245 / 342;
  background: var(--raised);
}
@media (min-width: 720px) { .detail-art { width: 100%; } }
.detail-art img { width: 100%; height: 100%; object-fit: cover; }
.detail h2 { margin: 0; font: 700 26px/1.1 var(--font-display); letter-spacing: -0.02em; }
.detail .sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section-label {
  margin: 20px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.variants { display: grid; gap: 8px; }
.variant {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  text-align: left;
}
.variant .check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  display: grid;
  place-items: center;
  color: transparent;
}
.variant .check svg { width: 14px; height: 14px; }
.variant[aria-checked="true"] { border-color: color-mix(in srgb, var(--owned) 55%, var(--line)); }
.variant[aria-checked="true"] .check { background: var(--owned); border-color: var(--owned); color: #0d2419; }
.variant .v-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.variant .v-print { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.tag {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 1px 8px;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--owned); }
.status.review::before { background: var(--accent); }
.notes { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.collector-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.legend-title { margin: 20px 0 8px; font: 600 17px/1.3 var(--font-display); }
.legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .pip { flex: none; width: 8px; height: 8px; }
.legend-plus { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); }
.legend-plus svg { width: 13px; height: 13px; }
.notes li + li { margin-top: 4px; }

.tier-info h2 { margin: 0 0 4px; font: 700 24px/1.15 var(--font-display); letter-spacing: -0.02em; }
.tier-info .lead { margin: 0 0 16px; color: var(--muted); }
.tier-card { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.tier-card + .tier-card { margin-top: 10px; }
.tier-card h3 { margin: 0; font: 600 17px/1.3 var(--font-display); }
.tier-card h3 small { font: 500 13px var(--font-body); color: var(--muted); }
.tier-card p { margin: 6px 0 0; font-size: 14px; }
.tier-card .example { color: var(--muted); }
.tier-card.current { border-color: var(--accent); }

/* ---------- home ---------- */
.home-hero { padding: 36px 0 8px; max-width: 620px; }
.home-hero h1 { margin: 6px 0 8px; font: 700 clamp(34px, 7vw, 54px)/1.02 var(--font-display); letter-spacing: -0.03em; text-wrap: balance; }
.home-hero p { margin: 0; color: var(--muted); font-size: 16px; }
.install-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 12px 8px 12px 12px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--surface);
}
.install-hint img { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.install-text { flex: 1; min-width: 0; display: grid; font-size: 13px; color: var(--muted); }
.install-text strong { color: var(--text); font-size: 14px; font-weight: 600; }
.install-btn {
  flex: none;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 13px;
}
.install-close { width: 32px; height: 32px; flex: none; color: var(--muted); }
.install-close svg { width: 16px; height: 16px; }
.artists { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); margin-top: 28px; }
.artist {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.2s, transform 0.2s;
}
.artist:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-1px); }
.artist .glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center 30%;
  filter: blur(26px) saturate(1.2);
  opacity: 0.22;
  transform: scale(1.3);
}
.artist .thumb { flex: none; width: 60px; aspect-ratio: 245 / 342; border-radius: 5px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.35); background: var(--raised); }
.artist .thumb img { width: 100%; height: 100%; object-fit: cover; }
.artist .body { flex: 1; min-width: 0; }
.artist { color: var(--text); }
.artist h2 { margin: 0; font: 600 20px/1.2 var(--font-display); letter-spacing: -0.01em; }
.artist p { margin: 2px 0 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar div { height: 100%; background: var(--accent); border-radius: 2px; }
