/* Hallmark · redesign · macrostructure: Catalogue Shelves · theme: candy-arcade (locked system)
 * genre: playful · nav/footer: shared site chrome (preserved) · enrichment: Tier-A CSS stickers */

/* Anime Mochi - /categories/ page. Extends site.css (chrome + design tokens,
   incl. the shared pastel accent set). The homepage is one big grid; this page
   groups every game by category, each category shelf carrying its own accent
   hue (same sticker/chip language as the guides hub in guides.css). */

/* identical shell metrics to the guides hub (site.css .page.guides-hub):
   same 1280px max-width, same 48/24/64 padding */
.cat-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: var(--space-7) var(--space-5) var(--space-8); flex: 1 0 auto; }

/* ---- hero ---- */
/* crumbs + subtitle match the guides .page cascade exactly (17px / ink-body) */
.cat-intro .crumbs { font-size: 1.0625rem; color: var(--ink-body); margin: 0 0 var(--space-4); }
.cat-intro .crumbs a { color: var(--teal-ink); text-decoration: none; font-weight: 700; }
.cat-intro .crumbs a:hover { text-decoration: underline; color: var(--ink); }
.cat-intro .crumbs span { margin: 0 7px; color: var(--edge-2); }
.cat-intro h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; font-size: clamp(2rem, 5vw, 2.6rem); color: var(--ink); margin: var(--space-2) 0 var(--space-4); line-height: 1.08; overflow-wrap: anywhere; min-width: 0; }
.cat-intro .hl {
  background: linear-gradient(transparent 60%, color-mix(in oklch, var(--pink) 36%, transparent) 60%);
  border-radius: 4px; padding: 0 2px;
}
.cat-intro p { color: var(--ink-body); font-size: 1.0625rem; margin: 0; max-width: 62ch; }

/* ---- jump chips - one per category, diamond dot in the shelf accent ---- */
.cat-chips { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: var(--space-5) 0 0; }
.cat-chips a {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 500; font-size: 0.98rem;
  color: var(--ink); text-decoration: none;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-pill);
  padding: 8px 16px;
  transition: transform var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
              box-shadow var(--dur-1) var(--ease-out);
}
.cat-chips a::before {
  content: ""; width: 11px; height: 11px; flex: none;
  border-radius: 4px; transform: rotate(45deg);
  background: var(--gc, var(--pink));
}
.cat-chips a b { font-weight: 500; color: var(--ink-soft); font-size: 0.88rem; }
.cat-chips a:hover, .cat-chips a:focus-visible {
  transform: translateY(-2px); border-color: var(--gc-ink, var(--pink-ink));
  box-shadow: 0 3px 0 color-mix(in oklch, var(--gc-ink, var(--pink-ink)) 45%, transparent);
}

/* ---- category shelves ---- */
.cat { margin: var(--space-7) 0 0; scroll-margin-top: 76px; }
.cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); }
.cat-head h2 {
  display: inline-block; transform: rotate(-1.6deg);
  font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; letter-spacing: 0.005em;
  color: var(--ink); background: var(--gc, var(--pink));
  border: 2px solid var(--ink); border-radius: var(--radius-md);
  padding: 6px 18px; margin: 0; box-shadow: 0 3px 0 var(--gc-ink, var(--pink-ink));
}
.cat-head .count { font-size: 0.92rem; color: var(--ink-soft); font-weight: 700; }
.cat-blurb { margin: 0 0 var(--space-4); color: var(--ink-soft); font-size: 1.0625rem; max-width: 62ch; }
.cat-blurb a { color: var(--gc-ink, var(--teal-ink)); font-weight: 700; text-decoration: none; }
.cat-blurb a:hover { color: var(--ink); text-decoration: underline; }

/* per-category accents (shared pastel set from site.css) */
#cat-adventure { --gc: var(--mint); --gc-ink: var(--mint-ink); }
#cat-io        { --gc: var(--teal); --gc-ink: var(--teal-ink); }
#cat-arcade    { --gc: var(--pink); --gc-ink: var(--pink-ink); }
#cat-logic     { --gc: var(--lav);  --gc-ink: var(--lav-ink); }
#cat-merge     { --gc: var(--sun);  --gc-ink: var(--sun-ink); }
#cat-memory    { --gc: var(--sky);  --gc-ink: var(--sky-ink); }

.cat-grid { display: flex; flex-wrap: wrap; gap: var(--space-4); align-content: start; }

/* game cards (same look as the homepage grid; up to 10 per row) */
a.card {
  flex: 0 1 calc((100% - 2 * 16px) / 3);
  position: relative; overflow: hidden; display: block; aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg); text-decoration: none; color: #fff;
  background: var(--paper-2); border: 2px solid var(--line-soft); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
  transform: translateZ(0);
}
@media (min-width: 512px)  { a.card { flex-basis: calc((100% - 3 * 16px) / 4); } }
@media (min-width: 672px)  { a.card { flex-basis: calc((100% - 4 * 16px) / 5); } }
@media (min-width: 852px)  { a.card { flex-basis: calc((100% - 5 * 16px) / 6); } }
@media (min-width: 1040px) { a.card { flex-basis: calc((100% - 6 * 16px) / 7); } }
@media (min-width: 1240px) { a.card { flex-basis: calc((100% - 7 * 16px) / 8); } }
@media (min-width: 1440px) { a.card { flex-basis: calc((100% - 8 * 16px) / 9); } }
@media (min-width: 1660px) { a.card { flex-basis: calc((100% - 9 * 16px) / 10); } }
a.card .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-2) var(--ease-out); }
a.card .title {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 10px;
  font-weight: 800; font-size: 0.82rem; letter-spacing: 0.01em;
  background: linear-gradient(to top, color-mix(in oklch, var(--scrim) 82%, transparent), transparent);
}
a.card::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  border: 3px solid var(--on-pink);
  background: var(--pink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") 54% center / 26px no-repeat;
  box-shadow: 0 6px 16px color-mix(in oklch, var(--scrim) 50%, transparent);
  opacity: 0; transform: scale(0.8); pointer-events: none;
  transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
a.card:active { transform: translateY(-1px); }
a.card:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
@media (hover: hover) {
  a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gc-ink, var(--pink)); }
  a.card:hover .thumb { transform: scale(1.06); }
  a.card:hover::after { opacity: 1; transform: scale(1); }
}
