/*
 * Wabi Theme - A warm, minimal theme inspired by Scandinavian and Japanese aesthetics
 * Named after wabi-sabi - finding beauty in simplicity and imperfection
 */

/* ===== CSS Custom Properties ===== */
:root {
  /* Warm color palette - cream, sand, terracotta */
  --color-bg: #faf8f5;
  --color-bg-subtle: #f5f2ed;
  --color-bg-accent: #ebe6de;

  --color-text: #2d2a26;
  --color-text-muted: #6b6560;
  --color-text-subtle: #9a948d;

  --color-accent: #b8574c;
  --color-accent-hover: #a04a40;
  --color-accent-subtle: #d4a59e;

  --color-border: #e5e0d8;
  --color-border-subtle: #ebe6de;

  /* Typography - distinctive, characterful fonts */
  --font-display: "Fraunces", Georgia, serif;  /* Quirky soft serif - headlines */
  --font-body: "Newsreader", Georgia, serif;   /* Elegant editorial serif - reading */
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;  /* Warm humanist sans - UI */
  --font-mono: "IBM Plex Mono", Consolas, Monaco, monospace;

  /* Type scale - slightly larger for better reading */
  --text-xs: 0.8rem;
  --text-sm: 0.9rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 2.75rem;
  --text-5xl: 3.25rem;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --max-width-content: 52rem;
  --max-width-wide: 72rem;
  --max-width-full: 84rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Line heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;
}

/* ===== Nightshift - warm/dim tones for nighttime ===== */
.nightshift {
  --color-bg: #e6ddd0;
  --color-bg-subtle: #dcd2c3;
  --color-bg-accent: #d0c5b4;

  --color-text: #33302a;
  --color-text-muted: #5e5850;
  --color-text-subtle: #7d766c;

  --color-accent: #c4685d;
  --color-accent-hover: #a8564c;
  --color-accent-subtle: #d4a59e;

  --color-border: #ccc4b6;
  --color-border-subtle: #d0c5b4;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-text);
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h4, h5, h6 {
  font-size: var(--text-lg);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-5);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Prose links get underlines */
.prose a {
  text-decoration: underline;
  text-decoration-color: var(--color-accent-subtle);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  text-decoration-color: var(--color-accent);
}

strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--wide {
  max-width: var(--max-width-wide);
}

.container--full {
  max-width: var(--max-width-full);
}

main {
  flex: 1;
  padding: var(--space-12) 0 var(--space-20);
}

/* ===== Header & Navigation ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border-subtle);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.header__logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-text);
}

.nav__link--active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--color-accent);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) 0;
  }

  .nav.is-open {
    display: flex;
  }

  .nav__link {
    padding: var(--space-3) var(--space-6);
    width: 100%;
  }

  .nav__link--active::after {
    display: none;
  }
}

/* ===== Footer ===== */
.footer {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--color-border-subtle);
  background-color: var(--color-bg-subtle);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

.footer__random {
  margin-bottom: var(--space-4);
}

.footer__links {
  display: flex;
  gap: var(--space-6);
}

.footer__link {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

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

.footer__copy {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

/* ===== Article / Post Styling ===== */
.article {
  margin-bottom: var(--space-16);
  min-width: 0; /* Prevent grid blowout from wide content */
}

.article__header {
  margin-bottom: var(--space-10);
  text-align: center;
}

.article__title {
  margin-bottom: var(--space-4);
}

.article__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.article__date {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.article__tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.article__image {
  margin: var(--space-8) calc(-1 * var(--space-6));
  border-radius: 4px;
  overflow: hidden;
}

.article__image img {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 768px) {
  .article__image {
    margin-left: -2rem;
    margin-right: -2rem;
  }
}

/* ===== Sidenotes (Tufte-style) ===== */
.sidenote-toggle {
  cursor: pointer;
  color: var(--color-accent);
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
}

.sidenote-checkbox {
  display: none;
}

.sidenote {
  float: right;
  clear: right;
  width: 200px;
  margin-right: -240px;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  position: relative;
}

/* On smaller screens, hide sidenotes by default and show inline on toggle */
@media (max-width: 1200px) {
  .sidenote {
    display: none;
    float: none;
    width: 100%;
    margin: var(--space-2) 0 var(--space-4) 0;
    padding: var(--space-3);
    background: var(--color-bg-subtle);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--color-border);
  }

  .sidenote-checkbox:checked + .sidenote {
    display: block;
  }
}

/* On wide screens, always show sidenotes in margin */
@media (min-width: 1201px) {
  .sidenote-toggle {
    cursor: default;
  }

  .sidenote {
    display: block;
  }
}

/* ===== Asides (casual quips, jokes, audience voice) ===== */
.aside-toggle {
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.85em;
  vertical-align: super;
  line-height: 0;
  opacity: 0.7;
}

.aside-checkbox {
  display: none;
}

.aside {
  float: right;
  clear: right;
  width: 200px;
  margin-right: -240px;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  position: relative;
  padding-left: var(--space-2);
  border-left: 2px dashed var(--color-text-muted);
  opacity: 0.8;
}

.aside::before {
  content: "";
}

/* On smaller screens, hide asides by default and show inline on toggle */
@media (max-width: 1200px) {
  .aside {
    display: none;
    float: none;
    width: 100%;
    margin: var(--space-2) 0 var(--space-4) 0;
    padding: var(--space-3);
    background: transparent;
    border-radius: var(--radius-sm);
    border-left: 2px dashed var(--color-text-muted);
    border-top: none;
    border-right: none;
    border-bottom: none;
  }

  .aside-checkbox:checked + .aside {
    display: block;
  }
}

/* On wide screens, always show asides in margin */
@media (min-width: 1201px) {
  .aside-toggle {
    cursor: default;
  }

  .aside {
    display: block;
  }
}

/* ===== Quote Blocks (blockquotes with attribution and optional collapse) ===== */
.quote-block {
  margin: var(--space-8) 0;
  padding: 0;
}

.quote-content {
  margin: 0;
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-accent-subtle);
  background-color: var(--color-bg-subtle);
  font-family: var(--font-body);
  font-style: italic;
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.quote-content p {
  margin-bottom: var(--space-3);
}

.quote-content p:last-child {
  margin-bottom: 0;
}

.quote-attribution {
  margin-top: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: right;
  font-style: normal;
}

.quote-author {
  font-weight: 500;
}

.quote-author::before {
  content: "\2014\00a0"; /* em dash + non-breaking space */
}

.quote-source {
  font-style: italic;
}

/* Collapsible quote styles */
.quote-collapsible {
  position: relative;
}

.quote-toggle-checkbox {
  display: none;
}

.quote-preview {
  display: block;
}

.quote-full {
  display: none;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border);
}

.quote-toggle-label {
  display: inline-block;
  margin-top: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-accent);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.quote-toggle-label:hover {
  color: var(--color-accent-hover);
}

.quote-show-less {
  display: none;
}

/* When checkbox is checked, show full content and hide preview */
.quote-toggle-checkbox:checked ~ .quote-preview {
  display: none;
}

.quote-toggle-checkbox:checked ~ .quote-full {
  display: block;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.quote-toggle-checkbox:checked ~ .quote-toggle-label .quote-show-more {
  display: none;
}

.quote-toggle-checkbox:checked ~ .quote-toggle-label .quote-show-less {
  display: inline;
}

/* ===== Margin Figures (small images in margin, click to enlarge) ===== */
.marginfig-wrapper {
  display: inline;
}

.marginfig-toggle {
  cursor: pointer;
  color: var(--color-accent);
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
}

.marginfig-checkbox {
  display: none;
}

.marginfig {
  float: right;
  clear: right;
  width: 200px;
  margin-right: -240px;
  margin-bottom: var(--space-3);
  position: relative;
}

.marginfig-thumb {
  width: 100%;
  height: auto;
  border-radius: 4px;
  cursor: zoom-in;
  transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 2px 4px rgba(45, 42, 38, 0.1);
}

.marginfig-thumb:hover {
  opacity: 0.9;
  box-shadow: 0 4px 8px rgba(45, 42, 38, 0.15);
}

.marginfig-caption {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  line-height: var(--leading-normal);
}

/* On smaller screens, hide margin figures by default and show inline on toggle */
@media (max-width: 1200px) {
  .marginfig {
    display: none;
    float: none;
    width: 100%;
    max-width: 300px;
    margin: var(--space-4) auto;
    padding: var(--space-3);
    background: var(--color-bg-subtle);
    border-radius: var(--radius-sm);
  }

  .marginfig-checkbox:checked + .marginfig {
    display: block;
  }
}

/* On wide screens, always show margin figures */
@media (min-width: 1201px) {
  .marginfig-toggle {
    cursor: default;
  }

  .marginfig {
    display: block;
  }

  /* When marginfigs are present (without TOC), expand container to make room */
  .container:has(.marginfig-wrapper):not(:has(.toc)) {
    max-width: calc(var(--max-width-content) + 280px);
    padding-right: 280px;
  }
}

/* Margin Figure Modal */
.marginfig-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(45, 42, 38, 0.9);
  backdrop-filter: blur(4px);
}

.marginfig-modal.is-open {
  display: flex;
}

.marginfig-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--color-bg);
  border-radius: 8px;
  padding: var(--space-4);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marginfig-modal-close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 36px;
  height: 36px;
  background: var(--color-bg-subtle);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.marginfig-modal-close:hover {
  background: var(--color-bg-accent);
  color: var(--color-text);
}

#marginfig-modal-img {
  max-width: 100%;
  max-height: calc(90vh - 100px);
  object-fit: contain;
  border-radius: 4px;
}

.marginfig-modal-caption {
  margin-top: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  max-width: 600px;
  line-height: var(--leading-relaxed);
}

/* ===== Prose Content ===== */
.prose {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  font-optical-sizing: auto;
  min-width: 0; /* Prevent grid blowout from wide content */
}

/* Offset headings for sticky header when clicking TOC links */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  scroll-margin-top: 5rem;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose > *:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose li::marker {
  color: var(--color-text-subtle);
}

.prose blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-accent-subtle);
  background-color: var(--color-bg-subtle);
  font-style: italic;
  color: var(--color-text-muted);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  margin: var(--space-12) 0;
  border: none;
  height: 1px;
  background-color: var(--color-border);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: var(--space-6) 0;
}

.prose figure {
  margin: var(--space-8) 0;
}

.prose figcaption {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-3);
}

/* Tables */
.prose table {
  width: 100%;
  margin: var(--space-6) 0;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.prose th,
.prose td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.prose th {
  font-weight: 600;
  background-color: var(--color-bg-subtle);
}

.prose tbody tr:hover {
  background-color: var(--color-bg-subtle);
}

/* Inline code */
.prose code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--color-bg-accent);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--color-text);
}

.prose pre {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background-color: #3d3632;
  border-radius: 6px;
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.prose pre code {
  background-color: transparent;
  padding: 0;
  font-size: inherit;
  color: #e8e4df;
}

/* Ensure chroma spans get their colors */
.prose pre code .chroma,
.prose pre.chroma code {
  color: #e8e4df;
}

/* ===== Syntax Highlighting (Chroma) ===== */
/* Warm wabi theme - earthy browns with vibrant accents */
.chroma { color: #e8e4df; background-color: #3d3632; }
.chroma .lnlinks { outline: none; text-decoration: none; color: inherit; }
.chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
.chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
.chroma .hl { background-color: #4d4540; }
.chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em; color: #8a857e; }
.chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em; color: #8a857e; }
.chroma .line { display: flex; }

/* Keywords - vibrant coral/salmon */
.chroma .k { color: #ff8c69; }
.chroma .kc { color: #ff8c69; }
.chroma .kd { color: #ff8c69; }
.chroma .kn { color: #ff8c69; }
.chroma .kp { color: #ff8c69; }
.chroma .kr { color: #ff8c69; }
.chroma .kt { color: #7ec4a6; }

/* Names - bright teal/green */
.chroma .na { color: #7ec4a6; }
.chroma .nc { color: #f5d67a; }
.chroma .no { color: #ff8c69; }
.chroma .nd { color: #7ec4a6; }
.chroma .ni { color: #e8e4df; }
.chroma .ne { color: #ff8c69; }
.chroma .nf { color: #7ec4a6; }
.chroma .fm { color: #7ec4a6; }
.chroma .nl { color: #f5d67a; }
.chroma .nn { color: #e8e4df; }
.chroma .nx { color: #e8e4df; }
.chroma .nt { color: #ff8c69; }
.chroma .nb { color: #f5d67a; }
.chroma .bp { color: #f5d67a; }
.chroma .nv { color: #e8e4df; }
.chroma .vc { color: #e8e4df; }
.chroma .vg { color: #e8e4df; }
.chroma .vi { color: #e8e4df; }
.chroma .vm { color: #e8e4df; }

/* Strings - bright golden yellow */
.chroma .s { color: #f5d67a; }
.chroma .sa { color: #f5d67a; }
.chroma .sb { color: #f5d67a; }
.chroma .sc { color: #f5d67a; }
.chroma .dl { color: #f5d67a; }
.chroma .sd { color: #a8a29a; font-style: italic; }
.chroma .s2 { color: #f5d67a; }
.chroma .se { color: #ff8c69; }
.chroma .sh { color: #f5d67a; }
.chroma .si { color: #ff8c69; }
.chroma .sx { color: #f5d67a; }
.chroma .sr { color: #7ec4a6; }
.chroma .s1 { color: #f5d67a; }
.chroma .ss { color: #7ec4a6; }

/* Numbers - soft lavender */
.chroma .m { color: #c9b8dc; }
.chroma .mb { color: #c9b8dc; }
.chroma .mf { color: #c9b8dc; }
.chroma .mh { color: #c9b8dc; }
.chroma .mi { color: #c9b8dc; }
.chroma .il { color: #c9b8dc; }
.chroma .mo { color: #c9b8dc; }

/* Operators */
.chroma .o { color: #e8e4df; }
.chroma .ow { color: #ff8c69; }
.chroma .p { color: #e8e4df; }

/* Comments - warm gray */
.chroma .c { color: #a8a29a; font-style: italic; }
.chroma .ch { color: #a8a29a; font-style: italic; }
.chroma .cm { color: #a8a29a; font-style: italic; }
.chroma .c1 { color: #a8a29a; font-style: italic; }
.chroma .cs { color: #a8a29a; font-style: italic; }
.chroma .cp { color: #7ec4a6; }
.chroma .cpf { color: #7ec4a6; }

/* Generic */
.chroma .gd { color: #ff8c69; }
.chroma .ge { font-style: italic; }
.chroma .gi { color: #7ec4a6; }
.chroma .gs { font-weight: bold; }
.chroma .gu { color: #a8a29a; }

/* Error */
.chroma .err { color: #ff6b6b; }

/* ===== Tag ===== */
.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-bg-accent);
  color: var(--color-text-muted);
  border-radius: 2px;
  text-decoration: none;
  transition: all var(--transition-fast);
  text-transform: lowercase;
}

.tag:hover {
  background-color: var(--color-border);
  color: var(--color-text);
}

/* ===== Journal Layout ===== */
.journal-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-12);
  align-items: start;
}

.journal-layout__sidebar {
  position: sticky;
  top: var(--space-8);
  padding-left: var(--space-8);
  border-left: 1px solid var(--color-border-subtle);
}

.journal-sidebar__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.journal-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.journal-sidebar__item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.journal-sidebar__item:last-child {
  border-bottom: none;
}

.journal-sidebar__link {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.journal-sidebar__link:hover {
  color: var(--color-accent);
}

.journal-sidebar__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-top: var(--space-1);
}

@media (max-width: 768px) {
  .journal-layout {
    grid-template-columns: 1fr;
  }

  .journal-layout__sidebar {
    position: static;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--color-border-subtle);
    padding-top: var(--space-8);
    order: 2;
  }
}

/* ===== Post List ===== */
.post-list {
  list-style: none;
}

.post-list__item {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.post-list__item:first-child {
  padding-top: 0;
}

.post-list__item:last-child {
  border-bottom: none;
}

.post-list__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: 0;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.post-list__title a {
  color: var(--color-text);
  text-decoration: none;
}

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

.post-list__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.post-list__excerpt {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-12);
  font-size: var(--text-sm);
}

.pagination__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.pagination__link:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.pagination__link--disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination__info {
  color: var(--color-text-subtle);
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-8);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.breadcrumbs__separator {
  margin: 0 var(--space-2);
}

/* ===== Subscribe Form ===== */
.subscribe {
  margin-top: var(--space-16);
  padding: var(--space-10);
  background-color: var(--color-bg-subtle);
  border-radius: 8px;
  text-align: center;
}

.subscribe__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.subscribe__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.subscribe__form {
  display: flex;
  gap: var(--space-3);
  max-width: 24rem;
  margin: 0 auto;
}

.subscribe__input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-bg);
  color: var(--color-text);
}

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

.subscribe__button {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-bg);
  background-color: var(--color-accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.subscribe__button:hover {
  background-color: var(--color-accent-hover);
}

@media (max-width: 480px) {
  .subscribe__form {
    flex-direction: column;
  }
}

/* ===== Page Content (for full-width pages) ===== */
.page-content {
  font-size: var(--text-base);
}

.page-content h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

.page-content h2:first-child {
  margin-top: var(--space-6);
}

.page-content > p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: var(--leading-relaxed);
}

/* Hide the hx-mt-12 spacer divs from old hextra markup */
.page-content > div[class*="hx-"] {
  display: none;
}

/* Code blocks in page content (OSS detail pages, etc.) */
.page-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--color-bg-accent);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.page-content pre {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background-color: #2d2a26;
  border-radius: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.page-content pre code {
  background-color: transparent;
  padding: 0;
  color: #f5f2ed;
  font-size: inherit;
}

/* ===== Guide List / Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
  margin: var(--space-6) 0 var(--space-12);
}

.card-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.card-grid.compact .card {
  padding: var(--space-4);
}

.card-grid.compact .card__title {
  font-size: var(--text-base);
}

.card-grid.compact .card__description {
  font-size: var(--text-xs);
}

.card {
  padding: var(--space-6);
  background-color: var(--color-bg-subtle);
  border-radius: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.08);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.card__title a {
  color: var(--color-text);
  text-decoration: none;
}

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

.card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* ===== Callouts ===== */
.callout {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--color-border);
  border-radius: 4px;
  background-color: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--info {
  border-left-color: var(--color-accent-subtle);
}

.callout--warning {
  border-left-color: #d4a04e;
}

.callout--error {
  border-left-color: var(--color-accent);
}

.callout--success {
  border-left-color: #6b8f71;
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

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

/* ===== Highlight wrapper ===== */
.highlight {
  margin: var(--space-6) 0;
  border-radius: 6px;
  overflow: hidden;
}

.highlight pre {
  margin: 0;
}

/* ===== Homepage ===== */
.homepage {
  padding-top: var(--space-6);
}

.homepage-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (min-width: 1024px) {
  .homepage-top {
    flex-direction: row;
    gap: var(--space-12);
    align-items: flex-start;
  }

  .homepage-top .hero {
    flex: 2;
    margin-bottom: 0;
  }

  .homepage-top .home-section--recent {
    flex: 3;
    margin-bottom: 0;
  }
}

.hero {
  max-width: 42rem;
}

.homepage-top .hero {
  max-width: none;
}

.hero__pretitle {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0;
  line-height: 1.1;
  color: var(--color-text-muted);
}

.hero__pretitle s {
  text-decoration: line-through;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  line-height: 1.1;
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn--primary {
  color: var(--color-bg);
  background-color: var(--color-accent);
}

.btn--primary:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-bg);
}

.btn--outline {
  color: var(--color-accent);
  background-color: transparent;
  border: 1px solid var(--color-accent);
}

.btn--outline:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

/* Home sections */
.home-section {
  margin-bottom: var(--space-16);
}


.home-section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: var(--space-6);
  letter-spacing: -0.01em;
}

.home-section__more {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
}

.home-section__more a {
  color: var(--color-accent);
}

/* Recent posts list */
.recent-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.recent-post {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.recent-post:hover {
  padding-left: var(--space-2);
}

.recent-post__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
}

.recent-post:hover .recent-post__title {
  color: var(--color-accent);
}

.recent-post__date {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  flex-shrink: 0;
  margin-left: var(--space-4);
}

/* Topics grid */
.topics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.topic-link {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background-color: var(--color-bg-subtle);
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.topic-link:hover {
  background-color: var(--color-bg-accent);
  color: var(--color-text);
}

/* ===== OSS Pages ===== */

/* OSS Hero with stats */
.oss-hero {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--color-border-subtle);
}

.oss-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

.oss-hero__description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 42rem;
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

/* Stats row */
.oss-stats {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.oss-stat {
  display: flex;
  flex-direction: column;
}

.oss-stat__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.oss-stat__label {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Language pills */
.oss-languages {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.oss-language {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background-color: var(--color-bg-subtle);
  border-radius: 4px;
}

/* OSS Section headers */
.oss-section {
  margin-bottom: var(--space-12);
}

.oss-section__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.oss-section__description {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.activity-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border-subtle);
}

.activity-item__action {
  color: var(--color-text-muted);
}

.activity-item__repo {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
}

.activity-item__date {
  margin-left: auto;
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
}

/* Featured Projects Grid */
.oss-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-6);
}

.oss-project-card {
  padding: var(--space-6);
  background-color: var(--color-bg-subtle);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.oss-project-card--featured {
  border: 1px solid var(--color-border);
}

.oss-project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.oss-project-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
}

.oss-project-card__title a {
  color: var(--color-text);
  text-decoration: none;
}

.oss-project-card__title a:hover {
  color: var(--color-accent);
}

.oss-project-card__language {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-bg);
  border-radius: 3px;
  color: var(--color-text-muted);
}

.oss-project-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  flex: 1;
  margin-bottom: var(--space-4);
}

.oss-project-card__stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.oss-project-card__stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.oss-project-card__stat .icon {
  opacity: 0.6;
}

/* Language bar */
.oss-project-card__lang-bar,
.oss-lang-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background-color: var(--color-bg);
  margin-bottom: var(--space-4);
}

.lang-segment {
  height: 100%;
  min-width: 3px;
}

/* Language colors */
.lang-segment[data-lang="python"] { background-color: #3572A5; }
.lang-segment[data-lang="javascript"] { background-color: #f1e05a; }
.lang-segment[data-lang="typescript"] { background-color: #3178c6; }
.lang-segment[data-lang="html"] { background-color: #e34c26; }
.lang-segment[data-lang="css"] { background-color: #563d7c; }
.lang-segment[data-lang="shell"] { background-color: #89e051; }
.lang-segment[data-lang="go"] { background-color: #00ADD8; }
.lang-segment[data-lang="rust"] { background-color: #dea584; }
.lang-segment[data-lang="java"] { background-color: #b07219; }
.lang-segment[data-lang="c"] { background-color: #555555; }
.lang-segment[data-lang="c++"] { background-color: #f34b7d; }
.lang-segment[data-lang="makefile"] { background-color: #427819; }
.lang-segment[data-lang="dockerfile"] { background-color: #384d54; }

.oss-project-card__links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.oss-project-card__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.oss-project-card__link:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.oss-project-card__link--primary {
  background-color: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

.oss-project-card__link--primary:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-bg);
  border-color: var(--color-accent-hover);
}

/* All repos grid */
.oss-repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.oss-repo-card {
  padding: var(--space-4);
  background-color: var(--color-bg-subtle);
  border-radius: 6px;
  transition: transform var(--transition-fast);
}

.oss-repo-card:hover {
  transform: translateY(-1px);
}

.oss-repo-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.oss-repo-card__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

.oss-repo-card__title a {
  color: var(--color-text);
  text-decoration: none;
}

.oss-repo-card__title a:hover {
  color: var(--color-accent);
}

.oss-repo-card__language {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

.oss-repo-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
}

.oss-repo-card__stats {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  display: flex;
  gap: var(--space-4);
}

/* OSS Footer */
.oss-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.oss-footer a {
  color: var(--color-text-muted);
}

/* ===== Individual Project Pages ===== */

.oss-project-page {
  max-width: var(--max-width-content);
}

.oss-project-page .breadcrumb {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  margin-bottom: var(--space-6);
}

.oss-project-page .breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.oss-project-page .breadcrumb a:hover {
  color: var(--color-accent);
}

.breadcrumb__separator {
  margin: 0 var(--space-2);
  color: var(--color-text-subtle);
}

/* Project Hero */
.oss-project-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--color-border-subtle);
}

@media (max-width: 768px) {
  .oss-project-hero {
    grid-template-columns: 1fr;
  }
}

.oss-project-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.oss-project-hero__description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.oss-project-hero__meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.oss-project-hero__language,
.oss-project-hero__license,
.oss-project-hero__org {
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  background-color: var(--color-bg-subtle);
  border-radius: 4px;
  color: var(--color-text-muted);
}

.oss-project-hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.oss-project-hero__stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-end;
}

.oss-project-stat {
  text-align: right;
}

.oss-project-stat__value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  display: block;
}

.oss-project-stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Project sections */
.oss-project-section {
  margin-bottom: var(--space-10);
}

.oss-project-section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

/* Language breakdown */
.oss-lang-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.oss-lang-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.oss-lang-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.oss-lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-text-subtle);
}

.oss-lang-item[data-lang="python"] .oss-lang-dot { background-color: #3572A5; }
.oss-lang-item[data-lang="javascript"] .oss-lang-dot { background-color: #f1e05a; }
.oss-lang-item[data-lang="typescript"] .oss-lang-dot { background-color: #3178c6; }
.oss-lang-item[data-lang="html"] .oss-lang-dot { background-color: #e34c26; }
.oss-lang-item[data-lang="css"] .oss-lang-dot { background-color: #563d7c; }
.oss-lang-item[data-lang="shell"] .oss-lang-dot { background-color: #89e051; }
.oss-lang-item[data-lang="makefile"] .oss-lang-dot { background-color: #427819; }

/* Commit chart */
.oss-commit-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  padding: var(--space-2) 0;
}

.commit-bar {
  flex: 1;
  background-color: var(--color-accent);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.commit-bar:hover {
  opacity: 1;
}

.oss-commit-chart__label {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin-top: var(--space-2);
}

/* Contributors */
.oss-contributors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.oss-contributor {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background-color: var(--color-bg-subtle);
  border-radius: 6px;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.oss-contributor:hover {
  transform: translateY(-1px);
}

.oss-contributor__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.oss-contributor__name {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.oss-contributor__count {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Releases */
.oss-releases {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.oss-release {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-bg-subtle);
  border-radius: 6px;
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.oss-release:hover {
  background-color: var(--color-bg-accent);
}

.oss-release__tag {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent);
  font-weight: 500;
}

.oss-release__name {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex: 1;
}

.oss-release__date {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Project info */
.oss-project-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.oss-project-info__item {
  padding: var(--space-3);
  background-color: var(--color-bg-subtle);
  border-radius: 6px;
}

.oss-project-info__item dt {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.oss-project-info__item dd {
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* Related posts */
.oss-related-posts {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.oss-related-post {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  text-decoration: none;
}

.oss-related-post:hover .oss-related-post__title {
  color: var(--color-accent);
}

.oss-related-post__title {
  font-size: var(--text-base);
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.oss-related-post__date {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

/* Project footer */
.oss-project-footer {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
}

.oss-project-footer a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ===== Search ===== */

/* Search trigger button in header */
.search {
  display: flex;
  align-items: center;
}

.search__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
}

.search__trigger:hover {
  background: var(--color-bg-accent);
  border-color: var(--color-text-subtle);
  color: var(--color-text);
}

.search__trigger svg {
  width: 16px;
  height: 16px;
}

.search__shortcut {
  display: none;
}

@media (min-width: 640px) {
  .search__shortcut {
    display: flex;
  }

  .search__shortcut kbd {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    padding: 2px 6px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-subtle);
  }
}

/* Search Modal */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-16) var(--space-4);
}

.search-modal.is-open {
  display: flex;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 42, 38, 0.5);
  backdrop-filter: blur(4px);
}

.search-modal__content {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: var(--color-bg);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(45, 42, 38, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--space-20));
}

.search-modal__header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.search-modal__input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search-modal__icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-subtle);
  flex-shrink: 0;
}

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

.search-modal__input::placeholder {
  color: var(--color-text-subtle);
}

.search-modal__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.search-modal__close kbd {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  padding: 4px 8px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-subtle);
}

.search-modal__close:hover kbd {
  background: var(--color-bg-accent);
  color: var(--color-text-muted);
}

/* Search results */
.search-modal__results {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
  min-height: 200px;
  max-height: 400px;
}

.search-modal__empty,
.search-modal__loading,
.search-modal__error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

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

/* Individual search result */
.search-result {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: 8px;
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

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

.search-result.is-selected {
  background: var(--color-bg-accent);
}

.search-result__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.search-result__section {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
}

.search-result__date {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

.search-result__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.search-result__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* Highlight matched text */
.search-result mark {
  background: rgba(184, 87, 76, 0.2);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}

/* Search modal footer */
.search-modal__footer {
  display: none;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg-subtle);
}

@media (min-width: 640px) {
  .search-modal__footer {
    display: flex;
  }
}

.search-modal__hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

.search-modal__hint kbd {
  font-family: var(--font-sans);
  font-size: 10px;
  padding: 2px 5px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  min-width: 20px;
  text-align: center;
}

/* Mobile search adjustments */
@media (max-width: 640px) {
  .search-modal {
    padding: var(--space-4);
  }

  .search-modal__content {
    max-height: calc(100vh - var(--space-8));
  }

  .search-modal__input {
    font-size: var(--text-base);
  }
}

/* ===== VC Wars Game (TI-83 Style) ===== */

.vc-wars-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 300;
}

.vc-wars-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 301;
  /* TI-83 screen dimensions (scaled up for better visibility) */
  width: min(600px, 90vw);
  background: #8b956d; /* Classic LCD green-gray */
  border-radius: 12px;
  padding: 20px;
  box-shadow:
    0 0 0 6px #2d2d2d,
    0 0 0 12px #1a1a1a,
    0 12px 48px rgba(0, 0, 0, 0.6);
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

.ti83-screen {
  position: relative;
  background: #9aab7a; /* LCD active area */
  border: 3px solid #6b7a5a;
  border-radius: 6px;
  padding: 16px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  color: #1a1a1a;
  font-size: 15px;
  line-height: 1.4;
  /* LCD pixel effect */
  image-rendering: pixelated;
}

.ti83-title {
  font-size: 14px;
  white-space: pre;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0;
}

.ti83-header {
  font-size: 14px;
  border-bottom: 2px dashed #1a1a1a;
  padding-bottom: 10px;
  margin-bottom: 12px;
  white-space: pre-line;
}

.ti83-event {
  background: #7a8a6a;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  border: 2px solid #5a6a4a;
}

.ti83-prices {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}

.ti83-prices pre {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  background: transparent;
  padding: 0;
  color: inherit;
}

.ti83-label {
  font-size: 13px;
  text-align: center;
  margin-bottom: 8px;
  opacity: 0.8;
}

.ti83-status {
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  padding: 8px;
  background: #7a8a6a;
  margin-bottom: 12px;
}

.ti83-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ti83-menu--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ti83-menu--single {
  justify-content: center;
}

.ti83-instructions {
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.3;
}

.ti83-instructions pre {
  margin: 0;
  white-space: pre-wrap;
}

.ti83-btn {
  background: #6b7a5a;
  border: 2px solid #4a5a3a;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  flex: 1;
  min-width: 80px;
  text-align: left;
  transition: background 0.1s;
}

.ti83-btn:hover:not(:disabled) {
  background: #5a6a4a;
}

.ti83-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ti83-btn--full {
  flex-basis: 100%;
}

.ti83-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.ti83-input-area {
  margin: 16px 0;
  text-align: center;
}

.ti83-input-display {
  font-size: 22px;
  font-weight: bold;
  background: #7a8a6a;
  padding: 12px 20px;
  border: 2px solid #5a6a4a;
  display: inline-block;
  min-width: 140px;
}

.ti83-numpad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.ti83-btn--num {
  min-width: auto;
  text-align: center;
  padding: 12px 8px;
}

.ti83-message {
  font-size: 13px;
  text-align: center;
  padding: 8px;
  background: #7a8a6a;
  margin-top: 8px;
}

.ti83-empty {
  text-align: center;
  padding: 30px;
  font-size: 14px;
  opacity: 0.7;
}

.ti83-footer {
  font-size: 11px;
  text-align: center;
  margin-top: 12px;
  opacity: 0.6;
}

/* Scanline effect for extra retro feel */
.ti83-screen::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  border-radius: 4px;
  z-index: 10;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .vc-wars-container {
    width: 95vw;
    padding: 12px;
  }

  .ti83-screen {
    min-height: 420px;
    padding: 12px;
    font-size: 13px;
  }

  .ti83-title {
    font-size: 12px;
  }

  .ti83-header {
    font-size: 12px;
  }

  .ti83-prices pre {
    font-size: 12px;
  }

  .ti83-btn {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* ===== Bookshelf Grid ===== */

.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

@media (min-width: 640px) {
  .bookshelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-8);
  }
}

.book-card {
  display: flex;
  flex-direction: column;
}

.book-card__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.book-card__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  background-color: var(--color-bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-3);
  box-shadow:
    0 2px 4px rgba(45, 42, 38, 0.1),
    0 4px 8px rgba(45, 42, 38, 0.08);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.book-card__link:hover .book-card__cover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 16px rgba(45, 42, 38, 0.15),
    0 12px 24px rgba(45, 42, 38, 0.1);
}

.book-card__cover img,
.prose .book-card__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 1;
  margin: 0;
  border-radius: 0;
}

.book-card__placeholder {
  z-index: 0;
}

.book-card__cover img.book-card__img--loaded + .book-card__placeholder {
  display: none;
}

.book-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: linear-gradient(145deg, var(--color-bg-accent), var(--color-bg-subtle));
  text-align: center;
}

.book-card__placeholder span {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: var(--leading-tight);
}

.book-card__info {
  text-align: center;
}

.book-card__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-1) 0;
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}

.book-card__link:hover .book-card__title {
  color: var(--color-accent);
}

.book-card__author {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
  line-height: var(--leading-normal);
}

.book-card__note {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: var(--space-2) 0 0 0;
  text-align: center;
  line-height: var(--leading-relaxed);
}

/* Bookshelf section headers within prose */
.prose .bookshelf-grid {
  margin-top: var(--space-6);
}

/* ===== Album Grid ===== */

.albumshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-6);
  margin: var(--space-8) 0;
}

@media (min-width: 640px) {
  .albumshelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-8);
  }
}

.album-card {
  display: flex;
  flex-direction: column;
}

.album-card__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.album-card__link {
  cursor: pointer;
}

.album-card__cover {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: var(--color-bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--space-3);
  box-shadow:
    0 2px 4px rgba(45, 42, 38, 0.1),
    0 4px 8px rgba(45, 42, 38, 0.08);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

a.album-card__link:hover .album-card__cover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 16px rgba(45, 42, 38, 0.15),
    0 12px 24px rgba(45, 42, 38, 0.1);
}

.album-card__cover img,
.prose .album-card__cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin: 0;
  border-radius: 0;
}

.album-card__cover img.album-card__img--loaded + .album-card__placeholder {
  display: none;
}

.album-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  background: linear-gradient(145deg, var(--color-bg-accent), var(--color-bg-subtle));
  text-align: center;
}

.album-card__placeholder span {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: var(--leading-tight);
}

.album-card__info {
  text-align: center;
}

.album-card__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-1) 0;
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}

a.album-card__link:hover .album-card__title {
  color: var(--color-accent);
}

.album-card__artist {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
  line-height: var(--leading-normal);
}

.album-card__note {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: var(--space-2) 0 0 0;
  text-align: center;
  line-height: var(--leading-relaxed);
}

/* Albumshelf section headers within prose */
.prose .albumshelf-grid {
  margin-top: var(--space-6);
}

/* ===== Aphorisms Collection ===== */
.aphorisms-collection {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 100%;
  margin: var(--space-6) 0;
}

/* Reset prose styles for aphorism elements */
.prose figure.aphorism {
  margin: 0;
}

.prose .aphorism blockquote,
.aphorism__quote {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font-style: normal;
  color: inherit;
}

.prose .aphorism figcaption {
  text-align: left;
  margin-top: var(--space-2);
}

/* Single elegant card design */
.aphorism {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  position: relative;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-accent-subtle);
}

.aphorism__text {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-style: italic;
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.aphorism__attribution {
  margin-top: var(--space-2);
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.aphorism__author {
  font-weight: 500;
}

.aphorism__author::before {
  content: "\2014\00a0";
}

.aphorism__source {
  font-style: italic;
}

.aphorism__source::before {
  content: ", ";
}

/* Section headers within aphorisms */
.aphorisms-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  margin: var(--space-12) 0 var(--space-6);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-accent);
}

/* Responsive adjustments for aphorisms */
@media (max-width: 640px) {
  .aphorism {
    padding: var(--space-3) var(--space-4);
  }
}

/* ===== Quotebook ===== */
.quotebook {
  margin: var(--space-6) 0;
}

/* Quote of the Day Hero */
.quotebook__hero {
  background: linear-gradient(135deg, var(--color-bg-subtle) 0%, var(--color-bg) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-8);
  text-align: center;
  position: relative;
}

.quotebook__hero::before {
  content: "\201C";
  position: absolute;
  top: var(--space-4);
  left: var(--space-6);
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.3;
}

.quotebook__hero-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.quotebook__hero-text {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  margin: 0;
  padding: 0 var(--space-6);
}

.quotebook__hero-attribution {
  margin-top: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.quotebook__hero-author::before {
  content: "\2014\00a0";
}

.quotebook__hero-source {
  font-style: italic;
}

.quotebook__hero-source::before {
  content: ", ";
}

/* Hero actions */
.quotebook__hero-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.quotebook__hero-copy,
.quotebook__hero-share {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quotebook__hero-copy:hover,
.quotebook__hero-share:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-bg-subtle);
}

.quotebook__hero-copy--success {
  color: var(--color-success, #22c55e);
  border-color: var(--color-success, #22c55e);
}

/* Filter indicator */
.quotebook__filter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.quotebook__filter-clear {
  margin-left: auto;
  padding: var(--space-1) var(--space-3);
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

.quotebook__filter-clear:hover {
  background: rgba(255,255,255,0.3);
}

/* Controls bar */
.quotebook__controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.quotebook__count {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.quotebook__shuffle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quotebook__shuffle:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-bg-subtle);
}

.quotebook__shuffle:active svg {
  transform: rotate(180deg);
}

.quotebook__shuffle svg {
  transition: transform 0.3s ease;
}

/* Quotes list */
.quotebook__quotes {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.quotebook__quotes .aphorism {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-5) var(--space-6);
  transition: all 0.3s ease;
  position: relative;
}

.quotebook__quotes .aphorism::before {
  content: "\201C";
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  font-family: Georgia, serif;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.15;
}

.quotebook__quotes .aphorism--highlighted {
  border-left-width: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.quotebook__quotes .aphorism__text {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

/* Footer with attribution and copy button */
.aphorism__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
  gap: var(--space-3);
}

.quotebook__quotes .aphorism__attribution {
  margin-top: 0;
  flex: 1;
}

/* Author as clickable button */
.aphorism__author {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.aphorism__author::before {
  content: "\2014\00a0";
}

.aphorism__author:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Copy button */
.aphorism__copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.aphorism:hover .aphorism__copy {
  opacity: 1;
}

.aphorism__copy:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.aphorism__copy--success {
  color: var(--color-success, #22c55e);
  border-color: var(--color-success, #22c55e);
}

@media (max-width: 640px) {
  .quotebook__hero {
    padding: var(--space-6) var(--space-4);
  }

  .quotebook__hero::before {
    font-size: 3rem;
    left: var(--space-4);
  }

  .quotebook__hero-text {
    font-size: var(--text-lg);
    padding: 0 var(--space-2);
  }

  .quotebook__quotes .aphorism {
    padding: var(--space-4) var(--space-5);
  }

  .quotebook__quotes .aphorism__text {
    font-size: var(--text-base);
  }

  .aphorism__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .aphorism__copy {
    opacity: 1;
  }
}

/* ===== Maps ===== */
.map-container {
  margin: var(--space-6) 0;
}

.map-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.map-embed {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(45, 42, 38, 0.08);
}

/* Map marker styling */
.map-marker {
  width: 24px;
  height: 24px;
  background: var(--color-accent);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.map-marker:hover {
  transform: scale(1.1);
}

/* MapLibre popup styling */
.wabi-popup .maplibregl-popup-content {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.15);
  border: 1px solid var(--color-border);
  padding: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.wabi-popup .maplibregl-popup-tip {
  border-top-color: var(--color-bg);
}

.map-popup__title {
  display: block;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-accent);
  text-decoration: none;
  margin-bottom: var(--space-1);
}

.map-popup__title:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

strong.map-popup__title {
  color: var(--color-text);
}

.map-popup__note {
  margin: 0;
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

/* Map link styling */
.map-link {
  font-size: 0.85em;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-left: 0.25em;
}

.map-link::before {
  content: "(";
}

.map-link::after {
  content: ")";
}

.map-link:hover {
  color: var(--color-accent);
}

/* MapLibre control overrides */
.map-embed .maplibregl-ctrl-group {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-embed .maplibregl-ctrl-group button {
  background: var(--color-bg);
  border-color: var(--color-border);
}

.map-embed .maplibregl-ctrl-group button:hover {
  background: var(--color-bg-subtle);
}

.map-embed .maplibregl-ctrl-attrib {
  background: rgba(250, 248, 245, 0.85);
  font-family: var(--font-sans);
  font-size: 10px;
}

/* ===== Recipe Card ===== */
.recipe-card {
  margin: var(--space-10) 0;
  padding: 0;
  border-radius: 8px;
  border: 2px solid var(--color-accent-subtle);
  background: linear-gradient(
    180deg,
    var(--color-bg-subtle),
    var(--color-bg) 100%
  );
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

.recipe-card__header {
  padding: var(--space-6) var(--space-6) var(--space-5);
  background: linear-gradient(
    135deg,
    var(--color-bg-accent),
    var(--color-bg-subtle)
  );
  border-bottom: 2px solid var(--color-accent-subtle);
}

.recipe-card__title {
  margin: 0 0 var(--space-3) 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-accent);
  letter-spacing: -0.01em;
}

.recipe-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.recipe-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.recipe-card__meta-item strong {
  font-weight: 500;
  color: var(--color-text-subtle);
}

.recipe-card__content {
  padding: var(--space-6);
}

/* Section headers within recipe (h4 for sub-sections) */
.recipe-card__content h4 {
  margin: var(--space-8) 0 var(--space-4) 0;
  padding-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  border-bottom: 1px solid var(--color-border);
}

.recipe-card__content h4:first-child {
  margin-top: 0;
}

/* Sub-sub-sections (h5) for ingredient groups */
.recipe-card__content h5 {
  margin: var(--space-5) 0 var(--space-2) 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  font-style: italic;
  color: var(--color-text);
}

/* Ingredient lists */
.recipe-card__content ul {
  margin: var(--space-3) 0;
  padding-left: var(--space-5);
  list-style-type: disc;
}

.recipe-card__content ul li {
  margin: var(--space-2) 0;
  padding-left: var(--space-1);
  line-height: var(--leading-relaxed);
  font-family: var(--font-body);
}

.recipe-card__content ul li::marker {
  color: var(--color-accent-subtle);
}

/* Instruction lists */
.recipe-card__content ol {
  margin: var(--space-3) 0;
  padding-left: 0;
  counter-reset: recipe-step;
  list-style: none;
}

.recipe-card__content ol li {
  margin: var(--space-4) 0;
  padding-left: var(--space-10);
  line-height: var(--leading-relaxed);
  position: relative;
  counter-increment: recipe-step;
  font-family: var(--font-body);
}

.recipe-card__content ol li::before {
  content: counter(recipe-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-bg-accent);
  border: 1px solid var(--color-accent-subtle);
  border-radius: 50%;
}

/* Paragraphs within recipe */
.recipe-card__content p {
  margin: var(--space-3) 0;
  line-height: var(--leading-relaxed);
  font-family: var(--font-body);
}

.recipe-card__content p:first-child {
  margin-top: 0;
}

.recipe-card__content p:last-child {
  margin-bottom: 0;
}

/* Bold text for ingredient quantities */
.recipe-card__content strong {
  font-weight: 600;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .recipe-card {
    background: linear-gradient(
      180deg,
      var(--color-bg-subtle),
      var(--color-bg) 100%
    );
    border-color: var(--color-accent);
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.2),
      0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .recipe-card__header {
    background: linear-gradient(
      135deg,
      var(--color-bg-accent),
      var(--color-bg-subtle)
    );
    border-bottom-color: var(--color-accent);
  }

  .recipe-card__content ol li::before {
    background: var(--color-bg-accent);
    border-color: var(--color-accent);
  }
}

/* Responsive adjustments for recipe cards */
@media (max-width: 640px) {
  .recipe-card {
    margin: var(--space-8) 0;
    border-radius: 6px;
  }

  .recipe-card__header {
    padding: var(--space-5) var(--space-5) var(--space-4);
  }

  .recipe-card__title {
    font-size: var(--text-xl);
  }

  .recipe-card__meta {
    font-size: var(--text-xs);
    gap: var(--space-2) var(--space-4);
  }

  .recipe-card__content {
    padding: var(--space-5);
  }

  .recipe-card__content h4 {
    font-size: var(--text-xs);
  }

  .recipe-card__content ol li {
    padding-left: var(--space-8);
  }

  .recipe-card__content ol li::before {
    width: 1.5rem;
    height: 1.5rem;
    font-size: var(--text-xs);
  }
}

/* ===== Print Styles ===== */
/* ===== Article Layout with TOC ===== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1200px) {
  /* Only expand container and use two-column layout when TOC is present */
  .container:has(.article-layout):has(.toc) {
    max-width: calc(var(--max-width-content) + 200px + var(--space-12));
  }

  /* When both TOC and marginfigs are present, add room for both */
  .container:has(.article-layout):has(.toc):has(.marginfig-wrapper) {
    max-width: calc(var(--max-width-content) + 200px + 280px + var(--space-12));
    padding-right: 280px;
  }

  .article-layout:has(.toc) {
    grid-template-columns: 200px 1fr;
    gap: var(--space-12);
  }
}

/* ===== Table of Contents ===== */
.toc {
  display: none;
}

@media (min-width: 1200px) {
  .toc {
    display: block;
    position: sticky;
    top: var(--space-8);
    align-self: start;
    max-height: calc(100vh - var(--space-16));
    overflow-y: auto;
  }
}

.toc__nav {
  padding-right: var(--space-4);
}

.toc__title {
  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);
  margin-bottom: var(--space-4);
}

.toc__nav nav {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.toc__nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc__nav li {
  margin-bottom: var(--space-2);
}

.toc__nav ul ul {
  padding-left: var(--space-4);
  margin-top: var(--space-2);
}

.toc__nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  padding: var(--space-1) 0;
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
  margin-left: calc(-1 * var(--space-3));
}

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

.toc__nav a.active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  font-weight: 500;
}

/* ===== Code Blocks with Copy Button ===== */
.prose pre {
  position: relative;
}

.prose pre .code-copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: #888;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.prose pre:hover .code-copy-btn {
  opacity: 1;
}

.prose pre .code-copy-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.prose pre .code-copy-btn.copied {
  color: #4ade80;
  border-color: #4ade80;
}

/* ===== Share Buttons ===== */
.share {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.share__label {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.share__buttons {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.share__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share__button:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  transform: translateY(-2px);
}

.share__button--twitter:hover {
  color: #000;
  background: #f0f0f0;
}

.share__button--linkedin:hover {
  color: #0077b5;
  border-color: #0077b5;
}

.share__button--hackernews:hover {
  color: #ff6600;
  border-color: #ff6600;
}

.share__button--email:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.share__button--copy:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.share__button--copied {
  color: #22c55e !important;
  border-color: #22c55e !important;
}

/* ===== Backlinks ===== */
.backlinks {
  margin-top: var(--space-8);
  padding: var(--space-5);
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
}

.backlinks__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-4) 0;
}

.backlinks__title svg {
  opacity: 0.6;
}

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

.backlinks__item {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.backlinks__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.backlinks__link {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  text-decoration: none;
}

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

.backlinks__desc {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ===== Random Post Button ===== */
.random-post-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.random-post-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-bg-subtle);
}

.random-post-btn svg {
  transition: transform 0.3s ease;
}

.random-post-btn:hover svg {
  transform: rotate(180deg);
}

/* ===== Audio Footer Player ===== */
/* Panel-style player that slides up from bottom */
.audio-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 420px;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.audio-footer.is-visible {
  transform: translateY(0);
}

/* Navigation arrows */
.audio-footer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 80px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.audio-footer__nav:hover {
  opacity: 1;
  color: var(--color-text);
}

.audio-footer__nav--prev {
  left: 8px;
}

.audio-footer__nav--next {
  right: 8px;
}

.audio-footer__nav svg {
  width: 24px;
  height: 24px;
}

.audio-footer__inner {
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header row: Album info + close button */
.audio-footer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.audio-footer__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.audio-footer__artwork {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--color-bg-subtle);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.audio-footer__artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.audio-footer__info {
  min-width: 0;
  overflow: hidden;
}

.audio-footer__title {
  display: block;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.audio-footer__artist {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin-top: 2px;
}

.audio-footer__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.audio-footer__source {
  display: flex;
  align-items: center;
}

.audio-footer__source-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  background: var(--color-bg-subtle);
  border-radius: 3px;
}

.audio-footer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.audio-footer__close:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

/* Center section is now hidden - we only show the player */
.audio-footer__center {
  display: none;
}

/* Main player area - takes remaining space */
.audio-footer__player {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 6px;
  background: var(--color-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-footer__player iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Spotify-specific styling - fixed height embed */
.audio-footer[data-source="spotify"] {
  height: 440px;
}

.audio-footer[data-source="spotify"] .audio-footer__player {
  height: 352px;
  flex: none;
}

.audio-footer[data-source="spotify"] .audio-footer__player iframe {
  height: 352px;
  border-radius: 12px;
}

/* Bandcamp-specific styling */
.audio-footer[data-source="bandcamp"] {
  height: 480px;
}

.audio-footer[data-source="bandcamp"] .audio-footer__player {
  height: 380px;
  flex: none;
  max-width: 100%;
}

.audio-footer[data-source="bandcamp"] .audio-footer__player iframe {
  width: 100% !important;
  max-width: 100%;
}

/* Album card play overlay */
.album-card--playable {
  cursor: pointer;
}

.album-card__link--playable {
  cursor: pointer;
}

.album-card__play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: inherit;
}

.album-card__play-overlay svg {
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.album-card--playable:hover .album-card__play-overlay {
  opacity: 1;
}

.album-card--playable:hover .album-card__play-overlay svg {
  transform: scale(1.1);
}

.album-card--playable .album-card__cover {
  position: relative;
}

/* Random album button */
.play-random-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-bg);
  background: var(--color-text);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.play-random-btn:hover {
  background: var(--color-accent);
  transform: translateY(-1px);
}

.play-random-btn svg {
  width: 18px;
  height: 18px;
}

/* Responsive: Tablet */
@media (max-width: 768px) {
  .audio-footer__nav {
    width: 32px;
    height: 60px;
    opacity: 0.3;
  }

  .audio-footer__nav--prev {
    left: 4px;
  }

  .audio-footer__nav--next {
    right: 4px;
  }

  .audio-footer__nav svg {
    width: 20px;
    height: 20px;
  }

  .audio-footer__inner {
    padding: 16px 20px;
    gap: 12px;
  }

  .audio-footer__source {
    display: none;
  }

  .audio-footer[data-source="spotify"] {
    height: 420px;
  }

  .audio-footer[data-source="bandcamp"] {
    height: 440px;
  }

  .audio-footer[data-source="bandcamp"] .audio-footer__player {
    height: 340px;
  }
}

/* Responsive: Mobile */
@media (max-width: 480px) {
  .audio-footer__inner {
    padding: 12px 16px;
    gap: 10px;
  }

  .audio-footer__artwork {
    width: 44px;
    height: 44px;
  }

  .audio-footer__title {
    font-size: 14px;
  }

  .audio-footer__artist {
    font-size: 12px;
  }

  .audio-footer__close {
    width: 28px;
    height: 28px;
  }

  .audio-footer[data-source="spotify"] {
    height: 400px;
  }

  .audio-footer[data-source="bandcamp"] {
    height: 400px;
  }

  .audio-footer[data-source="bandcamp"] .audio-footer__player {
    height: 300px;
  }
}

/* Body padding when player is visible */
body.audio-footer-active {
  padding-bottom: 480px;
}

@media (max-width: 768px) {
  body.audio-footer-active {
    padding-bottom: 440px;
  }
}

@media (max-width: 480px) {
  body.audio-footer-active {
    padding-bottom: 400px;
  }
}

@media print {
  .audio-footer {
    display: none;
  }

  .header,
  .footer,
  .subscribe,
  .pagination,
  .share,
  .backlinks,
  .toc {
    display: none;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .prose a {
    text-decoration: underline;
  }

  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ===== Speed Run Timer ===== */

.speedrun-timer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.speedrun-timer--visible {
  transform: translateX(0);
}

.speedrun-timer__inner {
  background: var(--color-bg, #faf8f5);
  border: 2px solid var(--color-accent, #b85c4f);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-family: "IBM Plex Mono", monospace;
  position: relative;
  min-width: 160px;
}

.speedrun-timer__clock {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text, #2a2520);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.speedrun-timer__clock--finished {
  color: #22c55e;
}

.speedrun-timer__label {
  font-size: 11px;
  text-align: center;
  color: var(--color-text-muted, #6b635a);
  margin-top: 2px;
}

.speedrun-timer__label--finished {
  color: #22c55e;
  font-weight: 700;
  letter-spacing: 2px;
}

.speedrun-timer__stats {
  margin-top: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.speedrun-timer__wpm {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text, #2a2520);
}

.speedrun-timer__rank {
  font-size: 13px;
  font-weight: 700;
}

.speedrun-timer__close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-text-muted, #6b635a);
  line-height: 1;
  padding: 0;
}

.speedrun-timer__close:hover {
  color: var(--color-text, #2a2520);
}

.speedrun-timer--finished .speedrun-timer__inner {
  border-color: #22c55e;
}

.speedrun-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.speedrun-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.speedrun-toast__inner {
  background: var(--color-bg, #faf8f5);
  border: 2px solid var(--color-accent, #b85c4f);
  border-radius: 8px;
  padding: 14px 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  font-family: "IBM Plex Mono", monospace;
}

.speedrun-toast__message {
  font-size: 14px;
  color: var(--color-text, #2a2520);
}

/* ===== Bike Ride Parallax ===== */

.bike-ride-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 300;
}

.bike-ride-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 301;
  width: min(900px, 92vw);
  height: min(500px, 70vh);
  background: #87ceeb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 4px #2d2d2d,
    0 12px 48px rgba(0, 0, 0, 0.6);
}

.bike-ride-container canvas {
  display: block;
}

.bike-ride-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.bike-ride-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

@media (max-width: 640px) {
  .bike-ride-container {
    width: 96vw;
    height: 60vh;
  }

  .speedrun-timer {
    top: 8px;
    right: 8px;
  }

  .speedrun-timer__clock {
    font-size: 22px;
  }
}
