/* ==========================================================================
   Ping Pong Arcade — Core stylesheet
   Serve. Rally. Smash. Score.
   Design system, layout, components.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette — ball amber + table teal on deep arena navy */
  --ppa-ball: #ff8a3d;
  --ppa-ball-strong: #f9701a;
  --ppa-table: #17b6c4;
  --ppa-table-deep: #0e7f8c;
  --ppa-line: #f4f7fb;

  /* Surfaces (dark default) */
  --bg: #0a1020;
  --bg-alt: #0f172b;
  --surface: #141f38;
  --surface-2: #1b2846;
  --surface-3: #24345a;
  --border: #25345c;
  --border-soft: #1c2a4a;

  /* Text */
  --text: #eef2fa;
  --text-muted: #a8b6d1;
  --text-dim: #7e8dab;
  --text-on-accent: #17120c;

  /* Accents */
  --accent: var(--ppa-ball);
  --accent-hover: #ffa15f;
  --accent-ink: #1a1105;
  --accent-2: var(--ppa-table);
  --accent-2-ink: #04222a;
  --focus: #ffd18a;

  /* Status */
  --good: #35d29a;
  --warn: #ffc24b;
  --bad: #ff6b6b;

  /* Typography */
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Semibold", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  --fs-xs: 0.78rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.075rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.9rem;
  --fs-3xl: 2.35rem;
  --fs-4xl: 3rem;

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  /* Radii + shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(3, 8, 20, 0.4);
  --shadow-md: 0 6px 18px rgba(3, 8, 20, 0.45);
  --shadow-lg: 0 18px 44px rgba(3, 8, 20, 0.55);
  --ring: 0 0 0 3px rgba(255, 138, 61, 0.35);

  --container: 1200px;
  --container-narrow: 820px;
  --header-h: 64px;

  --t-fast: 120ms ease;
  --t-base: 200ms ease;
}

/* Light theme */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fc;
    --bg-alt: #eef2f9;
    --surface: #ffffff;
    --surface-2: #f2f5fb;
    --surface-3: #e5ebf6;
    --border: #d5ddeb;
    --border-soft: #e4eaf4;
    --text: #131c2e;
    --text-muted: #4d5a72;
    --text-dim: #6b7890;
    --accent-ink: #2a1503;
    --focus: #b45309;
    --shadow-sm: 0 1px 2px rgba(19, 28, 46, 0.08);
    --shadow-md: 0 6px 18px rgba(19, 28, 46, 0.1);
    --shadow-lg: 0 18px 44px rgba(19, 28, 46, 0.14);
  }
}

:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --surface-3: #e5ebf6;
  --border: #d5ddeb;
  --border-soft: #e4eaf4;
  --text: #131c2e;
  --text-muted: #4d5a72;
  --text-dim: #6b7890;
  --accent-ink: #2a1503;
  --focus: #b45309;
  --shadow-sm: 0 1px 2px rgba(19, 28, 46, 0.08);
  --shadow-md: 0 6px 18px rgba(19, 28, 46, 0.1);
  --shadow-lg: 0 18px 44px rgba(19, 28, 46, 0.14);
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.015em;
  font-weight: 700;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--sp-4); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.3em; }
li { margin-bottom: var(--sp-2); }

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

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}

/* Focus visibility — never remove */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--r-md) 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
  text-decoration: none;
}

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

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

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

.section {
  padding-block: var(--sp-7);
  border-top: 1px solid var(--border-soft);
}
.section:first-of-type { border-top: 0; }
.section--flush { border-top: 0; }
.section--tight { padding-block: var(--sp-6); }
.section--alt { background: var(--bg-alt); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.section-head h2 { margin: 0; }
.section-head p {
  margin: var(--sp-2) 0 0;
  color: var(--text-muted);
  max-width: 65ch;
}
.section-head__text { flex: 1 1 22rem; min-width: 0; }

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: var(--sp-2);
}

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

.grid { display: grid; gap: var(--sp-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid--auto-wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.stack > * + * { margin-top: var(--sp-4); }
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* --------------------------------------------------------------------------
   4. Header + navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand__mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ppa-table) 0%, var(--ppa-table-deep) 100%);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand__mark::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ppa-ball);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55) inset;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text small {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}

.main-nav { margin-left: auto; }
.main-nav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav__list li { margin: 0; }
.main-nav__link {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.main-nav__link:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.main-nav__link[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 0 auto;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.nav-toggle { display: none; }

/* Mobile drawer */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: var(--bg);
  overflow-y: auto;
  padding: var(--sp-5) 0 var(--sp-8);
  border-top: 1px solid var(--border-soft);
}
.mobile-nav.is-open { display: block; }
.mobile-nav__list { list-style: none; margin: 0; padding: 0; }
.mobile-nav__list a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-md);
  border-bottom: 1px solid var(--border-soft);
}
.mobile-nav__list a:hover { background: var(--surface-2); text-decoration: none; }
.mobile-nav__group-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 700;
  margin: var(--sp-5) 0 var(--sp-2);
  padding-inline: var(--sp-4);
}
body.nav-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.35rem;
  min-height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-ink); }

.btn--secondary {
  background: var(--accent-2);
  color: var(--accent-2-ink);
}
.btn--secondary:hover { background: color-mix(in srgb, var(--accent-2) 82%, white); color: var(--accent-2-ink); }

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--accent); color: var(--text); }

.btn--sm { padding: 0.45rem 0.9rem; min-height: 38px; font-size: var(--fs-xs); }
.btn--lg { padding: 0.95rem 1.8rem; min-height: 52px; font-size: var(--fs-base); }
.btn--block { width: 100%; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-8) var(--sp-7);
  background:
    radial-gradient(1100px 460px at 78% -12%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 62%),
    radial-gradient(760px 360px at 6% 4%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    var(--bg-alt);
  border-bottom: 1px solid var(--border-soft);
}

/* Subtle table-surface motif */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ppa-line) 9%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ppa-line) 9%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 70% at 50% 40%, #000 0%, transparent 78%);
  opacity: 0.5;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--sp-7);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.2rem);
  margin-bottom: var(--sp-3);
}
.hero__tagline {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-3);
  letter-spacing: 0.01em;
}
.hero__desc {
  font-size: var(--fs-md);
  color: var(--text-muted);
  max-width: 58ch;
  margin-bottom: var(--sp-5);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  list-style: none;
  padding-left: 0;
}
.hero__stats li { margin: 0; }
.hero__stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--text);
  line-height: 1.1;
}
.hero__stats span { font-size: var(--fs-xs); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }

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

/* --------------------------------------------------------------------------
   7. Cards — games
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__badges {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  z-index: 2;
}

.card__body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: var(--sp-2);
}
.card__title {
  font-size: var(--fs-md);
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
}
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--accent); text-decoration: none; }
.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card__desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  margin-top: auto;
  padding-top: var(--sp-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.card__fav {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.card__fav:hover { transform: scale(1.08); border-color: var(--accent); }
.card__fav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.card__fav[aria-pressed="true"] { color: var(--accent); }
.card__fav[aria-pressed="true"] svg { fill: var(--accent); }

/* Badges / chips / tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge--new { background: var(--good); color: #05261a; border-color: transparent; }
.badge--featured { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.badge--2p { background: var(--accent-2); color: var(--accent-2-ink); border-color: transparent; }
.badge--easy { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 12%, transparent); }
.badge--medium { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge--hard { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.badge--expert { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 12%, transparent); }

.tag-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; margin: 0; }
.tag-list li { margin: 0; }
.tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
}
a.tag:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* --------------------------------------------------------------------------
   8. Category cards / tiles
   -------------------------------------------------------------------------- */
.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--t-base), border-color var(--t-base);
  overflow: hidden;
}
.cat-card:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.cat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.cat-card h3 { margin: 0; font-size: var(--fs-lg); }
.cat-card h3 a { color: var(--text); }
.cat-card h3 a::after { content: ""; position: absolute; inset: 0; }
.cat-card h3 a:hover { color: var(--accent); text-decoration: none; }
.cat-card p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.cat-card__count {
  margin-top: auto;
  padding-top: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.cat-card__icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  color: var(--accent-2);
  margin-bottom: var(--sp-2);
}
.cat-card__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------------------
   9. Panels, callouts, feature lists
   -------------------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.panel--accent { border-left: 4px solid var(--accent); }
.panel--info { border-left: 4px solid var(--accent-2); }
.panel h3:first-child, .panel h2:first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.feature-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.feature h3 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.feature p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.feature__num {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  margin-bottom: var(--sp-3);
}

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative;
  padding-left: 1.85rem;
  margin-bottom: var(--sp-3);
  color: var(--text-muted);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.check-list li strong { color: var(--text); }

/* --------------------------------------------------------------------------
   10. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs {
  padding-block: var(--sp-3);
  font-size: var(--fs-sm);
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumbs li { margin: 0; display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-dim); }
.breadcrumbs li + li::before {
  content: "/";
  color: var(--text-dim);
  opacity: 0.6;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------------------
   11. Forms, search, filters
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--sp-4); }
.field label {
  display: block;
  font-weight: 700;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-2);
  color: var(--text);
}
.field .hint { font-size: var(--fs-xs); color: var(--text-dim); margin-top: var(--sp-1); }

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 13px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.4rem;
}

.search-bar {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
}
.search-bar__field { position: relative; flex: 1 1 auto; }
.search-bar__field input { padding-left: 2.7rem; }
.search-bar__field svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.filters__row {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.filters__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
}
.results-count { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.results-count strong { color: var(--text); }

.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  padding: 0.4rem 0.9rem;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-muted);
}
.empty-state h3 { color: var(--text); }
.empty-state svg {
  width: 56px; height: 56px;
  margin: 0 auto var(--sp-4);
  fill: none; stroke: var(--text-dim); stroke-width: 1.5;
}

/* --------------------------------------------------------------------------
   12. FAQ / accordion
   -------------------------------------------------------------------------- */
.faq { display: grid; gap: var(--sp-3); }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: var(--sp-4);
  font-weight: 700;
  font-family: var(--font-display);
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--accent);
  transition: transform var(--t-base);
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--surface-2); }
.faq__answer { padding: 0 var(--sp-4) var(--sp-4); color: var(--text-muted); }
.faq__answer > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   13. Ad slots — reserved, labelled, never over content
   -------------------------------------------------------------------------- */
.ad-slot {
  display: block;
  width: 100%;
  min-height: 90px;
  margin-block: var(--sp-6);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
  contain: layout paint;
}
.ad-slot::before {
  content: "Advertisement";
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}
.ad-slot--leaderboard { min-height: 100px; }
.ad-slot--inline { min-height: 250px; }
.ad-slot:empty::after {
  content: "Ad space reserved";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-8);
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: var(--sp-7) var(--sp-5);
  font-size: var(--fs-sm);
}
.site-footer__grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
}
.site-footer h2 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--sp-2); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer__about p { color: var(--text-muted); max-width: 40ch; }
.site-footer__bottom {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   15. Misc utilities
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }

.table-wrap { overflow-x: auto; margin-bottom: var(--sp-5); border-radius: var(--r-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--surface); }
th, td { padding: var(--sp-3); text-align: left; border-bottom: 1px solid var(--border-soft); }
th { background: var(--surface-2); font-weight: 700; color: var(--text); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.notice {
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 35%, transparent);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-5);
}
.notice strong { color: var(--text); }
.notice > :last-child { margin-bottom: 0; }

.divider-dots {
  display: flex; gap: 6px; justify-content: center; margin-block: var(--sp-6);
}
.divider-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.divider-dots span:nth-child(2) { background: var(--accent); }

/* Toast for share / copy feedback */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(140%);
  z-index: 300;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  padding: 0.7rem 1.35rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: transform var(--t-base), opacity var(--t-base);
  opacity: 0;
  pointer-events: none;
}
.toast.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; }

/* --------------------------------------------------------------------------
   16. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover, .cat-card:hover, .btn:hover { transform: none; }
}

:root[data-motion="reduced"] .card:hover,
:root[data-motion="reduced"] .cat-card:hover,
:root[data-motion="reduced"] .btn:hover { transform: none; }
