/* 304 TCG storefront.
   Layout: a spruce shop sign across the top with the card mark standing on a ridgeline,
   then a fog-coloured counter of card-shaped tiles (63 x 88, a real card's proportions). */
:root {
  --ground: #F2F4EE; --surface: #FFFFFF; --ink: #17211C; --muted: #55635B; --hairline: #CCD3C8;
  --spruce: #1F4D3A; --hemlock: #143226; --ridge: #2F6B52; --gold: #C8962B; --gold-bright: #E3B84F;
  --on-spruce: #F2F4EE; --rhododendron: #A93E63; --link: #1F4D3A; --tile-back: #E4E9E0;
  --display: "Zilla Slab", Rockwell, Georgia, serif;
  --body: "Public Sans", Arial, Helvetica, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --radius-sm: 4px; --radius-card: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #101A15; --surface: #18261F; --ink: #E9EEE6; --muted: #A3B0A7; --hairline: #2A3A31;
    --spruce: #1F4D3A; --hemlock: #0C1711; --ridge: #2F6B52; --gold: #D9A93F; --gold-bright: #E3B84F;
    --on-spruce: #F2F4EE; --rhododendron: #D06A8C; --link: #8FCBAF; --tile-back: #1F3027;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.5 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: max(16px, 4vw); }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold-bright); color: #17211C; padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }

/* masthead */
.masthead { background: var(--hemlock); color: var(--on-spruce); position: sticky; top: 0; z-index: 10; }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-block: 12px; }
.brand img { width: 150px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.nav a { color: var(--on-spruce); text-decoration: none; font-weight: 600; font-size: 0.9375rem; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--gold-bright); }

/* hero */
.hero { background: var(--spruce); color: var(--on-spruce); position: relative; overflow: hidden; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 32px 56px; flex-wrap: wrap; padding-block: clamp(40px, 7vw, 84px) clamp(96px, 12vw, 132px); position: relative; z-index: 1; }
.hero-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-bright); }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 4.6vw, 4.25rem); line-height: 1; letter-spacing: -0.01em; max-width: 13ch; }
.lede { font-size: 1.0625rem; max-width: 54ch; color: #DCE6DD; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn { display: inline-block; font: 700 1rem/1 var(--body); text-decoration: none; padding: 14px 20px; border-radius: var(--radius-sm); border: 2px solid transparent; }
.btn-gold { background: var(--gold-bright); color: #17211C; }
.btn-gold:hover { background: #F0C95F; }
.btn-ghost { border-color: var(--on-spruce); color: var(--on-spruce); }
.btn-ghost:hover { background: rgba(242, 244, 238, 0.12); }
.hero-art { flex: 0 0 auto; margin-inline: auto; }
.hero-card { width: clamp(132px, 18vw, 189px); transform: rotate(4deg); filter: drop-shadow(0 14px 0 rgba(12, 31, 23, 0.45)); border-radius: var(--radius-card); }
.ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(54px, 8vw, 90px); display: block; }
.ridge-far { fill: var(--ridge); }
.ridge-near { fill: var(--ground); }

/* sections */
section { scroll-margin-top: 72px; }
.shop, .about { padding-block: clamp(40px, 6vw, 72px); }
.band { background: var(--surface); border-block: 1px solid var(--hairline); padding-block: clamp(40px, 6vw, 72px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.section-note { color: var(--muted); font-size: 0.9375rem; }
.fineprint { color: var(--muted); font-size: 0.8125rem; line-height: 1.55; max-width: 78ch; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 24px; padding: 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 0 1 190px; }
.field.grow { flex: 1 1 260px; }
.field label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select { font: 400 1rem var(--body); color: var(--ink); background: var(--ground); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; min-width: 0; }
.demo-flag { background: var(--rhododendron); color: #FFFFFF; font-weight: 600; font-size: 0.9375rem; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }

/* listing grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 24px; }
.tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.tile-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.tile-link:hover .tile-title { text-decoration: underline; text-underline-offset: 3px; }
.tile-photo { aspect-ratio: 63 / 88; background: var(--tile-back); display: grid; place-items: center; padding: 14px; position: relative; }
.tile-photo img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.tile-photo .no-photo { width: 46%; opacity: 0.55; }
.flag { position: absolute; top: 10px; left: 10px; background: var(--rhododendron); color: #FFFFFF; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 8px; border-radius: var(--radius-sm); }
.tile-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile-title { font: 600 1.0625rem/1.25 var(--display); overflow-wrap: anywhere; }
.tile-set { font: 500 0.8125rem/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.price { font: 700 1.25rem/1 var(--display); font-variant-numeric: tabular-nums; }
.tile-cta { font-size: 0.8125rem; font-weight: 700; color: var(--link); }

/* condition pills: told apart by label and lightness, not hue alone */
.pill { display: inline-block; font: 700 0.75rem/1 var(--body); letter-spacing: 0.06em; padding: 5px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pill-nm { background: var(--spruce); color: var(--on-spruce); }
.pill-lp { background: var(--ridge); color: #FFFFFF; }
.pill-mp { background: var(--gold-bright); color: #17211C; }
.pill-hp { background: transparent; color: var(--ink); border-color: var(--ink); }
.pill-dmg { background: var(--ink); color: var(--ground); }
.pill-other { background: var(--tile-back); color: var(--ink); border-color: var(--hairline); }

/* empty state */
.empty { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--surface); border: 1px dashed var(--hairline); border-radius: var(--radius-card); padding: clamp(20px, 4vw, 36px); }
.empty img { width: 84px; flex: 0 0 auto; transform: rotate(-4deg); }
.empty div { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.empty p { color: var(--muted); max-width: 60ch; }

/* condition guide */
.grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px 32px; margin: 0 0 24px; }
.grades dt { font: 600 1.0625rem/1.3 var(--display); display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.grades dd { margin: 0; color: var(--muted); font-size: 0.9375rem; }

/* about and contact */
.about-row, .contact-row { display: flex; gap: 32px 64px; flex-wrap: wrap; align-items: flex-start; }
.about-row > div, .contact-row > div { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 14px; max-width: 62ch; }
.facts, .contact-list { list-style: none; margin: 0; padding: 0; flex: 0 1 320px; min-width: 240px; border-top: 2px solid var(--gold); }
.facts li, .contact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--hairline); flex-wrap: wrap; }
.fact-k { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); align-self: center; }
.fact-v, .contact-list a { font-weight: 600; overflow-wrap: anywhere; }

/* footer */
.footer { background: var(--hemlock); color: var(--on-spruce); padding-block: 36px; }
.footer-row { display: flex; gap: 20px 40px; flex-wrap: wrap; align-items: center; }
.footer img { width: 190px; flex: 0 0 auto; }
.footer .fineprint { color: #B7C4BB; flex: 1 1 320px; min-width: 0; }

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile-body { padding: 10px 12px 12px; }
  .tile-foot { flex-direction: column; align-items: flex-start; }
  .hero-art { display: none; }
}
