/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #040714;
  --surface-1: rgba(255,255,255,.03);
  --surface-2: rgba(255,255,255,.07);
  --surface-toast: #1a1730;
  --surface-banner-bg: linear-gradient(135deg, #1a0a30 0%, #0a0518 100%);
  --border-subtle: rgba(255,255,255,.07);
  --border: rgba(255,255,255,.1);
  --text-primary: #f9f9f9;
  --text-secondary: #cacaca;
  --text-muted: rgba(255,255,255,.55);
  --text-content: #d8dce8;
  --accent: #10b981;
  --accent-dim: rgba(16,185,129,.15);
  --accent-bright: #34d399;
  --accent-border: rgba(16,185,129,.25);
  --accent-border-strong: rgba(16,185,129,.5);
  --font: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 1.875rem;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 15px;
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 120ms; --dur: 200ms;
}

body {
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────── */
.header-bar {
  background: linear-gradient(in oklch 135deg, #B015B0 0%, #3D0080 50%, #040714 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-6);
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-logo-img {
  height: 36px; width: auto; flex-shrink: 0;
  filter: brightness(0) invert(1);
  transition: transform 0.3s var(--ease-snap);
  display: block;
}
.header-logo-img:hover { transform: scale(1.14) rotate(-9deg); }
.header-logo h1, .header-logo .header-title { font-size: 1.2em; font-weight: 600; letter-spacing: .5px; }
.header-subtitle { font-size: .82em; color: rgba(255,255,255,.72); font-weight: 500; margin-top: 2px; }

/* ── Language toggle ───────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color var(--dur), background var(--dur);
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active {
  background: var(--accent);
  color: #000;
}

.header-home {
  display: flex; align-items: center;
  padding: 5px;
  color: rgba(255,255,255,0.9); text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--dur), background var(--dur); flex-shrink: 0;
}
.header-home:hover { color: #fff; background: rgba(255,255,255,0.12); }
.header-home svg { width: 34px; height: 34px; display: block; }

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: var(--space-4);
  z-index: 1000; padding: var(--space-2) var(--space-4);
  background: var(--accent); color: #000; font-weight: 600;
  font-size: var(--text-sm); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none; transition: top var(--dur);
}
.skip-link:focus { top: 0; }

/* ── Homepage hero ─────────────────────────────────────────── */
.hero {
  padding: var(--space-12) var(--space-6) var(--space-10);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-8);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: var(--space-5);
  max-width: 640px;
}
.hero-desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
}

/* ── Hero topic pills with hover preview ───────────────────── */
.hero-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hero-topic {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 100px;
  text-decoration: none;
  color: var(--accent-bright);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.hero-topic:hover {
  background: rgba(16,185,129,.22);
  border-color: var(--accent);
  color: #fff;
}

.hero-topic-arrow {
  transition: transform var(--dur);
  opacity: 0.7;
  font-size: 0.9em;
}
.hero-topic:hover .hero-topic-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* Preview tooltip — appears after hovering for ~350ms */
.hero-topic-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 288px;
  padding: var(--space-4) var(--space-5);
  background: #0d0d1f;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px rgba(16,185,129,.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  transition-delay: 0s;
  z-index: 50;
  text-align: left;
}
/* Small arrow pointing down */
.hero-topic-preview::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #0d0d1f;
  border-right: 1px solid var(--accent-border);
  border-bottom: 1px solid var(--accent-border);
}
.hero-topic:hover .hero-topic-preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.35s; /* "hover enough" before preview appears */
}

.hero-preview-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: 1.35;
}
.hero-preview-excerpt {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Posts grid ────────────────────────────────────────────── */
.posts-section {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-12);
  flex: 1;
}

.posts-grid {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

/* ── Section columns ───────────────────────────────────────── */
.section-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.section-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-4);
}

/* ── Section dividers ──────────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0 var(--space-1);
}

.section-divider::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.section-divider-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

/* ── Post card ─────────────────────────────────────────────── */
.post-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative; /* required for stretched-link */
  cursor: pointer;
  transition: transform var(--dur) ease-out, box-shadow var(--dur) ease-out,
              border-color var(--dur);
  animation: fadeIn 0.3s ease-out both;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  border-color: var(--accent);
}

.post-card-excerpt {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Stretched link: title <a> expands to cover the whole card */
.post-card-title-link {
  color: inherit;
  text-decoration: none;
}
.post-card-title-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
/* Part links and read button float above the stretched link */
.part-link,
.btn-read {
  position: relative;
  z-index: 2;
}

.post-card-banner {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--surface-banner-bg);
  overflow: hidden;
}
.post-card-banner img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-banner img { transform: scale(1.04); }
.post-card-banner.no-image img { display: none; }
.post-card-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(4,7,20,.7) 100%);
  pointer-events: none;
}

/* Series badge */
.series-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: var(--accent);
  color: #000;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}

.post-card-body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.post-card-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.post-card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
}

.post-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

/* ── Parts list (series card) ──────────────────────────────── */
.parts-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.part-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.4;
  position: relative;
  z-index: 2;
  transition: color var(--dur);
}
.part-link:hover { color: var(--accent-bright); }

.part-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  min-width: 16px;
  background: var(--surface-2);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Read button (decorative span — stretched link covers the click) ─── */
.btn-read {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--space-2);
  padding: 8px 18px;
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-top: var(--space-2);
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.3px;
}
.post-card:hover .btn-read {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
}

/* Series card: part-link inherits pointer from parent card */
.post-card--series .part-link { cursor: pointer; }

/* ── Post page ─────────────────────────────────────────────── */
.post-hero-banner {
  width: 100%;
  max-height: 220px;
  overflow: hidden;
  position: relative;
}
.post-hero-banner img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.post-hero-banner.no-image { height: 80px; }
.post-hero-banner.no-image img { display: none; }
.post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,7,20,.2) 0%, rgba(4,7,20,.9) 100%);
}

.post-header {
  max-width: 740px;
  width: 100%;
  margin: var(--space-8) auto 0;
  padding: 0 var(--space-6);
}
.post-header-series {
  font-size: var(--text-xs);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-2);
  text-decoration: none;
}
.post-header-series:hover { text-decoration: underline; }
.post-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}
.post-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

/* ── Series nav ────────────────────────────────────────────── */
.series-nav {
  max-width: 740px;
  width: 100%;
  margin: var(--space-6) auto;
  padding: var(--space-4) var(--space-6);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.series-nav.hidden { display: none; }

.series-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.series-progress-label {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 600;
}
.series-progress-part {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.series-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
  white-space: nowrap;
}
.nav-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--text-primary);
}
.nav-btn--next { background: var(--accent); color: #000; border-color: var(--accent); }
.nav-btn--next:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: #000; }
.nav-btn--home { font-size: var(--text-xs); }
.nav-btn-placeholder { width: 80px; }

/* ── Post layout (content centered, TOC fixed left) ────────── */
.post-layout {
  max-width: 740px;
  width: 100%;
  margin: var(--space-8) auto var(--space-12);
  padding: 0 var(--space-6);
}

/* ── TOC sidebar (fixed, outside content flow) ─────────────── */
.post-toc-column {
  position: fixed;
  left: max(16px, calc(50vw - 370px - 240px));
  top: calc(68px + var(--space-6));
  width: 208px;
  max-height: calc(100vh - 68px - 48px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.post-toc-column.toc-hidden { display: none; }
.post-toc-column.toc-active {
  opacity: 1;
  pointer-events: auto;
}

.post-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  border-left: 2px solid var(--accent);
}

.toc-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.toc-link {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px var(--space-2);
  border-radius: 4px;
  line-height: 1.4;
  transition: color var(--dur), background var(--dur);
}
.toc-link:hover { color: var(--text-primary); background: var(--surface-2); }
.toc-link.active {
  color: var(--accent-bright);
  font-weight: 600;
  background: rgba(16,185,129,.08);
  border-left: 2px solid var(--accent);
  padding-left: 6px;
  margin-left: -8px;
}

/* ── Post content (markdown rendered) ─────────────────────── */
.post-container {
  min-width: 0;
}

.post-content {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text-content);
}

.post-content h1 {
  font-size: var(--text-3xl);
  color: var(--text-primary);
  font-weight: 700;
  margin: var(--space-8) 0 var(--space-4);
  line-height: 1.2;
}
.post-content h2 {
  font-size: var(--text-2xl);
  color: var(--text-primary);
  font-weight: 700;
  margin: var(--space-8) 0 var(--space-3);
  padding-left: var(--space-4);
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, #34d399 0%, #059669 100%) 1;
  line-height: 1.25;
  scroll-margin-top: 88px;
}
.post-content h3 {
  font-size: var(--text-xl);
  color: var(--text-primary);
  font-weight: 600;
  margin: var(--space-6) 0 var(--space-3);
}
.post-content h4 {
  font-size: var(--text-lg);
  color: var(--text-primary);
  font-weight: 600;
  margin: var(--space-4) 0 var(--space-2);
}

.post-content p { margin-bottom: var(--space-4); }

/* Intro hook: paragraph whose only content is italic */
.post-content p > em:only-child {
  display: block;
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(135deg, rgba(16,185,129,.07) 0%, rgba(16,185,129,.02) 100%);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  color: var(--text-content);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.78;
}

/* Role info card: groups Tools + Profile + Career lines */
.role-card {
  margin: var(--space-4) 0 var(--space-6);
  padding: var(--space-1) var(--space-5);
  background: linear-gradient(135deg, rgba(16,185,129,.04) 0%, rgba(255,255,255,.015) 100%);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  overflow: hidden;
}
.role-card p {
  margin-bottom: 0;
  font-size: var(--text-sm);
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.role-card p:last-child { border-bottom: none; }

/* Diamond bullet */
.role-card p::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  min-width: 6px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
  margin-top: 6px;
  opacity: 0.8;
}
.role-card p strong {
  color: var(--accent-bright);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-content a { color: var(--accent-bright); text-decoration: underline; }
.post-content a:hover { color: #fff; }

.post-content ul, .post-content ol {
  margin: var(--space-4) 0 var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.post-content li { line-height: 1.65; }

.post-content strong { color: var(--text-primary); font-weight: 600; }

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin: var(--space-6) auto;
}

.post-content blockquote {
  border-left: 3px solid var(--accent-border-strong);
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6) var(--space-4) var(--space-6);
  background: linear-gradient(135deg, rgba(16,185,129,.06) 0%, rgba(255,255,255,.01) 100%);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
  font-size: 1.04rem;
  line-height: 1.75;
}
.post-content blockquote p { margin-bottom: 0; }

.post-content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: rgba(255,255,255,.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-bright);
}
.post-content pre {
  background: rgba(0,0,0,.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-6);
  overflow-x: auto;
  margin: var(--space-4) 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: var(--text-sm);
}

.post-content hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,.05);
  margin: var(--space-2) 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
}
.post-content th, .post-content td {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th {
  background: var(--surface-2);
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Skeleton & loading ────────────────────────────────────── */
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}
.post-loading { padding: var(--space-4); }

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--surface-toast); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px;
  font-size: 0.84rem; color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.55);
  pointer-events: none;
  transform: translateY(8px); opacity: 0;
  transition: opacity 0.18s, transform 0.18s;
}
.toast.visible { opacity: 1; transform: translateY(0); }

/* ── Load error ────────────────────────────────────────────── */
.load-error {
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-8);
}

/* ── Footer ────────────────────────────────────────────────── */
.info-footer {
  text-align: center; padding: 20px var(--space-6) 28px;
  color: var(--text-muted); font-size: .78em; line-height: 1.8;
  border-top: 1px solid var(--border-subtle);
}
.footer-link { color: var(--text-muted); text-decoration: none; transition: color var(--dur); }
.footer-link:hover { color: var(--text-secondary); text-decoration: underline; }

/* ── Focus styles ──────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .post-toc-column { display: none; }
}

@media (max-width: 700px) {
  .header-bar { padding: 0 var(--space-4); gap: var(--space-3); }
  .header-logo h1 { font-size: 1em; }
  .hero { padding: var(--space-8) var(--space-4) var(--space-8); }
  .hero-topic-preview { display: none; } /* tooltip doesn't fit on mobile */
  .posts-section { padding: 0 var(--space-4) var(--space-8); }
  .posts-grid { flex-direction: column; gap: var(--space-8); }
  .section-cards { gap: var(--space-4); }
  .post-header, .post-layout { padding: 0 var(--space-4); }
  .post-layout { margin-bottom: var(--space-8); }
  .series-nav { padding: var(--space-4); margin: var(--space-4) var(--space-4); }
  .series-buttons { flex-wrap: wrap; }
  .nav-btn-placeholder { display: none; }
  .parts-list { grid-template-columns: repeat(2, 1fr); }
}

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