/* Carniepunk. Palette tokens from docs/carniepunk-style.md; the style lives in
   the illustration (img/), the type and layout live here. */
@font-face { font-family: "Rye"; font-weight: 400; font-display: swap; src: url("/fonts/rye-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Sancreek"; font-weight: 400; font-display: swap; src: url("/fonts/sancreek-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 500; font-display: swap; src: url("/fonts/archivo-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("/fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url("/fonts/archivo-latin-800-normal.woff2") format("woff2"); }

:root {
  --ground: #070807; /* matched to the frame and hero art's black */
  --oxblood: #7e2420;
  --vermilion: #c23b2a;
  --mustard: #e3b33a;
  --sage: #9eb497;
  --cream: #f0e4c6;
  --band: #f7ebd3; /* matched to the mascot art's cream */
  --rust: #9a4e26;
  --rule: #2a2421;
  --muted: #bfb49a;
  --display: "Rye", Georgia, serif;
  --poster: "Sancreek", Georgia, serif;
  --body: "Archivo", system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--cream); font-family: var(--body); font-weight: 500; line-height: 1.45; }
a { color: var(--mustard); }
a:hover { color: var(--cream); }
img { max-width: 100%; }

/* Hero: the art is the header's background; the sky takes the wordmark. */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1776 / 896;
  max-height: 80vh;
  background: var(--ground) url("/img/carniepunk-hero.jpg") center / cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 2.6vw;
  text-align: center;
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 8.1vw, 124px);
  line-height: 1;
  color: var(--cream);
  text-shadow: 5px 5px 0 var(--ground), 8px 8px 0 var(--oxblood);
}
.tagline {
  margin: 0;
  font-family: var(--poster);
  font-size: clamp(18px, 2.35vw, 36px);
  color: var(--mustard);
  text-shadow: 3px 3px 0 var(--ground);
}

/* Category tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  justify-content: center;
  padding: 20px var(--gutter);
  border-bottom: 2px solid var(--rule);
}
.tab {
  font: 800 15px/1 var(--body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--cream);
  padding: 10px 4px;
  min-height: 44px;
  cursor: pointer;
}
.tab:hover { color: var(--mustard); }
.tab[aria-pressed="true"] { color: var(--mustard); border-bottom-color: var(--vermilion); }
.tab:focus-visible, .cta:focus-visible, a:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }
.stores .tab { font-size: 13px; color: var(--sage); }

/* Cards, three to a row */
.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding: 48px var(--gutter);
}
.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.framed {
  position: relative;
  width: 100%;
  aspect-ratio: 1136 / 1408;
  background: url("/img/carniepunk-frame.jpg") center / 100% 100% no-repeat;
}
/* The frame's blank panel: left 18%, right 17.7%, top 21.3%, bottom 14.8%. A
   pick with no copied image leaves it empty. */
.photo {
  position: absolute;
  left: 18%;
  right: 17.7%;
  top: 21.3%;
  bottom: 14.8%;
  overflow: hidden;
  border-radius: 10px;
}
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}
.blurb { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }
.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-weight: 700; font-size: 14px; }
.cat { color: var(--sage); }
.price { color: var(--mustard); }

/* The ringmistress band, after the first row of a longer list */
.barker {
  background: var(--band);
  color: var(--ground);
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 36px var(--gutter) 0;
}
.barker-art { width: 330px; height: 442px; object-fit: cover; object-position: top; align-self: flex-end; display: block; flex: none; }
.barker-words { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 36px; }
.barker-head { margin: 0; font: 400 clamp(40px, 5vw, 72px)/1 var(--display); color: var(--oxblood); }
.barker-copy { margin: 0; font-size: 20px; max-width: 560px; }
.barker-tag { margin: 0; font: 400 clamp(20px, 2vw, 28px)/1.2 var(--poster); color: var(--vermilion); }
.cta {
  display: inline-block;
  font: 800 16px/1 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  background: var(--oxblood);
  border: 3px solid var(--ground);
  padding: 14px 26px;
}
.cta:hover { background: var(--vermilion); color: var(--cream); }

/* A filter that matches nothing */
.none { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 72px var(--gutter); text-align: center; }
.none-head { margin: 0; font: 400 clamp(28px, 3.4vw, 48px)/1.1 var(--display); color: var(--mustard); }
.none-copy { margin: 0; font-size: 18px; color: var(--muted); }
.none .cta { cursor: pointer; border-color: var(--cream); }

/* Empty state, and the fallback for a missing or unreadable catalogue */
.empty { display: flex; align-items: center; justify-content: center; gap: 48px; padding: 56px var(--gutter) 0; background: var(--band); color: var(--ground); }
.empty-art { width: 330px; height: 442px; object-fit: cover; object-position: top; align-self: flex-end; flex: none; display: block; }
.empty-words { padding-bottom: 56px; max-width: 520px; }
.empty-words h2 { margin: 0 0 12px; font: 400 clamp(32px, 4vw, 56px)/1.05 var(--display); color: var(--oxblood); }
.empty-words p { margin: 0; font-size: 20px; }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  border-top: 2px solid var(--rule);
  padding: 26px var(--gutter);
  font-size: 14px;
  color: var(--muted);
}
.foot-mark { font: 400 20px/1 var(--display); color: var(--cream); }

@media (max-width: 900px) {
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
}

@media (max-width: 640px) {
  /* The art keeps the ringmistress (centre-left); the wordmark sits under it. */
  .hero {
    aspect-ratio: auto;
    max-height: none;
    padding-top: 66vw;
    padding-bottom: 20px;
    background-size: auto 66vw;
    background-position: 16% top;
    background-repeat: no-repeat;
  }
  .hero h1 { font-size: clamp(36px, 12.5vw, 64px); text-shadow: 3px 3px 0 var(--ground), 5px 5px 0 var(--oxblood); }
  .tabs { gap: 0 16px; padding: 12px var(--gutter); }
  .row { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 32px var(--gutter); }
  .barker, .empty { flex-direction: column; gap: 0; padding: 28px var(--gutter) 0; text-align: center; }
  .barker-words, .empty-words { align-items: center; padding-bottom: 28px; }
  .barker-art, .empty-art { width: min(260px, 70%); height: auto; aspect-ratio: 330 / 442; order: 2; align-self: center; }
  .barker-words { order: 1; }
  .empty-words { order: 1; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
