/* ==========================================================================
   Gem Arcade Games — Core design system
   gemarcadegames.xyz
   Vanilla CSS3. No frameworks, no external requests.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces — deep "cavern" palette */
  --bg:            #0a0e1c;
  --bg-deep:       #070a15;
  --surface:       #131a30;
  --surface-2:     #1a2340;
  --surface-3:     #222c4e;
  --line:          #2a3457;
  --line-soft:     #1f2843;

  /* Type */
  --text:          #eaeefb;
  --text-muted:    #a8b3d2;
  --text-dim:      #7e89a9;

  /* Gem accents */
  --gem-emerald:   #33e3a4;
  --gem-cyan:      #45c9ff;
  --gem-violet:    #9d82ff;
  --gem-amber:     #ffc65b;
  --gem-rose:      #ff6f9f;
  --gem-ruby:      #ff5a6e;

  /* Semantic */
  --brand:         #45c9ff;
  --brand-ink:     #06121c;
  --accent:        #33e3a4;
  --warn:          #ffc65b;
  --danger:        #ff5a6e;
  --ok:            #33e3a4;

  --grad-gem:      linear-gradient(135deg, #33e3a4 0%, #45c9ff 55%, #9d82ff 100%);
  --grad-amber:    linear-gradient(135deg, #ffc65b 0%, #ff6f9f 100%);
  --grad-surface:  linear-gradient(160deg, #1a2340 0%, #131a30 100%);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh-md: 0 6px 20px -8px rgba(0,0,0,.65);
  --sh-lg: 0 18px 48px -18px rgba(0,0,0,.8);
  --sh-glow: 0 0 0 1px rgba(69,201,255,.28), 0 12px 32px -14px rgba(69,201,255,.45);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 88px;

  /* Layout */
  --wrap: 1200px;
  --wrap-narrow: 760px;
  --header-h: 64px;

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

  --t-xs: .78rem;
  --t-sm: .875rem;
  --t-base: 1rem;
  --t-md: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5rem;
  --t-2xl: 1.9rem;
  --t-3xl: 2.4rem;
  --t-4xl: 3rem;

  --ease: cubic-bezier(.22,.68,.34,1);
}

/* --------------------------------------------------------------------------
   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) + 16px);
}

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

/* Subtle faceted backdrop — pure CSS, no image requests */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -6%, rgba(51,227,164,.10), transparent 62%),
    radial-gradient(760px 480px at 88% 2%, rgba(157,130,255,.12), transparent 60%),
    radial-gradient(700px 600px at 50% 108%, rgba(69,201,255,.08), transparent 65%);
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
img { background-color: var(--surface-2); }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--s-3);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.015em;
  color: #fff;
}
h1 { font-size: clamp(1.85rem, 1.25rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.05rem); }
h3 { font-size: clamp(1.15rem, 1.02rem + .6vw, 1.45rem); }
h4 { font-size: 1.1rem; }

p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.3em; }
li { margin-bottom: .45em; }
li::marker { color: var(--gem-cyan); }

a {
  color: var(--gem-cyan);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover { text-decoration: underline; }

small { font-size: var(--t-sm); }
strong, b { color: #fff; font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .9em;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: .1em .4em;
  color: var(--gem-emerald);
}
kbd {
  display: inline-block;
  min-width: 1.9em;
  text-align: center;
  padding: .18em .5em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  color: #fff;
  font-size: .82em;
  font-weight: 600;
  line-height: 1.4;
}

table { border-collapse: collapse; width: 100%; }

::selection { background: rgba(69,201,255,.3); color: #fff; }

/* Accessible focus */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--gem-amber);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--gem-amber);
  color: #131a30;
  padding: 12px 20px;
  font-weight: 700;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus {
  left: 0;
}

.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 helpers
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s-4);
}
.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--s-8); }
.section--tight { padding-block: var(--s-6); }
.section--flush-top { padding-top: var(--s-5); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 0; color: var(--text-muted); max-width: 62ch; }
.section-head .link-more {
  font-weight: 700;
  font-size: var(--t-sm);
  white-space: nowrap;
}
.section-head .link-more::after { content: " →"; }

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

.grid { display: grid; gap: var(--s-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(240px, 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.stack > * + * { margin-top: var(--s-4); }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 44px;
  padding: .62em 1.25em;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: var(--t-sm);
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s var(--ease),
              border-color .18s var(--ease), box-shadow .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  text-decoration: none;
  background: var(--surface-3);
  border-color: var(--line);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad-gem);
  border-color: transparent;
  color: var(--brand-ink);
  box-shadow: 0 10px 26px -14px rgba(69,201,255,.9);
}
.btn-primary:hover {
  background: var(--grad-gem);
  filter: brightness(1.07);
  box-shadow: 0 14px 30px -12px rgba(69,201,255,.95);
}

.btn-amber {
  background: var(--grad-amber);
  border-color: transparent;
  color: #2a1606;
}
.btn-amber:hover { filter: brightness(1.06); }

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

.btn-lg { min-height: 52px; font-size: var(--t-md); padding: .7em 1.6em; }
.btn-sm { min-height: 36px; font-size: var(--t-xs); padding: .45em .95em; }
.btn-block { display: flex; width: 100%; }

.btn[aria-pressed="true"] {
  background: rgba(51,227,164,.16);
  border-color: rgba(51,227,164,.5);
  color: var(--gem-emerald);
}
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* --------------------------------------------------------------------------
   5. Header & navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,14,28,.88);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 900;
  letter-spacing: -.02em;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 32px;
  height: 32px;
  flex: none;
  filter: drop-shadow(0 3px 8px rgba(69,201,255,.45));
}
.brand__name { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand__name b { font-weight: 900; }
.brand__name span {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gem-emerald);
}

.nav { margin-left: auto; }
.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list a {
  display: block;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: var(--t-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.nav__list a:hover { color: #fff; background: var(--surface-2); text-decoration: none; }
.nav__list a[aria-current="page"] {
  color: #fff;
  background: var(--surface-2);
  box-shadow: inset 0 -2px 0 var(--gem-cyan);
}

.header-actions { display: flex; align-items: center; gap: var(--s-2); flex: none; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: #fff; }
.icon-btn svg { width: 20px; height: 20px; }

.nav-toggle { display: none; }

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: var(--header-h) 0 0 auto;
  width: min(360px, 88vw);
  z-index: 99;
  background: var(--bg-deep);
  border-left: 1px solid var(--line);
  padding: var(--s-5) var(--s-4) var(--s-8);
  overflow-y: auto;
  transform: translateX(102%);
  transition: transform .26s var(--ease);
  visibility: hidden;
}
.mobile-nav[data-open="true"] { transform: translateX(0); visibility: visible; }
.mobile-nav ul { list-style: none; margin: 0 0 var(--s-5); padding: 0; }
.mobile-nav li { margin: 0; }
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 12px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--line-soft);
}
.mobile-nav a:hover { background: var(--surface); text-decoration: none; }
.mobile-nav a[aria-current="page"] { color: var(--gem-cyan); }
.mobile-nav__label {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 var(--s-2);
  padding-left: 12px;
}
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(4,6,14,.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity .26s var(--ease), visibility .26s var(--ease);
}
.nav-scrim[data-open="true"] { opacity: 1; visibility: visible; }

body[data-nav-open="true"] { overflow: hidden; }

/* --------------------------------------------------------------------------
   6. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb {
  padding-block: var(--s-4) 0;
  font-size: var(--t-sm);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-dim);
}
.breadcrumb li { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before {
  content: "›";
  color: var(--line);
  font-weight: 700;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gem-cyan); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------------------
   7. Cards — games
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--grad-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(69,201,255,.45);
  box-shadow: var(--sh-lg);
}

.game-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.game-card__media img,
.game-card__media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--s-4);
  gap: 8px;
}
.game-card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
}
.game-card__title a { color: #fff; }
.game-card__title a:hover { color: var(--gem-cyan); text-decoration: none; }
.game-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.game-card__desc {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  font-size: var(--t-xs);
  color: var(--text-dim);
}

.fav-btn {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-pill);
  background: rgba(10,14,28,.72);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.fav-btn:hover { background: rgba(10,14,28,.92); transform: scale(1.06); }
.fav-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn[aria-pressed="true"] { color: var(--gem-rose); border-color: rgba(255,111,159,.55); }
.fav-btn[aria-pressed="true"] svg { fill: var(--gem-rose); stroke: var(--gem-rose); }

/* Badges / chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.5;
}
.badge--new { color: var(--gem-emerald); border-color: rgba(51,227,164,.4); background: rgba(51,227,164,.1); }
.badge--featured { color: var(--gem-amber); border-color: rgba(255,198,91,.4); background: rgba(255,198,91,.1); }
.badge--easy { color: var(--gem-emerald); border-color: rgba(51,227,164,.35); }
.badge--medium { color: var(--gem-cyan); border-color: rgba(69,201,255,.35); }
.badge--hard { color: var(--gem-amber); border-color: rgba(255,198,91,.35); }
.badge--expert { color: var(--gem-ruby); border-color: rgba(255,90,110,.4); }

.card-ribbon {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}
.card-ribbon .badge {
  background: rgba(10,14,28,.8);
  backdrop-filter: blur(6px);
}

/* --------------------------------------------------------------------------
   8. Panels, callouts, tiles
   -------------------------------------------------------------------------- */
.panel {
  background: var(--grad-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.panel--flat { background: var(--surface); }
.panel h3:first-child, .panel h2:first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

.callout {
  border-left: 3px solid var(--gem-cyan);
  background: rgba(69,201,255,.07);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--s-4) var(--s-5);
  margin-block: var(--s-5);
}
.callout > :last-child { margin-bottom: 0; }
.callout__label {
  display: block;
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gem-cyan);
  margin-bottom: 6px;
}
.callout--tip { border-left-color: var(--gem-emerald); background: rgba(51,227,164,.07); }
.callout--tip .callout__label { color: var(--gem-emerald); }
.callout--warn { border-left-color: var(--gem-amber); background: rgba(255,198,91,.07); }
.callout--warn .callout__label { color: var(--gem-amber); }

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.tile__icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: rgba(69,201,255,.12);
  color: var(--gem-cyan);
  margin-bottom: 4px;
}
.tile__icon svg { width: 20px; height: 20px; }
.tile h3 { margin: 0; font-size: 1.02rem; }
.tile p { margin: 0; font-size: var(--t-sm); color: var(--text-muted); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--s-3);
}
.stat {
  text-align: center;
  padding: var(--s-4) var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.stat__num {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-dim);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   9. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--s-8) var(--s-7);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: var(--s-7);
  align-items: center;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(51,227,164,.32);
  background: rgba(51,227,164,.09);
  color: var(--gem-emerald);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: var(--s-4);
}
.hero h1 { margin-bottom: var(--s-4); }
.hero h1 .accent {
  background: var(--grad-gem);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__desc {
  font-size: var(--t-md);
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: var(--s-5);
}
.hero__cta { margin-bottom: var(--s-5); }
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  font-size: var(--t-sm);
  color: var(--text-dim);
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
}
.hero__facts li::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: var(--gem-emerald);
  flex: none;
}
.hero__facts li:nth-child(2)::before { background: var(--gem-cyan); }
.hero__facts li:nth-child(3)::before { background: var(--gem-violet); }
.hero__facts li:nth-child(4)::before { background: var(--gem-amber); }

.hero__art {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--grad-surface);
  box-shadow: var(--sh-lg);
}
.hero__art svg { width: 100%; height: auto; display: block; }

/* --------------------------------------------------------------------------
   10. Category cards
   -------------------------------------------------------------------------- */
.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--grad-surface);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  overflow: hidden;
}
.cat-card::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: var(--grad-gem);
  opacity: .85;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(157,130,255,.45);
  box-shadow: var(--sh-lg);
}
.cat-card__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: rgba(157,130,255,.13);
  color: var(--gem-violet);
}
.cat-card__icon svg { width: 26px; height: 26px; }
.cat-card h3 { margin: 0; font-size: 1.12rem; }
.cat-card h3 a { color: #fff; }
.cat-card h3 a:hover { text-decoration: none; color: var(--gem-violet); }
.cat-card h3 a::after { content: ""; position: absolute; inset: 0; }
.cat-card p { margin: 0; font-size: var(--t-sm); color: var(--text-muted); }
.cat-card__count {
  margin-top: auto;
  padding-top: 8px;
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--gem-emerald);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   11. Article / guide cards
   -------------------------------------------------------------------------- */
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.post-card:hover { transform: translateY(-3px); border-color: rgba(51,227,164,.4); }
.post-card__kicker {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gem-emerald);
}
.post-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.post-card h3 a { color: #fff; }
.post-card h3 a:hover { color: var(--gem-cyan); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card p { margin: 0; font-size: var(--t-sm); color: var(--text-muted); }
.post-card__meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: var(--t-xs);
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

/* --------------------------------------------------------------------------
   12. Filters, search & toolbars
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-5);
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label,
.filter-group__label {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

input[type="text"], input[type="search"], input[type="email"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: var(--t-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
  border-color: var(--gem-cyan);
  box-shadow: 0 0 0 3px rgba(69,201,255,.18);
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8b3d2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 36px;
  cursor: pointer;
}
select option { background: var(--surface); color: var(--text); }

.search-box { position: relative; flex: 1 1 260px; }
.search-box input[type="search"] { padding-left: 42px; }
.search-box__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-dim);
  pointer-events: none;
}
.search-box__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
}
.search-box__clear[data-visible="true"] { display: inline-flex; }
.search-box__clear:hover { color: #fff; background: var(--surface-3); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  font: inherit;
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.chip:hover { color: #fff; background: var(--surface-3); text-decoration: none; }
.chip[aria-pressed="true"], .chip[data-active="true"] {
  background: rgba(69,201,255,.14);
  border-color: rgba(69,201,255,.5);
  color: var(--gem-cyan);
}

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  font-size: var(--t-sm);
  color: var(--text-muted);
}
.results-bar strong { color: #fff; }

.empty-state {
  text-align: center;
  padding: var(--s-8) var(--s-4);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: rgba(19,26,48,.5);
}
.empty-state svg {
  width: 56px; height: 56px;
  margin: 0 auto var(--s-4);
  color: var(--line);
}
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); max-width: 46ch; margin-inline: auto; }

/* --------------------------------------------------------------------------
   13. FAQ / accordion
   -------------------------------------------------------------------------- */
.faq { display: grid; gap: var(--s-3); }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  list-style: none;
  min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--gem-cyan);
  font-weight: 800;
  font-size: 1.05rem;
  transition: transform .2s var(--ease);
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { background: var(--surface-2); }
.faq__answer {
  padding: 0 var(--s-5) var(--s-4);
  color: var(--text-muted);
  font-size: var(--t-sm);
  border-top: 1px solid var(--line-soft);
  padding-top: var(--s-4);
}
.faq__answer > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   14. Ad slots — reserved, never overlapping content
   -------------------------------------------------------------------------- */
.ad-slot {
  width: 100%;
  margin-block: var(--s-6);
  padding: var(--s-3);
  min-height: 100px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: rgba(19,26,48,.4);
  text-align: center;
  color: var(--text-dim);
  font-size: var(--t-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  display: grid;
  place-items: center;
  overflow: hidden;
  contain: layout paint;
}
.ad-slot--leaderboard { min-height: 100px; }
.ad-slot--in-article { min-height: 280px; }
.ad-slot--sidebar { min-height: 600px; position: sticky; top: calc(var(--header-h) + 20px); }
.ad-slot::before { content: "Advertisement"; }
.ad-slot:not(:empty)::before { content: none; }

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--s-9);
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  padding-block: var(--s-7) var(--s-5);
  font-size: var(--t-sm);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: var(--s-6) var(--s-5);
}
.site-footer h2 {
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--s-3);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--gem-cyan); }
.site-footer__about p { color: var(--text-muted); max-width: 42ch; }
.site-footer__brand { margin-bottom: var(--s-3); }
.site-footer__bottom {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: var(--t-xs);
}
.site-footer__bottom p { margin: 0; }

/* --------------------------------------------------------------------------
   16. Misc utilities
   -------------------------------------------------------------------------- */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pill-list li { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  transform: translate(-50%, 14px);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: #fff;
  font-size: var(--t-sm);
  font-weight: 600;
  box-shadow: var(--sh-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast[data-show="true"] { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.divider-gem {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-block: var(--s-6);
  color: var(--line);
}
.divider-gem::before, .divider-gem::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.divider-gem span {
  width: 10px; height: 10px;
  background: var(--grad-gem);
  transform: rotate(45deg);
  border-radius: 2px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-block: var(--s-5);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { min-width: 460px; font-size: var(--t-sm); }
.table-wrap th, .table-wrap td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.table-wrap th {
  background: var(--surface-2);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td { color: var(--text-muted); vertical-align: top; }

.page-head {
  padding-block: var(--s-6) var(--s-4);
}
.page-head h1 { margin-bottom: var(--s-3); }
.page-head .lead { margin-bottom: 0; }

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-6);
  border-radius: var(--r-xl);
  border: 1px solid rgba(69,201,255,.3);
  background:
    radial-gradient(600px 220px at 20% 0%, rgba(51,227,164,.16), transparent 70%),
    var(--grad-surface);
}
.cta-band h2 { margin-bottom: 6px; }
.cta-band p { margin: 0; color: var(--text-muted); max-width: 54ch; }

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

/* High-contrast / forced colors nicety */
@media (forced-colors: active) {
  .btn, .card, .panel, .chip { border: 1px solid ButtonText; }
}
