/* TCG Stands gallery. Tokens first; change them here. */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin.woff2') format('woff2-variations'), url('../fonts/archivo-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
/* Fallback sized to Archivo so the swap moves as little as possible. */
@font-face {
  font-family: 'Archivo Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Liberation Sans');
  size-adjust: 97%;
  ascent-override: 88%;
  descent-override: 22%;
  line-gap-override: 0%;
}

:root {
  --putty: #E5E7E2;
  --paper: #FBFBF9;
  --ink: #22262A;
  --plate: #23272B;
  --plate-top: #3B4046;
  --hot: #E03A1E;        /* large type and marks only: 3.52:1 on putty */
  --hot-text: #B3260F;   /* red for small text: 5.27:1 on putty, 6.33:1 on paper */
  --mute: #5F6569;       /* 4.75:1 on putty */
  --line: #BEC2BC;       /* decorative hairlines only */
  --line-strong: #787D7C; /* control borders: 3.36:1 on putty, 4.04:1 on paper */
  --holo: linear-gradient(120deg, #8BE9FF, #FFD1F5, #FFF6A8, #B7FFD1, #A4C8FF);

  --font: 'Archivo', 'Archivo Fallback', Arial, sans-serif;
  --wide: 118%;
  --narrow: 68%;

  --max: 1200px;
  --gutter: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --section: clamp(56px, 8vw, 104px);
  --radius: 6px;

  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--putty);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 720px) { body { font-size: 17px; } }

[hidden] { display: none !important; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
summary { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}
.btn:focus-visible { outline-offset: 3px; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  border-radius: var(--radius); z-index: 50; text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---------- type ---------- */

h1 {
  font-stretch: var(--wide);
  font-weight: 780;
  font-size: clamp(2rem, 1.1rem + 2.7vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.0;
  max-width: 40ch;
  text-wrap: balance;
}
h2 {
  font-stretch: var(--wide);
  font-weight: 760;
  font-size: clamp(1.55rem, 1.05rem + 1.8vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}
h3 {
  font-weight: 620;
  font-size: 1.0625rem;
  line-height: 1.3;
}
.num {
  font-stretch: var(--narrow);
  font-weight: 680;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
}

/* ---------- layout ---------- */

.masthead, .hero, .shop, .foot {
  width: min(100% - var(--gutter) * 2, var(--max));
  margin-inline: auto;
}

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; white-space: nowrap;
}
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name {
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1;
}
.masthead-actions { display: flex; align-items: center; gap: 24px; }
.sections { display: flex; gap: 4px 16px; }
@media (min-width: 720px) { .sections { gap: 4px 20px; } }
.sections a {
  font-weight: 600; text-decoration: none; padding: 6px 0; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
@media (max-width: 419px) { .brand-name { font-size: 1.05rem; } .sections a { font-size: 0.9375rem; } }
.sections a:hover { border-bottom-color: var(--ink); }

/* The first screen says what this is; the designs start right below it. */
.hero { padding: clamp(16px, 3vw, 36px) 0 clamp(32px, 5vw, 56px); }
.hero h1 { max-width: 16ch; }

/* ---------- photo tiles ---------- */

/* The photos have their own studio gray; the tile shows it while a photo loads, so nothing flashes white. */
.product-figure {
  position: relative; display: block;
  aspect-ratio: 1;
  border-radius: 12px; overflow: hidden;
  background: #D5D9DD;
}
.photo { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .photo { transition: transform 0.35s ease; }
  .product-link:hover .photo { transform: scale(1.04); }
}
.stage-none { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 12px; color: var(--mute); font-size: 0.8125rem; font-weight: 500; }

/* ---------- gallery tiles ---------- */

/* Two tiles across on a phone, more as there is room. */
.products {
  --card-pad: clamp(6px, 1.6vw, 14px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 32px;
  margin-inline: calc(var(--card-pad) * -1);
}
@media (min-width: 720px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; } }
@media (min-width: 1000px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.product { position: relative; min-width: 0; padding: 0 var(--card-pad); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--ink); color: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 620; font-size: 0.9375rem; line-height: 1.2;
  text-decoration: none; text-align: center;
  cursor: pointer;
}
.btn:hover { background: var(--plate-top); border-color: var(--plate-top); }
.btn.btn-quiet { background: transparent; color: var(--ink); }
.btn.btn-quiet:hover { background: var(--paper); }

/* ---------- gallery ---------- */

.shop { padding: 0 0 var(--section); }
.section-head { display: grid; gap: 8px; margin-bottom: 20px; }

.finder { display: grid; gap: 12px; margin-bottom: 8px; }
.finder-search { position: relative; max-width: 440px; }
.finder-search input[type="search"] {
  width: 100%;
  padding: 11px 44px 11px 42px;
  min-height: 46px;
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
}
.finder-search input[type="search"]:focus-visible { border-color: var(--ink); outline-offset: 2px; }
.finder-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.finder-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--mute); pointer-events: none; }
.finder-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.finder-clear:hover { background: var(--ink); color: var(--paper); }

.filters { display: grid; gap: 10px; }
.filter-group { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.filter-group::-webkit-scrollbar { display: none; }
.filter-label { flex: none; width: 5.2rem; font-size: 0.875rem; color: var(--mute); font-weight: 500; }
.chip {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-size: 0.9rem; font-weight: 520; line-height: 1.2;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.roster:empty { display: none; }
.roster-inline { flex-wrap: wrap; overflow: visible; }
.roster-panel { max-width: 100%; }
.roster-summary {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; padding: 6px 0; list-style: none;
}
.roster-summary::-webkit-details-marker { display: none; }
.roster-summary::before {
  content: ''; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); margin-right: 2px;
}
.roster-panel[open] .roster-summary::before { transform: rotate(45deg); margin-bottom: 3px; }
.roster-groups { columns: 11rem; column-gap: 28px; padding: 10px 0 4px; }
.roster-group { margin-bottom: 12px; }
.roster-letter { display: block; font-stretch: var(--wide); font-weight: 760; font-size: 0.9rem; margin-bottom: 4px; break-after: avoid; }
.roster-names { display: block; }
.roster-names li { break-inside: avoid; }
.roster-name {
  background: none; border: 0; padding: 4px 8px; margin-left: -8px;
  border-radius: 4px; text-align: left; cursor: pointer;
  font-size: 0.9375rem; line-height: 1.3;
}
.roster-name:hover { background: var(--paper); }
.roster-name[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.roster-count { color: var(--mute); font-size: 0.8em; }
.roster-name[aria-pressed="true"] .roster-count { color: var(--paper); opacity: 0.7; }

.shop-status { color: var(--mute); font-size: 0.9375rem; margin: 10px 0 8px; min-height: 1.5em; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
/* The result count is a heading (focus lands here when the control that was used is gone), dressed as the status line. */
.results-title { font: inherit; color: inherit; letter-spacing: inherit; }
.status-clear {
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 3px 10px; font-size: 0.85rem; font-weight: 560; cursor: pointer;
}
.status-x { opacity: 0.8; }
.no-match { display: grid; gap: 14px; padding: 8px 0 24px; max-width: 60ch; }
.no-match p:first-child { font-size: 1.125rem; font-weight: 600; }

.product-link { display: grid; gap: 12px; text-decoration: none; color: inherit; border-radius: 12px; }
.product-link:focus-visible { outline-offset: 4px; }
.product-body { display: grid; gap: 2px; }
.product-title { font-stretch: 108%; font-weight: 720; font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.2; }
.product-meta { font-size: 0.9375rem; color: var(--mute); }

/* ---------- a stand's own page ---------- */

.stand { width: min(100% - var(--gutter) * 2, var(--max)); margin: 0 auto; padding: 4px 0 var(--section); }
.stand-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.stand-back:hover { text-decoration: underline; }
.stand-layout { display: grid; gap: 24px; margin-top: 4px; }
@media (min-width: 860px) {
  .stand-layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
  .stand-info { position: sticky; top: 24px; }
}
.stand-photos { display: grid; gap: 10px; }
.stand-photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #D5D9DD; }
.stand-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stand-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.stand-thumb { display: block; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #D5D9DD; cursor: pointer; }
.stand-thumb[aria-current="true"] { border-color: var(--ink); }
.stand-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stand-info { display: grid; gap: 12px; align-content: start; }
.stand-game { color: var(--mute); font-weight: 600; font-size: 0.9375rem; }
.stand-info h1 { font-size: clamp(2rem, 1.2rem + 2.5vw, 3rem); }
.stand-desc { max-width: 52ch; margin-top: 8px; }

.stand-more { margin-top: var(--section); display: grid; gap: 20px; }
.stand-all { margin-top: 8px; }

/* ---------- designs: in progress and concepts ---------- */

.designs { width: min(100% - var(--gutter) * 2, var(--max)); margin: 0 auto; padding-bottom: var(--section); display: grid; gap: clamp(40px, 6vw, 72px); }
.designs section { display: grid; gap: 24px; }
.idea { display: grid; gap: 20px; }
@media (min-width: 860px) {
  .idea { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
}
.idea-images { display: grid; gap: 12px; }
.idea-images img { display: block; width: 100%; height: auto; border-radius: 14px; background: #D5D9DD; }
.idea-text { display: grid; gap: 10px; align-content: start; max-width: 46ch; }
.idea-text h3 { font-stretch: var(--wide); font-weight: 760; font-size: clamp(1.4rem, 1rem + 1.2vw, 1.9rem); letter-spacing: -0.015em; line-height: 1.1; }

/* ---------- footer ---------- */

.foot {
  display: grid; gap: 18px;
  padding: 28px 0 calc(44px + env(safe-area-inset-bottom, 0px));
  border-top: 3px solid var(--plate);
  color: var(--ink);
}
.foot-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.foot-name { font-stretch: var(--wide); font-weight: 800; letter-spacing: -0.02em; font-size: 1.1rem; }
.foot-tag { color: var(--mute); font-size: 0.9375rem; }
.foot-legal { color: var(--mute); font-size: 0.875rem; max-width: 70ch; line-height: 1.45; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
