/* ==========================================================================
   Physics Arcade — core stylesheet
   Push. Bounce. Swing. Launch. Master Physics.
   ========================================================================== */

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

:root {
  /* Palette — dark is the default surface for an arcade lab */
  --bg:            #0b0f1a;
  --bg-deep:       #070a12;
  --surface:       #121829;
  --surface-2:     #1a2238;
  --surface-3:     #212c47;
  --border:        #263252;
  --border-soft:   #1d2740;

  --text:          #e8ecf7;
  --text-strong:   #ffffff;
  --muted:         #97a3c2;
  --muted-2:       #6e7b9c;

  --accent:        #22d3ee;   /* velocity cyan */
  --accent-ink:    #06222a;
  --accent-2:      #fbbf24;   /* impulse amber */
  --accent-3:      #a78bfa;   /* field violet  */
  --success:       #34d399;
  --danger:        #f87171;

  --grad-hero: radial-gradient(1200px 600px at 12% -10%, rgba(34,211,238,.20), transparent 60%),
               radial-gradient(900px 520px at 88% 0%, rgba(167,139,250,.18), transparent 60%),
               linear-gradient(180deg, #0d1322 0%, var(--bg) 70%);

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

  --fs-xs:   .78rem;
  --fs-sm:   .875rem;
  --fs-base: 1rem;
  --fs-md:   1.075rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.55rem;
  --fs-2xl:  2rem;
  --fs-3xl:  2.6rem;
  --fs-4xl:  3.2rem;

  /* Space */
  --sp-1: .25rem;
  --sp-2: .5rem;
  --sp-3: .75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow:    0 10px 30px -12px rgba(0,0,0,.65);
  --shadow-lg: 0 24px 60px -24px rgba(0,0,0,.8);

  --wrap: 1180px;
  --wrap-narrow: 760px;

  --header-h: 64px;
}

/* Light theme — opt-in via the header toggle (persisted in localStorage). */
:root[data-theme="light"] {
  --bg:            #f5f7fc;
  --bg-deep:       #eaeefa;
  --surface:       #ffffff;
  --surface-2:     #f2f5fc;
  --surface-3:     #e7ecf8;
  --border:        #d5dcee;
  --border-soft:   #e3e8f5;

  --text:          #16203a;
  --text-strong:   #0a1226;
  --muted:         #56618a;
  --muted-2:       #78829f;

  --accent:        #0e7f97;
  --accent-ink:    #ffffff;
  --accent-2:      #a86a00;
  --accent-3:      #6d4fd1;
  --success:       #12795a;
  --danger:        #b3261e;

  --grad-hero: radial-gradient(1100px 560px at 10% -12%, rgba(14,127,151,.14), transparent 60%),
               radial-gradient(860px 500px at 90% -4%, rgba(109,79,209,.12), transparent 60%),
               linear-gradient(180deg, #ffffff 0%, var(--bg) 72%);

  --shadow:    0 10px 30px -14px rgba(20,32,64,.28);
  --shadow-lg: 0 24px 60px -26px rgba(20,32,64,.32);
}

/* --------------------------------------------------------------------------
   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;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5 {
  margin: 0 0 var(--sp-3);
  line-height: 1.2;
  color: var(--text-strong);
  font-weight: 750;
  letter-spacing: -.015em;
}

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); }
ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.3em; }
li { margin-bottom: .4em; }

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

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

code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }

code {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: .12em .42em;
}

kbd {
  display: inline-block;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: .08em .5em;
  font-size: .85em;
  color: var(--text-strong);
  min-width: 1.9em;
  text-align: center;
}

table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-5); }
th, td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--text-strong); font-weight: 700; background: var(--surface-2); }

/* Focus — visible everywhere, never removed */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--accent-ink);
  padding: .7rem 1.1rem;
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

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

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

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

.section { padding: var(--sp-7) 0; }
.section-tight { padding: var(--sp-6) 0; }

.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: .35rem 0 0; color: var(--muted); max-width: 62ch; }

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

.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(255px, 1fr)); }

.stack > * + * { margin-top: var(--sp-4); }
.lead { font-size: var(--fs-md); color: var(--muted); }

/* --------------------------------------------------------------------------
   4. Header & navigation
   -------------------------------------------------------------------------- */

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

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  height: var(--header-h);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.06rem;
  color: var(--text-strong);
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name small {
  display: block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-top: -2px;
}

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

.main-nav { margin-left: auto; }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: .1rem;
  list-style: none;
  margin: 0; padding: 0;
}
.main-nav a {
  display: block;
  padding: .5rem .66rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text-strong); background: var(--surface-2); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--accent); background: var(--surface-2); }

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text-strong); border-color: var(--accent); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

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

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

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

.btn-lg { padding: .92rem 1.7rem; font-size: var(--fs-base); }
.btn-sm { padding: .45rem .8rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }

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

.hero {
  position: relative;
  background: var(--grad-hero);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: var(--sp-7);
  align-items: center;
  padding: var(--sp-8) var(--sp-4);
  max-width: var(--wrap);
  margin-inline: auto;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, var(--fs-4xl));
  margin-bottom: var(--sp-4);
}
.hero h1 .hl {
  background: linear-gradient(95deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { font-size: var(--fs-md); color: var(--muted); max-width: 56ch; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.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);
}
.hero-stat strong {
  display: block;
  font-size: var(--fs-xl);
  color: var(--text-strong);
  line-height: 1.1;
}
.hero-stat span { font-size: var(--fs-xs); color: var(--muted-2); text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }

/* Canvas-driven hero visual (decorative, paused for reduced motion) */
.hero-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-visual canvas { width: 100%; height: 100%; display: block; }
.hero-visual::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.35));
  pointer-events: none;
}

/* Page header for interior pages */
.page-head {
  background: var(--grad-hero);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-6) 0 var(--sp-7);
}
.page-head h1 { margin-bottom: var(--sp-3); }
.page-head .lead { max-width: 68ch; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow); }

.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;
  gap: var(--sp-1);
  flex-wrap: wrap;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .24em .6em;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}
.badge-featured { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.badge-new      { background: var(--success); color: #04231a; border-color: transparent; }
.badge-popular  { background: var(--accent-2); color: #2a1c00; border-color: transparent; }

.card-body { padding: var(--sp-4); display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.card-body h3 a { color: var(--text-strong); }
.card-body h3 a:hover { color: var(--accent); text-decoration: none; }
.card-body p { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-3); }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--muted-2);
}

.chip {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: .2em .58em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--muted);
}
.chip-cat { color: var(--accent-3); border-color: color-mix(in srgb, var(--accent-3) 35%, transparent); }

.diff { font-weight: 800; }
.diff-Easy   { color: var(--success); }
.diff-Medium { color: var(--accent); }
.diff-Hard   { color: var(--accent-2); }
.diff-Expert { color: var(--danger); }

.card-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: auto;
  align-items: center;
}
.card-actions .btn { flex: 1; }

.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn:hover { color: var(--accent-2); border-color: var(--accent-2); }
.fav-btn[aria-pressed="true"] { color: var(--accent-2); border-color: var(--accent-2); }
.fav-btn[aria-pressed="true"] svg { fill: var(--accent-2); }

/* Category card */
.cat-card {
  display: block;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .16s ease, transform .16s ease;
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-3px); text-decoration: none; }
.cat-card .cat-icon { width: 42px; height: 42px; margin-bottom: var(--sp-3); color: var(--accent); }
.cat-card h3 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.cat-card p { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-3); }
.cat-card .cat-count { font-size: var(--fs-xs); font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }

/* Feature / info tiles */
.tile {
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tile h3 { font-size: var(--fs-md); }
.tile p  { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 0; }
.tile .tile-icon { width: 36px; height: 36px; color: var(--accent); margin-bottom: var(--sp-3); }

/* Guide / article card */
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .16s ease, transform .16s ease;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.article-card .card-body h3 a { font-size: var(--fs-md); }
.article-card .kicker {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: var(--sp-2);
}

/* --------------------------------------------------------------------------
   8. Breadcrumbs
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   9. FAQ / accordion
   -------------------------------------------------------------------------- */

.faq-list { display: grid; gap: var(--sp-3); }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: var(--sp-4);
  font-weight: 700;
  color: var(--text-strong);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform .18s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 var(--sp-4) var(--sp-4); color: var(--muted); }
.faq-item .faq-answer > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   10. Forms, search, filters
   -------------------------------------------------------------------------- */

label { display: block; font-weight: 650; font-size: var(--fs-sm); margin-bottom: var(--sp-2); color: var(--text-strong); }

input[type="text"], input[type="search"], input[type="email"],
select, textarea {
  width: 100%;
  padding: .66rem .85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 150px; resize: vertical; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.1rem;
}

.search-form { display: flex; gap: var(--sp-2); }
.search-form input { flex: 1; }

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--sp-3);
}
.filter-foot {
  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);
}
.result-count { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.result-count strong { color: var(--text-strong); }

.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state h3 { margin-bottom: var(--sp-2); }
.empty-state p { color: var(--muted); max-width: 46ch; margin-inline: auto; }

/* --------------------------------------------------------------------------
   11. Ad slots — always labelled, never over gameplay
   -------------------------------------------------------------------------- */

.ad-slot {
  display: block;
  margin: var(--sp-6) auto;
  max-width: 970px;
  min-height: 90px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}
.ad-slot::before {
  content: "Advertisement";
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 700;
}
.ad-slot-inline { max-width: 728px; min-height: 90px; }

/* --------------------------------------------------------------------------
   12. Callouts
   -------------------------------------------------------------------------- */

.callout {
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--sp-5);
}
.callout h4 { font-size: var(--fs-base); margin-bottom: var(--sp-2); }
.callout p:last-child { margin-bottom: 0; }
.callout-note    { border-left-color: var(--accent); }
.callout-physics { border-left-color: var(--accent-3); }
.callout-warn    { border-left-color: var(--accent-2); }

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: var(--sp-7) 0 var(--sp-5);
  margin-top: var(--sp-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: var(--sp-6);
}
.footer-brand p { font-size: var(--fs-sm); color: var(--muted); max-width: 38ch; }
.footer-col h3 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted-2);
  margin-bottom: var(--sp-3);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .45rem; }
.footer-col a { color: var(--muted); font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--accent); }

.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;
  font-size: var(--fs-xs);
  color: var(--muted-2);
}
.footer-bottom p { margin: 0; }

/* --------------------------------------------------------------------------
   14. Misc components
   -------------------------------------------------------------------------- */

.notice {
  padding: var(--sp-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 140%);
  background: var(--surface-3);
  border: 1px solid var(--accent);
  color: var(--text-strong);
  padding: .7rem 1.2rem;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 650;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  transition: transform .26s cubic-bezier(.2,.8,.3,1);
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); }

.pill-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.pill {
  display: inline-block;
  padding: .38rem .85rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 650;
}
a.pill:hover { border-color: var(--accent); color: var(--text-strong); text-decoration: none; }
.pill[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: var(--sp-3); }
.stat-box {
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.stat-box strong { display: block; font-size: var(--fs-xl); color: var(--accent); line-height: 1.15; }
.stat-box span { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

/* Author box */
.author-box {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: var(--sp-6) 0;
}
.author-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  display: grid;
  place-items: center;
  color: #04202a;
  font-weight: 800;
  font-size: 1.4rem;
}
.author-box h3 { font-size: var(--fs-md); margin-bottom: .2rem; }
.author-box .author-role { font-size: var(--fs-xs); color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin-bottom: var(--sp-2); }
.author-box p { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-2); }

/* Sitemap page columns */
.sitemap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: var(--sp-5); }
.sitemap-grid ul { list-style: none; padding: 0; }
.sitemap-grid li { margin-bottom: .35rem; font-size: var(--fs-sm); }

/* 404 */
.error-page { text-align: center; padding: var(--sp-8) var(--sp-4); }
.error-code {
  font-size: clamp(4rem, 16vw, 8rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(95deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: var(--sp-3);
}

/* --------------------------------------------------------------------------
   15. Reduced motion — site chrome only, gameplay stays functional
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   16. Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .ad-slot, .game-stage, .nav-toggle, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
