:root {
  /* existing */
  --medium-black: #242424;
  --medium-gray: #757575;
  --medium-light-gray: #f7f7f7;
  --medium-border: rgba(0, 0, 0, 0.1);
  --ai-purple: #8b5cf6;
  --code-blue: #3b82f6;
  --climate-green: #10b981;
  --link-color: var(--code-blue);

  /* new theme colors */
  --health-red: #ef4444;      /* energetic, fitness vibe */
  --books-amber: #f59e0b;     /* warm, bookish feel */
  --notes-pink: #ec4899;      /* creative, personal notes */

  /* gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
  --gradient-code: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); 
  --gradient-climate: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  --gradient-health: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --gradient-books: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-notes: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}


.tag.ai { background: var(--ai-purple); }
.tag.code { background: var(--code-blue); }
.tag.climate { background: var(--climate-green); }
.tag.health { background: var(--health-red); }
.tag.books { background: var(--books-amber); }
.tag.notes { background: var(--notes-pink); }

.topic-filter.ai { --gradient-primary: var(--gradient-primary); }
.topic-filter.code { --gradient-primary: var(--gradient-code); }
.topic-filter.climate { --gradient-primary: var(--gradient-climate); }
.topic-filter.health { --gradient-primary: var(--gradient-health); }
.topic-filter.books { --gradient-primary: var(--gradient-books); }
.topic-filter.notes { --gradient-primary: var(--gradient-notes); }

.author-avatar.ai { background: var(--gradient-primary); }
.author-avatar.code { background: var(--gradient-code); }
.author-avatar.climate { background: var(--gradient-climate); }
.author-avatar.health { background: var(--gradient-health); }
.author-avatar.books { background: var(--gradient-books); }
.author-avatar.notes { background: var(--gradient-notes); }

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

body {
    font-family: 'Charter', Georgia, serif;
    color: var(--medium-black);
    line-height: 1.6;
    background: #fff;
    position: relative;
    overflow-x: hidden;
    cursor: none;
}

/* Custom Cursor with Trail Effect */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--ai-purple);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

.cursor-trail {
    width: 8px;
    height: 8px;
    background: var(--ai-purple);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.6;
}


/* Navigation with Morphing Logo */
nav {
    border-bottom: 1px solid var(--medium-border);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

nav.scrolled {
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

/* Removed page-dimming overlay and solid-open override */

.nav-container {
    max-width: 1192px;
    margin: 0 auto;
    padding: 25px 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* for mobile dropdown positioning */
    z-index: 1; /* keep above overlay */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

/* Animated Logo with Morphing SVG */
.logo-animation {
    width: 40px;
    height: 40px;
    position: relative;
}

.logo-animation svg {
    width: 100%;
    height: 100%;
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% { transform: rotate(0deg) scale(1); }
    33% { transform: rotate(120deg) scale(1.1); }
    66% { transform: rotate(240deg) scale(0.9); }
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

/* Hamburger button (hidden by default, shown on small screens) */
.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--medium-border);
    border-radius: 8px;
    background: transparent;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.hamburger .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #222;
    transition: transform 0.25s ease, opacity 0.2s ease, background 0.2s ease;
}
.hamburger .bar:nth-child(1) { transform-origin: 10% 50%; }
.hamburger .bar:nth-child(3) { transform-origin: 10% 50%; }

/* Active (X) state */
#navbar.open .hamburger .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
#navbar.open .hamburger .bar:nth-child(2) { opacity: 0; }
#navbar.open .hamburger .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Dark mode for hamburger bars */
body.dark-mode .hamburger { border-color: rgba(255,255,255,0.12); }
body.dark-mode .hamburger .bar { background: #e5e5e5; }

.nav-link {
    font-family: 'Sohne', sans-serif;
    font-size: 14px;
    color: var(--medium-black);
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
    cursor: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

/* Hero Section with Dynamic Text */
.hero {
    padding: 80px 20px;
    max-width: 1192px;
    margin: 0 auto;
    position: relative;
}

.hero-title {
    font-family: 'Sohne', sans-serif;
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 30px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 5s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: 21px;
    color: var(--medium-gray);
    max-width: 600px;
    line-height: 1.5;
    margin-bottom: 40px;
}

.type-writer {
    font-family: 'JetBrains Mono', monospace;
    color: var(--code-blue);
    font-size: 18px;
    min-height: 30px;
}

.type-writer::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Interactive Topic Filters */
.topic-filters {
    display: flex;
    gap: 15px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.topic-filter {
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid transparent;
    background: var(--medium-light-gray);
    font-family: 'Sohne', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.topic-filter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--gradient-primary);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    z-index: -1;
}

.topic-filter:hover::before {
    width: 200%;
    height: 200%;
}

.topic-filter:hover {
    color: white;
    transform: translateY(-2px);
}

.topic-filter.active {
    background: var(--gradient-primary);
    color: white;
}


/* Container */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 52px 20px;
}

/* Wider reading width for blog posts only */
article.container {
    max-width: 760px;
}

/* Enhanced Article Cards */
.article-card {
    margin-bottom: 48px;
    padding: 30px;
    border: 1px solid var(--medium-border);
    border-radius: 12px;
    cursor: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: white;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
}

.article-card:hover::before {
    left: 0;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sohne', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: white;
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary);
}

.pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse-out 2s infinite;
}

@keyframes pulse-out {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.author-info {
    font-family: 'Sohne', sans-serif;
    font-size: 14px;
}

.author-name {
    color: var(--ai-purple);
    font-weight: 500;
}

.post-date {
    color: var(--medium-gray);
}

.article-title {
    font-family: 'Sohne', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--medium-black);
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-subtitle {
    font-size: 16px;
    color: var(--medium-gray);
    line-height: 1.5;
    margin-bottom: 15px;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Sohne', sans-serif;
    font-size: 13px;
    color: var(--medium-gray);
}

.tag {
    padding: 5px 12px;
    border-radius: 15px;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    display: inline-block;
}


.engagement {
    display: flex;
    gap: 15px;
    align-items: center;
}

.engagement span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Article Page */
.article-header {
    margin-bottom: 40px;
}

.article-page-title {
    font-family: 'Sohne', sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.article-page-subtitle {
    font-size: 21px;
    color: var(--medium-gray);
    line-height: 1.5;
    margin-bottom: 30px;
}

.article-content {
    font-size: 21px;
    line-height: 1.58;
}

.article-content p {
    margin-bottom: 30px;
}

.article-content h2 {
    font-family: 'Sohne', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin: 48px 0 20px;
}

  .article-content h3 {
    font-family: 'Sohne', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 32px 0 16px;
}

/* Code Blocks with Syntax Highlighting */
.code-block {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: attr(data-language);
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #d4d4d4;
    line-height: 1.6;
}

/* Interactive Climate Data Visualization */
.climate-viz {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.climate-viz::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.temp-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.temp-bar {
    flex: 1;
    background: var(--gradient-climate);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    position: relative;
    min-height: 20px;
}

.temp-bar:hover {
    opacity: 0.8;
}

.temp-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--climate-green);
    opacity: 0;
    transition: opacity 0.3s;
}

.temp-bar:hover::after {
    opacity: 1;
}

/* AI Model Performance Metrics */
.ai-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.metric-card {
    background: linear-gradient(135deg, #f6f6f6, #fff);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--medium-border);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.metric-label {
    font-family: 'Sohne', sans-serif;
    font-size: 12px;
    color: var(--medium-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Live NASA API Integration */
#nasa-feed {
    background: #0a0a0a;
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

#nasa-feed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.3) 0%, transparent 50%);
    animation: space-drift 30s ease-in-out infinite;
}

@keyframes space-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-20px, -20px) scale(1.1); }
    66% { transform: translate(20px, -10px) scale(0.9); }
}

#nasa-feed img {
    width: 100%;
    border-radius: 8px;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

#nasa-feed h3 {
    font-family: 'Sohne', sans-serif;
    font-size: 24px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

#nasa-feed p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Live Carbon Footprint Tracker */
.carbon-tracker {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    border: 2px solid var(--climate-green);
}

.carbon-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 48px;
    font-weight: 700;
    color: var(--climate-green);
    text-align: center;
    margin: 20px 0;
}

.carbon-label {
    text-align: center;
    color: var(--medium-gray);
    font-size: 14px;
}

/* Footer */
footer {
    border-top: 1px solid var(--medium-border);
    padding: 40px 20px;
    text-align: center;
    font-family: 'Sohne', sans-serif;
    color: var(--medium-gray);
    font-size: 14px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--medium-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: none;
}

.social-link:hover {
    background: var(--gradient-primary);
    transform: translateY(-5px) rotate(360deg);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--medium-light-gray);
    border-top-color: var(--ai-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode */
body.dark-mode {
    background: #0a0a0a;
    color: #e5e5e5;
}

body.dark-mode nav {
    background: rgba(10, 10, 10, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Dark mode solid background when menu is open */
/* Keep default nav appearance in dark mode when menu is open */

body.dark-mode .article-card {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-link,
body.dark-mode .article-title {
    color: #e5e5e5;
}

body.dark-mode .code-block {
    background: #0a0a0a;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 20px;
    }
    /* Show hamburger, hide links by default */
    .hamburger { display: inline-flex; }
    .nav-links {
        display: flex; /* keep in flow for animation */
        position: absolute;
        top: 100%;
        right: 20px;
        left: 20px;
        flex-direction: column;
        gap: 14px;
        padding: 16px;
        background: #ffffff; /* fully opaque */
        border: 1px solid var(--medium-border);
        border-radius: 12px;
        box-shadow: 0 12px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
        z-index: 1001; /* above overlay and page */
        pointer-events: none; /* disabled until open */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .18s ease, transform .2s ease, box-shadow .2s ease, visibility 0s linear .2s;
        will-change: opacity, transform;
    }
    #navbar.open .nav-links {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        transition: opacity .18s ease, transform .2s ease, box-shadow .2s ease, visibility 0s linear 0s;
    }
    /* Make links larger for touch */
    .nav-link { padding: 8px 4px; font-size: 16px; }
    .theme-toggle { align-self: center; }
    
    .hero-title {
        font-size: clamp(36px, 10vw, 64px);
    }
    
    .container {
        padding: 32px 20px;
    }
    
    .article-page-title {
        font-size: 36px;
    }
    
    .article-content {
        font-size: 18px;
    }
}

/* Dark mode dropdown background */
@media (max-width: 768px) {
  body.dark-mode .nav-links {
    background: #111111; /* fully opaque */
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.25);
    pointer-events: auto;
  }

}

/* Prefer capability over width: disable custom cursor on touch/coarse pointers */
@media (hover: none), (pointer: coarse) {
  .cursor,
  .cursor-trail { display: none; }
  body, * { cursor: auto !important; }
}

/* Unified link styles (load after media queries so they apply globally) */
.article-content a,
.article-content a:link,
.article-content a:visited,
.article-page-subtitle a,
.article-page-subtitle a:visited {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.article-content a strong { color: inherit; }
.article-content a:hover { filter: brightness(1.05); }
.article-content a:focus-visible {
  outline: 2px solid var(--link-color);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Ensure TOC links readable with unified color */
.article-content .md-toc a { color: var(--link-color); }

/* Ensure navbar stays on top of global stacking tweaks */
#navbar { z-index: 1000; }

/* 1) Make the whole card link not underline by default */
.article-link {
    display: block;
    color: inherit;
    text-decoration: none;
  }
  
  /* 2) Underline ONLY the title (and only on hover/focus if you prefer) */
  .article-link .article-title {
    text-decoration: none;                 /* default: no underline */
  }
  .article-link:hover .article-title,
  .article-link:focus-visible .article-title {
    text-decoration: underline;            /* show underline on intent */
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
  }
  
  /* 3) Never underline the subtitle/description */
  .article-link .article-subtitle {
    text-decoration: none;
  }
  
  /* 4) Better readability in dark mode */
  body.dark-mode {
    --medium-gray: #b9b9b9;                /* lighter gray for contrast */
    --medium-border: rgba(255,255,255,.12);
    --link-color: #8ab4ff;                 /* readable blue on dark */
  }
  body.dark-mode .article-subtitle {
    color: rgba(255,255,255,.80);          /* ~AA contrast on dark */
  }
  body.dark-mode .article-title {
    color: #fff;
  }
  
  /* 5) Optional: slightly larger, looser subtitle for readability */
  .article-subtitle {
    font-size: 16px;
    line-height: 1.6;
  }
  
  /* 6) Good keyboard focus for accessibility */
  .article-link:focus-visible {
    outline: 2px solid var(--code-blue);
    outline-offset: 4px;
    border-radius: 12px;
  }

  /* === AI Metrics grid === */
.ai-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
  }
  
  .metric-card {
    border: 1px solid var(--medium-border);
    border-radius: 16px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff, #f7f8fb);
    box-shadow: 0 8px 24px rgba(0,0,0,.04);
    text-align: center;
  }
  .metric-value {
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 1px;
    color: var(--ai-purple);
  }
  .metric-label {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--medium-gray);
  }
  
  /* Dark mode for metrics */
  body.dark-mode .metric-card {
    background: linear-gradient(180deg, #161616, #111);
    border-color: rgba(255,255,255,.08);
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
  }
  body.dark-mode .metric-label { color: rgba(255,255,255,.7); }
  body.dark-mode .metric-value { color: #b7a6ff; } /* softer purple on dark */



/* Make canvas a background layer */
#particle-canvas {
    position: fixed;
    inset: 0;           /* top:0; right:0; bottom:0; left:0 */
    z-index: 0;         /* not negative */
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  
  /* Ensure content sits above it */
  nav, main, footer {
    position: relative;
    z-index: 1;
  }

/* --- Markdown readability enhancements --- */
/* Heading permalinks (🔗) smaller and subtler */
.article-content .direct-link {
  font-size: 0.8em;
  margin-right: 8px;
  text-decoration: none;
  opacity: 0.55;
  line-height: 1;
}
.article-content .direct-link:hover { opacity: 0.9; }
body.dark-mode .article-content .direct-link { opacity: 0.6; }

/* Table of Contents */
.article-content .md-toc, .article-content nav.md-toc {
  padding: 12px 16px;
  border: 1px solid var(--medium-border);
  border-radius: 10px;
  background: #fafafa;
  font-size: 0.95rem;
  margin: 20px 0 24px;
}
body.dark-mode .article-content .md-toc, body.dark-mode .article-content nav.md-toc {
  background: #151515;
  border-color: rgba(255,255,255,.12);
}
.article-content .md-toc ul { list-style: none; padding-left: 0; }
.article-content .md-toc li { margin: 6px 0; }
.article-content .md-toc li ul { padding-left: 18px; border-left: 2px dotted var(--medium-border); margin-top: 6px; }
body.dark-mode .article-content .md-toc li ul { border-left-color: rgba(255,255,255,.12); }
.article-content .md-toc a { text-decoration: none; }

/* Blockquotes */
.article-content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid #8b5cf6; /* ai purple */
  background: linear-gradient(0deg, rgba(139,92,246,.06), rgba(139,92,246,.06));
  border-radius: 8px;
}
body.dark-mode .article-content blockquote {
  background: rgba(255, 255, 255, 0.05); /* subtle contrast */
  border-left: 4px solid #b7a6ff;        /* keep your purple accent */
  color: #e2e8f0;                        /* improve readability */
  border-radius: 0.5rem;                 /* optional: softer look */
  padding: 1rem 1.25rem;
}
.article-content blockquote p { margin-bottom: 8px; }

/* Lists and sublists */
.article-content ul,
.article-content ol { padding-left: 1.4rem; }
.article-content li { margin: 4px 0; }
.article-content ul ul { list-style: circle; }
.article-content ul ul ul { list-style: square; }
.article-content ol ol { list-style: lower-alpha; }
.article-content ul ul,
.article-content ol ol { margin-top: 4px; }

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.95rem;
}
.article-content th,
.article-content td {
  border: 1px solid var(--medium-border);
  padding: 10px 12px;
  text-align: left;
}
.article-content thead th { background: #f5f7fb; font-weight: 600; }
.article-content tbody tr:nth-child(even) { background: #fafbff; }
body.dark-mode .article-content th,
body.dark-mode .article-content td { border-color: rgba(255,255,255,.12); }
body.dark-mode .article-content thead th { background: #141414; }
body.dark-mode .article-content tbody tr:nth-child(even) { background: #101010; }

/* Definition lists */
.article-content dl { margin: 16px 0 24px; }
.article-content dt { font-weight: 700; margin-top: 12px; }
.article-content dd {
  margin: 4px 0 8px 0;
  padding-left: 14px;
  border-left: 2px solid var(--medium-border);
}
body.dark-mode .article-content dd { border-left-color: rgba(255,255,255,.12); }

/* Admonitions from markdown-it-container */
.article-content .note,
.article-content .warning {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--medium-border);
  margin: 16px 0 20px;
}
.article-content .note {
  background: linear-gradient(0deg, rgba(59,130,246,.06), rgba(59,130,246,.06));
  border-left: 4px solid #3b82f6;
}
.article-content .warning {
  background: linear-gradient(0deg, rgba(251,191,36,.10), rgba(251,191,36,.10));
  border-left: 4px solid #f59e0b;
}
body.dark-mode .article-content .note { background: linear-gradient(0deg, rgba(59,130,246,.12), rgba(59,130,246,.12)); }
body.dark-mode .article-content .warning { background: linear-gradient(0deg, rgba(245,158,11,.18), rgba(245,158,11,.18)); }
body.dark-mode .article-content .note,
body.dark-mode .article-content .warning { border-color: rgba(255,255,255,.12); }

/* Footnotes */
.article-content .footnotes { font-size: 0.9rem; color: var(--medium-gray); }
.article-content .footnotes hr { display: none; }
.article-content .footnotes ol { padding-left: 1.2rem; }
.article-content sup.footnote-ref { font-size: 0.75em; }
.article-content a.footnote-backref { text-decoration: none; margin-left: 6px; opacity: .7; }
body.dark-mode .article-content .footnotes { color: rgba(255,255,255,.75); }

/* Justified body text for articles (paragraphs and list items only) */
.article-content p,
.article-content li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

  /* Blockquotes */
blockquote {
  border-left: 4px solid #ddd;
  padding: .75rem 1rem;
  margin: 1rem 0;
  background: #fafafa;
  color: #333;
}

/* Heading anchor symbol */
.header-anchor {
  margin-left: .35rem;
  text-decoration: none;
  opacity: .5;
}
.header-anchor:hover { opacity: 1; }

/* TOC */
.md-toc {
  border: 1px solid #eee;
  padding: 1rem;
  background: #fff;
  font-size: .95rem;
}

/* Admonitions / containers */
.note,
.warning {
  border-left: 4px solid;
  padding: .75rem 1rem;
  margin: 1rem 0;
  background: #f9fbff;
}
.note { border-color: #3b82f6; }      /* blue */
.warning { border-color: #f59e0b; }   /* amber */

/* Task lists */
.task-list-item {
  list-style: none;
}


/* Simple, theme-friendly callout boxes. Drop in src/styles/callouts.css */
.callout {
  border-left: 4px solid currentColor;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0.5rem;
  background: rgba(0,0,0,0.04);
}

.callout .callout-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.callout.note { color: #2b6cb0; }    /* blue-ish */
.callout.tip { color: #2f855a; }     /* green-ish */
.callout.warning { color: #b7791f; } /* amber-ish */
.callout.danger { color: #c53030; }  /* red-ish */

/* Optional: better spacing for lists/code inside callouts */
.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }
.callout code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

@media (prefers-color-scheme: dark) {
  .callout {
    background: rgba(255,255,255,0.06);
  }
}
