:root {
    /* Light Mode Colors - Refined "Soft Silver" Palette */
    --bg-primary: #f0f0f2;      /* Light gray background (was #ffffff) */
    --bg-secondary: #e4e4e7;    /* Darker gray for badges/hover (was #f4f4f5) */
    --text-primary: #18181b;    /* Kept soft black */
    --text-secondary: #52525b;  /* Kept dark gray */
    --border-color: #d4d4d8;    /* Slightly darker border for definition */
    --accent-color: #18181b;
    --accent-text: #ffffff;
    --card-bg: #fafafa;         /* Off-white cards (was #ffffff) */
    
    /* Grid Pattern */
    --grid-color: rgba(0, 0, 0, 0.07);
    
    /* Rack Aesthetic */
    --rack-rail: #d4d4d8;
    --led-green: #22c55e;
    --led-blue: #3b82f6;
    --led-amber: #f59e0b;
    --metal-texture: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent 2px,
        rgba(0,0,0,0.05) 2px,
        rgba(0,0,0,0.05) 4px
    );
    
    /* Typography Scale - Responsive with clamp() */
    --fs-h1: clamp(2rem, 5vw + 1rem, 3.5rem);           /* Hero titles: 2rem mobile → 3.5rem desktop */
    --fs-h2: clamp(1.5rem, 2.5vw + 0.5rem, 2rem);      /* Section titles: 1.5rem mobile → 2rem desktop */
    --fs-subtitle: clamp(1.25rem, 2vw + 0.5rem, 1.5rem); /* Hero subtitles: 1.25rem mobile → 1.5rem desktop */
    --fs-h3: clamp(1.1rem, 1.5vw + 0.5rem, 1.35rem);     /* Card titles: 1.1rem mobile → 1.35rem desktop */
    --fs-body: clamp(0.95rem, 0.5vw + 0.85rem, 1rem);    /* Body text: 0.95rem mobile → 1rem desktop */
    --fs-small: clamp(0.8rem, 0.3vw + 0.7rem, 0.875rem); /* Small text: 0.8rem mobile → 0.875rem desktop */
    --fs-xs: clamp(0.7rem, 0.2vw + 0.6rem, 0.75rem);     /* Extra small: 0.7rem mobile → 0.75rem desktop */

    --nav-offset-gap: 220px;
    --nav-anchor-align: 0.4;
}

[data-theme="dark"] {
    /* Dark Mode Colors - Softened "Server Room" Palette */
    --bg-primary: #0a0a0c;      /* Darker, server room floor */
    --bg-secondary: #18181b;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --border-color: #27272a;
    --accent-color: #f4f4f5;
    --accent-text: #09090b;
    --card-bg: #131315;
    
    /* Grid Pattern */
    --grid-color: rgba(255, 255, 255, 0.03);
    --rack-rail: #3f3f46;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-offset-gap, 80px);
}

/* Respect user's motion preferences */
@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;
    }
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography for "Cloud/Tech" Vibe */
.mono-font, .tags span, .exp-date {
    font-family: 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Menlo', 'Courier New', monospace;
    letter-spacing: -0.02em;
}

/* Fixed Badge - clearer font */
.badge {
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    /* ... rest of badge styles handled below ... */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ... (rest of CSS) ... */

/* Server Rack Motion & Animations - CLEAN & PROFESSIONAL */

/* 1. Smooth Fade Up (No flicker, no snap) */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Gentle Pulse (Breathing Light) */
@keyframes pulseBreath {
    0% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.4; transform: scale(0.95); }
}

.card {
    /* ... existing styles ... */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    /* ... */
    opacity: 0; /* Hidden by default until scroll */
    /* Animation handled by JS adding classes */
}

/* Clean Entry Animation */
.card.powered-on {
    animation: fadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card.powered-on {
        animation: none;
        opacity: 1;
    }
    
    .badge::before {
        animation: none;
    }
    
    .project-card::before {
        animation: none;
    }
}

/* STATUS LED STRIP - PROJECTS ONLY */
/* Remove generic card::before to clean up UI */
.card::before {
    display: none;
}

/* Only Project Cards get the 'Service Status' indicator */
.project-card::before {
    content: '';
    display: block;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--led-green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    /* Gentle Pulse */
    animation: pulseBreath 4s ease-in-out infinite;
}

/* Background Static Noise - REMOVED for cleaner look */
.grid-background::after {
    display: none;
}

/* Rack Rails - Simplified (No texture, just subtle line) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    /* Removed heavy borders and texture */
    background: transparent; 
}

/* Remove mounting holes */
.container::before, .container::after {
    display: none;
}

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

/* Background Grid */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--bg-primary), 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 1.8vw + 0.5rem, 1.75rem);
    letter-spacing: -0.05em;
    text-decoration: none;
    color: var(--text-primary);
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-brand-logo {
    height: 1.1em;
    width: auto;
    display: block;
    transition: filter 0.3s ease, opacity 0.2s;
    object-fit: contain;
    vertical-align: middle;
}

/* Light mode: navbar logo should be dark */
[data-theme="light"] .nav-brand-logo {
    filter: brightness(0); /* Makes white logo black in light mode */
}

/* Dark mode: navbar logo should be white */
[data-theme="dark"] .nav-brand-logo {
    filter: none; /* Keep white logo as is in dark mode */
}

/* Footer Logo */
.footer-logo {
    height: 2.5rem;
    width: auto;
    display: block;
    transition: filter 0.3s ease, opacity 0.2s;
    opacity: 0.7;
}

.footer-logo:hover {
    opacity: 1;
}

/* Light mode: footer logo should be dark */
[data-theme="light"] .footer-logo {
    filter: brightness(0); /* Makes white logo black in light mode */
}

/* Dark mode: footer logo should be white */
[data-theme="dark"] .footer-logo {
    filter: none; /* Keep white logo as is in dark mode */
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-secondary);
}

/* Accessibility: Focus states */
.icon-btn:focus-visible,
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--led-blue);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Skip to main content link (hidden until focused) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000;
    border: 2px solid var(--led-blue);
    opacity: 0;
    pointer-events: none;
}

.skip-link:focus {
    top: 0;
    opacity: 1;
    pointer-events: auto;
}

/* Theme Toggle Logic */
.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* Nav Controls Container */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Section progress (navbar) */
/* Section progress (top of page) */
.nav-progress {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--nav-offset, 0px) - 1px);
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: 120;
}

.nav-progress-bar {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.nav-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--scroll-progress, 0%);
    height: 100%;
    background: var(--text-primary);
    transition: width 0.2s ease;
}

/* Language Switcher */
.lang-switcher {
    position: relative;
}

#lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
}

#lang-toggle .current-lang {
    font-size: var(--fs-xs);
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: var(--fs-small);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.lang-dropdown .fi {
    flex-shrink: 0;
    margin-right: 0.5rem;
    border-radius: 2px;
}

.lang-dropdown button:hover {
    background: var(--bg-secondary);
}

.lang-dropdown button[data-lang].active {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* Cards (Squared Design) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Server Rack Motion */
    animation: slotIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    position: relative;
    overflow: hidden;
}

/* Hover: Server Bezel Glow moved to main card definition above */


/* Asset/Download Card Styles */
.asset-card {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.asset-card h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.asset-card h3 i {
    width: 20px;
    height: 20px;
}

.asset-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.asset-download-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--accent-primary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.asset-download-button i {
    width: 18px;
    height: 18px;
}

/* Image Caption Styles */
.hardware-image-caption {
    color: var(--text-secondary);
    font-style: italic;
    text-align: left;
    flex: 1;
    margin: 0;
}

/* Node card captions keep light color (dark backgrounds don't change with theme) */
.node-card .hardware-image-caption {
    color: rgba(255, 255, 255, 0.5);
}

.project-image-caption {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .hardware-image-caption {
        text-align: center;
    }
}

/* Lab Badge - Server Type Badge */
.lab-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(29, 78, 216, 0.2) !important;
    border: 1px solid rgba(29, 78, 216, 0.6) !important;
    border-color: rgba(29, 78, 216, 0.6) !important;
    color: #1e3a8a !important;
    font-size: var(--fs-xs);
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lab-badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #2563eb !important;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.8);
    animation: pulse 2s infinite;
}

[data-theme="dark"] .lab-badge {
    background: rgba(56, 189, 248, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.5) !important;
    color: #7dd3fc !important;
}

[data-theme="dark"] .lab-badge::before {
    background-color: #38bdf8 !important;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* MVP Badge - Orange Badge Style */
.mvp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(245, 158, 11, 0.2) !important;
    border: 1px solid rgba(245, 158, 11, 0.6) !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    color: #d97706 !important;
    font-size: var(--fs-xs);
    font-weight: 600;
    margin-bottom: 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mvp-badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #f59e0b !important;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
    animation: pulse 2s infinite;
}

[data-theme="dark"] .mvp-badge {
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.5) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .mvp-badge::before {
    background-color: #fbbf24 !important;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

/* Hero Section - Bento Grid */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.5rem;
    margin-top: 6rem;
    margin-bottom: 4rem;
}

.hero-text {
    grid-column: 1 / 6;
    grid-row: 1 / 3;
    justify-content: center;
    padding: 2rem;
    align-items: flex-start;
}

.hero-image {
    grid-column: 6 / 9;
    grid-row: 1 / 3;
    padding: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.profile-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center top;
    /* Removed grayscale filter */
    transition: transform 0.3s;
    border-radius: 4px;
}

.hero-image:hover .profile-img {
    transform: scale(1.02);
}

.stat-box {
    grid-column: span 2;
    grid-row: 3;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    min-height: 120px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.stat-box:hover {
    transform: translateY(-2px);
    border-color: var(--text-primary);
}

.stat-box i {
    width: 32px;
    height: 32px;
    color: var(--accent-primary, var(--led-blue));
    margin-bottom: 0.25rem;
}

.stat-box h3 {
    font-size: var(--fs-h3);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.stat-box p {
    font-size: var(--fs-small);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.stat-box:nth-child(3) {
    grid-column: 1 / 3;
}

.stat-box:nth-child(4) {
    grid-column: 3 / 5;
}

.stat-box:nth-child(5) {
    grid-column: 5 / 7;
}

.stat-box:nth-child(6) {
    grid-column: 7 / 9;
}

/* Square-ish screens: keep stats compact so the hero doesn't feel bulky */
@media (max-aspect-ratio: 4/3) and (min-width: 769px) {
    .hero-grid {
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-text {
        padding: 1.5rem;
    }

    .stat-box {
        padding: 0.9rem 0.75rem;
        min-height: 96px;
    }

    .stat-box i {
        width: 24px;
        height: 24px;
        margin-bottom: 0.2rem;
    }

    .stat-box h3 {
        font-size: var(--fs-body);
    }

    .stat-box p {
        font-size: var(--fs-xs);
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-size: var(--fs-xs);
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.score-badge {
    font-size: var(--fs-xs);
    background: #22c55e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
    display: inline-block;
}

.badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #10b981; /* Emerald Green Status Light */
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

h1 {
    font-size: var(--fs-h1);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: var(--fs-subtitle);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0.5rem;
}

/* Project Page Subtitle - Balanced with content */
.project-title-group .subtitle {
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Project Page Common Styles */
.project-hero {
    padding: 2.5rem 0 1.5rem;
    margin-bottom: 0.5rem;
}

.project-meta-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 0.5rem;
}

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

.project-sidebar .card {
    position: sticky;
    top: 100px;
}

.tech-stack-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.tech-stack-list li i {
    color: var(--accent-primary);
    width: 18px;
    height: 18px;
}

.skill-list {
    list-style-type: square;
    padding-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.skill-list li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: var(--fs-small);
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-secondary);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

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

/* Project Article Styles */
article h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

article p, article li {
    font-size: var(--fs-body);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

/* Project Certifications Section */
.project-certifications {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.project-cert-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    font-size: var(--fs-small);
}

.project-cert-badge:hover {
    border-color: var(--accent-primary);
    background: var(--surface-secondary);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.project-cert-badge img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.project-cert-name {
    font-weight: 500;
    font-size: var(--fs-small);
    color: var(--text-primary);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .project-certifications {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    .project-cert-badge {
        padding: 0.3rem 0.5rem;
        margin-right: 0;
        margin-bottom: 0;
        flex: 0 1 auto;
        max-width: 100%;
        white-space: normal !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .project-cert-badge img {
        width: 28px;
        height: 28px;
    }
    
    .project-cert-name {
        white-space: normal !important;
        word-wrap: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

/* Project Page Common Components */
.accent-icon {
    color: var(--accent-primary);
}

.hardware-showcase {
    display: grid;
    gap: 1.25rem;
    margin: 2rem 0;
}

/* Image Modal/Lightbox */
.image-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.3s ease;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.95);
}

.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0);
    cursor: default;
    display: block;
    transform: scale(0.9);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-modal.active .image-modal-content {
    transform: scale(1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    opacity: 0;
    transform: scale(0.8);
}

.image-modal.active .image-modal-close {
    opacity: 1;
    transform: scale(1);
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.image-modal-close i {
    width: 20px;
    height: 20px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}


.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: 1px solid var(--text-primary);
    transition: all 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

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

.btn.primary:hover {
    background: transparent;
    color: var(--text-primary);
}

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
}

.btn.secondary:hover {
    background: var(--bg-secondary);
}

/* Section Styles */
.section-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 4rem;
}

/* Ensure experience section grid has equal column widths */
#experience.section-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Certifications section: keep a clean 2-column grid on desktop */
#certifications.section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Medium Desktop / 14-inch laptops (1201px - 1600px) */
@media (min-width: 1201px) and (max-width: 1600px) {
    .section-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    #certifications.section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    /* Projects section: 2x2 layout */
    #projects.section-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    #projects .project-card {
        grid-column: span 2;
    }
    
    .skill-category {
        padding: 1rem;
    }
    
    /* Typography uses scale variables - no override needed */
    
}

/* Tablet / Smaller Desktop (769px - 1200px) */
@media (min-width: 769px) and (max-width: 1200px) {
    .section-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    #certifications.section-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .skill-category {
        padding: 1rem;
        min-height: fit-content;
    }
    
    .skill-header {
        margin-bottom: 0.75rem;
    }
    
    .skill-header i {
        width: 16px;
        height: 16px;
    }
    
    .skill-list li {
        line-height: 1.5;
    }
    
    /* Ensure project cards also use 2 columns on tablet */
    .project-card {
        grid-column: span 1;
    }
    
    /* Hero section adjustments for tablet */
    .hero-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.25rem;
    }
    
    .hero-text {
        grid-column: 1 / 5;
        padding: 2rem 1.5rem;
    }
    
    .hero-image {
        grid-column: 5 / 7;
    }
    
    .stat-box {
        grid-column: span 2;
    }
    
    .stat-box:nth-child(3) {
        grid-column: 1 / 3;
        grid-row: 3;
    }
    
    .stat-box:nth-child(4) {
        grid-column: 3 / 5;
        grid-row: 3;
    }
    
    .stat-box:nth-child(5) {
        grid-column: 1 / 3;
        grid-row: 4;
    }
    
    .stat-box:nth-child(6) {
        grid-column: 3 / 5;
        grid-row: 4;
    }
}

.section-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: var(--fs-h2);
    white-space: nowrap;
}

.section-header .line {
    height: 1px;
    background: var(--border-color);
    width: 100%;
}

/* About Specifics */
.about-content {
    grid-column: 1 / -1;
    font-size: var(--fs-body);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.about-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.about-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.about-item p {
    margin: 0;
    line-height: 1.6;
    max-width: 75ch;
}

.about-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.about-fact {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.about-fact i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.about-fact-title {
    margin: 0 0 0.5rem;
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

.about-facts .tags span {
    font-size: var(--fs-xs);
    padding: 0.2rem 0.45rem;
}

.about-facts .tags {
    gap: 0.4rem;
}

.about-image {
    grid-column: span 1;
    padding: 0;
    overflow: hidden;
}

.profile-img-small {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Removed grayscale filter */
}

/* Skills Section - Optimized for Large Screens (3-column layout) */
#skills.section-grid {
    /* Base: inherits 4-column from .section-grid, overridden by media queries */
    align-items: stretch; /* Ensure cards have equal height */
}

.skill-capability {
    grid-column: span 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    min-height: 0; /* Allow flex items to shrink if needed */
}

.skill-capability:hover {
    transform: translateY(-2px);
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.skill-header h3 {
    font-size: var(--fs-h3);
    margin: 0;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.3;
}

.skill-header i {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.skill-description {
    color: var(--text-secondary);
    font-size: var(--fs-body);
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

.skill-highlights {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    margin-top: 0.5rem;
}

.skill-highlights li {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: var(--fs-small);
    line-height: 1.5;
    padding-left: 1.25rem;
    position: relative;
}

.skill-highlights li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-primary);
    font-weight: 600;
    font-size: var(--fs-small);
}

/* Desktop (≥1280px) - 3-column layout, one card per column */
@media (min-width: 1280px) {
    #skills.section-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .skill-capability {
        grid-column: span 1;
        padding: 2.25rem;
    }
    
    .skill-description {
        line-height: 1.65;
    }
}

/* Tablet (769px - 1024px) - 2-column layout */
@media (min-width: 769px) and (max-width: 1024px) {
    #skills.section-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .skill-capability {
        grid-column: span 1;
        padding: 1.75rem;
    }
}

/* Small Tablet (1025px - 1279px) - 2-column layout with adjusted spacing */
@media (min-width: 1025px) and (max-width: 1279px) {
    #skills.section-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .skill-capability {
        grid-column: span 1;
        padding: 2rem;
    }
}

/* Mobile (≤768px) - Full width stack */
@media (max-width: 768px) {
    #skills.section-grid {
        grid-template-columns: 1fr;
    }
    
    .skill-capability {
        grid-column: span 1;
        padding: 1.5rem;
    }

    .about-facts {
        grid-template-columns: 1fr;
    }

    .about-fact-title {
        font-size: var(--fs-body);
    }

    .about-facts .tags span {
        font-size: var(--fs-small);
        padding: 0.25rem 0.55rem;
    }

    #certifications.section-grid {
        grid-template-columns: 1fr;
    }
}

/* Experience & Certifications Combined Section */
.section-grid .section-header:not(:first-child) {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Projects */
.project-card {
    grid-column: span 2; /* 2 wide per row on 4-column grid */
    border-left-width: 4px; /* Rack handle */
    text-decoration: none;
    color: inherit;
}

/* Override for tablet - ensure projects display side by side */
@media (min-width: 769px) and (max-width: 1200px) {
    #projects .project-card {
        grid-column: span 1 !important;
    }
}

.project-card-link {
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.project-card-link:hover {
    transform: translateY(-2px);
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


.project-card-link:hover .project-cta {
    color: var(--text-primary);
    gap: 0.75rem;
}

.project-card-link:hover .project-cta i {
    transform: translateX(4px);
}

/* Removed alternating status lights for cleaner professional look */

.project-icon {
    margin-bottom: 1rem;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    /* Removed metal texture */
}

.project-desc {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: var(--fs-body);
    flex-grow: 1;
}

.project-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--fs-body);
    transition: color 0.2s, gap 0.2s;
}

.project-cta i {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    font-size: var(--fs-xs);
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
}

/* Experience */
.experience-card {
    grid-column: span 4;
    display: grid;
    grid-template-columns: 240px 1fr;
    align-items: start;
    gap: 0 2rem; /* Remove row gap, control via margins */
}

.experience-card .exp-date {
    grid-column: 1;
    grid-row: 1 / span 3; /* Span vertically */
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--fs-body);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.experience-card .exp-date img {
    width: 120px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.experience-card .exp-date span {
    white-space: nowrap;
}

.experience-card h3 {
    grid-column: 2;
    margin-bottom: 0.25rem;
}

.experience-card h4 {
    grid-column: 2;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.experience-card p {
    grid-column: 2;
    margin: 0;
}

/* Certifications */
#certifications-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    grid-column: 1 / -1;
    width: 100%;
    min-height: 100px;
    visibility: visible !important;
    opacity: 1 !important;
}

.cert-card {
    grid-column: span 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    text-align: left;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    min-height: 80px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Ensure cert cards display in a clean grid inside the certifications section */
#certifications .cert-card {
    grid-column: span 1;
    width: 100%;
    max-width: 100%;
}

.cert-info {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.cert-info h3 {
    margin-bottom: 0.25rem;
    font-size: var(--fs-body);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cert-status {
    font-size: var(--fs-small);
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Removed duplicate - using .cert-info h3 and .cert-status instead */

.cert-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    flex-shrink: 0;
}

.cert-icon i {
    width: 24px;
    height: 24px;
    color: var(--accent-primary, var(--led-blue));
}

.cert-badge-img {
    width: 100%;
    height: 100%;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-primary);
    padding: 4px;
    box-sizing: border-box;
}

.cert-logo {
    width: 100%;
    height: 100%;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    border-radius: 8px;
    padding: 4px;
    box-sizing: border-box;
}

.cert-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-icon-fallback i {
    width: 32px;
    height: 32px;
    color: #8b5cf6;
}

/* Arηs logo light mode inversion */
html[data-theme="light"] img.arns-logo-light-mode {
    filter: invert(1);
}

/* Duplicate removed - using styles defined above */

/* Contact */
.contact-card {
    grid-column: span 4;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
}

.contact-links {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.contact-item:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.contact-card {
    overflow: visible;
}

.cv-dropdown {
    position: relative;
    display: inline-flex;
}

.cv-dropdown-toggle {
    cursor: pointer;
    background: transparent;
}

.cv-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

.cv-dropdown.open .cv-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.cv-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.cv-dropdown-item:hover,
.cv-dropdown-item:focus {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

    /* Responsive Adjustments for "Rack" Feel */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Remove Side Rails to save width on mobile */
    .container {
        padding: 1rem; /* Less padding */
        border-left: none;
        border-right: none;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .container::before, .container::after {
        display: none; /* Hide mounting holes on mobile */
    }

    .section-grid {
        display: flex;
        flex-direction: column;
        gap: 1.25rem; /* Consistent spacing */
    }

    .card {
        padding: 1.25rem; /* Compact padding */
        min-height: auto; /* Allow content to dictate height */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* Prevent text overflow on all text elements */
    h1, p, h2, h3, h4, span, a, li {
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .hero-text .badge {
        margin-bottom: 1rem;
        padding: 0.2rem 0.6rem;
    }

    .hero-text h1 {
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }

    .hero-text .subtitle {
        line-height: 1.5;
        margin-bottom: 1.25rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.25rem;
    }

    /* Hero Section - Optimized Grid Layout for Mobile */
    .hero-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 1rem;
        margin-top: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Hero Image - Full width, first row */
    .hero-image {
        grid-column: 1 / -1;
        grid-row: 1;
        height: 380px;
        min-height: 380px;
        border-left-width: 4px;
        padding: 0.75rem;
    }
    
    .hero-image .profile-img {
        object-position: center top;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Hero Text - Full width, second row */
    .hero-text {
        grid-column: 1 / -1;
        grid-row: 2;
        padding: 1.75rem 1.25rem;
    }
    
    .stat-box {
        padding: 1rem;
        min-height: auto;
        order: 0;
    }
    
    .stat-box:nth-child(3) {
        grid-column: 1;
        grid-row: 3;
    }
    
    .stat-box:nth-child(4) {
        grid-column: 2;
        grid-row: 3;
    }
    
    .stat-box:nth-child(5) {
        grid-column: 1;
        grid-row: 4;
    }
    
    .stat-box:nth-child(6) {
        grid-column: 2;
        grid-row: 4;
    }

    .stat-box i {
        width: 28px;
        height: 28px;
    }

    .stat-box h3 {
        margin: 0.4rem 0;
    }

    /* Stack everything like 1U units */
    .project-card, .skill-category {
        width: 100%;
    }
    
    /* Fix Experience Card on Mobile */
    .experience-card {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .experience-card .exp-date {
        margin-bottom: 0.25rem;
        color: var(--text-secondary); /* Consistent with design language */
    }
    
    .experience-card .exp-date span {
        color: var(--text-secondary); /* Use normal text color */
    }

    /* Fix Cert Cards on Mobile */
    #certifications-list {
        grid-template-columns: 1fr;
    }

    .cert-card {
        grid-column: span 1;
    }

    /* Mobile Top Nav - Fixed and Visible */
    .navbar {
        padding: 0.75rem 1rem;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        background: rgba(var(--bg-primary), 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .nav-brand {
        /* Typography uses scale variables - no override needed */
        z-index: 101;
    }
    
    .nav-brand-logo {
        height: 1em; /* Match text height on mobile too */
    }
    
    .nav-links {
        display: none; /* Hide desktop links */
    }
    
    .nav-controls {
        position: relative;
        right: auto;
        top: auto;
        gap: 0.5rem;
        display: flex;
        align-items: center;
    }

    .nav-progress {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        height: 2px;
        background: var(--border-color);
        z-index: 1001;
    }

    .nav-progress-bar {
        width: 100%;
        height: 100%;
    }
    
    /* Language toggle uses type scale - no override needed */
    
    .lang-dropdown {
        right: 0;
        min-width: 140px;
    }
    
    /* Add padding to main container to account for fixed navbar */
    .container {
        padding-top: 4.5rem; /* Space for fixed navbar */
    }
    
    /* MOBILE BOTTOM NAV BAR */
    body::after {
        content: ''; /* Placeholder for bottom spacer */
        display: block;
        height: 80px;
    }

    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        background: rgba(var(--bg-secondary), 0.9);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 0.75rem 1.5rem;
        border-radius: 2rem;
        justify-content: space-between;
        align-items: center;
        border: 1px solid var(--border-color);
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
        z-index: 1000;
        animation: slideUp 0.5s ease-out 0.5s backwards;
    }

    @keyframes slideUp {
        from { transform: translate(-50%, 100%); opacity: 0; }
        to { transform: translate(-50%, 0); opacity: 1; }
    }

    .contact-links {
        flex-direction: column;
        width: 100%;
    }
    
    .contact-item {
        width: 100%;
        justify-content: center;
    }
}

/* Certification Level Badges for Index Page */
/* .cert-level typography moved to unified scale section above */

.level-advanced {
    color: #dc2626;
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.level-intermediate {
    color: #2563eb;
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.level-beginner {
    color: #059669;
    border-color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border: 1px solid #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* Compact Top Certification Showcase */
.top-certification-compact {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s;
}

.top-certification-compact:hover {
    border-color: var(--text-primary);
}

.top-cert-compact-badge {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.top-cert-compact-info {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.top-cert-compact-details h4 {
    font-size: var(--fs-h3);
    margin-bottom: 0.25rem;
    font-family: 'Space Grotesk', sans-serif;
}

.top-cert-compact-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

.top-cert-compact-actions {
    display: flex;
    gap: 0.5rem;
}

.see-more-btn {
    padding: 0.5rem 1rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: var(--fs-small);
}

.see-more-btn:hover {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.see-more-btn i {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .top-certification-compact {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .top-cert-compact-info {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .top-cert-compact-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Desktop Only: Hide Mobile Nav */
.mobile-nav {
    display: none;
}


/* Footer */
footer {
    margin-top: 4rem;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    font-size: var(--fs-small);
}

/* ============================================
   Page-Specific Typography (Unified Scale)
   ============================================ */

/* Projects & Certifications Page Hero */
.projects-hero h1,
.certifications-hero h1 {
    font-size: var(--fs-h1);
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.projects-hero .subtitle,
.certifications-hero .subtitle {
    font-size: var(--fs-subtitle);
    color: var(--text-secondary);
}

/* Project Page Title */
.project-title-group h1 {
    font-size: var(--fs-h1);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Stats Box Typography */
.stats-row .stat-box h3 {
    font-size: var(--fs-h2);
    margin-bottom: 0.25rem;
}

.stats-row .stat-box p {
    font-size: var(--fs-small);
    color: var(--text-secondary);
    margin: 0;
}

/* Filter Buttons */
.filter-button,
.filter-btn {
    font-size: var(--fs-small);
    font-weight: 500;
    font-family: 'Space Grotesk', sans-serif;
}

.category-filter-option label {
    font-size: var(--fs-small);
    color: var(--text-primary);
}

/* Project/Certification List Items */
.project-name,
.cert-name {
    font-size: var(--fs-h3);
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
}

.project-meta,
.cert-meta {
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

.project-category,
.cert-category,
.cert-level,
.project-status-badge {
    font-size: var(--fs-xs);
    font-weight: 600;
}

/* Modal Typography */
.modal-header h2 {
    font-size: var(--fs-h2);
    margin-bottom: 0.75rem;
}

.modal-description {
    font-size: var(--fs-body);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.skill-tag {
    font-size: var(--fs-small);
}

/* Badge Typography */
.score-badge {
    font-size: var(--fs-xs);
    font-weight: 600;
}

.mvp-badge {
    font-size: var(--fs-small);
    font-weight: 600;
}

.category-count {
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

/* Node Card Typography (Project Pages) */
.node-card h3 {
    font-size: var(--fs-h3);
    font-family: 'Space Grotesk', sans-serif;
}

.node-card p {
    font-size: var(--fs-body);
    line-height: 1.5;
}

.node-spec {
    font-family: 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Menlo', 'Courier New', monospace;
}

.node-detail {
    font-size: var(--fs-small);
    font-family: 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Menlo', 'Courier New', monospace;
}

.node-tags {
    font-size: var(--fs-xs);
    font-family: 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Menlo', 'Courier New', monospace;
}

.hardware-image-caption {
    font-size: var(--fs-xs);
    line-height: 1.5;
}

.sidebar-description {
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

/* ==========================================
   Skills: Compact Stack Layout
   ========================================== */

.skills-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.skill-stack-card {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skill-stack-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-stack-header i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.skill-stack-header h3 {
    margin: 0;
    font-size: var(--fs-h3);
}

.skill-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-chip {
    font-size: var(--fs-xs);
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    letter-spacing: 0.01em;
}

@media (max-width: 1200px) {
    .skills-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* ==========================================
   SEARCH MODAL
   ========================================== */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    overflow-y: auto;
}

.search-modal.active {
    display: flex;
}

.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
    margin-bottom: 10vh;
}

/* ==========================================
   CV MODAL (MOBILE)
   ========================================== */

.cv-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10vh 1rem 1rem;
    overflow-y: auto;
}

.cv-modal.active {
    display: flex;
}

.cv-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.cv-modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    z-index: 10000;
    animation: slideDown 0.25s ease-out;
}

.cv-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.cv-modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--fs-h3);
    margin: 0;
}

.cv-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cv-modal-close:hover,
.cv-modal-close:focus {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.cv-modal-list {
    display: grid;
    gap: 0.5rem;
    padding: 1rem;
}

.cv-modal-list .cv-dropdown-item {
    justify-content: center;
}

@media (max-width: 768px) {
    .cv-modal {
        align-items: flex-end;
        padding: 0;
    }

    .cv-modal-content {
        max-width: 100%;
        width: 100%;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-radius: 16px 16px 0 0;
        animation: cvSlideUp 0.25s ease-out;
    }

    @keyframes cvSlideUp {
        from { opacity: 0; transform: translateY(16px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: var(--fs-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    padding: 0.5rem 0;
}

#search-input::placeholder {
    color: var(--text-secondary);
}

.search-close-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.search-close-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--text-primary);
}

.search-close-btn i {
    width: 18px;
    height: 18px;
}

.search-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

.search-hint kbd {
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-family: 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', monospace;
    font-size: var(--fs-xs);
}

.search-hint-mobile {
    display: none;
    font-size: var(--fs-small);
    color: var(--text-secondary);
}

.search-results {
    max-height: 60vh;
    overflow-y: auto;
}

.search-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-empty i {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.search-empty p {
    font-size: var(--fs-body);
}

.search-no-results {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-no-results i {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.search-group {
    border-bottom: 1px solid var(--border-color);
}

.search-group:last-child {
    border-bottom: none;
}

.search-group-title {
    padding: 0.75rem 1.5rem;
    font-size: var(--fs-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.search-subgroup-title {
    padding: 0.375rem 1.5rem 0.375rem 2rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent);
    border-top: 1px solid var(--border-color);
    background: transparent;
}

.search-subgroup-title:first-child {
    border-top: none;
}

.search-result-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--bg-secondary);
    border-left: 2px solid var(--text-primary);
    padding-left: calc(1.5rem - 2px);
}

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

.search-result-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.search-result-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.search-result-badge {
    font-size: var(--fs-xs);
    padding: 0.125rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-family: 'SF Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.search-result-description {
    font-size: var(--fs-small);
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.search-result-tag {
    font-size: var(--fs-xs);
    padding: 0.125rem 0.375rem;
    background: transparent;
    border: 1px solid var(--border-color);
    font-family: 'SF Mono', monospace;
    color: var(--text-secondary);
}

/* Match highlighting */
.search-result-item mark {
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.125rem 0.25rem;
    font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .search-modal {
        padding-top: 5vh;
    }

    .search-modal-content {
        width: 95%;
        margin-bottom: 5vh;
    }

    .search-header {
        padding: 1rem;
    }

    .search-result-item {
        padding: 0.875rem 1rem;
    }

    .search-hint {
        display: none;
    }

    .search-hint-mobile {
        display: block;
        font-size: var(--fs-xs);
        line-height: 1.4;
    }
}
