/* --- Google Workspace Design System --- */
:root {
    /* Colors */
    --primary: #1B6EF3;
    --primary-hover: #185ABC;
    --text-main: #1F1F1F;
    --text-sub: #474747;
    --bg-body: #FFFFFF;
    --bg-surface: #F0F4F9;
    --outline: #E0E3E7;
    
    /* Accents */
    --accent-red: #EA4335;
    --accent-yellow: #FBBC04;
    --accent-green: #34A853;
    --accent-blue: #4285F4;

    /* Typography */
    --font-display: 'Outfit', sans-serif; 
    --font-body: 'Roboto', sans-serif;

    /* Shapes */
    --radius-s: 8px;
    --radius-m: 16px;
    --radius-l: 28px;
    --radius-pill: 100px;
    
    /* Shadows */
    --shadow-1: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .logo, .btn { font-family: var(--font-display); }

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    /* Semi-transparent initially */
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 1.25rem;
}

.logo-icon { color: var(--primary); font-size: 28px; }

.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a:not(.btn) {
    text-decoration: none;
    color: var(--text-sub);
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:not(.btn):hover { color: var(--primary); }

.mobile-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius-pill);
}
.btn-primary:hover { background-color: var(--primary-hover); box-shadow: var(--shadow-1); }

.btn-outline {
    border: 1px solid var(--outline);
    color: var(--primary);
    border-radius: var(--radius-pill);
}
.btn-outline:hover { background-color: #F5F9FF; border-color: var(--primary); }

.btn-text { color: var(--primary); padding: 0; font-weight: 600; gap: 4px; }
.btn-text:hover { gap: 8px; }

.btn-lg { padding: 16px 32px; font-size: 1.1rem; }

/* --- Hero Section --- */
.hero {
    max-width: 1200px;
    margin: 140px auto 80px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #E8F0FE;
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 32px;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 32px;
    letter-spacing: -1px;
    color: var(--text-main);
}

.highlight { color: var(--primary); }

.hero-sub {
    font-size: 1.25rem;
    color: var(--text-sub);
    margin-bottom: 56px;
    max-width: 500px;
}

.cta-group { display: flex; gap: 24px; align-items: center; }

/* --- Hero Graphic --- */
.hero-graphic { position: relative; }

.main-card {
    background: var(--text-main);
    color: white;
    padding: 32px;
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-2);
    position: relative;
    transform: rotate(-2deg);
    transition: transform 0.3s;
}

.main-card:hover { transform: rotate(0deg) scale(1.02); }

.card-header { display: flex; gap: 8px; margin-bottom: 24px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: var(--accent-red); }
.yellow { background: var(--accent-yellow); }
.green { background: var(--accent-green); }

.code-block { font-family: 'Courier New', monospace; font-size: 1rem; line-height: 1.8; opacity: 0.9; }
.keyword { color: #C678DD; }
.class-name { color: #E5C07B; }
.func { color: #61AFEF; }
.comment { color: #7F848E; font-style: italic; }

.floating-badge {
    position: absolute;
    background: white;
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-1);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.9rem;
}

.badge-1 { top: -20px; right: -20px; transform: rotate(5deg); }
.badge-2 { bottom: -20px; left: -20px; transform: rotate(-3deg); }

/* --- Stats Strip --- */
.stats-strip {
    max-width: 800px;
    margin: 60px auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-surface);
    padding: 32px;
    border-radius: var(--radius-l);
}

.stat-item { text-align: center; }
.stat-number { display: block; font-size: 2.5rem; font-family: var(--font-display); font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.9rem; font-weight: 500; color: var(--text-sub); }
.divider { width: 1px; height: 40px; background: #D0D0D0; }

/* --- About / Experience Section --- */
.about-section {
    padding: 100px 24px;
    background: white; /* Keep background clean */
}

.about-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Split 50/50 */
    gap: 80px;
    align-items: center;
}

/* Left Column: Bio */
.section-label {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.about-bio h2 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--text-main);
}

.about-bio p {
    font-size: 1.1rem;
    color: var(--text-sub);
    margin-bottom: 24px;
    max-width: 450px;
}

/* Chips for Skills */
.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.chip {
    background: var(--bg-surface);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px; /* Slightly squarer than pill for tech feel */
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.chip:hover {
    background: #E8F0FE; /* Google Light Blue */
    color: var(--primary);
    border-color: #D2E3FC;
}

/* Right Column: Experience Stack */
.experience-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.exp-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-m);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.exp-card:hover {
    background: white;
    transform: translateX(-5px); /* Gentle nudges */
    box-shadow: var(--shadow-2);
}

.exp-icon {
    min-width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Use Google Accent Colors for Icons */
.bg-red { background: var(--accent-red); }
.bg-blue { background: var(--primary); }
.bg-yellow { background: var(--accent-yellow); }

.exp-content h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.exp-role {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exp-content p {
    font-size: 0.95rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* Mobile Responsiveness for About */
@media (max-width: 768px) {
    .about-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .about-bio h2 { font-size: 2.5rem; }
}

/* --- Split Section (Philosophy Tabs) --- */
.split-section { padding: 100px 24px; background: white; }

.split-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 350px 1fr; /* Fixed width for tabs */
    gap: 80px;
    align-items: start;
}

.sticky-tabs {
    position: sticky;
    top: 150px;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
    margin-bottom: 12px;
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.3s;
}

.tab-indicator {
    width: 4px;
    height: 32px;
    background: #E0E3E7; /* Inactive Gray */
    border-radius: 4px;
    transition: all 0.3s;
}

.tab-item h3 {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
}

/* Active Tab Styling */
.tab-item.active { color: var(--text-main); }
.tab-item.active h3 { font-weight: 500; }
.tab-item.active .tab-indicator {
    background: var(--primary); /* Google Blue */
    height: 48px;
    width: 5px;
}

.scroll-content { display: flex; flex-direction: column; gap: 48px; }

.feature-card {
    background: var(--bg-surface);
    padding: 48px;
    border-radius: var(--radius-l);
    transition: transform 0.3s;
}

.feature-card:hover { transform: translateY(-5px); }

.feature-icon {
    width: 56px; height: 56px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    margin-bottom: 24px;
}
.feature-icon span { font-size: 32px; }
.bg-blue { background: var(--accent-blue); }
.bg-green { background: var(--accent-green); }
.bg-purple { background: #A142F4; }

.feature-card h3 { font-size: 1.75rem; margin-bottom: 12px; }
.feature-card p { font-size: 1.1rem; color: var(--text-sub); }


/* --- Projects Grid --- */
.projects-section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section-head { margin-bottom: 48px; text-align: center; }
.section-head h2 { font-size: 2.5rem; margin-bottom: 16px; }

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.project-tile {
    background: var(--bg-surface);
    border-radius: var(--radius-l);
    overflow: hidden;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid transparent;
    
    /* OPTIMIZATION: Hardware accelerated properties only */
    /* This custom bezier creates a "spring" snap effect */
    transition: 
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
        box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.3s ease,
        border-color 0.3s ease;
    
    will-change: transform; /* Hint to browser to promote to own layer */
}

/* Interaction State */
.project-tile:hover {
    background: white;
    /* Lift up and scale slightly */
    transform: translateY(-8px) scale(1.01); 
    /* Deep, soft shadow for depth */
    box-shadow: 0 12px 32px rgba(27, 110, 243, 0.15); 
    border-color: var(--outline);
    z-index: 10;
}

/* Micro-interaction: Animate the Icon */
.project-tile .tile-icon {
    width: 48px; height: 48px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main); margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    
    /* Smooth transition for the icon specifically */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                color 0.3s ease, 
                background-color 0.3s ease;
}

.project-tile:hover .tile-icon {
    /* Rotate and pop */
    transform: scale(1.1) rotate(-6deg);
    color: var(--primary);
    background-color: #E8F0FE; /* Very light blue tint */
}

/* Micro-interaction: Slide the Link Arrow */
.tile-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    width: fit-content; /* Important: Restricts hit area to just the text/icon */
    transition: color 0.2s ease; /* Add explicit transition for link color */
}

/* Optional: Make link darker when specifically hovered */
.tile-link:hover {
    color: var(--primary-hover);
}

/* Define transition on the icon itself */
.tile-link .material-symbols-rounded {
    /* Use the same snappy physics curve for consistency */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Ensure no initial transform */
    transform: translateX(0);
}

/* THE FIX: Trigger the transform only when .tile-link is hovered */
.tile-link:hover .material-symbols-rounded {
    transform: translateX(6px); /* Slide arrow right */
}

/* Existing Layout Styles */
.large { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }

.tile-image {
    background-color: #DDE3EA;
    width: 100%; height: 100%;
    min-height: 200px;
    border-radius: var(--radius-m);
    /* Add subtle zoom to image on hover */
    transition: transform 0.5s ease;
    transform-origin: center;
}

/* Optional: Zoom image inside the card */
.project-tile:hover .tile-image {
    transform: scale(1.02);
}

.placeholder-ssm {
    background: linear-gradient(135deg, #E8F0FE 0%, #D2E3FC 100%);
    position: relative;
    overflow: hidden; /* Ensure zoom doesn't spill out */
}
.placeholder-ssm::after {
    content: '∑';
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 5rem; font-weight: bold; color: rgba(255,255,255,0.8);
}

.tile-meta {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px;
    font-weight: 700; color: var(--text-sub); margin-bottom: 12px;
}

.tile-content h3 { font-size: 1.5rem; margin-bottom: 12px; }
.tile-content p { color: var(--text-sub); margin-bottom: 24px; }

/* --- Footer --- */
.footer { padding: 24px; margin-top: 80px; }

.footer-card {
    background: var(--bg-surface);
    border-radius: var(--radius-l);
    padding: 80px 24px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.footer-card h2 { font-size: 3rem; margin-bottom: 16px; }
.footer-card p { font-size: 1.25rem; color: var(--text-sub); margin-bottom: 40px; }

.footer-actions { display: flex; justify-content: center; gap: 16px; }

.footer-links {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 32px;
    color: var(--text-sub);
    font-size: 0.9rem;
    padding-bottom: 32px;
}
.footer-links a { color: var(--text-sub); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }


/* --- ANIMATION FIXES --- */

/* 1. Base State: Hidden */
.animate-on-scroll, 
.hero-animate { 
    opacity: 0;
    transform: translateY(30px); /* Start slightly lower */
    /* Changed to a smoother easing curve */
    transition: opacity 1s cubic-bezier(0.2, 0, 0, 1), transform 1s cubic-bezier(0.2, 0, 0, 1);
    will-change: opacity, transform;
}

/* 2. Visible State: Applied by JS Observer */
.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-toggle { display: block; }
    
    .hero { grid-template-columns: 1fr; text-align: center; margin-top: 100px; }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .main-card { transform: rotate(0); }
    
    .split-container { grid-template-columns: 1fr; }
    .sticky-tabs { display: none; } /* Hide complex tabs on mobile */
    
    .grid-container { grid-template-columns: 1fr; }
    .large { 
        grid-column: auto;      /* 1. Stop spanning 2 columns */
        display: flex;          /* 2. Switch from Grid to Flex */
        flex-direction: column; /* 3. Stack image on top of text */
        gap: 24px;              /* 4. Restore gap between image and text */
    }
    
    h1 { font-size: 2.5rem; }
}

/* --- HEADER MODS --- */
/* 1. Make the menu button visible on Desktop */
.mobile-toggle {
    display: block; /* Was 'none' in mobile query previously */
    margin-left: 24px;
    background: transparent;
    border: 1px solid var(--outline); /* Add border to make it look like a UI element */
    border-radius: 8px; /* Square-ish */
    padding: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-toggle:hover {
    background-color: var(--bg-surface);
    color: var(--primary);
}

/* --- SIDE DRAWER (The Blog Toggle) --- */
.side-drawer-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3); /* Dim background */
    backdrop-filter: blur(2px);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.side-drawer-backdrop.is-open {
    opacity: 1;
    pointer-events: all;
}

.side-drawer {
    position: fixed;
    top: 0; right: 0;
    width: 400px; /* Fixed width sidebar */
    height: 100%;
    background: white;
    z-index: 1002;
    padding: 40px;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    
    /* Off-screen by default */
    transform: translateX(100%); 
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Spring physics */
}

.side-drawer.is-open {
    transform: translateX(0);
}

/* Drawer Content Styling */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.drawer-close {
    background: none; border: none;
    cursor: pointer;
    color: var(--text-sub);
    transition: color 0.2s;
}
.drawer-close:hover { color: var(--accent-red); }

.drawer-preview h3 { font-size: 1.5rem; margin-bottom: 8px; }
.drawer-preview p { color: var(--text-sub); margin-bottom: 24px; font-size: 0.95rem; }

.drawer-link-group {
    margin-top: 40px;
    border-top: 1px solid var(--outline);
    padding-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Mobile Tweaks */
@media (max-width: 600px) {
    .side-drawer { width: 85%; }
}

/* Fix: Ensure hover is snappy (0.4s) while entrance remains slow (1s) */
.project-tile.is-visible {
    /* Override the 1s scroll animation speed with our snappy hover speed */
    transition: 
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
        box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 1s ease; /* Keep opacity separate for safety */
}

/* --- Blog Page Styles --- */

/* Grid Layout */
.blog-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    /* responsive grid: min 340px width, then stretch */
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Card Container - Material Surface Style */
.blog-card {
    background-color: var(--bg-surface);
    border-radius: var(--radius-l); /* 28px */
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Springy transition */
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none; /* In case you wrap the whole card in an anchor */
    position: relative;
    overflow: hidden;
}

/* Hover Effect: Lift and whiten */
.blog-card:hover {
    background-color: white;
    transform: translateY(-6px);
    box-shadow: var(--shadow-2);
    border-color: var(--outline);
}

/* Header inside card */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* The Category Pill */
.blog-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: white;
    color: var(--text-sub);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Color variants for tags (Add these classes in HTML) */
.tag-blue { color: var(--primary); background: #E8F0FE; }
.tag-red { color: var(--accent-red); background: #FCE8E6; }
.tag-yellow { color: #E37400; background: #FEF7E0; }
.tag-green { color: var(--accent-green); background: #E6F4EA; }

.blog-date {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 500;
    opacity: 0.8;
}

/* Typography */
.blog-card h3 {
    font-size: 1.5rem;
    line-height: 1.25;
    margin-bottom: 12px;
    color: var(--text-main);
    font-weight: 600;
}

.blog-card p {
    font-size: 1rem;
    color: var(--text-sub);
    margin-bottom: 32px;
    line-height: 1.6;
    flex-grow: 1; /* Pushes the link to the bottom */
}

/* Read Link */
.blog-link {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-size: 0.95rem;
}

/* Create an arrow using CSS pseudo-element */
.blog-link::after {
    content: "arrow_forward";
    font-family: 'Material Symbols Rounded';
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-link::after {
    transform: translateX(6px);
}

/* Adjusting the "Back to Home" nav for the blog page */
.navbar .logo-icon {
    font-size: 24px; /* Slightly smaller for the back arrow */
}

/* --- Article Page Fixes --- */

/* 1. Fix the overlap by pushing the container down */
.post-container {
    max-width: 800px;
    margin: 0 auto;
    /* This ensures the title starts well below the navbar */
    padding-top: 160px; 
    padding-bottom: 100px;
    padding-left: 24px;
    padding-right: 24px;
}

/* 2. Style the Main Title (The first H1) */
.blog-content h1 {
    font-family: var(--font-display); /* 'Outfit' */
    font-size: 3.5rem;       /* Much larger */
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
    letter-spacing: -1.5px;  /* Tighter for that modern look */
    margin-bottom: 24px;     /* Space before the text starts */
    margin-top: 0;           /* Remove default top margin */
}

/* 3. Style Section Headers (H2) to be distinct but smaller */
.blog-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-top: 60px;        /* ample space between sections */
    margin-bottom: 20px;
    color: var(--text-main);
    letter-spacing: -0.5px;
    border-bottom: 1px solid var(--outline); /* Optional: nice divider */
    padding-bottom: 10px;
}

/* 4. Style Sub-headers (H3) */
.blog-content h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--text-sub);
}

/* 5. Make the text itself readable */
.blog-content p {
    font-size: 1.125rem;     /* 18px text is standard for blogs */
    line-height: 1.8;        /* Open line height for readability */
    color: #374151;          /* Dark grey, softer than pure black */
    margin-bottom: 24px;
}

/* 6. MathJax Overflow Fix */
/* Ensures long equations don't break mobile layout */
mjx-container {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

/* --- Table Styling for Blog Posts --- */
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0; /* Vertical spacing around the table */
    font-size: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden; /* Rounds the corners of the table */
}

.blog-content th {
    background-color: #F0F4F9; /* Google Surface color */
    color: var(--text-main);
    font-weight: 600;
    text-align: left;
    padding: 16px; /* Comfortable padding */
    border-bottom: 2px solid var(--outline);
}

/* Center the middle and right columns for better alignment */
.blog-content th:not(:first-child),
.blog-content td:not(:first-child) {
    text-align: center;
}

.blog-content td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--outline);
    color: var(--text-sub);
}

.blog-content tr:last-child td {
    border-bottom: none;
}

/* Optional: Citation text styling */
.table-citation {
    display: block;
    margin-top: -16px; /* Pulls it closer to table, but not touching */
    margin-bottom: 32px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* --- Code Block Styling (Minimal / Light) --- */
.blog-content pre {
    /* Matches the 'Google Surface' color used in Table Headers */
    /*background: #F0F4F9;
    border: 1px solid var(--outline);*/
    border-radius: 8px; /* Same radius as tables */
    padding: 24px;      /* Clean, even padding */
    margin: 32px 0;
    overflow-x: auto;   /* Scroll if code is too long */
    
    /* Remove the "Mac Window" decorations */
    position: static;
    box-shadow: none;
}

/* Ensure we don't accidentally show the dots anymore */
.blog-content pre::before,
.blog-content pre::after {
    display: none;
}

/* Typography for the code */
.blog-content code {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace; 
    font-size: 0.9rem;
    line-height: 1.6;
    background: transparent; /* Let the pre background show through */
}

/* --- Global Inline Links --- */
/* Targets links inside paragraphs, lists, or spans, excluding buttons/nav */
p a:not(.btn), 
li a:not(.btn),
span a:not(.btn) {
    color: var(--primary);          /* Google Blue */
    text-decoration: none;          /* Clean look by default */
    font-weight: 500;               /* Slightly thicker than body text */
    border-bottom: 1px solid transparent; /* Preps the hover effect without layout shift */
    transition: color 0.2s ease, border-color 0.2s ease;
}

/* Hover State */
p a:not(.btn):hover, 
li a:not(.btn):hover,
span a:not(.btn):hover {
    color: var(--primary-hover);    /* Darker blue */
    border-bottom-color: var(--primary-hover); /* Crisp underline appears */
}

/* Focus State (Accessibility) */
p a:not(.btn):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- Blockquote Styling --- */
.blog-content blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    background-color: #F8F9FA; /* Very light Google Grey */
    border-left: 4px solid var(--primary); /* Google Blue accent bar */
    border-radius: 0 8px 8px 0; /* Rounded on the right side */
    font-size: 1.15rem;
    font-style: italic;
    color: #4B5563; /* Medium grey for contrast */
}

/* Remove bottom margin from the last paragraph inside a quote */
.blog-content blockquote p:last-child {
    margin-bottom: 0; 
}

/* --- List (Bullet/Number) Styling --- */
.blog-content ul, 
.blog-content ol {
    margin: 24px 0 24px 24px; /* Matches paragraph spacing */
    padding-left: 16px;
}

.blog-content li {
    font-size: 1.125rem; /* Matches your paragraph size */
    line-height: 1.8;    /* Open line height for readability */
    color: #374151;      /* Matches paragraph text */
    margin-bottom: 12px; /* Space between list items */
    padding-left: 8px;   /* Slight indent from the bullet */
}

/* Color the bullets Google Blue for a nice accent */
.blog-content ul li::marker {
    color: var(--primary);
    font-size: 1.2em; /* Make the dot slightly bigger */
}

/* Style ordered lists (1., 2., 3.) */
.blog-content ol li::marker {
    color: var(--text-main);
    font-weight: 600; /* Bold numbers */
}

/* Nested lists */
.blog-content li ul,
.blog-content li ol {
    margin-top: 12px;
    margin-bottom: 0;
}