/* ==========================================================================
   AGENTIC THINKING - Design System v4
   MAXIMUM IMPACT. BOLD. ALIVE. UNAPOLOGETIC.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
  /* Colors - Soft paper tints */
  --color-bg: #f8f6f1; /* Warm paper, not pure white */
  --color-bg-alt: #f0ede6;
  --color-bg-warm: #f5ede0;
  --color-bg-cool: #eef2f5;
  --color-bg-accent: #e8f0e6;
  --color-bg-blush: #f5ebe8;
  --color-bg-butter: #f5f2e4;
  --color-bg-ink: #1a1a1a;
  --color-bg-slate: #2d3748;
  --color-bg-navy: #1a2744;
  --color-text: #1c1c1c;
  --color-text-muted: #666;
  --color-text-light: #888;
  --color-accent: #1a6b4a; /* Single accent - sophisticated teal-green */
  --color-accent-hover: #145a3d;
  --color-pop-coral: #d4594a;
  --color-pop-gold: #b8922a;
  --color-pop-violet: #5f5086;
  --color-border: #e0ddd6;
  --color-border-light: #eae8e2;

  /* Typography */
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-sans-condensed: "Arial Narrow", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", monospace;

  /* EXTREME Fluid Typography - Never too small! */
  --text-xs: clamp(0.7rem, 0.5rem + 0.5vw, 0.9rem);
  --text-sm: clamp(0.85rem, 0.6rem + 0.6vw, 1.1rem);
  --text-base: clamp(1rem, 0.8rem + 0.5vw, 1.25rem);
  --text-lg: clamp(1.15rem, 0.8rem + 1vw, 1.7rem);
  --text-xl: clamp(1.35rem, 0.9rem + 1.5vw, 2.5rem);
  --text-2xl: clamp(1.6rem, 1rem + 2vw, 3.5rem);
  --text-3xl: clamp(1.9rem, 1rem + 3vw, 4rem);
  --text-4xl: clamp(2.2rem, 1rem + 4vw, 5rem);
  --text-5xl: clamp(2.6rem, 1.2rem + 5vw, 6rem);
  --text-hero: clamp(3rem, 1rem + 8vw, 8rem);
  --text-mega: clamp(3.5rem, 0.5rem + 10vw, 10rem);
  --text-ultra: clamp(4rem, 0rem + 12vw, 14rem);

  /* Spacing */
  --space-xs: clamp(0.2rem, 0.15rem + 0.25vw, 0.5rem);
  --space-sm: clamp(0.4rem, 0.2rem + 0.5vw, 1rem);
  --space-md: clamp(0.8rem, 0.4rem + 1vw, 2rem);
  --space-lg: clamp(1.5rem, 0.8rem + 2vw, 4rem);
  --space-xl: clamp(2.5rem, 1.5rem + 4vw, 8rem);

  /* Layout */
  --max-width: 100%;
  --content-width: 750px;

  /* Transitions */
  --transition-fast: 100ms ease-out;
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode - via class or system preference */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) {
    --color-bg: #0a0a0a;
    --color-bg-alt: #111;
    --color-bg-warm: #12100b;
    --color-bg-cool: #0a0d12;
    --color-bg-accent: #0a110c;
    --color-bg-blush: #120d0b;
    --color-bg-butter: #11100a;
    --color-bg-ink: #f0f0f0;
    --color-bg-slate: #c8cdd5;
    --color-bg-navy: #c5cee0;
    --color-text: #e8e8e8;
    --color-text-muted: #888;
    --color-text-light: #666;
    --color-border: #2a2a2a;
    --color-border-light: #222;
  }
}

/* Dark mode via JS toggle */
:root.dark-mode {
  --color-bg: #0a0a0a;
  --color-bg-alt: #111;
  --color-bg-warm: #12100b;
  --color-bg-cool: #0a0d12;
  --color-bg-accent: #0a110c;
  --color-bg-blush: #120d0b;
  --color-bg-butter: #11100a;
  --color-bg-ink: #f0f0f0;
  --color-bg-slate: #c8cdd5;
  --color-bg-navy: #c5cee0;
  --color-text: #e8e8e8;
  --color-text-muted: #888;
  --color-text-light: #666;
  --color-accent: #4a9b6a;
  --color-border: #2a2a2a;
  --color-border-light: #222;
}

/* Fix masthead in dark mode */
:root.dark-mode .masthead {
  background: rgba(10, 10, 10, 0.92);
}

/* Dark mode: inverted cards need proper text colors */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) .post-card:nth-child(7),
  :root:not(.light-mode) .post-card:nth-child(12),
  :root:not(.light-mode) .post-card:nth-child(17),
  :root:not(.light-mode) .post-card:nth-child(20) {
    color: var(--color-bg);
  }

  :root:not(.light-mode) .post-card:nth-child(7) .post-card__excerpt,
  :root:not(.light-mode) .post-card:nth-child(7) .post-card__meta,
  :root:not(.light-mode) .post-card:nth-child(12) .post-card__excerpt,
  :root:not(.light-mode) .post-card:nth-child(12) .post-card__meta,
  :root:not(.light-mode) .post-card:nth-child(17) .post-card__excerpt,
  :root:not(.light-mode) .post-card:nth-child(17) .post-card__meta,
  :root:not(.light-mode) .post-card:nth-child(20) .post-card__excerpt,
  :root:not(.light-mode) .post-card:nth-child(20) .post-card__meta {
    color: rgba(10, 10, 10, 0.6);
  }
}

:root.dark-mode .post-card:nth-child(7),
:root.dark-mode .post-card:nth-child(12),
:root.dark-mode .post-card:nth-child(17),
:root.dark-mode .post-card:nth-child(20) {
  color: var(--color-bg);
}

:root.dark-mode .post-card:nth-child(7) .post-card__excerpt,
:root.dark-mode .post-card:nth-child(7) .post-card__meta,
:root.dark-mode .post-card:nth-child(12) .post-card__excerpt,
:root.dark-mode .post-card:nth-child(12) .post-card__meta,
:root.dark-mode .post-card:nth-child(17) .post-card__excerpt,
:root.dark-mode .post-card:nth-child(17) .post-card__meta,
:root.dark-mode .post-card:nth-child(20) .post-card__excerpt,
:root.dark-mode .post-card:nth-child(20) .post-card__meta {
  color: rgba(10, 10, 10, 0.6);
}

/* Dark mode: interest filter */
:root.dark-mode .interest-filter__input {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--color-text);
  color: var(--color-bg);
}

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

/* Cartoon images: ensure visibility in dark mode */
img[src*="/cartoons/"] {
  border-radius: 8px;
}
.dark-mode img[src*="/cartoons/"] {
  background: #f5f5f5;
  padding: 0.5rem;
}
@media (prefers-color-scheme: dark) {
  html:not(.light-mode) img[src*="/cartoons/"] {
    background: #f5f5f5;
    padding: 0.5rem;
  }
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.1em;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  line-height: 1;
  letter-spacing: -0.03em;
  text-wrap: balance;
  text-wrap: pretty; /* Fallback for browsers that support it */
}

p + p {
  margin-top: 1.4em;
}

blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-md);
  font-style: italic;
  color: var(--color-text-muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-bg-alt);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--color-bg-alt);
  padding: var(--space-md);
  border-radius: 4px;
  overflow-x: auto;
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  margin: var(--space-md) 0;
}

pre code {
  background: none;
  padding: 0;
}

/* Consistent spacing in post content */
.post-content > * + * {
  margin-top: var(--space-md);
}

.post-content > h2 {
  margin-top: var(--space-xl);
}

.post-content > h3 {
  margin-top: var(--space-lg);
}

.post-content > pre + p,
.post-content > pre + ul,
.post-content > pre + ol {
  margin-top: var(--space-md);
}

.post-content > blockquote {
  margin: var(--space-md) 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

@media (min-width: 1200px) {
  .container {
    padding: 0 var(--space-md);
  }
}

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* --------------------------------------------------------------------------
   Topic Filters
   -------------------------------------------------------------------------- */

.topic-filters {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-md);
}

.topic-filter {
  position: relative;
  background: transparent;
  border: none;
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  cursor: pointer;
  overflow: hidden;
}

.topic-filter::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-text);
  transition:
    width 0.3s ease,
    left 0.3s ease;
}

.topic-filter:hover {
  color: var(--color-text);
  letter-spacing: 0.15em;
  transition:
    color 0.2s ease,
    letter-spacing 0.3s ease;
}

.topic-filter:hover::after {
  width: 100%;
  left: 0;
}

.topic-filter.is-active {
  color: var(--color-text);
}

.topic-filter.is-active::after {
  width: 100%;
  left: 0;
}

/* --------------------------------------------------------------------------
   Masthead - Editorial OS Bar
   -------------------------------------------------------------------------- */

.masthead {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(248, 246, 241, 0.92);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  max-width: 1800px;
  margin: 0 auto;
  position: relative;
}

.masthead__logo {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: opacity 0.3s ease;
}

.masthead__logo:hover {
  color: inherit;
  opacity: 0.6;
}

.masthead__logo svg {
  width: 20px;
  height: 20px;
}

/* OS Bar - Right side controls */
.masthead__controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.masthead__control {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-xs) 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.masthead__control:hover {
  color: var(--color-text);
}

.masthead__control-icon {
  font-size: 1.1em;
  opacity: 0.7;
}

/* Context-aware: condense on scroll */
.masthead--condensed {
  padding: var(--space-xs) 0;
}

.masthead--condensed .masthead__logo {
  font-size: var(--text-xs);
}

/* Hide some controls on mobile */
@media (max-width: 600px) {
  .masthead__controls {
    gap: var(--space-sm);
  }
  .masthead__control-label {
    display: none;
  }
}

/* ==========================================================================
   FIRST-TIME SEARCH TOOLTIP
   ========================================================================== */

.search-tooltip {
  position: fixed;
  top: 60px;
  right: var(--space-md);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  border-radius: 4px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  animation: tooltip-in 0.3s ease 1s forwards;
  pointer-events: none;
}

.search-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  border: 6px solid transparent;
  border-bottom-color: var(--color-text);
  border-top: none;
}

.search-tooltip kbd {
  padding: 0.15em 0.4em;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  margin-left: 0.3em;
}

.search-tooltip--hidden {
  display: none;
}

@keyframes tooltip-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   POSTS GRID - FULL BLEED, ORGANIC, WILD
   ========================================================================== */

/* Masthead brand - centered title + byline */
.masthead .masthead__inner {
  justify-content: center;
}

.masthead__brand {
  text-align: center;
  flex: 1;
  transition: opacity 0.4s ease;
}

/* Child pages - subtle */
.masthead__brand {
  opacity: 0.45;
}

.masthead__brand:hover {
  opacity: 0.85;
}

.masthead__title {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text);
  display: block;
}

.masthead__byline {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

.masthead__byline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.masthead__byline a:hover {
  color: var(--color-accent);
}

/* Controls positioned to the right */
.masthead__controls {
  position: absolute;
  right: 0;
}

/* Homepage - full prominence with entrance animation */
.masthead--home .masthead__brand {
  opacity: 1;
}

/* Entrance animations for homepage */
@keyframes scaleDown {
  0% {
    transform: scale(2.5);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideUp {
  0% {
    transform: translateY(10px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes typeReveal {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

.masthead--home .masthead__title {
  animation: scaleDown 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.masthead--home .masthead__byline {
  opacity: 0;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(160px, auto);
  grid-auto-flow: dense; /* Fill gaps automatically */
  gap: 2px;
  background: var(--color-border);
}

/* Default mobile */
.post-card {
  grid-column: span 12;
  background: var(--color-bg);
}

/* Tablet */
@media (min-width: 600px) {
  .post-card {
    grid-column: span 6;
  }
  .post-card--featured {
    grid-column: span 12;
  }
}

/* Desktop - Flexible grid with variety */
@media (min-width: 900px) {
  .post-card {
    grid-column: span 4;
  }

  /* Featured - full width */
  .post-card--featured {
    grid-column: span 12;
  }

  /* Create variety with modular pattern */
  .post-card:nth-child(3n + 2) {
    grid-column: span 5;
  }
  .post-card:nth-child(5n + 3) {
    grid-column: span 7;
  }
  .post-card:nth-child(7n + 4) {
    grid-column: span 6;
  }
  .post-card:nth-child(11n + 7) {
    grid-column: span 8;
  }

  /* Every 6th card full width for rhythm */
  .post-card:nth-child(6n) {
    grid-column: span 12;
  }
}

/* Large screens - more columns available */
@media (min-width: 1400px) {
  .post-card:nth-child(4n + 2) {
    grid-column: span 4;
  }
  .post-card:nth-child(5n + 3) {
    grid-column: span 5;
  }
  .post-card:nth-child(7n + 5) {
    grid-column: span 7;
  }
}

/* Last card fills remaining space to avoid gaps */
@media (min-width: 900px) {
  .post-card:last-child {
    grid-column: 1 / -1; /* Fill entire row */
  }

  /* Second-to-last fills half when last is full-width */
  .post-card:nth-last-child(2) {
    grid-column: span 6;
  }
}

/* ==========================================================================
   VERTICAL SPANS - JS handles dynamic row spans based on content
   ========================================================================== */

/* Featured card always tall */
.post-card--featured {
  grid-row: span 2;
}

/* ==========================================================================
   POST CARD - Base
   ========================================================================== */

.post-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  text-decoration: none;
  position: relative;
  transition: background-color 0.4s ease;
  min-height: 200px;
  justify-content: flex-start;
}

.post-card--compact {
  padding: var(--space-sm);
}

.post-card--tall {
  justify-content: center;
}

.post-card--tall .post-card__title {
  margin-bottom: var(--space-md);
}

@media (min-width: 900px) {
  .post-card--tall:hover {
    transform: translateY(6px) scale(1.03);
    z-index: 5;
  }
}

/* Keep hover effects from reflowing layout */
@media (min-width: 900px) {
  .post-card--tall {
    will-change: transform;
  }
}

@media (min-width: 900px) {
  /* Vary vertical placement for rhythm */
  .post-card:nth-child(4n + 2) {
    justify-content: center;
  }
  .post-card:nth-child(6n + 3) {
    justify-content: flex-end;
  }
}

.post-card:hover {
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.015);
}

/* Relevance indicator for filtered results */
.post-card__relevance {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.post-card--relevant .post-card__relevance {
  opacity: 1;
  transform: translateY(0);
}

/* Filtering transitions */
.posts-grid--filtering .post-card {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.post-card--faded {
  opacity: 0.3;
}

.post-card--hidden-filter {
  display: none;
}

/* Reorder animation */
.post-card--reordering {
  animation: card-reorder 0.4s ease;
}

@keyframes card-reorder {
  0% {
    opacity: 0.5;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Subtle inner glow on hover */
.post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.4s ease;
  pointer-events: none;
}

.post-card:hover::before {
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.post-card__title {
  transition:
    color 0.3s ease,
    letter-spacing 0.3s ease;
  margin-bottom: var(--space-sm);
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: none;
  text-wrap: balance;
}

.post-card:hover .post-card__title {
  color: var(--color-accent);
  letter-spacing: -0.01em; /* Subtle tightening on hover */
}

.post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card--compact .post-card__excerpt {
  -webkit-line-clamp: 2;
  font-size: var(--text-xs);
}

/* Compact cards expand slightly on hover */
@media (min-width: 900px) {
  .post-card--compact:hover {
    transform: translateY(4px) scale(1.02);
    z-index: 5;
  }
  .post-card--compact {
    will-change: transform;
  }
}

.post-card__meta {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: auto;
  padding-top: var(--space-sm);
}

/* ==========================================================================
   FEATURED POST - ABSOLUTELY MASSIVE
   ========================================================================== */

.post-card--featured {
  padding: var(--space-lg) var(--space-md);
  padding-bottom: var(--space-xl);
  min-height: 70vh;
  min-height: 70svh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

/* Scroll hint for featured card */
.post-card--featured::after {
  content: "";
  position: absolute;
  bottom: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: translateX(-50%) rotate(45deg);
  opacity: 0.4;
  animation: scroll-hint 2s ease-in-out infinite;
}

@keyframes scroll-hint {
  0%,
  100% {
    opacity: 0.4;
    transform: translateX(-50%) rotate(45deg) translateY(0);
  }
  50% {
    opacity: 0.7;
    transform: translateX(-50%) rotate(45deg) translateY(6px);
  }
}

.post-card--featured .post-card__title {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 10vw, 10rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  text-wrap: balance;
}

.post-card--featured .post-card__excerpt {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  max-width: 900px;
  -webkit-line-clamp: unset;
  color: var(--color-text-muted);
}

/* ==========================================================================
   TITLE STYLE OPTIONS - Set via front matter: titleStyle: outline|serif|light
   ========================================================================== */

/* Outline style - hollow text with stroke (scales with font size) */
.post-card__title--outline {
  color: transparent !important;
  -webkit-text-stroke: 1px var(--color-text);
  text-stroke: 1px var(--color-text);
  paint-order: stroke fill;
}

/* Scale stroke with card/font size */
.post-card--featured .post-card__title--outline {
  -webkit-text-stroke: 2px var(--color-text);
  text-stroke: 2px var(--color-text);
}

@media (min-width: 900px) {
  .post-card__title--outline {
    -webkit-text-stroke: 1.5px var(--color-text);
    text-stroke: 1.5px var(--color-text);
  }

  .post-card--featured .post-card__title--outline {
    -webkit-text-stroke: 3px var(--color-text);
    text-stroke: 3px var(--color-text);
  }
}

.post-card:hover .post-card__title--outline {
  -webkit-text-stroke-color: var(--color-accent);
  text-stroke-color: var(--color-accent);
}

/* Serif style - elegant serif font */
.post-card__title--serif {
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

/* Light style - thin weight */
.post-card__title--light {
  font-weight: 200 !important;
  letter-spacing: -0.02em !important;
}

/* Italic style */
.post-card__title--italic {
  font-style: italic !important;
}

/* Accent colored */
.post-card__title--accent {
  color: var(--color-accent) !important;
}

.post-card:hover .post-card__title--accent {
  color: var(--color-text) !important;
}

/* ==========================================================================
   TYPOGRAPHY VARIATIONS - MIXED WEIGHTS & STYLES
   ========================================================================== */

/* Base */
.post-card__title {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.05;
}

/* Slightly larger starting letter on some cards */
@media (min-width: 900px) {
  .post-card:nth-child(3n + 1):not(.post-card--featured)
    .post-card__title::first-letter {
    font-size: 1.35em;
    letter-spacing: -0.02em;
  }
}

/* Variation 1: Bold Serif - Clear and Strong */
.post-card:nth-child(10n + 2) .post-card__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1.05;
}

.post-card:nth-child(10n + 2) .post-card__title .title-light {
  font-weight: 400;
}

/* Variation 2: Bold Serif - Stronger */
.post-card:nth-child(10n + 3) .post-card__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: normal;
  font-size: var(--text-3xl);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Variation 3: BOLD CAPS - Larger and Stronger */
.post-card:nth-child(10n + 4) .post-card__title {
  font-family: var(--font-sans);
  font-weight: 800;
  text-transform: uppercase;
  font-size: var(--text-2xl);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* Variation 4: Ultra Light Giant */
.post-card:nth-child(10n + 5) .post-card__title {
  font-family: var(--font-sans);
  font-weight: 200;
  font-size: var(--text-4xl);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

/* Variation 5: Bold Serif */
.post-card:nth-child(10n + 6) .post-card__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1.1;
}

/* Variation 6: Bold Sans */
.post-card:nth-child(10n + 7) .post-card__title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--text-2xl);
  line-height: 1.05;
}

/* Variation 7: Mixed Case Italic Sans */
.post-card:nth-child(10n + 8) .post-card__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-style: italic;
  font-size: var(--text-2xl);
  line-height: 1.05;
}

/* Variation 8: Italic Sans */
.post-card:nth-child(10n + 9) .post-card__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-style: italic;
  font-size: var(--text-xl);
  line-height: 1.1;
}

/* Variation 9: Large serif */
.post-card:nth-child(10n + 10):not(.post-card--featured) .post-card__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1.05;
}

/* ==========================================================================
   CARDS THAT POP - COLOR TREATMENTS
   ========================================================================== */

/* INVERTED - Ink Black */
.post-card:nth-child(7),
.post-card:nth-child(20) {
  background: var(--color-bg-ink);
  color: var(--color-bg);
}

/* INVERTED - Slate */
.post-card:nth-child(12) {
  background: var(--color-bg-slate);
  color: #fff;
}

/* INVERTED - Navy */
.post-card:nth-child(17) {
  background: var(--color-bg-navy);
  color: #fff;
}

.post-card:nth-child(7) .post-card__title,
.post-card:nth-child(12) .post-card__title,
.post-card:nth-child(17) .post-card__title,
.post-card:nth-child(20) .post-card__title {
  color: inherit;
}

.post-card:nth-child(7) .post-card__excerpt,
.post-card:nth-child(7) .post-card__meta,
.post-card:nth-child(12) .post-card__excerpt,
.post-card:nth-child(12) .post-card__meta,
.post-card:nth-child(17) .post-card__excerpt,
.post-card:nth-child(17) .post-card__meta,
.post-card:nth-child(20) .post-card__excerpt,
.post-card:nth-child(20) .post-card__meta {
  color: rgba(255, 255, 255, 0.6);
}

.post-card:nth-child(7):hover .post-card__title,
.post-card:nth-child(20):hover .post-card__title {
  color: var(--color-accent-light);
}

.post-card:nth-child(12):hover .post-card__title {
  color: var(--color-pop-gold);
}

.post-card:nth-child(17):hover .post-card__title {
  color: var(--color-pop-coral);
}

/* Fix outline text on dark */
.post-card:nth-child(7) .post-card__title {
  -webkit-text-stroke-color: var(--color-bg);
}

/* WARM - Cream */
.post-card:nth-child(3) {
  background: var(--color-bg-warm);
}

/* COOL - Light Blue */
.post-card:nth-child(5) {
  background: var(--color-bg-cool);
}

/* GREEN TINT */
.post-card:nth-child(9) {
  background: var(--color-bg-accent);
}

/* BLUSH - Pink tint */
.post-card:nth-child(11) {
  background: var(--color-bg-blush);
}

/* BUTTER - Yellow tint */
.post-card:nth-child(14) {
  background: var(--color-bg-butter);
}

/* COOL again */
.post-card:nth-child(16) {
  background: var(--color-bg-cool);
}

/* WARM again */
.post-card:nth-child(19) {
  background: var(--color-bg-warm);
}

/* ==========================================================================
   ACCENT COLOR TITLES - Pop of color
   ========================================================================== */

.post-card:nth-child(4) .post-card__title {
  color: var(--color-accent);
}

.post-card:nth-child(8) .post-card__title {
  color: var(--color-pop-coral);
}

.post-card:nth-child(13) .post-card__title {
  color: var(--color-pop-violet);
}

.post-card:nth-child(18) .post-card__title {
  color: var(--color-pop-gold);
}

/* Hover states for colored titles */
.post-card:nth-child(4):hover .post-card__title,
.post-card:nth-child(8):hover .post-card__title,
.post-card:nth-child(13):hover .post-card__title,
.post-card:nth-child(18):hover .post-card__title {
  color: var(--color-text);
}

/* ==========================================================================
   TALL CARDS - Vertical emphasis with negative space
   ========================================================================== */

/* Cards with row spans - fill height and position content */
.post-card:nth-child(2),
.post-card:nth-child(4),
.post-card:nth-child(8),
.post-card:nth-child(9),
.post-card:nth-child(15) {
  justify-content: flex-end;
}

/* Some at top */
.post-card:nth-child(2) {
  justify-content: flex-start;
}

/* Some centered */
.post-card:nth-child(9) {
  justify-content: center;
}

/* ==========================================================================
   FIRST ROW AFTER HERO - Clean and balanced
   ========================================================================== */

@media (min-width: 900px) {
  /* Card 2: Left - Bold serif */
  .post-card:nth-child(2) .post-card__title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: var(--text-2xl);
    line-height: 1.1;
  }

  /* Card 3: Middle - Strong sans caps */
  .post-card:nth-child(3) .post-card__title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: var(--text-lg);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
  }

  /* Card 4: Right - Large bold */
  .post-card:nth-child(4) .post-card__title {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: var(--text-3xl);
    line-height: 0.95;
  }
}

/* ==========================================================================
   BORDER ACCENTS
   ========================================================================== */

.post-card:nth-child(2) {
  border-left: 4px solid var(--color-accent);
}

.post-card:nth-child(6) {
  border-bottom: 4px solid var(--color-pop-coral);
}

.post-card:nth-child(10) {
  border-left: 4px solid var(--color-pop-violet);
}

.post-card:nth-child(15) {
  border-top: 4px solid var(--color-pop-gold);
}

/* ==========================================================================
   WIDE CARDS - MASSIVE TITLES
   ========================================================================== */

@media (min-width: 900px) {
  /* Wide cards get bigger */
  .post-card:nth-child(3) .post-card__title,
  .post-card:nth-child(7) .post-card__title,
  .post-card:nth-child(13) .post-card__title {
    font-size: clamp(2rem, 4vw, 4rem) !important;
    font-weight: 900 !important;
    font-style: normal !important;
    text-transform: uppercase;
    color: inherit;
    -webkit-text-stroke: none;
  }

  /* Full width cards - ULTRA */
  .post-card:nth-child(12):not(.post-card--featured),
  .post-card:nth-child(20):not(.post-card--featured) {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    min-height: 45vh;
    justify-content: center;
    align-items: center;
  }

  .post-card:nth-child(12):not(.post-card--featured) .post-card__title,
  .post-card:nth-child(20):not(.post-card--featured) .post-card__title {
    font-size: clamp(2.5rem, 5vw, 5rem) !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    -webkit-text-stroke: none;
    color: inherit;
  }

  .post-card:nth-child(12) .post-card__excerpt,
  .post-card:nth-child(20) .post-card__excerpt {
    max-width: 700px;
    font-size: var(--text-lg);
  }
}

/* ==========================================================================
   SPECIAL: Card 5 gets OUTLINE on wide screens
   ========================================================================== */

@media (min-width: 900px) {
  .post-card:nth-child(5) .post-card__title {
    font-size: clamp(2rem, 5vw, 4rem) !important;
    font-weight: 900 !important;
    color: transparent !important;
    -webkit-text-stroke: 2px var(--color-text);
    text-transform: uppercase;
    text-align: center;
  }

  .post-card:nth-child(5) {
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 50vh;
  }

  .post-card:nth-child(5):hover .post-card__title {
    color: var(--color-accent) !important;
    -webkit-text-stroke-color: var(--color-accent);
  }
}

/* --------------------------------------------------------------------------
   Hidden Posts (removed from DOM by JS unless ?justgonnasendit)
   -------------------------------------------------------------------------- */

/* When revealed, style them with a preview badge */
.reveal-hidden .post-card--hidden {
  position: relative;
}

.reveal-hidden .post-card--hidden::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed var(--color-accent);
  pointer-events: none;
  z-index: 1;
}

.reveal-hidden .post-card--hidden::after {
  content: "PREVIEW";
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
  background: var(--color-accent);
  color: white;
  padding: 0.4em 0.8em;
  letter-spacing: 0.15em;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Post Page
   -------------------------------------------------------------------------- */

.post-header {
  padding: var(--space-md);
  text-align: center;
  margin-bottom: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.post-header__title {
  font-family: var(--font-sans);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);

  /* Constrained sizing - never exceed container */
  font-size: clamp(2rem, 6vw, 3.5rem);
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: none;
  text-wrap: balance;
}

/* Larger screens */
@media (min-width: 900px) {
  .post-header {
    padding: var(--space-lg);
  }

  .post-header__title {
    font-size: clamp(2.5rem, 5vw, 5rem);
  }
}

@media (min-width: 1400px) {
  .post-header__title {
    font-size: clamp(3rem, 5vw, 6rem);
  }
}

.post-header__meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}

/* Transition zone - excerpt/intro */
.post-intro {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.post-content {
  padding: 0 0 var(--space-xl);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-xl);
}

/* Headings - clickable anchor wrapper */
.post-content h2,
.post-content h3,
.post-content h4 {
  position: relative;
}

.post-content h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--text-2xl);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  letter-spacing: -0.02em;
}

.post-content h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-xl);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.post-content h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
}

/* Heading anchor - wraps entire heading, clickable */
.heading-anchor-wrap {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.heading-anchor-wrap:hover {
  color: var(--color-accent);
}

/* Pilcrow - slides in from left on hover */
.heading-anchor-wrap .pilcrow {
  position: absolute;
  left: -1.2em;
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  font-weight: 400;
  font-size: 0.7em;
  color: var(--color-text-muted);
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease;
}

.heading-anchor-wrap:hover .pilcrow {
  opacity: 0.5;
  transform: translateY(-50%) translateX(0);
}

/* Tooltip - appears below heading on hover */
.heading-anchor-wrap .copy-hint {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  pointer-events: none;
}

.heading-anchor-wrap:hover .copy-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Copied state */
.heading-anchor-wrap.copied {
  color: var(--color-accent);
}

.heading-anchor-wrap.copied .pilcrow {
  opacity: 1;
  color: var(--color-accent);
}

.heading-anchor-wrap.copied .copy-hint {
  color: var(--color-accent);
}

.post-content ul,
.post-content ol {
  padding-left: 1.3em;
  margin: var(--space-md) 0;
}

.post-content li {
  margin-bottom: 0.35em;
}

.post-content li::marker {
  color: var(--color-accent);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: var(--text-sm);
}

.post-content th,
.post-content td {
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  text-align: left;
}

.post-content th {
  background: var(--color-bg-alt);
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
}

.post-content a {
  color: var(--color-accent);
}

/* Drop cap - DRAMATIC */
.post-content > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 5em;
  line-height: 0.8;
  padding-right: 0.05em;
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Section Rail - Table of Contents
   -------------------------------------------------------------------------- */

.section-rail {
  position: fixed;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  display: none;
}

@media (min-width: 1100px) {
  .section-rail {
    display: block;
  }
}

/* Hidden by default, show on mouse activity */
.section-rail.visible {
  opacity: 0.15;
  pointer-events: none;
}

.section-rail.visible.active {
  opacity: 1;
  pointer-events: auto;
}

/* Always show when directly hovering the left edge zone */
.section-rail.visible:hover {
  opacity: 1;
  pointer-events: auto;
}

.section-rail__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-rail__item {
  margin-bottom: var(--space-xs);
}

.section-rail__link {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-light);
  text-decoration: none;
  display: inline-block;
  padding: 0.3em 0;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
  transform-origin: left center;
}

.section-rail__link:hover {
  color: var(--color-text);
  transform: scale(1.1, 1.3);
}

.section-rail__link.active {
  color: var(--color-accent);
  font-weight: 600;
}

/* Progress indicator */
.section-rail__progress {
  position: absolute;
  left: -8px;
  top: 0;
  width: 2px;
  background: var(--color-border);
  height: 100%;
}

.section-rail__progress-fill {
  width: 100%;
  background: var(--color-accent);
  transition: height 0.2s ease;
}

/* --------------------------------------------------------------------------
   Reading Progress
   -------------------------------------------------------------------------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-accent);
  z-index: 1000;
  transition: width 0.1s ease;
}

/* --------------------------------------------------------------------------
   Post Navigation
   -------------------------------------------------------------------------- */

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
  border-top: 3px solid var(--color-text);
  margin-top: var(--space-xl);
}

.post-nav a {
  flex: 1;
  text-decoration: none;
  padding: var(--space-sm);
  transition: var(--transition-base);
}

.post-nav a:hover {
  background: var(--color-bg-alt);
}

.post-nav__label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: block;
  margin-bottom: var(--space-xs);
}

.post-nav__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-lg);
}

/* ==========================================================================
   FLOATING NAV ARROWS - Edge Previews
   ========================================================================== */

.floating-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: none;
}

@media (min-width: 1100px) {
  .floating-nav {
    display: block;
  }
}

.floating-nav--prev {
  left: 0;
}

.floating-nav--next {
  right: 0;
}

.floating-nav__trigger {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  padding: var(--space-md) var(--space-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-nav--prev .floating-nav__trigger {
  padding-left: var(--space-xs);
}

.floating-nav--next .floating-nav__trigger {
  padding-right: var(--space-xs);
  flex-direction: row-reverse;
}

.floating-nav__arrow {
  font-size: 2rem;
  font-weight: 200;
  line-height: 1;
  opacity: 0.3;
  transition: all 0.3s ease;
}

.floating-nav__trigger:hover .floating-nav__arrow {
  opacity: 1;
  transform: scale(1.2);
}

.floating-nav--prev .floating-nav__trigger:hover .floating-nav__arrow {
  transform: scale(1.2) translateX(-4px);
}

.floating-nav--next .floating-nav__trigger:hover .floating-nav__arrow {
  transform: scale(1.2) translateX(4px);
}

/* Mini Preview Card */
.floating-nav__preview {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  padding: var(--space-md);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-nav--prev .floating-nav__preview {
  left: 100%;
  margin-left: var(--space-sm);
  transform: translateY(-50%) translateX(-20px) scale(0.95);
}

.floating-nav--next .floating-nav__preview {
  right: 100%;
  margin-right: var(--space-sm);
  transform: translateY(-50%) translateX(20px) scale(0.95);
}

.floating-nav__trigger:hover + .floating-nav__preview,
.floating-nav__preview:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.floating-nav__preview-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

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

.floating-nav__preview-meta {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-sm);
}

/* Keyboard hint */
.floating-nav__key {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2em 0.5em;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  margin-left: var(--space-xs);
  opacity: 0.5;
}

.floating-nav--next .floating-nav__key {
  margin-left: 0;
  margin-right: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  padding: var(--space-lg) var(--space-md);
  border-top: 3px solid var(--color-text);
  text-align: center;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer a {
  color: var(--color-text);
  margin: 0 var(--space-sm);
}

/* --------------------------------------------------------------------------
   AI Chat Widget
   -------------------------------------------------------------------------- */

.ai-chat-toggle {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: var(--transition-base);
  z-index: 900;
}

.ai-chat-toggle:hover {
  transform: scale(1.15) rotate(-5deg);
  background: var(--color-accent);
}

.ai-chat-panel {
  position: fixed;
  bottom: calc(var(--space-md) + 65px);
  right: var(--space-md);
  width: min(380px, calc(100vw - 2 * var(--space-md)));
  height: 450px;
  max-height: calc(100vh - 140px);
  background: var(--color-bg);
  border: 3px solid var(--color-text);
  display: none;
  flex-direction: column;
  z-index: 899;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.ai-chat-panel.open {
  display: flex;
}

.ai-chat-header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.ai-chat-input {
  padding: var(--space-sm);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-xs);
}

.ai-chat-input input {
  flex: 1;
  padding: var(--space-sm);
  border: 2px solid var(--color-border);
  font-family: inherit;
  font-size: var(--text-sm);
  background: var(--color-bg);
  color: var(--color-text);
}

.ai-chat-input input:focus {
  outline: none;
  border-color: var(--color-text);
}

.ai-chat-input button {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ai-chat-input button:hover {
  background: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Animations - Slow and Small (Editorial)
   -------------------------------------------------------------------------- */

/* Subtle fade up - all motion is slow and small */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideFromTop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Base state - visible by default for accessibility */
.post-card {
  opacity: 1;
}

/* Only hide for animation if JS is available and user hasn't disabled motion */
@media (prefers-reduced-motion: no-preference) {
  .posts-grid.js-ready .post-card:not(.animate-in) {
    opacity: 0;
  }
}

/* Animated state - slow and elegant */
.post-card.animate-in {
  opacity: 1;
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
  animation-fill-mode: forwards;
}

/* Hero fades in first */
.post-card:nth-child(1).animate-in {
  animation-name: fadeIn;
  animation-duration: 0.8s;
}

/* Left column cards slide from left */
.post-card:nth-child(2).animate-in,
.post-card:nth-child(4).animate-in,
.post-card:nth-child(7).animate-in,
.post-card:nth-child(9).animate-in,
.post-card:nth-child(13).animate-in,
.post-card:nth-child(15).animate-in,
.post-card:nth-child(18).animate-in {
  animation-name: slideFromLeft;
}

/* Right column cards slide from right */
.post-card:nth-child(3).animate-in,
.post-card:nth-child(6).animate-in,
.post-card:nth-child(8).animate-in,
.post-card:nth-child(11).animate-in,
.post-card:nth-child(14).animate-in,
.post-card:nth-child(17).animate-in,
.post-card:nth-child(19).animate-in {
  animation-name: slideFromRight;
}

/* Center cards scale in */
.post-card:nth-child(5).animate-in,
.post-card:nth-child(10).animate-in,
.post-card:nth-child(16).animate-in {
  animation-name: scaleIn;
}

/* Full-width cards drop from top */
.post-card:nth-child(12).animate-in,
.post-card:nth-child(20).animate-in {
  animation-name: slideFromTop;
  animation-duration: 0.6s;
}

/* Staggered delays - creates the "locking into place" feel */
.post-card:nth-child(1) {
  animation-delay: 0s;
}
.post-card:nth-child(2) {
  animation-delay: 0.08s;
}
.post-card:nth-child(3) {
  animation-delay: 0.12s;
}
.post-card:nth-child(4) {
  animation-delay: 0.18s;
}
.post-card:nth-child(5) {
  animation-delay: 0.22s;
}
.post-card:nth-child(6) {
  animation-delay: 0.28s;
}
.post-card:nth-child(7) {
  animation-delay: 0.32s;
}
.post-card:nth-child(8) {
  animation-delay: 0.38s;
}
.post-card:nth-child(9) {
  animation-delay: 0.42s;
}
.post-card:nth-child(10) {
  animation-delay: 0.48s;
}
.post-card:nth-child(11) {
  animation-delay: 0.52s;
}
.post-card:nth-child(12) {
  animation-delay: 0.58s;
}
.post-card:nth-child(n + 13) {
  animation-delay: 0.65s;
}
.post-card:nth-child(n + 16) {
  animation-delay: 0.75s;
}
.post-card:nth-child(n + 19) {
  animation-delay: 0.85s;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Skip Navigation Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  z-index: 10001;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* Focus & Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Better focus ring for cards */
.post-card:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: -3px;
  z-index: 20;
}

/* Ensure focus is visible in dark mode */
.dark-mode a:focus-visible,
.dark-mode button:focus-visible {
  outline-color: #4a9b6a;
}

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

/* --------------------------------------------------------------------------
   View Transitions (Page Navigation)
   -------------------------------------------------------------------------- */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: fade-out 0.25s ease-out forwards;
}

::view-transition-new(root) {
  animation: fade-in 0.35s ease-out forwards;
}

@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Masthead persists across transitions */
.masthead {
  view-transition-name: masthead;
}

::view-transition-old(masthead),
::view-transition-new(masthead) {
  animation: none;
  mix-blend-mode: normal;
}

/* Post title animates specifically */
.post-header__title {
  view-transition-name: post-title;
}

::view-transition-old(post-title) {
  animation: title-out 0.3s ease-out forwards;
}

::view-transition-new(post-title) {
  animation: title-in 0.4s ease-out forwards;
}

@keyframes title-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes title-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Mixed Weight Titles
   -------------------------------------------------------------------------- */

.title-light {
  font-weight: 200 !important;
  opacity: 0.7;
}

.title-bold {
  font-weight: 900 !important;
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --------------------------------------------------------------------------
   Search Overlay
   -------------------------------------------------------------------------- */

/* Search overlay - dropdown style from header */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: none;
}

.search-overlay.open {
  display: block;
}

.search-container {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateY(-100%);
  opacity: 0;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.search-overlay.open .search-container {
  transform: translateY(0);
  opacity: 1;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-md);
}

.search-input-wrapper svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  margin-right: var(--space-sm);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  color: var(--color-text);
  outline: none;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-results {
  max-height: 60vh;
  overflow-y: auto;
  max-width: 800px;
  margin: 0 auto;
}

.search-result {
  display: block;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.2s ease;
}

.search-result:hover,
.search-result.selected {
  background: var(--color-bg-alt);
}

.search-result.selected {
  border-left: 3px solid var(--color-accent);
}

.search-result mark {
  background: rgba(26, 107, 74, 0.2);
  color: inherit;
}

.search-result__semantic {
  font-size: 0.75em;
  opacity: 0.7;
}

.search-result__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: 0.25em;
}

.search-result__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-empty {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
}

.search-hint {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  display: flex;
  justify-content: space-between;
}

.search-hint kbd {
  font-family: var(--font-mono);
  background: var(--color-bg);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--color-border);
}

/* Share search link button */
.search-share {
  display: none;
  align-items: center;
  gap: 0.5em;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
  border-top: 1px solid var(--color-border-light);
}

.search-share.visible {
  display: flex;
}

.search-share:hover {
  background: var(--color-bg);
  color: var(--color-accent);
}

.search-share.copied {
  color: var(--color-accent);
}

.search-share svg {
  width: 14px;
  height: 14px;
}

.search-share kbd {
  font-family: var(--font-mono);
  font-size: 0.75em;
  background: var(--color-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Micro Grid Overlay (visible at large widths)
   -------------------------------------------------------------------------- */

.micro-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.micro-grid.visible {
  opacity: 1;
}

.micro-grid__lines {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  height: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.micro-grid__line {
  border-left: 1px solid rgba(0, 0, 0, 0.04);
}

.micro-grid__line:last-child {
  border-right: 1px solid rgba(0, 0, 0, 0.04);
}

/* Only show on very large screens */
@media (max-width: 1600px) {
  .micro-grid {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Search Lab - Column-based Comparison with Performance Metrics
   -------------------------------------------------------------------------- */

.search-lab {
  margin: var(--space-lg) 0;
  overflow: hidden;
  background: var(--color-bg);
  /* Break out of content width for more space */
  width: 100vw;
  max-width: none;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 1000px) {
  .search-lab {
    width: calc(100% + 100px);
    margin-left: -50px;
    margin-right: -50px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
  }
}

@media (min-width: 1200px) {
  .search-lab {
    width: calc(100% + 200px);
    margin-left: -100px;
    margin-right: -100px;
  }
}

.search-lab__input-wrapper {
  padding: var(--space-md);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.search-lab__input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-lg);
  font-family: var(--font-sans);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
}

.search-lab__input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.search-lab__input-wrapper {
  position: relative;
}

.search-lab__settings-toggle {
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 0.5em;
}

.search-lab__settings-toggle:hover {
  opacity: 1;
}

.search-lab__settings-toggle.active {
  opacity: 1;
  color: var(--color-accent);
}

/* Settings Panel */
.search-lab__settings {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.search-lab__settings[hidden] {
  display: none;
}

.search-lab__settings-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.search-lab__settings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  align-items: center;
}

.search-lab__setting {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}

.search-lab__setting label {
  white-space: nowrap;
}

.search-lab__setting input[type="range"] {
  width: 100px;
  accent-color: var(--color-accent);
}

.search-lab__setting strong {
  min-width: 2em;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--color-accent);
}

.search-lab__setting--checkboxes {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.search-lab__setting--checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.search-lab__setting--checkboxes input[type="checkbox"] {
  accent-color: var(--color-accent);
}

.search-lab__settings-note {
  margin-top: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

/* Sections */
.search-lab__section {
  border-top: 1px solid var(--color-border);
}

.search-lab__section-header {
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-alt);
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.search-lab__section-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-lab__section-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Column grids */
.search-lab__grid {
  display: grid;
  border-top: 1px solid var(--color-border);
}

.search-lab__grid--1 {
  grid-template-columns: 1fr;
}

.search-lab__grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.search-lab__grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
  .search-lab__grid--2,
  .search-lab__grid--3 {
    grid-template-columns: 1fr;
  }
}

.search-lab__column {
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-lab__column:last-child {
  border-right: none;
}

@media (max-width: 600px) {
  .search-lab__column {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .search-lab__column:last-child {
    border-bottom: none;
  }
}

/* Column header */
.search-lab__header {
  padding: var(--space-sm);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
  min-height: 44px;
}

.search-lab__header .search-lab__method {
  flex-shrink: 0;
}

.search-lab__header .search-lab__load-btn {
  margin-left: auto;
}

.search-lab__method {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
}

.search-lab__method--keyword {
  color: var(--color-text);
}
.search-lab__method--fuzzy {
  color: var(--color-pop-gold);
}
.search-lab__method--semantic {
  color: var(--color-accent);
}
.search-lab__method--llm {
  color: var(--color-pop-violet);
}
.search-lab__method--remote {
  color: var(--color-pop-coral);
}

.search-lab__runtime {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 0.2em 0.5em;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-lab__load-btn {
  padding: 0.3em 0.6em;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  background: var(--color-bg);
  border: 1px solid currentColor;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.search-lab__load-btn:hover {
  opacity: 1;
  background: currentColor;
  color: white;
}

.search-lab__load-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.search-lab__status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Performance metrics */
.search-lab__metrics {
  padding: var(--space-sm);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-xs);
}

.search-lab__metric {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  padding: 0.15em 0;
  line-height: 1.3;
}

.search-lab__metric span:first-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.search-lab__metric strong {
  color: var(--color-text);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.search-lab__metric--highlight {
  background: rgba(26, 107, 74, 0.15);
  margin: 0.3em calc(-1 * var(--space-sm));
  padding: 0.4em var(--space-sm);
  border-radius: 4px;
}

.search-lab__metric--highlight strong {
  color: var(--color-accent);
  font-weight: 700;
}

.search-lab__extra {
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0.7;
}

/* Results list */
.search-lab__results {
  flex: 1;
  padding: var(--space-sm);
  min-height: 200px;
}

.search-lab__result {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 4px;
  margin-bottom: 2px;
}

.search-lab__result:hover {
  background: var(--color-bg-alt);
}

.search-lab__rank {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 1.5em;
}

.search-lab__title {
  flex: 1;
  min-width: 0; /* Critical for text-overflow to work in flex */
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-lab__title:hover {
  color: var(--color-accent);
}

.search-lab__score {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 2.5em;
  text-align: right;
}

/* States */
.search-lab__no-results,
.search-lab__loading-results,
.search-lab__error-msg {
  padding: var(--space-md);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.search-lab__error-msg {
  color: var(--color-pop-coral);
}

/* LLM Answer format */
.search-lab__answer-score {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--color-border-light);
  cursor: help;
  position: relative;
}
.search-lab__answer-score--high {
  color: var(--color-accent);
  background: rgba(26, 107, 74, 0.08);
}
.search-lab__answer-score--medium {
  color: var(--color-pop-gold);
  background: rgba(184, 146, 42, 0.08);
}
.search-lab__answer-score--low {
  color: var(--color-pop-coral);
  background: rgba(212, 89, 74, 0.08);
}

.search-lab__answer {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text);
  max-height: 180px;
  overflow-y: auto;
}

.search-lab__sources {
  padding: var(--space-xs) var(--space-md) var(--space-sm);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}

.search-lab__sources-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}

.search-lab__source {
  font-size: var(--text-xs);
  padding: 0.2em 0.5em;
  background: var(--color-bg-alt);
  border-radius: 3px;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.search-lab__source:hover {
  background: var(--color-accent);
  color: var(--color-bg);
  font-size: var(--text-xs);
}

.search-lab__error-text {
  color: var(--color-pop-coral);
}

.search-lab__loading-results {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Placeholder for unloaded models */
.search-lab__placeholder {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.search-lab__placeholder-btn {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-lab__placeholder-btn:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* ==========================================================================
   INFINITE SCROLL / LOAD MORE
   ========================================================================== */

.load-more {
  grid-column: 1 / -1;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  background: var(--color-bg);
}

.load-more__btn {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: var(--space-md) var(--space-xl);
  background: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.load-more__btn:hover {
  background: var(--color-text);
  color: var(--color-bg);
  transform: scale(1.05);
}

.load-more__btn:active {
  transform: scale(0.98);
}

.load-more__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading spinner */
.load-more__spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

.load-more--loading .load-more__btn {
  display: none;
}

.load-more--loading .load-more__spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* "You've seen it all" state */
.load-more--end {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-text-muted);
}

.load-more--end .load-more__btn,
.load-more--end .load-more__spinner {
  display: none;
}

/* ==========================================================================
   SCROLL PROGRESS DOTS (optional)
   ========================================================================== */

.scroll-dots {
  position: fixed;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;
}

@media (min-width: 1400px) {
  .scroll-dots {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

.scroll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.scroll-dot:hover {
  background: var(--color-text-muted);
  transform: scale(1.3);
}

.scroll-dot.active {
  background: var(--color-text);
  transform: scale(1.5);
}

/* --------------------------------------------------------------------------
   Mermaid Diagrams - Light/Dark Mode Support
   -------------------------------------------------------------------------- */

.mermaid {
  margin: var(--space-lg) 0;
  padding: var(--space-md);
  background: var(--color-bg-alt);
  border-radius: var(--radius, 8px);
  border: 1px solid var(--color-border);
  text-align: center;
  overflow-x: auto;
}

/* Ensure SVG renders properly */
.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Light mode overrides */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon,
.mermaid .node path {
  stroke: var(--color-border);
}

.mermaid .label {
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
  :root:not(.light-mode) .mermaid {
    background: var(--color-bg-alt);
    border-color: var(--color-border);
  }

  :root:not(.light-mode) .mermaid .label,
  :root:not(.light-mode) .mermaid .nodeLabel,
  :root:not(.light-mode) .mermaid foreignObject div {
    color: var(--color-text) !important;
  }

  :root:not(.light-mode) .mermaid .labelBkg,
  :root:not(.light-mode) .mermaid .label-container,
  :root:not(.light-mode) .mermaid .note rect {
    fill: var(--color-bg-alt) !important;
  }
}

:root.dark-mode .mermaid {
  background: var(--color-bg-alt);
  border-color: var(--color-border);
}

:root.dark-mode .mermaid .label,
:root.dark-mode .mermaid .nodeLabel,
:root.dark-mode .mermaid foreignObject div {
  color: var(--color-text) !important;
}

:root.dark-mode .mermaid .labelBkg,
:root.dark-mode .mermaid .label-container,
:root.dark-mode .mermaid .note rect {
  fill: var(--color-bg-alt) !important;
}

/* Flowchart specific */
.mermaid .flowchart-link {
  stroke: var(--color-text-muted);
}

/* Edge labels - subtle inline annotations */
.mermaid .edgeLabel {
  font-size: 0.65rem;
  font-weight: 500;
}

/* Edge label background - match diagram background */
.mermaid .edgeLabel rect.label-container,
.mermaid .labelBkg rect {
  fill: var(--color-bg-alt) !important;
  stroke: var(--color-border-light) !important;
  stroke-width: 1px !important;
  rx: 3px !important;
}

/* Edge label text - readable muted color */
.mermaid .edgeLabel span {
  color: var(--color-text) !important;
  padding: 1px 4px !important;
}

/* Hide empty edge labels (Mermaid creates them even for unlabeled edges) */
.mermaid .edgeLabel:empty,
.mermaid .labelBkg:has(.edgeLabel:empty) {
  display: none !important;
}

/* Radar and Sankey chart text - improve visibility */
.mermaid text {
  fill: var(--color-text) !important;
}

/* Chart titles */
.mermaid .chartTitle,
.mermaid .title {
  fill: var(--color-text) !important;
  font-weight: 600 !important;
}

/* Axis labels on radar/other charts */
.mermaid .legend text,
.mermaid .axis text,
.mermaid .tick text {
  fill: var(--color-text-muted) !important;
  font-size: 0.75rem !important;
}

/* Sankey node labels */
.mermaid .sankey-node text,
.mermaid .node-label {
  fill: var(--color-text) !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
}

/* --------------------------------------------------------------------------
   Mermaid Semantic Node Classes
   Use :::className in diagrams, e.g., A["Node"]:::primary
   
   Only override STROKE colors - let Mermaid theme handle fill/text
   for automatic light/dark mode contrast
   -------------------------------------------------------------------------- */

/* Primary - main nodes, questions, user input (blue stroke) */
.mermaid .node.primary rect,
.mermaid .node.primary polygon,
.mermaid .node.primary circle,
.mermaid .primary rect,
.mermaid .primary polygon {
  stroke: #3b82f6 !important;
  stroke-width: 2px !important;
}

/* Secondary - supporting nodes, processes (gray stroke) */
.mermaid .node.secondary rect,
.mermaid .node.secondary polygon,
.mermaid .node.secondary circle,
.mermaid .secondary rect,
.mermaid .secondary polygon {
  stroke: #64748b !important;
  stroke-width: 1.5px !important;
}

/* Accent - success, output, results (green stroke) */
.mermaid .node.accent rect,
.mermaid .node.accent polygon,
.mermaid .node.accent circle,
.mermaid .accent rect,
.mermaid .accent polygon {
  stroke: #22c55e !important;
  stroke-width: 2px !important;
}

/* Warning - errors, warnings (red stroke) */
.mermaid .node.warning rect,
.mermaid .node.warning polygon,
.mermaid .node.warning circle,
.mermaid .warning rect,
.mermaid .warning polygon {
  stroke: #ef4444 !important;
  stroke-width: 2px !important;
}

/* Agent - agents, specialized components (amber stroke) */
.mermaid .node.agent rect,
.mermaid .node.agent polygon,
.mermaid .node.agent circle,
.mermaid .agent rect,
.mermaid .agent polygon {
  stroke: #f59e0b !important;
  stroke-width: 1.5px !important;
}

/* Highlight - special emphasis, external systems (violet stroke) */
.mermaid .node.highlight rect,
.mermaid .node.highlight polygon,
.mermaid .node.highlight circle,
.mermaid .highlight rect,
.mermaid .highlight polygon {
  stroke: #8b5cf6 !important;
  stroke-width: 2px !important;
}

/* Sequence diagram */
.mermaid .actor {
  stroke: var(--color-border);
  fill: var(--color-bg-alt);
}

.mermaid .actor-line {
  stroke: var(--color-border);
}

/* Fix node labels - ensure text is visible on all node types */
.mermaid .node .label,
.mermaid .node .nodeLabel,
.mermaid .nodeLabel,
.mermaid .label foreignObject div,
.mermaid foreignObject div {
  color: var(--color-text) !important;
  background: transparent !important;
}

/* Cluster/subgraph labels */
.mermaid .cluster-label,
.mermaid .cluster-label .nodeLabel {
  color: var(--color-text) !important;
  font-weight: 600 !important;
}

/* Notes and annotations - make them readable */
.mermaid .note,
.mermaid .note rect {
  fill: var(--color-bg-alt) !important;
  stroke: var(--color-border) !important;
}

.mermaid .note .label,
.mermaid .noteText {
  color: var(--color-text) !important;
  fill: var(--color-text) !important;
}

/* Generic label containers - visible background */
.mermaid .labelBkg,
.mermaid .label-container {
  fill: var(--color-bg-alt) !important;
}

/* Make diagrams responsive */
@media (max-width: 768px) {
  .mermaid {
    padding: var(--space-sm);
    font-size: 0.75rem;
  }

  .mermaid svg {
    min-width: 100%;
  }
}

/* ==========================================================================
   Content Calendar Overlay (?allthethings)
   ========================================================================== */

.calendar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 10000;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.calendar-overlay.open {
  display: block;
  opacity: 1;
}

.calendar-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 60px 20px;
}

.calendar-overlay h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin: 0 0 0.25rem;
  letter-spacing: -0.03em;
}

.calendar-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  margin: 0 0 2rem;
}

.calendar-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  background: var(--color-bg-alt);
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10001;
}

.calendar-close:hover {
  background: var(--color-accent);
  color: white;
}

.calendar-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}

.calendar-stat {
  background: var(--color-bg-alt);
  padding: 1.25rem 1rem;
  border-radius: 12px;
  text-align: center;
}

.calendar-stat__num {
  display: block;
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1;
}

.calendar-stat__label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-item {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  align-items: center;
}

.calendar-item:hover {
  background: var(--color-accent);
  color: white;
}

.calendar-item__date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.calendar-item:hover .calendar-item__date {
  color: rgba(255, 255, 255, 0.8);
}

.calendar-item__title {
  font-weight: 600;
  font-size: var(--text-base);
}

.calendar-item__cat {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  text-align: right;
}

.calendar-item:hover .calendar-item__cat {
  color: rgba(255, 255, 255, 0.7);
}

.calendar-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .calendar-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .calendar-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .calendar-item__cat {
    text-align: left;
  }
}

/* Dark mode */
.dark-mode .calendar-overlay {
  background: var(--color-bg);
}

/* ==========================================================================
   Visual Calendar Grid
   ========================================================================== */

.vcal {
  margin: 2rem 0;
}

.vcal-month {
  margin-bottom: 2rem;
}

.vcal-month__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.vcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.vcal-header {
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vcal-day {
  aspect-ratio: 1;
  min-height: 60px;
  background: var(--color-bg-alt);
  border-radius: 6px;
  padding: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.vcal-day--empty {
  background: transparent;
}

.vcal-day--today {
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

.vcal-day__num {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.vcal-day__posts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.vcal-post {
  display: block;
  font-size: 9px;
  line-height: 1.2;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--color-accent);
  color: white;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s;
}

.vcal-post:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
  z-index: 10;
  white-space: normal;
  position: absolute;
  left: 4px;
  right: 4px;
  top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tag colors */
.vcal-post[data-tag="mcp"] {
  background: #2563eb;
}
.vcal-post[data-tag="cursor"] {
  background: #7c3aed;
}
.vcal-post[data-tag="ema"] {
  background: #059669;
}
.vcal-post[data-tag="search"] {
  background: #d97706;
}
.vcal-post[data-tag="personal"] {
  background: #dc2626;
}
.vcal-post[data-tag="developer"] {
  background: #0891b2;
}
.vcal-post[data-tag="workflow"] {
  background: #4f46e5;
}
.vcal-post[data-tag="fundamentals"] {
  background: #475569;
}

/* Multiple posts indicator */
.vcal-day--multi .vcal-day__num::after {
  content: attr(data-count);
  font-size: 8px;
  background: var(--color-accent);
  color: white;
  padding: 1px 4px;
  border-radius: 8px;
  margin-left: 4px;
}

/* List toggle */
.calendar-list-toggle {
  margin-top: 2rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.calendar-list-toggle summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0.5rem 0;
}

.calendar-list-toggle summary:hover {
  color: var(--color-accent);
}

.calendar-list-toggle[open] .calendar-grid {
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .vcal-grid {
    gap: 2px;
  }

  .vcal-day {
    min-height: 40px;
    padding: 2px;
  }

  .vcal-day__num {
    font-size: 8px;
  }

  .vcal-post {
    font-size: 7px;
    padding: 1px 2px;
  }
}

/* ==========================================================================
   Native Calendar Page (/calendar/)
   ========================================================================== */

.cal-header {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}

.cal-header__title {
  font-size: var(--text-hero);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}

.cal-header__sub {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: var(--space-sm) 0 0;
}

/* Calendar Page Container */
.cal-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Month Section */
.cal-month {
  margin-bottom: var(--space-xl);
}

.cal-month__name {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.cal-month__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--color-border-light);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  overflow: hidden;
}

.cal-month__day-name {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-sm);
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
}

/* Calendar Day */
.cal-day {
  background: var(--color-bg);
  min-height: 100px;
  padding: var(--space-xs);
  display: flex;
  flex-direction: column;
}

.cal-day--empty {
  background: var(--color-bg-alt);
  opacity: 0.5;
}

.cal-day--today {
  background: var(--color-bg-accent);
}

.cal-day--today .cal-day__number {
  color: var(--color-accent);
  font-weight: 700;
}

.cal-day__number {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 2px 4px;
}

.cal-day__items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px;
  overflow: hidden;
}

/* Post Button in Calendar */
.cal-day__post {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.cal-day__post:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

/* Tag colors */
.cal-day__post[data-tag="mcp"] {
  background: #2563eb;
}
.cal-day__post[data-tag="cursor"] {
  background: #7c3aed;
}
.cal-day__post[data-tag="ema"] {
  background: #059669;
}
.cal-day__post[data-tag="search"] {
  background: #d97706;
}
.cal-day__post[data-tag="personal"] {
  background: #dc2626;
}
.cal-day__post[data-tag="llm"] {
  background: #4f46e5;
}
.cal-day__post[data-tag="agentic-ai"] {
  background: #475569;
}
.cal-day__post[data-tag="embeddings"] {
  background: #b45309;
}

/* List Toggle */
.cal-list-toggle {
  max-width: 1000px;
  margin: var(--space-lg) auto;
  padding: 0 var(--space-md);
}

.cal-list-toggle summary {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}

.cal-list-toggle summary::-webkit-details-marker {
  display: none;
}
.cal-list-toggle summary::before {
  content: "▸ ";
}
.cal-list-toggle[open] summary::before {
  content: "▾ ";
}
.cal-list-toggle summary:hover {
  color: var(--color-accent);
}

.cal-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-md);
}

.cal-list__item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}

.cal-list__item:hover {
  background: var(--color-bg-alt);
}

.cal-list__item time {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cal-list__title {
  font-weight: 600;
}

.cal-list__tag {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-light);
}

/* ==========================================================================
   Preview Popup
   ========================================================================== */

.cal-preview {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.cal-preview.open {
  display: flex;
}

.cal-preview__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.cal-preview__card {
  position: relative;
  background: var(--color-bg);
  max-width: 600px;
  width: 100%;
  padding: var(--space-lg);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: preview-in 0.2s ease-out;
}

@keyframes preview-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cal-preview__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-bg-alt);
  border-radius: 50%;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.cal-preview__close:hover {
  background: var(--color-accent);
  color: white;
}

.cal-preview__tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--color-accent);
  color: white;
  margin-bottom: var(--space-sm);
}

.cal-preview__tag[data-tag="mcp"] {
  background: #2563eb;
}
.cal-preview__tag[data-tag="cursor"] {
  background: #7c3aed;
}
.cal-preview__tag[data-tag="ema"] {
  background: #059669;
}
.cal-preview__tag[data-tag="search"] {
  background: #d97706;
}
.cal-preview__tag[data-tag="personal"] {
  background: #dc2626;
}
.cal-preview__tag[data-tag="llm"] {
  background: #4f46e5;
}
.cal-preview__tag[data-tag="agentic-ai"] {
  background: #475569;
}
.cal-preview__tag[data-tag="embeddings"] {
  background: #b45309;
}

.cal-preview__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 var(--space-md);
}

.cal-preview__excerpt {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 0 var(--space-lg);
}

.cal-preview__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.cal-preview__meta time {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.cal-preview__link {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.cal-preview__link:hover {
  color: var(--color-accent-hover);
}

/* Dark mode preview */
.dark-mode .cal-preview__backdrop {
  background: rgba(0, 0, 0, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
  .cal-month__grid {
    font-size: 9px;
  }

  .cal-day {
    min-height: 60px;
  }

  .cal-day__number {
    font-size: var(--text-xs);
  }

  .cal-day__post {
    font-size: 8px;
    padding: 2px 4px;
  }

  .cal-list__item {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .cal-preview__card {
    padding: var(--space-md);
  }

  .cal-preview__title {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  .cal-day {
    min-height: 45px;
    padding: 2px;
  }

  .cal-day__post {
    font-size: 7px;
  }
}

/* ==========================================================================
   Series Navigation
   ========================================================================== */

.series-nav {
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface-alt, var(--color-bg));
}

.series-nav__details {
  padding: 0;
}

.series-nav__summary {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.series-nav__summary::-webkit-details-marker {
  display: none;
}

.series-nav__summary::before {
  content: "▸";
  font-size: 0.75em;
  transition: transform var(--transition-base, 200ms ease);
}

details[open] > .series-nav__summary::before {
  transform: rotate(90deg);
}

.series-nav__list {
  margin: 0;
  padding: 0 var(--space-md) var(--space-sm);
  list-style: none;
  counter-reset: series;
}

.series-nav__item {
  counter-increment: series;
  padding: var(--space-xs) 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  border-top: 1px solid var(--color-border);
}

.series-nav__item::before {
  content: counter(series) ". ";
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.series-nav__item a {
  color: var(--color-accent, var(--color-text));
  text-decoration: none;
}

.series-nav__item a:hover {
  text-decoration: underline;
}

.series-nav__item--current {
  font-weight: 700;
}

.series-nav__current {
  color: var(--color-text);
}

.series-nav__item--upcoming {
  opacity: 0.5;
  font-style: italic;
}

.series-nav__upcoming {
  color: var(--color-text-muted);
}

.dark-mode .series-nav {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   Series Grid — Homepage series overview
   ========================================================================== */

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

.series-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}

.series-card:hover {
  border-color: var(--color-accent, var(--color-text));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.series-card--upcoming {
  opacity: 0.7;
  border-style: dashed;
}

.series-card__count {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent, var(--color-text-muted));
}

.series-card__title {
  font-size: var(--text-xl, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.series-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.series-card__toc {
  margin: var(--space-xs) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-sm);
}

.series-card__toc li {
  counter-increment: toc;
  padding: 2px 0;
  line-height: 1.4;
}

.series-card__toc li::before {
  content: counter(toc) ". ";
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.series-card__toc-future {
  opacity: 0.45;
  font-style: italic;
}

.dark-mode .series-card {
  background: rgba(255, 255, 255, 0.02);
}

.dark-mode .series-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
