/* ==========================================================================
   CSS: Modern Architecture & Design System for Daniel's Premium Portfolio
   ========================================================================== */

/* Define Cascade Layers for clean specificity and predictability */
@layer reset, base, design-system, components, layout, animations;

@layer reset {
    *, *::before, *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    html {
        scroll-behavior: smooth;
        text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }

    body {
        min-height: 100vh;
        text-rendering: optimizeSpeed;
        line-height: 1.6;
        overflow-x: hidden;
    }

    img, picture, svg, video {
        display: block;
        max-width: 100%;
        height: auto;
    }

    button, input, select, textarea {
        font: inherit;
        color: inherit;
        background: none;
        border: none;
    }

    button {
        cursor: pointer;
    }

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

    ul, ol {
        list-style: none;
    }
}

@layer base {
    :root {
        /* Color Scheme Activation */
        color-scheme: dark;

        /* Typography Tokens */
        --font-sans: 'Outfit', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
        --font-mono: 'JetBrains Mono', 'Courier New', monospace;

        /* Design Tokens Tier 1: Literal Colors (OKLCH for vivid, gamuted colors) */
        --raw-dark-bg: oklch(12% 0.015 255);
        --raw-dark-surface: oklch(16% 0.02 255);
        --raw-dark-surface-hover: oklch(20% 0.03 255);
        --raw-text-primary: oklch(95% 0.01 255);
        --raw-text-muted: oklch(75% 0.015 255);
        
        --raw-electric-purple: oklch(62% 0.22 295);
        --raw-cyber-cyan: oklch(66% 0.17 215);
        --raw-cyber-emerald: oklch(72% 0.16 145);
        --raw-neon-orange: oklch(68% 0.19 45);

        /* Design Tokens Tier 2: Semantic Colors */
        --bg-main: var(--raw-dark-bg);
        --bg-surface: var(--raw-dark-surface);
        --bg-surface-hover: var(--raw-dark-surface-hover);
        --text-color: var(--raw-text-primary);
        --text-muted: var(--raw-text-muted);

        --color-primary: var(--raw-electric-purple);
        --color-secondary: var(--raw-cyber-cyan);
        --color-accent: var(--raw-cyber-emerald);
        --color-warning: var(--raw-neon-orange);

        --border-glow: rgba(255, 255, 255, 0.07);
        --border-glow-active: rgba(147, 51, 234, 0.3);

        /* Layout & Spacing Tokens */
        --container-max-width: 1200px;
        --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
        --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.25rem);
        --space-md: clamp(1.25rem, 1rem + 1.25vw, 2.5rem);
        --space-lg: clamp(2.5rem, 2rem + 2.5vw, 5rem);
        --space-xl: clamp(5rem, 4rem + 5vw, 10rem);

        /* Transitions */
        --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    /* [Light-theme styles moved to the end of the file for unlayered cascade precedence] */


    /* Style for theme toggle button in header */
    .btn-theme-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-glow);
        color: var(--text-color);
        transition: transform var(--transition-spring), 
                    background-color var(--transition-smooth), 
                    color var(--transition-smooth);
    }

    .btn-theme-toggle:hover {
        background: rgba(255, 255, 255, 0.12);
        color: var(--color-secondary);
        transform: scale(1.08) rotate(15deg);
    }

    /* Style for language toggle button in header */
    .btn-lang-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 var(--space-xs);
        height: 38px;
        border-radius: 19px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-glow);
        color: var(--text-color);
        font-family: var(--font-sans);
        font-size: 0.85rem;
        font-weight: 600;
        text-decoration: none;
        gap: 6px;
        transition: transform var(--transition-spring), 
                    background-color var(--transition-smooth), 
                    color var(--transition-smooth);
    }

    .btn-lang-toggle:hover {
        background: rgba(255, 255, 255, 0.12);
        color: var(--color-primary);
        transform: scale(1.05);
    }



    body {
        background-color: var(--bg-main);
        color: var(--text-color);
        font-family: var(--font-sans);
        font-size: 1rem;
        overflow-y: auto;
    }

    /* Selection Highlighting */
    ::selection {
        background-color: color-mix(in oklab, var(--color-primary) 30%, transparent);
        color: var(--text-color);
    }

    /* Custom Scrollbar */
    ::-webkit-scrollbar {
        width: 10px;
    }
    ::-webkit-scrollbar-track {
        background: var(--bg-main);
    }
    ::-webkit-scrollbar-thumb {
        background: color-mix(in oklab, var(--bg-surface) 150%, transparent);
        border: 2px solid var(--bg-main);
        border-radius: 5px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: var(--color-primary);
    }

    /* Headings structure */
    h1, h2, h3, h4, h5, h6 {
        font-family: var(--font-sans);
        font-weight: 700;
        line-height: 1.15;
        letter-spacing: -0.02em;
    }

    /* Focus Management */
    :focus-visible {
        outline: 2px solid var(--color-secondary);
        outline-offset: 4px;
    }
}

@layer design-system {
    /* Layout helper containers */
    .container {
        width: 100%;
        max-width: var(--container-max-width);
        margin-inline: auto;
        padding-inline: var(--space-md);
    }

    /* Beautiful Gradients and text highlights */
    .text-gradient {
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .text-gradient-purple {
        background: linear-gradient(135deg, var(--raw-electric-purple), oklch(50% 0.2 320));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .text-gradient-blue {
        background: linear-gradient(135deg, var(--raw-cyber-cyan), oklch(50% 0.15 250));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .text-gradient-emerald {
        background: linear-gradient(135deg, var(--raw-cyber-emerald), oklch(55% 0.15 165));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .text-gradient-orange {
        background: linear-gradient(135deg, var(--raw-neon-orange), oklch(55% 0.18 15));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* Ambient Background Glows */
    .ambient-glow {
        position: fixed;
        width: clamp(200px, 30vw, 500px);
        aspect-ratio: 1;
        border-radius: 50%;
        filter: blur(120px);
        opacity: 0.15;
        pointer-events: none;
        z-index: -1;
    }

    .bg-glow-1 {
        top: 10%;
        left: -5%;
        background-color: var(--color-primary);
        animation: pulse-glow 8s infinite alternate ease-in-out;
    }

    .bg-glow-2 {
        bottom: 20%;
        right: -5%;
        background-color: var(--color-secondary);
        animation: pulse-glow 12s infinite alternate ease-in-out 2s;
    }

    .bg-glow-3 {
        top: 50%;
        left: 40%;
        background-color: var(--color-accent);
        animation: pulse-glow 10s infinite alternate ease-in-out 1s;
    }

    @keyframes pulse-glow {
        0% {
            transform: translate(0, 0) scale(1);
            opacity: 0.12;
        }
        100% {
            transform: translate(30px, 20px) scale(1.15);
            opacity: 0.22;
        }
    }

    /* Premium Glassmorphic Cards */
    .glass-card {
        background: rgba(255, 255, 255, 0.02);
        backdrop-filter: blur(16px) saturate(120%);
        -webkit-backdrop-filter: blur(16px) saturate(120%);
        border: 1px solid var(--border-glow);
        border-radius: clamp(12px, 1.5rem, 24px);
        transition: border-color var(--transition-smooth), 
                    transform var(--transition-smooth), 
                    background-color var(--transition-smooth),
                    box-shadow var(--transition-smooth);
    }

    .glass-card:hover {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.15);
        transform: translateY(-4px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }

    /* Screen reader helper */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

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

    .text-wrap-pretty {
        text-wrap: pretty;
    }

    .text-wrap-balance {
        text-wrap: balance;
    }
}

@layer components {
    /* Premium Buttons */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75em 1.75em;
        border-radius: 50px;
        font-family: var(--font-sans);
        font-weight: 600;
        font-size: clamp(0.85rem, 0.8rem + 0.35vw, 1.05rem);
        transition: transform var(--transition-spring), 
                    box-shadow var(--transition-smooth),
                    background-color var(--transition-smooth),
                    border-color var(--transition-smooth);
    }

    .btn-lg {
        padding: 0.9em 2.2em;
    }

    .btn-sm {
        padding: 0.5em 1.25em;
        font-size: 0.85rem;
    }

    .btn-primary {
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        color: #fff;
        box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    }

    .btn-primary:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    }

    .btn-primary-outline {
        border: 1px solid var(--color-primary);
        color: var(--text-color);
        background: rgba(139, 92, 246, 0.05);
    }

    .btn-primary-outline:hover {
        background: var(--color-primary);
        color: #fff;
        transform: translateY(-2px);
    }

    .btn-secondary {
        background: rgba(255, 255, 255, 0.06);
        color: var(--text-color);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
    }

    .btn-block {
        display: flex;
        width: 100%;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: var(--space-lg);
    }

    .section-tag {
        font-size: 0.8rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: var(--color-secondary);
        display: inline-block;
        margin-bottom: 0.75rem;
    }

    .section-title {
        font-size: clamp(2rem, 1.5rem + 3vw, 3.5rem);
        margin-bottom: 1rem;
        font-family: 'Outfit', sans-serif;
    }

    .section-subtitle {
        color: var(--text-muted);
        font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
        max-width: 650px;
        margin-inline: auto;
    }

    /* Tech Badges */
    .badge {
        display: inline-flex;
        align-items: center;
        padding: 0.25em 0.75em;
        border-radius: 50px;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .badge-tech {
        background: rgba(147, 51, 234, 0.15);
        color: oklch(75% 0.15 300);
        border: 1px solid rgba(147, 51, 234, 0.3);
    }

    /* Glow on Hover Elements */
    .glow {
        position: relative;
    }

    .glow::after {
        content: '';
        position: absolute;
        inset: -2px;
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        border-radius: inherit;
        z-index: -1;
        opacity: 0;
        filter: blur(10px);
        transition: opacity var(--transition-smooth);
    }

    .glow:hover::after {
        opacity: 0.6;
    }
}

@layer layout {
    /* ==========================================
       Header Styles
       ========================================== */
    .main-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(12, 13, 20, 0.7);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-glow);
        padding-block: 1rem;
        transition: padding var(--transition-smooth);
    }

    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .logo {
        font-family: 'Outfit', sans-serif;
        font-size: 1.5rem;
        font-weight: 800;
        letter-spacing: -0.01em;
        color: var(--text-color);
        display: flex;
        align-items: center;
    }

    .logo-accent {
        color: var(--color-primary);
    }

    .nav-menu ul {
        display: flex;
        align-items: center;
        gap: clamp(1rem, 0.5rem + 1vw, 2.5rem);
    }

    .nav-link {
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-muted);
        position: relative;
        padding-block: 0.25rem;
        transition: color var(--transition-smooth);
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--text-color);
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
        transition: width var(--transition-smooth);
    }

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

    .mobile-toggle {
        display: none;
        color: var(--text-color);
        font-size: 1.5rem;
    }

    /* ==========================================
       Hero Section
       ========================================== */
    .hero-section {
        padding-block: var(--space-xl) var(--space-lg);
        position: relative;
    }

    .hero-grid {
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        gap: var(--space-md);
        align-items: center;
    }

    .hero-tag {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.35em 1em;
        background: rgba(16, 185, 129, 0.1);
        border: 1px solid rgba(16, 185, 129, 0.3);
        border-radius: 50px;
        color: var(--color-accent);
        font-size: 0.8rem;
        font-weight: 600;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        margin-bottom: 1.5rem;
    }

    .hero-tag::before {
        content: '';
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: var(--color-accent);
        box-shadow: 0 0 8px var(--color-accent);
    }

    .hero-title {
        font-size: clamp(2.5rem, 2rem + 4vw, 4.5rem);
        line-height: 1.05;
        margin-bottom: 1rem;
        font-family: 'Outfit', sans-serif;
    }

    .hero-subtitle {
        font-size: clamp(1.25rem, 1.1rem + 1.5vw, 2rem);
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.2rem;
    }

    .hero-subtitle .cursor {
        color: var(--color-primary);
        animation: blink-cursor 1s steps(2, start) infinite;
    }

    @keyframes blink-cursor {
        to { opacity: 0; }
    }

    .hero-description {
        font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
        color: var(--text-muted);
        margin-bottom: var(--space-md);
        max-width: 620px;
    }

    .hero-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
        margin-bottom: var(--space-md);
    }

    .quick-contact {
        display: flex;
        align-items: center;
        gap: clamp(1rem, 0.5rem + 1vw, 2rem);
        flex-wrap: wrap;
        border-top: 1px solid var(--border-glow);
        padding-top: 1.5rem;
    }

    .contact-item {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.9rem;
        color: var(--text-muted);
        transition: color var(--transition-smooth);
    }

    .contact-item:hover {
        color: var(--text-color);
    }

    .contact-item svg {
        width: 16px;
        height: 16px;
        color: var(--color-secondary);
    }

    /* Hero Visual Card */
    .hero-visual {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .visual-card {
        width: min(100%, 380px);
        aspect-ratio: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .avatar-container {
        width: 250px;
        height: 250px;
        position: relative;
        z-index: 2;
    }

    .avatar-glow {
        position: absolute;
        inset: -10px;
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        border-radius: 50%;
        filter: blur(20px);
        opacity: 0.35;
        animation: pulse-glow-avatar 4s infinite alternate ease-in-out;
    }

    @keyframes pulse-glow-avatar {
        0% { transform: scale(0.95); opacity: 0.3; }
        100% { transform: scale(1.05); opacity: 0.5; }
    }

    .avatar-inner {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--bg-surface), var(--bg-main));
        border: 4px solid rgba(255, 255, 255, 0.05);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
        position: relative;
        z-index: 3;
    }

    .avatar-text {
        font-family: 'Outfit', sans-serif;
        font-size: 5rem;
        font-weight: 800;
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        letter-spacing: -0.03em;
    }

    /* Floating Badges */
    .floating-badge {
        position: absolute;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5em 1em;
        background: rgba(25, 27, 38, 0.8);
        backdrop-filter: blur(8px);
        border: 1px solid var(--border-glow);
        border-radius: 50px;
        font-size: 0.8rem;
        font-weight: 600;
        z-index: 10;
        animation: float-badge 6s infinite ease-in-out;
    }

    .floating-badge img {
        width: 20px;
        height: 20px;
    }

    .badge-gcp {
        top: 10%;
        left: -5%;
        animation-delay: 0s;
        border-color: rgba(66, 133, 244, 0.3);
    }

    .badge-python {
        bottom: 15%;
        left: -10%;
        animation-delay: 1.5s;
        border-color: rgba(255, 224, 82, 0.3);
    }

    .badge-gitlab {
        top: 30%;
        right: -5%;
        animation-delay: 3s;
        border-color: rgba(226, 67, 41, 0.3);
    }

    @keyframes float-badge {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }

    /* ==========================================
       Stats Section
       ========================================== */
    .stats-section {
        margin-block: var(--space-md) var(--space-lg);
    }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: var(--space-sm);
    }

    .stat-card {
        padding: var(--space-sm) var(--space-md);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-height: 180px;
    }

    .stat-icon-wrapper {
        font-size: 2.25rem;
        margin-bottom: 0.5rem;
    }

    .stat-icon-wrapper svg {
        width: 36px;
        height: 36px;
    }

    .stat-number {
        font-family: 'Outfit', sans-serif;
        font-size: 2.5rem;
        font-weight: 800;
        line-height: 1;
        margin-bottom: 0.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--text-muted);
        line-height: 1.3;
    }

    /* ==========================================
       Skills Section
       ========================================== */
    .skills-section {
        padding-block: var(--space-md);
    }

    .skills-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--space-sm);
    }

    .skill-category-card {
        padding: var(--space-md);
        height: 100%;
    }

    .category-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: var(--space-sm);
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--text-color);
        border-bottom: 1px solid var(--border-glow);
        padding-bottom: 0.75rem;
    }

    .category-title svg {
        width: 20px;
        height: 20px;
        color: var(--color-primary);
    }

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

    .skill-tag-item {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        padding: 0.5em 0.9em;
        border-radius: 50px;
        font-size: 0.85rem;
        font-weight: 500;
        transition: transform var(--transition-smooth),
                    border-color var(--transition-smooth),
                    background-color var(--transition-smooth);
    }

    .skill-tag-item:hover {
        background: rgba(255, 255, 255, 0.07);
        border-color: var(--color-primary);
        transform: scale(1.03);
    }

    .skill-icon {
        width: 16px;
        height: 16px;
    }

    .skill-icon-lucide {
        width: 16px;
        height: 16px;
    }

    /* ==========================================
       Projects Showcase
       ========================================== */
    .projects-section {
        padding-block: var(--space-md);
    }

    .project-filters {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: var(--space-md);
    }

    .filter-btn {
        padding: 0.5em 1.25em;
        border-radius: 50px;
        font-size: 0.85rem;
        font-weight: 600;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        transition: var(--transition-smooth);
    }

    .filter-btn:hover,
    .filter-btn.active {
        background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
        border-color: transparent;
        color: #fff;
        transform: scale(1.02);
    }

    .projects-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: var(--space-sm);
        transition: opacity var(--transition-smooth);
    }

    .project-card {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: 100%;
    }

    .project-card.hidden {
        display: none;
    }

    .project-img-placeholder {
        width: 100%;
        height: 160px;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.03));
        border-bottom: 1px solid var(--border-glow);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3rem;
    }

    .project-img-placeholder svg {
        width: 48px;
        height: 48px;
    }

    .project-content {
        padding: var(--space-sm) var(--space-md);
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    .project-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }

    .project-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-color);
    }

    .project-desc {
        color: var(--text-muted);
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.5;
        flex-grow: 1;
    }

    .project-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        margin-bottom: var(--space-sm);
    }

    .project-tags span {
        font-family: var(--font-mono);
        font-size: 0.75rem;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        padding: 0.2em 0.6em;
        border-radius: 4px;
        color: var(--text-muted);
    }

    .project-link {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        color: var(--color-secondary);
        font-size: 0.85rem;
        font-weight: 600;
        margin-top: auto;
        transition: color var(--transition-smooth);
        align-self: flex-start;
    }

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

    .project-link svg {
        width: 14px;
        height: 14px;
    }

    .project-link-disabled {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        color: var(--text-muted);
        font-size: 0.8rem;
        font-weight: 500;
        margin-top: auto;
        opacity: 0.7;
    }

    .project-link-disabled svg {
        width: 12px;
        height: 12px;
    }

    /* ==========================================
       Experience Timeline
       ========================================== */
    .experience-section {
        padding-block: var(--space-md);
    }

    .timeline {
        position: relative;
        max-width: 900px;
        margin: 0 auto;
        padding-left: 2rem;
        border-left: 2px solid var(--border-glow);
    }

    .timeline-item {
        position: relative;
        margin-bottom: var(--space-md);
    }

    .timeline-item:last-child {
        margin-bottom: 0;
    }

    .timeline-dot {
        position: absolute;
        left: calc(-2rem - 6px);
        top: 24px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: var(--border-glow);
        border: 2px solid var(--bg-main);
        z-index: 2;
        transition: background-color var(--transition-smooth), 
                    transform var(--transition-smooth);
    }

    .timeline-dot.glow {
        background-color: var(--color-primary);
        box-shadow: 0 0 10px var(--color-primary);
        transform: scale(1.2);
    }

    .timeline-card {
        padding: var(--space-md);
    }

    .timeline-header {
        margin-bottom: 0.75rem;
    }

    .timeline-date {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: block;
        margin-bottom: 0.25rem;
    }

    .timeline-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.35rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: var(--text-color);
    }

    .timeline-company {
        font-size: 1rem;
        font-weight: 600;
    }

    .timeline-body ul {
        margin-top: 0.75rem;
        display: grid;
        gap: 0.5rem;
    }

    .timeline-body li {
        position: relative;
        padding-left: 1.25rem;
        font-size: 0.925rem;
        color: var(--text-muted);
        line-height: 1.5;
    }

    .timeline-body li::before {
        content: '▸';
        position: absolute;
        left: 0;
        top: 0;
        color: var(--color-secondary);
        font-weight: bold;
    }

    /* Highlight timeline on hover */
    .timeline-item:hover .timeline-dot {
        background-color: var(--color-secondary);
        box-shadow: 0 0 12px var(--color-secondary);
        transform: scale(1.3);
    }

    /* ==========================================
       Certifications Slider
       ========================================== */
    .certifications-section {
        padding-block: var(--space-md);
    }

    .certifications-slider-wrapper {
        overflow-x: auto;
        padding-bottom: var(--space-sm);
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
    }

    .certifications-grid {
        display: flex;
        gap: var(--space-sm);
        width: max-content;
    }

    .cert-card {
        width: 280px;
        padding: var(--space-md);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        scroll-snap-align: start;
    }

    .cert-icon-wrapper {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-glow);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .cert-icon-wrapper img {
        width: 32px;
        height: 32px;
    }

    .cert-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.05rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: var(--text-color);
        line-height: 1.3;
    }

    .cert-issuer {
        font-size: 0.85rem;
        color: var(--text-muted);
        margin-bottom: auto;
    }

    .cert-date {
        margin-top: 1rem;
        font-family: var(--font-mono);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--color-primary);
        background: rgba(147, 51, 234, 0.1);
        padding: 0.2em 0.8em;
        border-radius: 50px;
        border: 1px solid rgba(147, 51, 234, 0.2);
    }

    /* ==========================================
       Hobbies Section
       ========================================== */
    .hobbies-section {
        padding-block: var(--space-md);
    }

    .hobbies-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--space-sm);
    }

    .hobby-card {
        padding: var(--space-md);
        text-align: center;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hobby-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .hobby-icon svg {
        width: 40px;
        height: 40px;
    }

    .hobby-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
        color: var(--text-color);
    }

    .hobby-desc {
        font-size: 0.9rem;
        color: var(--text-muted);
        line-height: 1.5;
    }

    /* ==========================================
       Contact Section
       ========================================== */
    .contact-section {
        padding-block: var(--space-md) var(--space-lg);
    }

    .contact-grid {
        display: grid;
        grid-template-columns: 0.9fr 1.1fr;
        gap: var(--space-md);
        align-items: stretch;
    }

    .contact-info {
        padding: var(--space-md);
        display: flex;
        flex-direction: column;
    }

    .contact-info-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .contact-info-desc {
        color: var(--text-muted);
        font-size: 0.95rem;
        margin-bottom: var(--space-sm);
    }

    .contact-list {
        display: grid;
        gap: 0.75rem;
        margin-bottom: var(--space-sm);
    }

    .contact-card {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-glow);
        padding: 0.75rem 1rem;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 1rem;
        position: relative;
    }

    .contact-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: rgba(147, 51, 234, 0.08);
        border: 1px solid rgba(147, 51, 234, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-primary);
    }

    .contact-card-icon svg {
        width: 18px;
        height: 18px;
    }

    .contact-card-details {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    .contact-label {
        font-family: var(--font-mono);
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--color-secondary);
        letter-spacing: 0.05em;
    }

    .contact-value {
        font-size: 0.9rem;
        font-weight: 500;
    }

    .btn-copy {
        color: var(--text-muted);
        padding: 0.5rem;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color var(--transition-smooth), 
                    background-color var(--transition-smooth);
        position: relative;
    }

    .btn-copy:hover {
        color: var(--text-color);
        background-color: rgba(255, 255, 255, 0.05);
    }

    .btn-copy svg {
        width: 16px;
        height: 16px;
    }

    /* Clipboard Copy Feedback */
    .btn-copy::before {
        content: '¡Copiado!';
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(-5px);
        background: var(--bg-surface);
        border: 1px solid var(--color-primary);
        color: var(--text-color);
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.25em 0.5em;
        border-radius: 4px;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-smooth);
    }

    .btn-copy.copied::before {
        opacity: 1;
    }

    .social-networks {
        margin-top: auto;
        border-top: 1px solid var(--border-glow);
        padding-top: var(--space-sm);
    }

    .social-title {
        font-family: 'Outfit', sans-serif;
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

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

    .social-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5em 1.25em;
        border-radius: 50px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-glow);
        font-size: 0.85rem;
        font-weight: 500;
        transition: var(--transition-smooth);
    }

    .social-btn:hover {
        background: rgba(255, 255, 255, 0.07);
        border-color: var(--color-secondary);
        transform: translateY(-2px);
    }

    .social-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Contact Form Styles */
    .contact-form-wrapper {
        padding: var(--space-md);
    }

    .contact-form {
        display: grid;
        gap: 1.25rem;
    }

    .form-group {
        display: grid;
        gap: 0.5rem;
    }

    .form-group label {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
    }

    .input-wrapper {
        position: relative;
        width: 100%;
    }

    .input-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
        color: var(--text-muted);
        pointer-events: none;
    }

    .contact-form input,
    .contact-form textarea {
        width: 100%;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-glow);
        border-radius: 12px;
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.95rem;
        color: var(--text-color);
        transition: border-color var(--transition-smooth), 
                    background-color var(--transition-smooth);
    }

    .contact-form textarea {
        padding-left: 1rem;
        resize: vertical;
    }

    .contact-form input:focus,
    .contact-form textarea:focus {
        background: rgba(255, 255, 255, 0.04);
        border-color: var(--color-primary);
        outline: none;
    }

    /* Validity Styles (Only triggers after interaction - :user-invalid) */
    .contact-form input:user-invalid,
    .contact-form textarea:user-invalid {
        border-color: var(--color-warning);
    }

    /* ==========================================
       Footer
       ========================================== */
    .main-footer {
        border-top: 1px solid var(--border-glow);
        padding-block: var(--space-lg) var(--space-md);
        background: rgba(8, 9, 14, 0.9);
    }

    .footer-logo {
        font-family: 'Outfit', sans-serif;
        font-size: 1.75rem;
        font-weight: 800;
        color: var(--text-color);
        margin-bottom: 0.5rem;
    }

    .footer-tagline {
        color: var(--text-muted);
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .footer-links {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1.5rem;
        margin-bottom: 2rem;
    }

    .footer-links a {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text-muted);
        transition: color var(--transition-smooth);
    }

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

    .copyright {
        font-size: 0.8rem;
        color: var(--text-muted);
        border-top: 1px solid var(--border-glow);
        padding-top: 1.5rem;
    }
}

@layer animations {
    /* ==========================================================
       Native Scroll-driven animations with graceful progressive
       enhancement for supported browsers (Chrome, Edge, Safari 26)
       ========================================================== */
    @media (prefers-reduced-motion: no-preference) {
        @supports ((animation-timeline: view()) and (animation-range: entry)) {
            @keyframes fade-reveal {
                from {
                    opacity: 0;
                    transform: translateY(30px);
                }
                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }

            .scroll-reveal {
                animation: fade-reveal auto linear backwards;
                animation-timeline: view();
                animation-range: entry 5% cover 30%;
            }

            .timeline-item {
                animation: fade-reveal auto linear backwards;
                animation-timeline: view();
                animation-range: entry 5% cover 25%;
            }
        }
    }
}

/* ==========================================================
   Responsive Breakpoints & Adjustments
   ========================================================== */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-md);
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-description {
        margin-inline: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .quick-contact {
        justify-content: center;
    }

    .hero-visual {
        margin-top: 1rem;
    }

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

@media (max-width: 768px) {
    .main-header {
        padding-block: 0.75rem;
    }

    .mobile-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(12, 13, 20, 0.95);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-glow);
        padding: 1.5rem;
        display: none;
    }

    .light-theme .nav-menu {
        background: rgba(255, 255, 255, 0.96);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

    .nav-menu.open {
        display: block;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .nav-link {
        font-size: 1.05rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-dot {
        left: calc(-1.5rem - 6px);
    }
}

/* Fallback styles for browsers without native scroll-driven animations */
.no-scroll-timeline .scroll-reveal,
.no-scroll-timeline .timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.no-scroll-timeline .scroll-reveal.in-view,
.no-scroll-timeline .timeline-item.in-view {
    opacity: 1;
    transform: translateY(0);
}


/* ==========================================================================
   UNLAYERED LIGHT THEME STYLES (Supreme Cascade Priority)
   ========================================================================== */

:root.light-theme {
    color-scheme: light;

    /* Design Tokens Tier 1: Literal Colors for Light Mode */
    --raw-light-bg: oklch(98% 0.005 255);
    --raw-light-surface: oklch(95% 0.01 255);
    --raw-light-surface-hover: oklch(90% 0.015 255);
    --raw-light-text: oklch(20% 0.015 255);
    --raw-light-text-muted: oklch(48% 0.02 255);

    /* Design Tokens Tier 2: Semantic Colors override */
    --bg-main: var(--raw-light-bg);
    --bg-surface: var(--raw-light-surface);
    --bg-surface-hover: var(--raw-light-surface-hover);
    --text-color: var(--raw-light-text);
    --text-muted: var(--raw-light-text-muted);

    /* High-contrast, premium, accessible gradients for Light Mode */
    --color-primary: oklch(48% 0.22 295);      /* Rich Royal Purple */
    --color-secondary: oklch(52% 0.18 245);    /* Premium Deep Cyan/Blue */
    --color-accent: oklch(45% 0.16 145);       /* Deep Emerald */
    --color-warning: oklch(55% 0.18 45);       /* Deep Sunset Amber */

    --border-glow: rgba(0, 0, 0, 0.08);
    --border-glow-active: rgba(147, 51, 234, 0.15);
}

.light-theme .ambient-glow {
    opacity: 0.03;
}

.light-theme .glass-card {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02) !important;
}

.light-theme .glass-card:hover {
    background: rgba(255, 255, 255, 0.88) !important;
    border-color: rgba(147, 51, 234, 0.22) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.05) !important;
}

.light-theme .skill-tag-item {
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01) !important;
}

.light-theme .skill-tag-item:hover {
    background: #ffffff !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.08) !important;
}

.light-theme .project-tags span {
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(0, 0, 0, 0.02) !important;
    color: oklch(35% 0.01 255) !important;
}

.light-theme .project-img-placeholder {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.03)) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.light-theme .cert-icon-wrapper {
    background: rgba(0, 0, 0, 0.02) !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
}

.light-theme .contact-card {
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01) !important;
}

.light-theme .social-btn {
    background: rgba(0, 0, 0, 0.02) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.light-theme .social-btn:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: var(--color-secondary) !important;
}

.light-theme .btn-copy:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: var(--text-color) !important;
}

.light-theme .contact-form input::placeholder,
.light-theme .contact-form textarea::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
}

.light-theme .contact-form input,
.light-theme .contact-form textarea {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.09) !important;
    color: var(--text-color) !important;
}

.light-theme .contact-form input:focus,
.light-theme .contact-form textarea:focus {
    background: #ffffff !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.08) !important;
}

.light-theme .main-header {
    background: rgba(255, 255, 255, 0.8) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

.light-theme .nav-link {
    color: oklch(35% 0.01 255) !important;
}

.light-theme .nav-link:hover,
.light-theme .nav-link.active {
    color: var(--color-primary) !important;
}

.light-theme .mobile-toggle {
    color: var(--text-color) !important;
}

.light-theme .main-footer {
    background: oklch(94% 0.01 255) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.light-theme .main-footer .footer-logo {
    color: var(--text-color) !important;
}

.light-theme .main-footer .footer-tagline {
    color: var(--text-muted) !important;
}

.light-theme .main-footer .footer-links a {
    color: var(--text-muted) !important;
}

.light-theme .main-footer .footer-links a:hover {
    color: var(--color-primary) !important;
}

.light-theme .main-footer .copyright {
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-muted) !important;
}

.light-theme .floating-badge {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #12131a !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

.light-theme .badge-tech {
    background: rgba(147, 51, 234, 0.08) !important;
    color: oklch(50% 0.22 300) !important;
    border: 1px solid rgba(147, 51, 234, 0.15) !important;
}

.light-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: var(--text-color) !important;
}

.light-theme .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.light-theme .filter-btn {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text-color) !important;
}

.light-theme .filter-btn:hover,
.light-theme .filter-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

/* Light Theme Custom Scrollbar Overrides */
.light-theme::-webkit-scrollbar-track,
.light-theme *::-webkit-scrollbar-track {
    background: var(--bg-main) !important;
}
.light-theme::-webkit-scrollbar-thumb,
.light-theme *::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12) !important;
    border: 2px solid var(--bg-main) !important;
}
.light-theme::-webkit-scrollbar-thumb:hover,
.light-theme *::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25) !important;
}

.light-theme .btn-theme-toggle {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: var(--text-color) !important;
}

.light-theme .btn-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: var(--color-primary) !important;
    transform: scale(1.08) rotate(-15deg) !important;
}

.light-theme .btn-lang-toggle {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: var(--text-color) !important;
}

.light-theme .btn-lang-toggle:hover {
    background: rgba(0, 0, 0, 0.08) !important;
    color: var(--color-primary) !important;
}

.light-theme .nav-menu {
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}


