/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Import fonts - Display font for headings and Inter for body */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Green Brutalist - Moss on Concrete Palette - Dark Mode (Default) */
    --primary-color: #4ade80; /* vibrant moss green - like fresh growth */
    --primary-hover: #22c55e; /* deeper moss */
    --secondary-color: #86efac; /* light moss/lichen */
    --accent-warm: #a3e635; /* lime green - nature's neon */
    --accent-warm-hover: #84cc16; /* deeper lime */
    
    /* Backgrounds - Concrete & Stone */
    --bg-primary: #1c1c1e; /* dark concrete/asphalt */
    --bg-secondary: #2c2c2e; /* weathered concrete */
    --bg-tertiary: #3a3a3c; /* concrete blocks */
    
    /* Text colors */
    --text-primary: #e8f5e9; /* pale moss-tinted white */
    --text-secondary: #c5e1a5; /* faded moss green */
    --text-tertiary: #9ccc65; /* subdued green */
    
    /* Borders and dividers - Raw concrete edges */
    --border-color: #4a4a4c; /* concrete seam */
    --border-subtle: #3a3a3c; /* subtle concrete texture */
    
    /* Shadows - Deep concrete shadows with organic softness */
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
    
    /* Semantic colors - Nature's signals */
    --success: #4ade80; /* thriving moss */
    --warning: #facc15; /* cautionary yellow */
    --error: #ef4444; /* warning red */
    --info: #22d3ee; /* clear water cyan */
    
    /* Spacing scale (base-8: 0.5rem = 8px) */
    --space-1: 0.5rem;   /* 8px */
    --space-2: 1rem;     /* 16px */
    --space-3: 1.5rem;   /* 24px */
    --space-4: 2rem;     /* 32px */
    --space-6: 3rem;     /* 48px */
    --space-8: 4rem;     /* 64px */
    --space-12: 6rem;    /* 96px */
    --space-16: 8rem;    /* 128px */
    
    /* Typography scale (1.25 ratio - major third) */
    --text-xs: 0.8rem;      /* 12.8px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.25rem;     /* 20px */
    --text-xl: 1.563rem;    /* 25px */
    --text-2xl: 1.953rem;   /* 31.25px */
    --text-3xl: 2.441rem;   /* 39px */
    --text-4xl: 3.052rem;   /* 48.8px */
    --text-5xl: 3.815rem;   /* 61px */
    
    /* Font families */
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Monaco', 'Menlo', 'Courier New', monospace;
    
    /* Border radius */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    
    /* RGB values for rgba() usage */
    --primary-rgb: 74, 222, 128; /* moss green */
    --accent-rgb: 163, 230, 53; /* lime green */
}

/* Light mode theme - Sunlit Concrete Garden */
[data-theme="light"] {
    --primary-color: #16a34a; /* deep moss green for better contrast */
    --primary-hover: #15803d; /* even deeper moss */
    --secondary-color: #22c55e; /* bright growth */
    --accent-warm: #65a30d; /* deeper lime */
    --accent-warm-hover: #4d7c0f; /* darkest lime */
    --info: #0891b2;
    
    --bg-primary: #d6d3d1; /* darker concrete - better contrast */
    --bg-secondary: #c7c4c1; /* weathered concrete with texture */
    --bg-tertiary: #b8b5b2; /* darker concrete blocks */
    
    --text-primary: #0a0a0a; /* near-black for maximum contrast */
    --text-secondary: #1c1917; /* deep charcoal */
    --text-tertiary: #44403c; /* medium gray */
    
    --border-color: #78716c; /* darker concrete cracks */
    --border-subtle: #a8a29e; /* subtle texture */
    
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 16px -3px rgba(0, 0, 0, 0.3);
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: var(--text-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    /* Subtle concrete texture */
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.01) 2px,
            rgba(255, 255, 255, 0.01) 4px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.01) 2px,
            rgba(255, 255, 255, 0.01) 4px
        );
}

/* Heading styles */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5em;
    text-wrap: balance;
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.035em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.03em; }
h3 { font-size: var(--text-2xl); letter-spacing: -0.025em; font-weight: 600; }
h4 { font-size: var(--text-xl); font-weight: 600; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Global link styles - set a readable default and accessible focus states */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Keyboard focus - visible and not relying on browser defaults */
a:focus-visible, .btn:focus-visible, button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Visited links stay within palette but slightly subdued */
a:visited {
    color: var(--primary-color);
}

/* Keep nav/menu styles intact but ensure they override the global anchor rules */
.nav-menu a {
    color: var(--text-secondary);
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    background: var(--accent-warm);
    color: var(--bg-primary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    z-index: 200;
    transition: top 0.2s ease;
}

.skip-to-content:focus {
    top: var(--space-4);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 3px solid var(--primary-color);
    border-radius: 0; /* Brutalist sharp edges */
    padding: var(--space-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--primary-color);
    width: 56px;
    height: 56px;
    margin-left: auto;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-primary);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.theme-toggle svg {
    width: 44px;
    height: 44px;
    stroke-width: 2.5;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-2);
    }
}

/* Header and Navigation */
.site-header {
    background-color: rgba(44, 44, 46, 0.95);
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .site-header {
    background-color: rgba(28, 28, 30, 0.95);
    border-bottom: 3px solid var(--primary-color);
}

[data-theme="light"] .site-header {
    background-color: rgba(245, 245, 244, 0.95);
    border-bottom: 3px solid var(--primary-color);
}

/* Navigation wrapper */
.navbar {
    padding: var(--space-2) 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    width: 100%;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-6);
    margin: 0;
    padding: 0;
    align-items: center;
}
.logo {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    text-transform: uppercase;
    font-feature-settings: 'ss01' 1, 'ss02' 1;
    flex-shrink: 1;
    min-width: 0;
}

[data-theme="light"] .logo {
    color: #18181b;
}

/* Profile Photo in Header */
.profile-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
    border-color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-6);
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    transition: color 0.2s ease, border-color 0.2s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="light"] .nav-menu a {
    color: #3f3f46;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-16) 0 var(--space-12);
    text-align: left;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

/* CRT Video Background */
.crt-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    opacity: 0.4;
    background: linear-gradient(
        135deg,
        #1a1a1c 0%,
        #2a2a2c 25%,
        #1a1a1c 50%,
        #2a2a2c 75%,
        #1a1a1c 100%
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

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

.crt-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px) saturate(1.3) contrast(0.9);
}

/* CRT Screen Effects */
.crt-video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0) 1px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.15) 3px
    );
    pointer-events: none;
    z-index: 2;
}

/* Scanline effect */
.crt-video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    animation: scanline 8s linear infinite;
    z-index: 2;
}

@keyframes scanline {
    0% { background-position: 0 0; }
    100% { background-position: 0 100%; }
}

/* Green tint overlay for CRT monitor effect */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(74, 222, 128, 0.08) 0%,
        rgba(34, 197, 94, 0.15) 100%
    );
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 1;
}

/* Light mode adjustments */
[data-theme="light"] .crt-video-container {
    opacity: 0.3;
}

[data-theme="light"] .crt-video-container video {
    filter: blur(10px) saturate(1.2) contrast(0.8) brightness(0.85);
}

/* ASCII Animation Container */
.ascii-animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.hero > .container {
    position: relative;
    z-index: 10;
}

/* ASCII Particles */
.ascii-particle {
    position: absolute;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-size: 12px;
    pointer-events: none;
    user-select: none;
    opacity: 0.15;
    font-weight: 400;
}

/* ASCII Animal Container */
.ascii-animal-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual ASCII Animal Characters */
.ascii-animal-char {
    position: absolute;
    font-family: monospace;
    font-size: 14px;
    color: rgba(74, 222, 128, 0.5); /* moss green with transparency */
    pointer-events: none;
    user-select: none;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
    opacity: 0;
    transition: left 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 1.2s ease;
}

.ascii-animal-char.forming {
    opacity: 0;
}

.ascii-animal-char.formed {
    opacity: 0.7;
}

/* Light mode ASCII - much darker and bolder for visibility */
[data-theme="light"] .ascii-animal-char {
    color: rgba(22, 163, 74, 1); /* solid dark moss green - no transparency */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

[data-theme="light"] .ascii-animal-char.formed {
    opacity: 1; /* fully opaque */
}

/* Remove old animal styles */
.ascii-animal {
    display: none;
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--text-primary);
    font-family: var(--font-display);
    text-wrap: balance;
}

.hero-subtitle {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-display);
    font-feature-settings: 'ss01' 1;
}

.hero-description {
    font-size: var(--text-lg);
    max-width: 600px;
    margin-bottom: var(--space-6);
    color: var(--text-secondary);
    line-height: 1.75;
    font-weight: 400;
    text-wrap: pretty;
}

.hero-cta {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: 0; /* Brutalist sharp edges */
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-base);
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
    min-height: 44px;
    text-transform: uppercase;
    font-family: var(--font-display);
}

.btn-primary {
    background: var(--accent-warm);
    color: var(--bg-primary);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-warm);
}

.btn-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.25);
}

/* Featured Section */
.featured {
    padding: var(--space-12) 0;
    background-color: var(--bg-primary);
}

.featured h2 {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    margin-bottom: var(--space-8);
    text-align: center;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

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

.blog-card {
    position: relative;
    background-color: var(--bg-secondary);
    padding: var(--space-6);
    border-radius: 0; /* Brutalist sharp edges */
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid var(--border-color);
    color: var(--text-primary);
    overflow: hidden;
}

/* Category color strip - like moss creeping in */
.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-warm));
}

/* Reveal animation: start slightly down & faded, then slide up into place */
.reveal {
    opacity: 0;
    transform: translateY(18px);
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Tilt base state (will be transformed by JS) - preserve hover transform by layering translateZ 0 */
.tilt {
    will-change: transform;
    transition: transform 0.25s ease;
}

.blog-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.blog-card h3 {
    font-family: var(--font-display);
    margin-bottom: var(--space-3);
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary);
    text-wrap: balance;
}

/* Ensure any page-level headings accidentally included inside cards are constrained
   (sometimes summaries or excerpts may contain H1/H2 from content). */
.blog-card h1,
.blog-card h2,
.project-card h1,
.project-card h2,
.taxonomy-item h1,
.taxonomy-item h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.35;
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Also ensure very large page header styles don't leak into small contexts */
.blog-card .page-header h1,
.project-card .page-header h1 {
    font-size: 1.4rem;
}

.blog-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h3 a:hover {
    color: var(--primary-color);
}

.meta {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
    font-weight: 500;
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.blog-card p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: var(--text-sm);
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
    transition: gap 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.read-more:hover {
    color: var(--secondary-color);
    gap: var(--space-2);
}

.view-all {
    text-align: center;
}

/* Blog List */
.blog-list {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

@media (max-width: 768px) {
    .section-header h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 480px) {
    .section-header h1 {
        font-size: 1.875rem;
    }
}

.section-header p {
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 400;
}

.blog-articles {
    max-width: 800px;
    margin: 0 auto;
}

.blog-item {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.blog-item:last-child {
    border-bottom: none;
}

.blog-item h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.blog-item h2 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-item h2 a:hover {
    color: var(--primary-color);
}

.blog-item .summary {
    margin-bottom: 1rem;
}

/* Single Page */
.single-page {
    padding: 4rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.page-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
}

.page-content h2 {
    font-size: 2.25rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    position: relative;
    padding-bottom: 0.5rem;
}

.page-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-warm));
    border-radius: 2px;
}

.page-content h3 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.page-content a:hover {
    border-bottom-color: var(--primary-color);
}

.page-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    text-wrap: pretty;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
}

.page-content li {
    margin-bottom: 0.5rem;
}

.page-content code {
    background-color: var(--bg-tertiary);
    color: var(--secondary-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.page-content pre {
    background-color: #1a1a1c;
    color: var(--text-primary);
    padding: var(--space-4);
    border-radius: 0; /* Brutalist sharp edges */
    overflow-x: auto;
    margin-bottom: var(--space-6);
    border: 3px solid var(--primary-color);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
    line-height: 1.5;
}

.page-content pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.95rem;
    border: none;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

/* Syntax highlighting improvements */
.page-content pre .comment { color: var(--text-tertiary); font-style: italic; }
.page-content pre .keyword { color: var(--primary-color); font-weight: 600; }
.page-content pre .string { color: var(--accent-warm); }
.page-content pre .number { color: var(--secondary-color); }
.page-content pre .function { color: var(--info); }
.page-content pre .operator { color: var(--text-secondary); }

.page-content blockquote {
    border-left: 6px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
    background-color: var(--bg-secondary);
    padding: var(--space-4);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

/* CV Section */
.cv-section {
    margin-bottom: 3rem;
}

.cv-section h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.cv-section h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

.cv-item {
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.cv-item h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.cv-item .cv-meta {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.cv-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.skill-item {
    background-color: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.skill-item:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* About & Contact Sections */
.socials-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.socials-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-image {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background: var(--bg-secondary);
}

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

.socials-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.socials-bio {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.socials-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.socials-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.socials-button:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.socials-button-secondary {
    background-color: transparent;
    border-style: dashed;
    opacity: 0.7;
}

.socials-button-secondary:hover {
    opacity: 1;
}

.socials-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.socials-label {
    flex: 1;
    text-align: center;
}

.additional-info {
    max-width: 800px;
    margin: 4rem auto 0;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.info-section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.info-section h3 {
    font-family: var(--font-display);
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.info-section p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.info-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.info-section li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Tags and Categories */
.tags, .categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag, .category {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: 0; /* Brutalist sharp edges */
    font-size: 0.875rem;
    text-decoration: none;
    border: 2px solid var(--primary-color);
    transition: all 0.2s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.tag:hover, .category:hover {
    background-color: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
}

.taxonomy-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2.25rem;
    margin: 2rem 0;
}

.taxonomy-item {
    position: relative;
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0; /* Brutalist sharp edges */
    border: 3px solid var(--border-color);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.22s cubic-bezier(.2,.9,.3,1), box-shadow 0.22s ease;
    color: var(--text-primary);
}

.taxonomy-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.taxonomy-item h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    text-wrap: balance;
}

/* Ensure taxonomy/title links use site text color (not browser default blue) */
.taxonomy-item h3 a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
}

.taxonomy-item h3 a:hover {
    color: var(--primary-color);
}

.taxonomy-item .count {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Project Cards */
.project-card {
    position: relative;
    background-color: var(--bg-secondary);
    padding: var(--space-6);
    border-radius: 0; /* Brutalist sharp edges */
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 3px solid var(--border-color);
    color: var(--text-primary);
    overflow: hidden;
}

/* Lime/moss accent for projects - nature taking over technology */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--accent-warm), var(--primary-color), var(--secondary-color));
}

.project-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.5);
    border-color: var(--accent-warm);
}

.project-card h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    text-wrap: balance;
}

.project-card .project-meta {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-link:hover {
    color: var(--primary-hover);
}

/* subtle hover overlay on cards (adds polish) */
.blog-card::after, .taxonomy-item::after, .project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    pointer-events: none;
    /* very subtle highlight line at top to keep cards feeling tactile */
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.blog-card:hover::after, .taxonomy-item:hover::after, .project-card:hover::after {
    /* keep overlay subtle even on hover */
    opacity: 0.6;
}

/* Respect users who prefer reduced motion: remove tilts/lifts */
@media (prefers-reduced-motion: reduce) {
    .tilt, .blog-card, .project-card, .taxonomy-item {
        transition: none !important;
        transform: none !important;
        will-change: auto !important;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Section Headers */
.section-divider {
    border-top: 2px solid var(--border-color);
    margin: 3rem 0;
}

.section-title {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.75rem;
    text-wrap: balance;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    /* Expand to match the visual width of the card grid. Keep padding on small viewports. */
    width: calc(100% - var(--space-4));
    max-width: 1100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-warm));
    border-radius: 2px;
}

/* Footer */
.site-footer {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    padding: var(--space-8) 0;
    margin-top: var(--space-12);
    border-top: 1px solid var(--border-color);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.social-links a:hover {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-3);
    }

    .hero {
        padding: var(--space-12) 0 var(--space-8);
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-subtitle {
        font-size: var(--text-lg);
    }

    .hero-description {
        font-size: var(--text-base);
    }

    .nav-menu {
        gap: var(--space-4);
    }

    .theme-toggle {
        width: 52px;
        height: 52px;
        padding: var(--space-2);
    }

    .theme-toggle svg {
        width: 32px;
        height: 32px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .featured {
        padding: var(--space-8) 0;
    }

    .page-header h1 {
        font-size: var(--text-3xl);
    }

    .page-content {
        font-size: var(--text-base);
    }

    .site-footer .container {
        flex-direction: column;
        text-align: center;
        gap: var(--space-4);
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    z-index: 1002;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: nowrap;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 3;
        margin-left: auto;
    }

    .logo {
        order: 1;
        margin-right: auto;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: stretch;
        padding: 80px var(--space-6) var(--space-6);
        gap: var(--space-3);
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        order: 2;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        width: 100%;
        margin: 0;
    }

    .nav-menu a {
        display: block;
        padding: var(--space-3);
        font-size: var(--text-base);
        border-bottom: none;
        border-left: 3px solid transparent;
        width: 100%;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        border-bottom: none;
        border-left-color: var(--primary-color);
        background: var(--bg-color);
    }

    body.menu-open {
        overflow: hidden;
    }

    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: var(--text-lg);
        gap: var(--space-2);
    }

    .profile-photo {
        width: 36px;
        height: 36px;
    }

    .mobile-menu-toggle {
        padding: var(--space-1);
    }

    .mobile-menu-toggle span {
        width: 24px;
    }

    .navbar .container {
        gap: var(--space-2);
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .blog-grid {
        gap: var(--space-3);
    }
}

/* ============================================
   SYNTAX HIGHLIGHTING - Green/Grey Theme
   ============================================ */

/* Chroma syntax highlighting base */
 .chroma {
     background-color: #1f2937; /* slate-800 */
     border-radius: var(--radius-md);
     padding: 0;
     overflow-x: auto;
     border: 1px solid #374151; /* slate-700 */
     box-shadow: var(--shadow-md);
 }

 .chroma code {
     background: transparent !important;
     border: none !important;
     padding: 0 !important;
 }

 /* Line numbers */
 .chroma .lnt, .chroma .ln {
     color: #9ca3af; /* gray-400 */
     margin-right: 0;
     user-select: none;
     font-size: 0.8rem;
 }

 /* Tighten line number gutter spacing */
 .chroma .lntable {
     width: 100%;
     border-collapse: collapse;
     margin: 0;
     padding: 0;
 }

 .chroma .lntd {
     margin: 0;
     padding: 0;
     vertical-align: top;
 }

 .chroma .lntd:first-child {
     width: 2rem; /* narrower gutter */
     padding: 0.25rem 0.5rem;
     background-color: #111827; /* gray-900 */
 }

 .chroma .lntd:last-child {
     padding: 0.25rem 0.75rem;
 }

 /* Code font compactness */
 .chroma pre, .chroma code {
     font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
     font-size: 0.875rem;
     line-height: 1.4;
     padding: 0;
     margin: 0;
 }
 
 .chroma .lntable pre {
     padding: 0;
     margin: 0;
 }

 /* Copy button - subtle icon style */
 .code-copy-btn {
     position: absolute;
     top: 8px;
     right: 8px;
     background: transparent;
     color: #6b7280;
     border: none;
     border-radius: 0;
     font-size: 1rem;
     padding: 0;
     cursor: pointer;
     width: 24px;
     height: 24px;
     display: flex;
     align-items: center;
     justify-content: center;
     opacity: 0.6;
     transition: opacity 0.2s ease, color 0.2s ease;
 }
 
 .code-copy-btn:hover {
     opacity: 1;
     color: #e5e7eb;
 }
 
 .code-copy-btn.copied {
     color: #10b981;
 }

 /* Positioning context for copy button */
 .chroma {
     position: relative;
 }

/* Keywords - emerald green */
.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, 
.chroma .kp, .chroma .kr, .chroma .kt {
    color: var(--primary-color);
    font-weight: 600;
}

/* Strings - warm amber/gold */
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, 
.chroma .sc, .chroma .dl, .chroma .sd {
    color: var(--accent-warm);
}

/* Numbers - lighter emerald */
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, 
.chroma .mi, .chroma .il, .chroma .mo {
    color: var(--secondary-color);
}

/* Functions - teal/cyan green */
.chroma .n, .chroma .na, .chroma .nb, .chroma .nc, 
.chroma .nf, .chroma .fm, .chroma .nn {
    color: var(--info);
}

/* Comments - muted grey */
.chroma .c, .chroma .c1, .chroma .cm, .chroma .cp, 
.chroma .cpf, .chroma .cs, .chroma .ch {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Operators - light grey */
.chroma .o, .chroma .ow {
    color: var(--text-secondary);
}

/* Variables - primary text */
.chroma .nv, .chroma .vc, .chroma .vg, .chroma .vi, .chroma .vm {
    color: var(--text-primary);
}

/* Classes - green accent */
.chroma .nd, .chroma .ni, .chroma .ne, .chroma .nl {
    color: var(--primary-color);
    font-weight: 600;
}

/* Built-ins - teal */
.chroma .bp {
    color: var(--info);
}

/* Errors - keep red */
.chroma .err {
    color: var(--error);
}

/* Generic - text color */
.chroma .g, .chroma .gd, .chroma .ge, .chroma .gr, 
.chroma .gh, .chroma .gi, .chroma .go, .chroma .gp, 
.chroma .gs, .chroma .gu, .chroma .gt {
    color: var(--text-secondary);
}

/* Highlight current line */
.chroma .hl {
    background-color: rgba(16, 185, 129, 0.12); /* emerald highlight */
    display: block;
}

/* Visitor Tracker Ticker Styles */
.visitor-ticker-container {
    background-color: #000;
    border-bottom: 1px solid #1a1a1a;
    overflow: hidden;
    position: relative;
    z-index: 50;
    padding: 4px 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.visitor-ticker-container.show {
    opacity: 1;
}

.visitor-ticker-track {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    white-space: nowrap;
    animation: scroll-left 40s linear infinite;
    animation-play-state: running;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.visitor-ticker-container:hover .visitor-ticker-track {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.visitor-ticker-item {
    display: inline-block;
    color: #ffeb3b;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    padding: 0 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.visitor-ticker-separator {
    color: #555;
    font-weight: 300;
    margin: 0 4px;
}

/* Highlight first/welcome item */
.visitor-ticker-item:first-child {
    color: #ffeb3b;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 235, 59, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .visitor-ticker-track {
        padding: 0 8px;
        animation: scroll-left 50s linear infinite;
    }
    
    .visitor-ticker-item {
        font-size: 10px;
        padding: 0 2px;
    }
}
