:root {
  --yellow: #FFD83D;
  --red: #FF4037;
  --blue: #3267FF;

  --paper: #FFFAF0;
  --paper-dim: #FFFFFF;
  --ink: #121212;
  --ink-soft: #4A4A4A;
  --line: var(--ink);

  --golden: #FFCB05;
  --silver: #9FB0BF;
  --bronze: #C1440E;
  --copper: #9C7A26;
  --modern: var(--blue);

  --tag: var(--red);

  --display: 'Anton', sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'Inter', system-ui, sans-serif;

  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-md: 7px 7px 0 var(--ink);
  --shadow-lg: 10px 10px 0 var(--ink);
}

:root[data-theme="dark"] {
  --paper: #17140F;
  --paper-dim: #221D15;
  --ink: #EDE6D6;
  --ink-soft: #B7AE95;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px;
}

a { color: inherit; }

/* ---------- Buttons / pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--body);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-dim);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.pill:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.pill:active { transform: translate(0, 0); box-shadow: 2px 2px 0 var(--ink); }
.pill.dark { background: var(--ink); color: var(--paper); }
.pill:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: var(--shadow-sm);
  transform: none;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--yellow);
  border-bottom: 4px solid var(--ink);
  padding: 14px 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  min-height: 50px;
}

.wordmark-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  text-decoration: none;
}
.spacer { flex: 1; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: 34px;
}
.site-nav a {
  font-family: var(--body);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-decoration: none;
  color: var(--ink);
}
.site-nav a:hover { color: var(--red); }

.site-icon {
  display: block;
  height: 69px;
  width: auto;
}

.site-wordmark-img {
  display: block;
  height: 54px;
  width: auto;
}

.account-area { display: flex; align-items: center; gap: 10px; }

.signin-link {
  font-family: var(--body);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  background: var(--paper-dim);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
}
.signin-link:hover { background: var(--yellow); }

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
}
.account-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ink);
}
.account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.member-badge {
  font-family: var(--body);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  background: var(--paper-dim);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none;
}

.upgrade-btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--ink);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.upgrade-btn:hover { filter: brightness(1.05); }

.signout-btn {
  background: transparent;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 5px 9px;
  cursor: pointer;
  border-radius: 999px;
  opacity: 0.75;
}
.signout-btn:hover { opacity: 1; background: var(--paper-dim); }

.theme-toggle {
  background: var(--paper-dim);
  border: 3px solid var(--ink);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  padding: 9px 12px;
  cursor: pointer;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.theme-toggle:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 40px; overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}

.kicker {
  display: inline-block;
  border: 3px solid var(--ink);
  padding: 7px 12px;
  background: var(--red);
  color: #fff;
  font-family: var(--body);
  font-weight: 800;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 5.5vw, 68px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 20px 0;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero h1 em {
  color: var(--blue);
  font-style: normal;
  text-shadow: 3px 3px 0 var(--ink);
}

.hero-desc {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  max-width: 560px;
  font-weight: 500;
  color: var(--ink-soft);
}

.hero-search {
  display: flex;
  margin-top: 26px;
  border: 4px solid var(--ink);
  background: var(--paper-dim);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-width: 560px;
}
.hero-search input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 15px;
  background: transparent;
  color: var(--ink);
  font: 600 15px var(--body);
}
.hero-search button {
  border: 0;
  background: var(--red);
  color: #fff;
  font-family: var(--body);
  font-weight: 900;
  text-transform: uppercase;
  padding: 0 22px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
}
.hero-search button:hover { filter: brightness(1.05); }

.hero-art { min-height: 420px; position: relative; }
.hero-art .burst {
  position: absolute;
  inset: 20px;
  background-color: var(--yellow);
  background-image: radial-gradient(circle, rgba(0,0,0,0.18) 1px, transparent 1.1px);
  background-size: 9px 9px;
  clip-path: polygon(50% 0,60% 31%,82% 8%,73% 38%,100% 36%,78% 53%,99% 68%,70% 66%,78% 100%,56% 72%,42% 100%,42% 70%,11% 93%,29% 61%,0 57%,29% 47%,7% 26%,39% 36%);
  border: 5px solid var(--ink);
}
.hero-issue {
  position: absolute;
  width: 220px;
  height: 320px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(6deg);
  background: var(--blue);
  border: 6px solid var(--ink);
  box-shadow: 12px 12px 0 rgba(0,0,0,0.85);
  overflow: hidden;
}
.hero-issue img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-issue .placeholder-label {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--display);
  text-align: center;
  font-size: 22px;
  line-height: 1;
  padding: 12px;
  text-transform: uppercase;
}
.hero-badge {
  position: absolute;
  right: 0px;
  top: 10px;
  width: 165px;
  height: auto;
  transform: rotate(10deg);
}

/* ---------- Era tabs (filter pills) ---------- */
.era-tabs {
  display: flex;
  gap: 10px;
  padding: 0 22px 34px;
  overflow-x: auto;
}

.era-tab {
  font-family: var(--body);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--ink);
  background: var(--paper-dim);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background 0.1s ease;
}
.era-tab:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

.era-tab .years {
  display: block;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.75;
  margin-top: 1px;
}

.era-tab[data-era="golden"].active { background: var(--golden); }
.era-tab[data-era="silver"].active { background: var(--silver); }
.era-tab[data-era="bronze"].active { background: var(--bronze); color: #fff; }
.era-tab[data-era="copper"].active { background: var(--copper); color: #fff; }
.era-tab[data-era="modern"].active { background: var(--modern); color: #fff; }
.era-tab[data-era=""].active { background: var(--red); color: #fff; }

/* ---------- Results bar ---------- */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 20px;
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
}

#sort {
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
  background: var(--paper-dim);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink);
}

/* ---------- Grid & cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  gap: 22px;
  padding-bottom: 50px;
}

.card {
  position: relative;
  background: var(--paper-dim);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--ink);
  display: block;
  padding-bottom: 16px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 11px 11px 0 var(--ink);
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
  display: block;
  background: var(--line);
  border-bottom: 4px solid var(--ink);
}

.price-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red);
  color: #fff;
  font-family: var(--body);
  font-weight: 900;
  font-size: 14px;
  padding: 5px 10px;
  border: 3px solid var(--ink);
  transform: rotate(4deg);
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-family: var(--body);
  font-weight: 800;
  font-size: 16px;
  margin: 14px 14px 2px;
  line-height: 1.25;
}

.card .issue {
  font-family: var(--body);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 14px;
}

.grade {
  display: inline-block;
  font-family: var(--body);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 3px 8px;
}
.card .grade { margin: 10px 6px 0 14px; }

.cert-tag {
  display: inline-block;
  font-family: var(--body);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.2px;
  color: #fff;
  background: var(--blue);
  border: 2px solid var(--ink);
  padding: 3px 8px;
}
.card .cert-tag { margin: 10px 14px 0 0; }


.empty-state {
  font-family: var(--body);
  font-weight: 600;
  color: var(--ink-soft);
  padding: 40px 0;
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 200;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border: 4px solid var(--paper);
  box-shadow: 0 0 0 4px var(--ink);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-family: var(--body);
  font-weight: 800;
  font-size: 18px;
  width: 44px;
  height: 44px;
  background: var(--paper-dim);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.lightbox-close:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

.loading-more {
  font-family: var(--body);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  padding: 20px 0 50px;
}
#scroll-sentinel {
  height: 1px;
}

.site-footer {
  padding: 26px 22px 50px;
  color: var(--ink-soft);
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  border-top: 3px solid var(--ink);
}

@media (max-width: 850px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 340px; }
}

@media (max-width: 560px) {
  .hero h1 { letter-spacing: -2px; white-space: normal; }
  .hero-search { display: block; }
  .hero-search button { width: 100%; padding: 15px; margin-top: 4px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .header-row { flex-direction: column; align-items: stretch; }
  .hero-art { min-height: 280px; }
  .hero-issue { width: 170px; height: 240px; }
}
