/* ==========================================================================
   Components. Animation is limited to transform/opacity (§31).
   ========================================================================== */

/* ---------- Button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent;
  transition: transform var(--dur-1) var(--ease), background-color var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
  will-change: transform;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-2); }
.btn--primary:hover { background: var(--accent-strong); color: var(--on-accent); box-shadow: var(--glow); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
.btn--sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn--block { width: 100%; }

/* ---------- Icon button (44px target) ---------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  border-radius: var(--radius-full);
  color: var(--text);
  transition: background-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; }

/* All inline icons are stroked outlines. Without this they inherit the default
   black fill and render as solid blobs outside .icon-btn (e.g. inside .btn). */
svg { stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.btn svg { width: 18px; height: 18px; flex: 0 0 18px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header { backdrop-filter: blur(14px) saturate(140%); }
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-1); }

.header__inner {
  display: flex; align-items: center; gap: var(--space-2);
  height: var(--header-h);
  transition: height var(--dur-3) var(--ease);
}
.site-header.is-scrolled .header__inner { height: calc(var(--header-h) - 6px); }

.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--text-lg); color: var(--text); letter-spacing: -.02em;
  margin-right: auto; white-space: nowrap;
}
.brand__mark {
  display: grid; place-items: center;
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--on-accent); font-size: 15px; font-weight: 900;
}

.header__nav { display: none; }
@media (min-width: 900px) {
  .header__nav { display: flex; align-items: center; gap: var(--space-1); margin-right: var(--space-2); }
  .header__nav a {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    color: var(--text-2); font-size: var(--text-sm); font-weight: 600;
    transition: color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease);
  }
  .header__nav a:hover { color: var(--text); background: var(--surface-2); }
  .header__nav a[aria-current="page"] { color: var(--accent); background: var(--accent-deep); }
  .header__menu-btn { display: none; }
}

/* ---------- Drawer ---------- */
.drawer-scrim {
  position: fixed; inset: 0; z-index: var(--z-drawer);
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-3) var(--ease);
}
@supports (backdrop-filter: blur(1px)) { .drawer-scrim { backdrop-filter: blur(3px); } }
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; inset-block: 0; right: 0; z-index: calc(var(--z-drawer) + 1);
  width: min(86vw, 340px);
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  transform: translate3d(100%, 0, 0);
  transition: transform var(--dur-3) var(--ease-out);
  overscroll-behavior: contain;
}
.drawer.is-open { transform: translate3d(0, 0, 0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  padding-top: max(var(--space-4), env(safe-area-inset-top, 0px));
}
.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-3) var(--space-8); }
.drawer__link {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--tap); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text); font-weight: 600;
}
.drawer__link:hover, .drawer__link[aria-current="page"] { background: var(--surface-2); color: var(--accent); }

.drawer__group { margin-top: var(--space-2); }
.drawer__toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: var(--tap); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-muted); font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
}
.drawer__toggle::after {
  content: ""; width: 8px; height: 8px; flex: 0 0 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-2) var(--ease);
}
.drawer__toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
.drawer__panel { display: grid; }
.drawer__panel[hidden] { display: none; }
.drawer__panel a {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--tap); padding: var(--space-2) var(--space-4) var(--space-2) var(--space-6);
  border-radius: var(--radius-md);
  color: var(--text-2); font-size: var(--text-sm);
}
.drawer__panel a:hover { background: var(--surface-2); color: var(--accent); }
.drawer__panel .count { color: var(--text-muted); font-size: var(--text-xs); }

/* ---------- Bottom navigation (mobile) ---------- */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-bottomnav);
  display: grid; grid-template-columns: repeat(4, 1fr);
  /* Opaque, not translucent: content scrolling underneath was showing through
     and making the labels hard to read. */
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }
.bottom-nav a, .bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: var(--bottomnav-h);
  color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: .02em;
  transition: color var(--dur-2) var(--ease);
}
.bottom-nav a[aria-current="page"], .bottom-nav a:hover, .bottom-nav button:hover { color: var(--accent); }
.bottom-nav svg { width: 21px; height: 21px; stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(2rem, 1rem + 5vw, 5rem) clamp(1.5rem, 1rem + 3vw, 3rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: -30%;
  width: min(120%, 900px); aspect-ratio: 1; translate: -50% 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px var(--space-3); margin-bottom: var(--space-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text-2);
  font-size: var(--text-xs); font-weight: 600;
}
.hero__eyebrow b { color: var(--accent); }
.hero h1 { font-size: var(--text-4xl); max-width: 14ch; }
.hero__lede { margin-top: var(--space-4); max-width: 52ch; font-size: var(--text-lg); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.hero__actions .btn { flex: 1 1 auto; min-width: 150px; }
@media (min-width: 560px) { .hero__actions .btn { flex: 0 0 auto; } }

.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3); margin-top: var(--space-8);
}
.stat {
  padding: var(--space-4) var(--space-3); text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat__num { display: block; font-family: var(--font-display); font-size: var(--text-2xl);
  font-weight: 800; color: var(--accent); line-height: 1; }
.stat__label { display: block; margin-top: 6px; font-size: var(--text-xs);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Category chips ---------- */
.chips {
  display: flex; gap: var(--space-2);
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: var(--space-2);
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text-2);
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
  transition: color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); font-weight: 700;
}
.chip .count { opacity: .75; font-weight: 600; }

/* ---------- Game grid ---------- */
.game-grid {
  display: grid; gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* mobile: 2 cols */
}
@media (min-width: 560px)  { .game-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--space-4); } }
@media (min-width: 900px)  { .game-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (min-width: 1200px) { .game-grid { grid-template-columns: repeat(5, minmax(0,1fr)); gap: var(--space-5); } }
@media (min-width: 1440px) { .game-grid { grid-template-columns: repeat(6, minmax(0,1fr)); } }

/* ---------- Game card ---------- */
.game-card {
  position: relative; display: flex; flex-direction: column;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease);
  will-change: transform;
}
.game-card:hover, .game-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}
.game-card:active { transform: scale(.985); }
.game-card[hidden] { display: none; }

.game-card__media {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.game-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-3) var(--ease);
}
.game-card:hover .game-card__media img { transform: scale(1.04); }

.game-card__body { padding-top: var(--space-3); }
.game-card__title {
  font-size: var(--text-sm); font-weight: 700; color: var(--text);
  line-height: var(--lh-snug);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.game-card__title a { color: inherit; }
.game-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.game-card__meta {
  margin-top: 4px; font-size: var(--text-xs); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}

/* ---------- Carousel ---------- */
.carousel { position: relative; }
.carousel__track {
  display: grid; grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 42vw);
  gap: var(--space-3);
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * { scroll-snap-align: start; }
@media (min-width: 560px)  { .carousel__track { grid-auto-columns: minmax(170px, 26vw); gap: var(--space-4); } }
@media (min-width: 900px)  { .carousel__track { grid-auto-columns: 200px; } }
.carousel__controls { display: none; gap: var(--space-2); }
@media (min-width: 900px) { .carousel__controls { display: flex; } }
.carousel__btn {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text);
  transition: background-color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              opacity var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.carousel__btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.carousel__btn:active:not(:disabled) { transform: scale(.92); }
.carousel__btn:disabled { opacity: .35; cursor: default; }
.carousel__btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; flex-direction: column;
  background: var(--bg);
  opacity: 0; pointer-events: none;
  transform: translate3d(0, -8px, 0);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.search-overlay.is-open { opacity: 1; pointer-events: auto; transform: none; }
.search-overlay__bar {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--gutter);
  padding-top: max(var(--space-3), env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border); background: var(--bg-elevated);
}
.search-overlay__field {
  flex: 1; min-height: var(--tap);
  padding: var(--space-2) var(--space-4);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: 16px;                      /* 16px stops iOS/Android zoom-on-focus */
}
.search-overlay__field::placeholder { color: var(--text-muted); }
.search-overlay__field:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.search-overlay__body { flex: 1; overflow-y: auto; padding: var(--space-4) var(--gutter) var(--space-12); }
.search-overlay__hint { color: var(--text-muted); font-size: var(--text-sm); margin-bottom: var(--space-3); }

.search-results { display: grid; gap: var(--space-2); }
.search-result {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--tap); padding: var(--space-2) var(--space-3);
  border: 1px solid transparent; border-radius: var(--radius-md);
  color: var(--text);
}
.search-result:hover, .search-result:focus-visible { background: var(--surface); border-color: var(--border); color: var(--text); }
.search-result img { width: 40px; height: 40px; border-radius: 8px; flex: 0 0 40px; object-fit: cover; background: var(--surface-2); }
.search-result__name { font-weight: 600; font-size: var(--text-sm); }
.search-result__cat { font-size: var(--text-xs); color: var(--text-muted); }
.search-result mark { background: var(--accent-deep); color: var(--accent); border-radius: 3px; padding: 0 2px; }

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton-1) 25%, var(--skeleton-2) 37%, var(--skeleton-1) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton--media { aspect-ratio: 1; }
.skeleton--line { height: 11px; margin-top: var(--space-2); }
.skeleton--line.is-short { width: 55%; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { padding-block: var(--space-4); font-size: var(--text-xs); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: var(--space-2); color: var(--text-muted); opacity: .6; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--text-2); }

/* ---------- Game detail ---------- */
.game-hero { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: center; padding-block: var(--space-4) var(--space-8); }
.game-hero__media {
  width: 104px; height: 104px; flex: 0 0 104px;
  border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
  box-shadow: var(--shadow-2);
}
@media (min-width: 768px) { .game-hero__media { width: 132px; height: 132px; flex-basis: 132px; } }
.game-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.game-hero__meta { min-width: 0; flex: 1 1 260px; }
.game-hero h1 { font-size: var(--text-3xl); }
.game-hero__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text-2);
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.game-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }

.spec-table {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
.spec-table th, .spec-table td {
  padding: var(--space-3) var(--space-4); text-align: left;
  font-size: var(--text-sm); border-bottom: 1px solid var(--border);
}
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-table th { width: 42%; color: var(--text-muted); font-weight: 600; background: var(--surface-2); }
.spec-table td { color: var(--text); }

/* Read-more: collapses visually, never removes content from the DOM (§27). */
.readmore { position: relative; }
.readmore__content { overflow: hidden; }
.readmore[data-collapsed="true"] .readmore__content { max-height: 11.5rem; }
.readmore[data-collapsed="true"]::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 2.6rem; height: 4rem;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.readmore__btn { margin-top: var(--space-3); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: var(--space-2); }
.faq__item { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  width: 100%; min-height: var(--tap); padding: var(--space-4);
  text-align: left; font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-base); color: var(--text);
}
.faq__q::after {
  content: ""; width: 9px; height: 9px; flex: 0 0 9px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-2) var(--ease);
}
.faq__q[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
.faq__a { padding: 0 var(--space-4) var(--space-4); font-size: var(--text-sm); }
.faq__a[hidden] { display: none; }

/* ---------- Notice / pending ---------- */
.notice {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-md); background: var(--surface);
  font-size: var(--text-sm);
}
.notice p { color: var(--text-2); }
.content-pending {
  padding: var(--space-5);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text-muted); font-size: var(--text-sm);
}

/* ---------- Category card ---------- */
.cat-grid { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease);
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.cat-card__count { font-size: var(--text-xs); font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em; }
.cat-card h3 a { color: var(--text); }
.cat-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cat-card p { font-size: var(--text-sm); }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--space-16); border-top: 1px solid var(--border); background: var(--bg-elevated); }
.footer__grid { display: grid; gap: var(--space-2); padding-block: var(--space-8); }
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr; gap: var(--space-8); }
}
.footer__brand p { font-size: var(--text-sm); margin-top: var(--space-3); max-width: 46ch; }
.footer__col > h2 { font-size: var(--text-sm); color: var(--text); margin-bottom: var(--space-3); }
/* Mobile: collapsible sections. Desktop: always open. */
.footer__toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: var(--tap); font-family: var(--font-display);
  font-size: var(--text-sm); font-weight: 700; color: var(--text);
  border-top: 1px solid var(--border);
}
.footer__toggle::after {
  content: ""; width: 8px; height: 8px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-2) var(--ease);
}
.footer__toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
.footer__links { padding-bottom: var(--space-4); }
.footer__links[hidden] { display: none; }
.footer__links li a {
  display: block; min-height: 38px; padding-block: var(--space-2);
  color: var(--text-2); font-size: var(--text-sm);
}
.footer__links li a:hover { color: var(--accent); }
@media (min-width: 768px) {
  .footer__toggle { display: none; }
  .footer__links[hidden] { display: block; }
  .footer__links li a { min-height: 0; padding-block: 5px; }
}
.footer__bottom {
  padding-block: var(--space-5); border-top: 1px solid var(--border);
  font-size: var(--text-xs); color: var(--text-muted);
}
.footer__bottom p + p { margin-top: var(--space-2); }

/* ---------- Age gate / cookie ---------- */
.age-gate {
  display: none; position: fixed; inset: 0; z-index: var(--z-modal);
  background: var(--scrim); align-items: center; justify-content: center; padding: var(--gutter);
}
@supports (backdrop-filter: blur(1px)) { .age-gate { backdrop-filter: blur(6px); } }
.age-gate__panel {
  max-width: 400px; padding: var(--space-8) var(--space-6); text-align: center;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow-3);
}
.age-gate__panel h2 { margin-bottom: var(--space-3); }
.age-gate__actions { display: grid; gap: var(--space-2); margin-block: var(--space-6) var(--space-4); }
.age-gate__legal { font-size: var(--text-xs); color: var(--text-muted); }

.cookie-banner {
  display: none; position: fixed; inset-inline: var(--space-3);
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + var(--space-3));
  z-index: var(--z-toast);
  flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between;
  padding: var(--space-4);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
}
@media (min-width: 768px) {
  .cookie-banner { bottom: var(--space-4); inset-inline: auto var(--space-4); max-width: 420px; }
}
.cookie-banner p { font-size: var(--text-sm); }
.cookie-banner__actions { display: flex; gap: var(--space-2); }

/* ---------- Ad slot: reserves space so it cannot shift layout (§29) ---------- */
.ad-slot {
  display: grid; place-items: center;
  margin-block: var(--space-8);
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--surface-2); color: var(--text-muted);
  font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase;
}
.ad-slot--leaderboard { min-height: 100px; }
@media (min-width: 768px) { .ad-slot--leaderboard { min-height: 120px; } }

/* ---------- Low-end device mode ---------- */
.perf-lite .site-header,
.perf-lite .bottom-nav,
.perf-lite .drawer-scrim,
.perf-lite .age-gate { backdrop-filter: none !important; }
.perf-lite .hero::before { display: none; }
.perf-lite .skeleton { animation: none; }
.perf-lite * { box-shadow: none !important; }

/* ==========================================================================
   Touch-target corrections (§21). Applies at every width; the brand and the
   section "view all" links were 25-32px on desktop.
   Inline links inside prose are deliberately excluded - padding them to 44px
   would break line flow, and WCAG 2.5.8 exempts links inline in text.
   ========================================================================== */
.brand { min-height: var(--tap); }
.section__head--row > a {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding-inline: var(--space-2);
  margin-inline: calc(var(--space-2) * -1);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 600;
}
.section__head--row > a:hover { background: var(--surface-2); }
.footer__links li a { min-height: 40px; display: flex; align-items: center; }
@media (min-width: 768px) {
  .footer__links li a { min-height: 40px; padding-block: var(--space-1); }
}

/* ==========================================================================
   Links inside running text carry an underline as well as colour. Colour alone
   is not a sufficient distinguishing cue (WCAG 1.4.1). Navigation, buttons,
   chips and cards are excluded: they are distinguishable by shape and position.
   ========================================================================== */
.prose a,
.notice a,
.footer__brand a,
.age-gate__legal a,
.cookie-banner a,
.content-pending a,
main p a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.prose a:hover,
.notice a:hover,
main p a:hover { text-decoration-thickness: 2px; }
