/* ==========================================================================
   Coin Collector Arcade — core stylesheet
   Layout, typography, components and the design system.
   Responsive rules live in responsive.css, game-page rules in games.css
   and long-form article rules in article.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces — a dark arcade cabinet palette */
  --bg: #0d0f1c;
  --bg-alt: #121527;
  --surface: #191d33;
  --surface-2: #212640;
  --surface-3: #2b3154;
  --border: #2e3455;
  --border-strong: #3d456e;

  /* Text */
  --text: #e9ecf7;
  --text-muted: #a3abc9;
  --text-dim: #7a83a3;

  /* Brand */
  --gold: #ffc531;
  --gold-dark: #d98c12;
  --gold-soft: rgba(255, 197, 49, 0.14);
  --cyan: #4dc9ff;
  --cyan-soft: rgba(77, 201, 255, 0.14);
  --pink: #ff5d8f;
  --green: #7bed9f;
  --purple: #8e7cff;
  --red: #ff6b6b;

  /* Difficulty colours */
  --diff-easy: #7bed9f;
  --diff-medium: #ffc531;
  --diff-hard: #ff9f43;
  --diff-expert: #ff5d8f;

  /* Type */
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* Spacing scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;

  /* Shape */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 44px rgba(0, 0, 0, 0.45);

  --container: 1180px;
  --container-narrow: 760px;

  --header-h: 66px;
}

/* --------------------------------------------------------------------------
   2. Reset and base
   -------------------------------------------------------------------------- */

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

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  /* A faint radial wash so the flat dark background has some depth. */
  background-image:
    radial-gradient(circle at 12% -8%, rgba(77, 201, 255, 0.10), transparent 46%),
    radial-gradient(circle at 88% 0%, rgba(255, 197, 49, 0.09), transparent 42%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--s4);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
h4 { font-size: 1.06rem; }

p { margin: 0 0 var(--s4); }

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

ul, ol { margin: 0 0 var(--s4); padding-left: 1.35em; }
li { margin-bottom: var(--s2); }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s6) 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

/* Focus ring — visible, consistent, and never removed. */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s5);
}

.container--narrow { max-width: var(--container-narrow); }

.visually-hidden {
  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-link {
  position: absolute;
  left: var(--s4);
  top: -80px;
  z-index: 1000;
  background: var(--gold);
  color: #16180f;
  font-weight: 700;
  padding: var(--s3) var(--s5);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 0;
  text-decoration: none;
}

.section { padding-block: var(--s8); }
.section--tight { padding-block: var(--s6); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
}

.section__head h2 { margin-bottom: var(--s1); }

.section__sub {
  color: var(--text-muted);
  margin: 0;
  max-width: 62ch;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }

.lead {
  font-size: 1.12rem;
  color: var(--text-muted);
  max-width: 68ch;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  font-size: 0.97rem;
  line-height: 1.2;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, background-color 0.14s ease,
    border-color 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--gold);
  color: #17190d;
}
.btn--primary:hover { background: #ffd35c; }

.btn--secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--surface-3); }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn--ghost:hover { color: var(--text); border-color: var(--border-strong); }

.btn--sm { padding: 8px 15px; font-size: 0.87rem; }
.btn--block { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   5. Header and navigation
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 28, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.06rem;
  color: var(--text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand:hover { text-decoration: none; color: var(--gold); }

.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-size: 1.02rem; }
.brand__tag {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav { margin-left: auto; }

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--s1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list li { margin: 0; }

.nav__link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.nav__link[aria-current="page"] {
  color: var(--gold);
  background: var(--gold-soft);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 19px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--s9) var(--s8);
  border-bottom: 1px solid var(--border);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--s7);
  align-items: center;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(255, 197, 49, 0.28);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: var(--s4);
}

.hero h1 { margin-bottom: var(--s4); }

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero__text {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: var(--s5);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  font-size: 0.88rem;
  color: var(--text-dim);
}

.hero__meta strong { color: var(--text); display: block; font-size: 1.24rem; }

.hero__art {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   7. Cards — games
   -------------------------------------------------------------------------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: var(--s5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.game-grid li { margin: 0; }

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.game-card:hover,
.game-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  .game-card:hover, .game-card:focus-within { transform: none; }
}

.game-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}

.game-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card__badges {
  position: absolute;
  top: var(--s3);
  left: var(--s3);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(13, 15, 28, 0.82);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.badge--new { background: var(--green); color: #0c2415; border-color: transparent; }
.badge--featured { background: var(--gold); color: #17190d; border-color: transparent; }
.badge--popular { background: var(--pink); color: #2a0a15; border-color: transparent; }

.game-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--s4);
  gap: var(--s3);
}

.game-card__title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 800;
}

.game-card__title a { color: var(--text); }
.game-card__title a:hover { color: var(--gold); text-decoration: none; }

/* Makes the whole card clickable without nesting interactive elements. */
.game-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.game-card__desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tag--easy   { color: var(--diff-easy);   border-color: rgba(123, 237, 159, 0.34); }
.tag--medium { color: var(--diff-medium); border-color: rgba(255, 197, 49, 0.34); }
.tag--hard   { color: var(--diff-hard);   border-color: rgba(255, 159, 67, 0.34); }
.tag--expert { color: var(--diff-expert); border-color: rgba(255, 93, 143, 0.34); }

.game-card__actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 0 var(--s4) var(--s4);
}

.game-card__actions .btn { flex: 1; position: relative; z-index: 2; }

/* Favourite toggle — a real button with a real pressed state. */
.fav-btn {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.fav-btn:hover { color: var(--gold); border-color: var(--gold); }

.fav-btn[aria-pressed="true"] {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: var(--gold);
}

.fav-btn svg { width: 19px; height: 19px; }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }

/* --------------------------------------------------------------------------
   8. Cards — categories
   -------------------------------------------------------------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--s5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-grid li { margin: 0; }

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent, var(--gold));
}

.category-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }

@media (prefers-reduced-motion: reduce) {
  .category-card:hover { transform: none; }
}

.category-card h3 { margin-bottom: var(--s2); font-size: 1.14rem; }
.category-card h3 a { color: var(--text); }
.category-card h3 a::after { content: ""; position: absolute; inset: 0; }
.category-card h3 a:hover { color: var(--gold); text-decoration: none; }

.category-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: var(--s3);
}

.category-card__count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   9. Breadcrumbs
   -------------------------------------------------------------------------- */

.breadcrumbs {
  padding-block: var(--s4);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: 0;
  color: var(--text-dim);
}

.breadcrumbs li + li::before {
  content: "›";
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1;
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------------------
   10. Page header block
   -------------------------------------------------------------------------- */

.page-head {
  padding-block: var(--s7) var(--s6);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.page-head h1 { margin-bottom: var(--s3); }
.page-head .lead { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   11. Filters and search
   -------------------------------------------------------------------------- */

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  margin-bottom: var(--s6);
}

.filters__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s4);
}

.filters__row:last-child { margin-bottom: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.field input,
.field select {
  font: inherit;
  font-size: 0.93rem;
  padding: 10px 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 100%;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23a3abc9' d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  padding-right: 34px;
}

.field input::placeholder { color: var(--text-dim); }

.filters__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding-top: var(--s4);
  border-top: 1px solid var(--border);
}

.results-count {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: var(--s3);
  margin-bottom: var(--s5);
}

.search-form input { flex: 1; }

/* Empty-state block, shared by search, favourites and recently played. */
.empty-state {
  text-align: center;
  padding: var(--s8) var(--s5);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state h2 { font-size: 1.28rem; }
.empty-state p { color: var(--text-muted); max-width: 52ch; margin-inline: auto; }

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: center;
  margin-top: var(--s5);
}

/* --------------------------------------------------------------------------
   12. Content blocks
   -------------------------------------------------------------------------- */

.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--s7); }
.prose h3 { margin-top: var(--s6); }
.prose > *:first-child { margin-top: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
}

.panel--accent {
  border-left: 4px solid var(--gold);
}

.panel h3 { margin-bottom: var(--s3); }
.panel > *:last-child { margin-bottom: 0; }

.note {
  background: var(--cyan-soft);
  border: 1px solid rgba(77, 201, 255, 0.28);
  border-radius: var(--radius);
  padding: var(--s4) var(--s5);
  font-size: 0.93rem;
  color: var(--text-muted);
}

.note strong { color: var(--text); }
.note > *:last-child { margin-bottom: 0; }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--s5);
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s3);
}

.feature-list li {
  position: relative;
  padding-left: 30px;
  margin: 0;
  color: var(--text-muted);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.52em;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

/* Data table used for controls and scoring breakdowns. */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 11px var(--s3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  color: var(--text-dim);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

.data-table td:first-child { font-weight: 700; white-space: nowrap; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --------------------------------------------------------------------------
   13. FAQ (details/summary — works with no JavaScript)
   -------------------------------------------------------------------------- */

.faq { display: grid; gap: var(--s3); }

.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq__item summary {
  cursor: pointer;
  padding: var(--s4) var(--s5);
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__item summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--gold);
  line-height: 1;
}

.faq__item[open] summary::after { content: "−"; }
.faq__item[open] summary { border-bottom: 1px solid var(--border); }

.faq__body { padding: var(--s4) var(--s5); color: var(--text-muted); }
.faq__body > *:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   14. Author box
   -------------------------------------------------------------------------- */

.author-box {
  display: flex;
  gap: var(--s5);
  align-items: flex-start;
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.author-box__avatar {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
}

.author-box__name { margin: 0 0 2px; font-size: 1.04rem; }
.author-box__role {
  margin: 0 0 var(--s3);
  font-size: 0.83rem;
  color: var(--gold);
  font-weight: 700;
}
.author-box p:last-child { margin-bottom: 0; font-size: 0.9rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   15. Ad slots
   -------------------------------------------------------------------------- */

/* Ad containers are always clearly separated from content, never overlap
   anything interactive, and reserve their own height so inserting one
   cannot shift the page. */
.ad-slot {
  display: block;
  margin-block: var(--s6);
  padding: var(--s3);
  min-height: 108px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  overflow: hidden;
}

.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--s2);
}

.ad-slot--leaderboard { min-height: 108px; }
.ad-slot--rect { min-height: 268px; }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: var(--s8) var(--s5);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--s6);
  margin-bottom: var(--s6);
}

.footer__brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 38ch;
  margin-top: var(--s3);
}

.footer__col h3 {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: var(--s3);
}

.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin-bottom: 9px; }

.footer__col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer__col a:hover { color: var(--gold); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s5);
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-dim);
}

.footer__bottom p { margin: 0; }

/* --------------------------------------------------------------------------
   17. Misc
   -------------------------------------------------------------------------- */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s4);
}

.pill-row li { margin: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: var(--s4);
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s4);
  text-align: center;
}

.stat__value {
  display: block;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
}

.stat__label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  margin-bottom: var(--s6);
}

.toc h2 { font-size: 0.96rem; margin-bottom: var(--s3); }
.toc ol { margin: 0; padding-left: 1.25em; }
.toc li { margin-bottom: 6px; font-size: 0.92rem; }

[hidden] { display: none !important; }
