:root {
    --background: 0 0% 100%;
    --foreground: 0 0% 20%;
    --card: 0 0% 100%;
    --primary: 0 0% 9%;
    --secondary: 0 0% 96.1%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --border: 0 0% 89.8%;
    --radius: 0.5rem;
    --font-size-base: 16px;
    font-family: "Comic Sans MS", "OpenDyslexic", system-ui, sans-serif;
  }

  /* Mobile-first: increase base font size on very small screens for better readability */
  @media (max-width: 375px) {
    :root {
      --font-size-base: 15px;
    }
  }
    line-height: 1.6;
    color: hsl(var(--foreground));
    background: hsl(var(--background));
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
  }

  /* Visually hidden / screen-reader only */
  .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;
  }

  /* Skip to Content */
  .skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: hsl(var(--primary));
    color: hsl(var(--background));
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    z-index: 100;
    border-radius: 0 0 var(--radius) 0;
  }
  .skip-link:focus {
    top: 0;
  }

  /* Reading Progress */
  .reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: hsl(var(--muted));
    z-index: 999;
    font-size: 14px;
  }
  .reading-progress-bar {
    height: 100%;
    background: hsl(var(--primary));
    width: 0%;
    transition: width 0.1s ease;
  }

  /* Focus Mode Overlay */
  .focus-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), backdrop-filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
  }

  body.focus-mode .focus-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.focus-mode .breadcrumbs {
    display: none;
  }

  body.focus-mode .post-layout {
    position: relative;
    z-index: 1001;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }

  body.focus-mode .post-container {
    max-width: 780px;
    margin-inline: auto;
    background: hsl(var(--background));
    padding: 3rem;
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12);
    animation: focusModeSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes focusModeSlideIn {
    from {
      opacity: 0;
      transform: translateY(30px) scale(0.96);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  body.focus-mode .post-sidebar {
    display: none;
  }

  body.focus-mode .post-meta {
    color: #333333;
    opacity: 1;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    transition: color 0.2s;
  }

  body.focus-mode .post-meta:hover {
    color: #000000;
  }

  body.focus-mode .post-controls {
    margin-bottom: 2rem;
    opacity: 0.6;
    transition: opacity 0.2s;
  }

  body.focus-mode .post-controls:hover {
    opacity: 1;
  }

  body.focus-mode .post-footer-links,
  body.focus-mode .post-tags {
    opacity: 0.6;
    transition: opacity 0.2s;
  }

  body.focus-mode .post-footer-links:hover,
  body.focus-mode .post-tags:hover {
    opacity: 1;
  }

  body.focus-mode .post-tags {
    margin-bottom: 2.5rem;
  }

  body.focus-mode .post-title {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 3.5vw, 2.5rem);
    line-height: 1.2;
  }

  body.focus-mode .post-subtitle {
    margin-bottom: 2.5rem;
    opacity: 0.8;
    font-size: 1.1rem;
  }

  body.focus-mode .post-body {
    font-size: calc(var(--font-size-base) * 1.08);
    line-height: 1.8;
    letter-spacing: 0.01em;
  }

  body.focus-mode .post-body h2 {
    margin-top: 2.5em;
    margin-bottom: 0.75em;
  }

  body.focus-mode .post-body h3 {
    margin-top: 2em;
    margin-bottom: 0.6em;
  }

  body.focus-mode .post-body p {
    margin-bottom: 2em;
  }

  body.focus-mode .post-cover {
    margin-bottom: 3rem;
    border-radius: calc(var(--radius) * 1.5);
  }

  body.focus-mode .post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
  }

  body.focus-mode .post-footer:hover {
    opacity: 1;
  }

  body.focus-mode .reading-progress {
    z-index: 1002;
    height: 3px;
  }

  @media (max-width: 768px) {
    body.focus-mode .post-container {
      padding: 2rem 1.5rem;
      border-radius: 0;
      max-width: 100%;
    }
    
    body.focus-mode .post-layout {
      padding: 0;
    }
  }
  .progress-indicator {
    position: fixed;
    top: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: hsl(var(--card));
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 1002;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  @media (min-width: 1024px) {
    .progress-indicator {
      position: static;
      transform: none;
      box-shadow: none;
      border: 1px solid hsl(var(--border));
      background: hsl(var(--secondary));
      padding: 0.25rem 0.55rem;
      border-radius: 0.4rem;
      font-size: 0.75rem;
      font-weight: 500;
      color: hsl(var(--foreground));
    }
  }

  /* Accessibility Controls (from snippet) */
  .a11y-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .a11y-controls-card {
    background: hsl(var(--card));
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    padding: 1rem;
  }

  .a11y-controls-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: hsl(var(--foreground));
    text-align: center;
  }

  .a11y-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 400;
    color: hsl(var(--foreground));
  }
  .a11y-btn:hover {
    background: hsl(var(--secondary));
    transform: scale(1.05);
  }
  .a11y-btn.active {
    background: hsl(var(--primary));
    color: hsl(var(--background));
  }

  /* Text Customization & Focus Mode Controls */
  .post-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .focus-toggle,
  .text-options-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .focus-toggle:hover,
  .text-options-toggle:hover {
    background: hsl(var(--secondary));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .focus-toggle[aria-pressed="true"] {
    background: hsl(var(--primary));
    color: hsl(var(--background));
    border-color: hsl(var(--primary));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1002;
  }

  .focus-toggle[aria-pressed="true"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  }

  @keyframes focusPulse {
    0%, 100% {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(0, 0, 0, 0.2);
    }
    50% {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 4px rgba(0, 0, 0, 0.1);
    }
  }

  body.focus-mode .focus-toggle[aria-pressed="true"] {
    animation: focusPulse 3s ease-in-out infinite;
  }

  /* Keyboard Shortcuts Overlay */
  .shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1003;
    backdrop-filter: blur(4px);
  }
  .shortcuts-overlay.active {
    display: flex;
  }
  .shortcuts-panel {
    background: hsl(var(--card));
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
  }
  @media (max-width: 640px) {
    .shortcuts-panel {
      width: calc(100% - 2rem);
      padding: 1.5rem;
      max-height: 90vh;
    }
  }
  .shortcuts-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
  }
  .shortcut-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(var(--border));
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
  }
  .shortcut-key {
    background: #333333;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: calc(var(--radius) - 4px);
    font-family: monospace;
    font-weight: 600;
    font-size: 0.8rem;
  }
  .shortcuts-close-btn {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.625rem;
    background: hsl(var(--primary));
    color: hsl(var(--background));
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
  }
  .shortcuts-close-btn:hover {
    opacity: 0.9;
  }
  .shortcuts-close-btn:focus-visible {
    outline: 2px solid hsl(var(--background));
    outline-offset: 2px;
  }

  /* Text Customization Modal */
  .text-customization-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1003;
    backdrop-filter: blur(4px);
  }
  .text-customization-overlay.active {
    display: flex;
  }
  .text-customization-panel {
    background: hsl(var(--card));
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
  }
  @media (max-width: 640px) {
    .text-customization-panel {
      width: calc(100% - 2rem);
      padding: 1.5rem;
      max-height: 90vh;
    }
  }
  .text-customization-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
  }
  .text-customization-description {
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }
  .customization-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
  }
  .customization-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .customization-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: hsl(var(--foreground));
  }
  .customization-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .customization-controls .a11y-btn {
    flex-direction: column;
    gap: 0.5rem;
    height: auto;
    padding: 0.75rem;
    min-height: 3.5rem;
    width: auto;
    min-width: 5.5rem;
  }
  .a11y-btn-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
  }
  .text-customization-close-btn {
    margin-top: 1.5rem;
    width: 100%;
    padding: 0.625rem;
    background: hsl(var(--primary));
    color: hsl(var(--background));
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
  }
  .text-customization-close-btn:hover {
    opacity: 0.9;
  }
  .text-customization-close-btn:focus-visible {
    outline: 2px solid hsl(var(--background));
    outline-offset: 2px;
  }

  @media (max-width: 640px) {
    .progress-indicator {
      top: auto;
      bottom: 0.75rem;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  /* Breadcrumbs */
  .breadcrumbs {
    background: #f7f7f7;
    padding: 0.75rem 0;
    margin: 0;
    width: 100%;
  }
  .breadcrumb-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
  }
  @media (max-width: 640px) {
    .breadcrumb-list {
      padding: 0 1rem;
    }
  }
  .breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
  .breadcrumb-link {
    color: hsl(215 16% 47%);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
    border-radius: calc(var(--radius) - 4px);
    padding: 0.125rem 0.25rem;
    margin: -0.125rem -0.25rem;
  }
  .breadcrumb-link:hover {
    color: hsl(222.2 47.4% 11.2%);
  }
  .breadcrumb-link:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
    color: hsl(222.2 47.4% 11.2%);
  }
  .breadcrumb-page {
    color: hsl(222.2 47.4% 11.2%);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
  }
  .breadcrumb-separator {
    color: hsl(215 16% 47%);
    user-select: none;
    font-size: 0.875rem;
  }

  /* Layout with Sidebar */
  .post-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem 3.5rem;
  }
  @media (max-width: 640px) {
    .post-layout {
      padding: 1.5rem 1rem 2rem;
      gap: 1.5rem;
    }
  }
  @media (min-width: 1024px) {
    .post-layout {
      grid-template-columns: 1fr 260px;
    }
  }
  .post-container {
    max-width: 800px;
  }
  
  .post-container,
  .post-container p,
  .post-container li,
  .post-body {
    font-size: var(--font-size-base);
    transition: font-size 0.2s ease;
  }

  /* Reading mode styles */
  body.reading-mode .post-layout {
    grid-template-columns: 1fr;
  }
  body.reading-mode .post-sidebar {
    display: none;
  }
  body.reading-mode .post-container {
    max-width: 720px;
  }

  /* Post meta and header */
  .post-meta {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    color: #333333;
    flex-wrap: wrap;
  }
  .post-date,
  .post-reading-time,
  .post-author {
    display: inline-flex;
    align-items: center;
    gap: 0.05rem;
  }
  .dot {
    font-size: 1.5rem;
    color: #333333;
  }

  .post-title {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.2;
  }

  .post-subtitle {
    font-size: clamp(1.05rem, 3vw, 1.25rem);
    line-height: 1.6;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1.5rem;
  }

  /* Cover image */
  .post-cover {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid hsl(var(--border));
    margin-bottom: 2.5rem;
    background: hsl(var(--muted));
  }
  .post-cover-inner {
    width: 100%;
    height: clamp(180px, 40vw, 320px);
    background-size: cover;
    background-position: center;
  }
  @media (max-width: 640px) {
    .post-cover {
      margin-left: -1rem;
      margin-right: -1rem;
      border-radius: 0;
      border-left: none;
      border-right: none;
    }
    .post-cover-inner {
      height: clamp(200px, 50vw, 280px);
    }
  }

  /* Tags row */
  .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    color: hsl(var(--muted-foreground));
  }
  .post-tag {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: hsl(var(--secondary));
  }

  /* Article body */
  .post-body {
    color: hsl(var(--foreground));
  }
  .post-body > * + * {
    margin-top: 1.5em;
  }
  .post-body h2,
  .post-body h3,
  .post-body h4 {
    margin-top: 1.8em;
    margin-bottom: 0.4em;
    letter-spacing: -0.02em;
  }
  .post-body h2 {
    font-size: clamp(1.4em, 4vw, 1.6em);
  }
  .post-body h3 {
    font-size: clamp(1.2em, 3.5vw, 1.3em);
  }
  .post-container .post-body p {
    margin-top: 0;
    margin-bottom: 2em;
  }
  .post-body a {
    color: #1d4ed8;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.4);
  }
  .post-body a:hover {
    border-bottom-color: #1d4ed8;
  }
  body.high-contrast .post-body a {
    color: #0000EE;
    text-decoration: underline;
    border-bottom: 2px solid #0000EE;
  }
  .post-body ul,
  .post-body ol {
    padding-left: 2.5rem;
    margin: 0.75rem 0 1.5rem 0;
    list-style-position: outside;
  }
  @media (max-width: 640px) {
    .post-body ul,
    .post-body ol {
      padding-left: 1.5rem;
    }
  }
  .post-body li + li {
    margin-top: 0.5rem;
  }
  .post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.86em;
    padding: 0.15em 0.4em;
    border-radius: 0.35rem;
    background: rgba(15, 23, 42, 0.06);
  }
  .post-body pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    background: #020617;
    color: #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  @media (max-width: 640px) {
    .post-body pre {
      font-size: 0.8rem;
      padding: 0.75rem;
      margin-left: -1rem;
      margin-right: -1rem;
      border-radius: 0;
    }
  }

  /* Footer meta and prev/next */
  .post-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid hsl(var(--border));
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  @media (max-width: 640px) {
    .post-footer {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
    }
  }

  .post-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  @media (max-width: 640px) {
    .post-footer-links {
      width: 100%;
    }
    .post-footer-links .chip-link {
      flex: 1;
      justify-content: center;
      min-width: 0;
    }
  }

  .chip-link {
    border-radius: 999px;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    padding: 0.3rem 0.8rem;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
  }
  .chip-link:hover {
    background: hsl(var(--secondary));
    transform: translateY(-1px);
    border-color: hsl(var(--foreground) / 0.25);
  }
  .chip-link:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
    background: hsl(var(--secondary));
  }

  /* Sidebar */
  .post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 14px;
  }
  @media (max-width: 1023px) {
    .post-sidebar {
      order: -1;
    }
  }
  .sidebar-card {
    background: hsl(var(--card));
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    padding: 1rem;
    font-size: 0.85rem;
    color: hsl(var(--muted-foreground));
  }
  .sidebar-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: hsl(var(--foreground));
  }
  .sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
  }
  .sidebar-list li + li {
    margin-top: 0.35rem;
  }

  /* TOC styles */
  .toc-card {
    position: sticky;
    top: 6rem;
  }
  .toc-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
  }
  .toc-toggle:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
    border-radius: calc(var(--radius) - 2px);
  }
  .toc-toggle::after {
    content: "▾";
    font-size: 1.5rem;
  }
  .toc-toggle[aria-expanded="false"]::after {
    content: "▸";
  }
  .toc-list {
    margin-top: 0.5rem;
    font-size: 0.85rem;
  }
  .toc-item-level-3 {
    padding-left: 1rem;
    font-size: 0.83rem;
    opacity: 0.9;
  }
  .toc-item-level-4 {
    padding-left: 2rem;
    font-size: 0.81rem;
    opacity: 0.85;
  }
  .toc-item-level-5 {
    padding-left: 3rem;
    font-size: 0.79rem;
    opacity: 0.8;
  }
  .toc-list a {
    text-decoration: none;
    color: #333333;
    display: block;
    padding: 0.35rem 0.5rem;
    margin: 0.15rem 0;
    border-radius: calc(var(--radius) - 4px);
    transition: background 0.15s, color 0.15s;
  }
  .toc-list a:hover {
    color: hsl(var(--primary));
    background: hsl(var(--secondary));
  }
  .toc-list a:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
    color: hsl(var(--primary));
    background: hsl(var(--secondary));
  }
  .toc-list a.active {
    color: hsl(var(--primary));
    background: hsl(var(--secondary));
    font-weight: 600;
  }

  @media (max-width: 1023px) {
    .toc-card {
      position: static;
    }
  }

  footer.site-footer {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid hsl(var(--border));
    padding-top: 1.25rem;
  }
  @media (max-width: 640px) {
    footer.site-footer {
      padding: 0 1rem;
      padding-top: 1rem;
      font-size: 0.75rem;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
    .reading-progress-bar,
    .a11y-btn,
    .chip-link,
    .toc-list a {
      transition: none !important;
      transform: none !important;
    }
  }

  html {
    scroll-behavior: smooth;
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }

  /* Print styles */
  @media print {
    .reading-progress,
    .focus-overlay,
    .shortcuts-overlay,
    .text-customization-overlay,
    .post-controls,
    .a11y-controls,
    .focus-toggle,
    .text-options-toggle,
    .skip-link,
    .post-footer-links,
    .post-sidebar {
      display: none !important;
    }
    
    body {
      background: white;
      color: black;
    }
    
    .post-body a {
      color: black;
      text-decoration: underline;
    }
    
    .post-body a[href]:after {
      content: " (" attr(href) ")";
      font-size: 0.8em;
      color: #666;
    }
    
    .post-container {
      max-width: 100%;
    }
  }
