/* =========================================================================
   Get Curious — global stylesheet
   Sections:
     1. Reset & base
     2. Design tokens (CSS custom properties)
     3. Typography
     4. Layout utilities
     5. Site header / nav
     6. Hero
     7. Purpose section
     8. Categories
     9. Footer
    10. Animations
    11. Responsive
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Reset & base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; }

/* -------------------------------------------------------------------------
   2. Design tokens
   ------------------------------------------------------------------------- */
:root {
  /* Backgrounds — layered depth */
  --bg-base: #0f1117;
  --bg-surface: #1a1d27;
  --bg-elevated: #22263a;

  /* Text */
  --text-primary: #e8eaf0;
  --text-secondary: #9ba3bf;
  --text-muted: #5c6380;

  /* Accent — indigo / violet */
  --accent: #7c83f5;
  --accent-hover: #9da3f8;
  --accent-dim: rgba(124, 131, 245, 0.15);

  /* Semantic */
  --success: #4ade80;
  --warning: #fbbf24;
  --danger:  #f87171;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(124, 131, 245, 0.5);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);

  /* Spacing scale (8px grid) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;

  /* Radii */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-pill: 9999px;
}

/* -------------------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&display=swap');

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { color: var(--text-secondary); }

a {
  color: var(--accent);
  transition: color 160ms ease;
}
a:hover { color: var(--accent-hover); }
a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Serif display face for the inline pull-quote — single tasteful exception */
.pull { font-family: 'Fraunces', Georgia, serif; }

/* Accessibility utility: visually hidden, available to screen readers. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------------------
   4. Layout utilities
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.section-title {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* -------------------------------------------------------------------------
   5. Site header / nav
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 23, 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
}
.brand:hover { color: var(--accent-hover); }

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.nav-list a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.2rem;
  position: relative;
}
.nav-list a:hover { color: var(--text-primary); }
.nav-list a.active { color: var(--text-primary); }
.nav-list a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

/* -------------------------------------------------------------------------
   6. Intro — combined hero + purpose in one compact section
   ------------------------------------------------------------------------- */
.intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--space-5) var(--space-4);
}

/* Faint starfield wash behind the intro — kept very dim so type stays primary. */
.intro-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(124, 131, 245, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(15, 17, 23, 0) 0%, var(--bg-base) 92%),
    url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?w=1600&q=70&auto=format&fit=crop') center / cover no-repeat;
  filter: saturate(55%) brightness(0.45);
}

.intro-inner {
  max-width: 60rem;
}

.kicker {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.lede {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.lede strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Inline pull-quote — serif italic in an accent tint, no quote glyphs from <q>. */
.pull {
  font-style: italic;
  color: var(--accent-hover);
  font-size: 1.05em;
}
.pull::before,
.pull::after { content: '\201C'; }
.pull::after  { content: '\201D'; }

/* -------------------------------------------------------------------------
   8. Categories
   ------------------------------------------------------------------------- */
.categories {
  padding-block: var(--space-3) var(--space-5);
}

/* Home page main band: categories on the left (2fr), recent-posts sidebar
   on the right (1fr). Collapses to a single column on small screens. */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  align-items: stretch;
}
/* The <li> is the grid item; make it a flex container so the inner <a> can
   stretch to fill its full height. Without this the card hugs its content
   and rows look ragged when descriptions are different lengths. */
.cat-grid > li { display: flex; }

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
  position: relative;
  overflow: hidden;
  width: 100%;       /* fill the grid cell horizontally */
  min-height: 100%;  /* and vertically, so all cards match the tallest in the row */
}
.cat-card::before {
  /* faint accent halo on the top edge */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0;
  transition: opacity 220ms ease;
}
.cat-card:hover {
  transform: translateY(-2px);
  background: var(--bg-elevated);
  border-color: var(--border-focus);
}
.cat-card:hover::before { opacity: 1; }
.cat-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

.cat-glyph {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
}
.cat-card h3 {
  font-size: 1.1rem;
  margin: 0;
}
.cat-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}
.cat-cta {
  margin-top: auto;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------------------------
   8a. Recent-posts sidebar (home page)
   ------------------------------------------------------------------------- */
.recent-col { min-width: 0; }

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.recent-item {
  display: block;
  padding: 0.7rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.recent-item:hover {
  background: var(--bg-elevated);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}
.recent-title-line {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0 0 0.25rem;
}
.recent-meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}
.recent-tag {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.72rem;
}

/* -------------------------------------------------------------------------
   8b. Contact form (home page)
   ------------------------------------------------------------------------- */
.contact {
  padding-block: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}
.contact-inner { max-width: 42rem; }
.contact-lede {
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-size: 1rem;
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.contact-form .field { display: flex; flex-direction: column; gap: 0.35rem; }
.contact-form .field.full { grid-column: 1 / -1; }

.contact-form label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.contact-form .req {
  color: var(--accent);
  font-weight: 700;
  margin-left: 0.1rem;
}

.contact-form input,
.contact-form textarea {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 160ms ease, background 160ms ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--text-muted); }
.contact-form input:hover,
.contact-form textarea:hover { border-color: rgba(255, 255, 255, 0.15); }
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.contact-form textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.55;
}
/* Red border only after user has entered something invalid (avoids angry-red
   inputs the moment the page loads). */
.contact-form input:not(:placeholder-shown):invalid {
  border-color: var(--danger);
}

.contact-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
  flex-wrap: wrap;
}
.contact-status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}
.contact-status.is-success { color: var(--success); }
.contact-status.is-error   { color: var(--danger); }
.contact-status.is-info    { color: var(--accent-hover); }
.contact-status a { color: inherit; text-decoration: underline; }

/* -------------------------------------------------------------------------
   9. Footer
   ------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-4);
  background: var(--bg-base);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-sub { color: var(--text-muted); }

/* -------------------------------------------------------------------------
   9a. Category index pages (math.html, physics.html, …)
   ------------------------------------------------------------------------- */
.category-head {
  padding-block: var(--space-5) var(--space-2);
}
.category-head h1 {
  font-size: 2.4rem;
  margin: var(--space-1) 0 var(--space-2);
}
.category-head .lede { max-width: 50rem; }

.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding-block: var(--space-3) var(--space-6);
}
.article-grid > li { display: flex; }

.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  width: 100%;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}
.article-card:hover {
  transform: translateY(-2px);
  background: var(--bg-elevated);
  border-color: var(--border-focus);
}
.article-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}
.article-title { font-size: 1.4rem; margin: 0; color: var(--text-primary); }
.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}
.article-meta .stub {
  color: var(--warning);
  font-style: italic;
}
.article-meta a { color: var(--accent); }
.article-excerpt {
  color: var(--text-secondary);
  margin: 0.2rem 0 0;
}
.article-cta {
  margin-top: 0.4rem;
  color: var(--accent);
  font-size: 0.9rem;
}
.empty {
  color: var(--text-muted);
  padding: var(--space-3) 0;
  list-style: none;
}

/* -------------------------------------------------------------------------
   9b. Article page (articles/*.html)
   ------------------------------------------------------------------------- */

/* Share bar — sits between article header and body */
.share-bar {
  max-width: 46rem;
  margin-inline: auto;
  padding-block: var(--space-2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.share-label-prefix {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.25rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.share-btn svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }
.share-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-focus);
  color: var(--text-primary);
}
.share-btn.copied {
  border-color: var(--success);
  color: var(--success);
}

/* -------------------------------------------------------------------------
   Custom 404 page
   ------------------------------------------------------------------------- */
.not-found-section {
  padding-block: var(--space-6);
  max-width: 36rem;
}
.not-found-code {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 6rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  opacity: 0.35;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.04em;
}
.not-found-section h1 {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}
.not-found-section .lede { margin-bottom: var(--space-3); }
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}


.article-page main { padding-bottom: var(--space-5); }

.article-head {
  max-width: 46rem;
  margin-inline: auto;
  padding-block: var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border);
}
.article-head h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  margin: var(--space-1) 0;
}
.article-head .nowrap { white-space: nowrap; }
.article-head .article-meta { margin-top: var(--space-1); }
.article-head .author { color: var(--text-secondary); }

.article-body {
  max-width: 46rem;
  margin-inline: auto;
  padding-block: var(--space-4);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}
.article-body h2 {
  font-size: 1.5rem;
  margin: var(--space-4) 0 var(--space-2);
}
.article-body p {
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}
.article-body em { color: var(--accent-hover); font-style: italic; }
.article-body strong { color: var(--text-primary); }
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border-focus);
  text-underline-offset: 0.2em;
}
.article-body code {
  font-family: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-surface);
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  color: var(--accent-hover);
}
.article-body figure {
  margin: var(--space-3) 0;
  text-align: center;
}
.article-body figure svg { max-width: 100%; height: auto; }
.article-body figcaption {
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}
/* MathJax SVG output picks up currentColor, so display math reads in --text-primary */
.article-body mjx-container { color: var(--text-primary); }
.article-body mjx-container[display="true"] {
  display: block;
  margin: var(--space-2) auto;
  overflow-x: auto;
}

/* -------------------------------------------------------------------------
   9c. Reactions bar (thumbs up / down)
   ------------------------------------------------------------------------- */
.reactions {
  max-width: 46rem;
  margin-inline: auto;
  padding-block: var(--space-3);
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.reaction-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-focus);
}
.reaction-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.reaction-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent-hover);
}
.reaction-btn svg { width: 1.15rem; height: 1.15rem; }
.reactions-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* -------------------------------------------------------------------------
   9d. Comments
   ------------------------------------------------------------------------- */
.comments {
  max-width: 46rem;
  margin-inline: auto;
  padding-block: var(--space-4) var(--space-6);
}
.comments h2 {
  font-size: 1.4rem;
  margin-bottom: var(--space-3);
}
#comments-list { margin-bottom: var(--space-3); }

.comment {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
}
.comment:first-child { border-top: 0; }
.comment-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--bg-elevated);
  object-fit: cover;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
  display: flex;
  gap: var(--space-1);
  align-items: baseline;
  margin-bottom: 0.2rem;
}
.comment-author { color: var(--text-primary); font-weight: 600; font-size: 0.95rem; }
.comment-date { color: var(--text-muted); font-size: 0.85rem; }
.comment-text { color: var(--text-secondary); margin: 0; word-wrap: break-word; }

.comment-composer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.comment-composer textarea {
  width: 100%;
  min-height: 5rem;
  padding: 0.75rem;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}
.comment-composer textarea:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}
.comment-actions {
  margin-top: var(--space-2);
  display: flex;
  justify-content: flex-end;
}
.signed-in-as {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.signed-in-as img {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
}
.signin-prompt {
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.signin-prompt p { margin-bottom: var(--space-2); color: var(--text-secondary); }

/* -------------------------------------------------------------------------
   9e. Buttons (used in comments + coming-soon page)
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 100ms ease;
}
.btn-primary {
  background: var(--accent);
  color: #0b0d18;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover {
  border-color: var(--border-focus);
  background: var(--bg-elevated);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* -------------------------------------------------------------------------
   10. Animations — used with Intersection Observer in script.js
   ------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeInUp 600ms ease both;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------
   11. Responsive — single breakpoint
   ------------------------------------------------------------------------- */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }

  .nav-toggle { display: inline-flex; }
  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) var(--space-3) var(--space-3);
    background: rgba(15, 17, 23, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 200ms ease, opacity 200ms ease;
  }
  .nav-list li { border-top: 1px solid var(--border); }
  .nav-list li:first-child { border-top: 0; }
  .nav-list a {
    display: block;
    padding-block: var(--space-2);
  }

  .nav-open .nav-list {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .cat-grid { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .contact-form { grid-template-columns: 1fr; }
  .contact-actions { flex-direction: column-reverse; align-items: stretch; }
  .contact-actions .btn { width: 100%; justify-content: center; }

  .article-head { padding-block: var(--space-4) var(--space-2); }
  .reactions, .comments, .article-body, .article-head { padding-inline: var(--space-3); }
}
