:root {
    /* Color Palette - Cyberpunk x SF Tech */
    --color-bg: #1a1a1a;
    --color-bg-alt: #0a0a0a;
    --color-text: #f5f5f5;
    --color-text-muted: #a0a0a0;
    --color-primary: #00ffff;
    /* Cyan */
    --color-secondary: #ff00ff;
    /* Magenta */
    --color-tertiary: #00ff88;
    /* Green */
    --color-glitch: var(--color-primary);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Roboto Mono', Menlo, monospace;

    /* Spacing */
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* Effects */
    --glow-primary: 0 0 20px rgba(0, 255, 255, 0.3);
    --glow-secondary: 0 0 20px rgba(255, 0, 255, 0.3);
    --border-radius: 8px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--color-primary);
    text-shadow: var(--glow-primary);
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    text-transform: uppercase;
    margin-bottom: var(--space-md);
}

h2 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    color: var(--color-text);
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-bottom: var(--space-lg);
}

code,
pre {
    font-family: var(--font-mono);
}

/* Layout */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

section {
    padding: var(--space-xl) 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Header/Nav */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-sm) 0;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo {
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Footer */
.site-footer {
    padding: var(--space-md) 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Common Components */
.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
}

.btn:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: var(--glow-primary);
}

/* Glitch Effect - Simplistic CSS version */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(3px, 9999px, 8px, 0);
    }

    20% {
        clip: rect(76px, 9999px, 9px, 0);
    }

    40% {
        clip: rect(42px, 9999px, 89px, 0);
    }

    60% {
        clip: rect(12px, 9999px, 2px, 0);
    }

    80% {
        clip: rect(32px, 9999px, 78px, 0);
    }

    100% {
        clip: rect(90px, 9999px, 5px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 12px, 0);
    }

    20% {
        clip: rect(12px, 9999px, 3px, 0);
    }

    40% {
        clip: rect(87px, 9999px, 53px, 0);
    }

    60% {
        clip: rect(15px, 9999px, 20px, 0);
    }

    80% {
        clip: rect(3px, 9999px, 2px, 0);
    }

    100% {
        clip: rect(54px, 9999px, 43px, 0);
    }
}

/* Grid for Projects */
/* Grid definition moved to bottom for specificity override */
/* .project-grid previous definition removed */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-md);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: var(--glow-primary);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--color-text-muted);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --space-lg: 2.5rem;
        --space-xl: 4rem;
    }
}

/* Code Syntax Highlighting Glow */
pre[class*="language-"] {
    border: 1px solid var(--color-tertiary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
    background: #0d0d0d;
    padding: 1rem;
    overflow-x: auto;
}

code[class*="language-"],
pre[class*="language-"] {
    text-shadow: 0 0 2px rgba(0, 255, 136, 0.5);
    font-family: var(--font-mono);
}

/* Profile Picture & Keys */
.profile-container {
    margin-bottom: var(--space-md);
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    box-shadow: var(--glow-primary);
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.profile-pic:hover {
    filter: grayscale(0%);
    box-shadow: var(--glow-secondary);
    border-color: var(--color-secondary);
}

.key-links {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.key-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    text-decoration: none;
}

.key-link:hover {
    color: var(--color-tertiary);
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 1rem;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 2000;
    }

    .hamburger-icon {
        width: 30px;
        height: 2px;
        background: var(--color-primary);
        position: relative;
        transition: all 0.3s ease;
    }

    .hamburger-icon::before,
    .hamburger-icon::after {
        content: '';
        position: absolute;
        width: 30px;
        height: 2px;
        background: var(--color-primary);
        left: 0;
        transition: all 0.3s ease;
    }

    .hamburger-icon::before {
        top: -8px;
    }

    .hamburger-icon::after {
        top: 8px;
    }

    .mobile-nav-toggle[aria-expanded="true"] .hamburger-icon {
        background: transparent;
    }

    .mobile-nav-toggle[aria-expanded="true"] .hamburger-icon::before {
        transform: rotate(45deg);
        top: 0;
    }

    .mobile-nav-toggle[aria-expanded="true"] .hamburger-icon::after {
        transform: rotate(-45deg);
        top: 0;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 30%;
        height: 100dvh;
        /* Fallback and dynamic viewport height */
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: min(20vh, 5rem) 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        border-left: 1px solid var(--color-primary);
    }

    .nav-links[data-visible="true"] {
        transform: translateX(0%);
    }
}

@media (min-width: 769px) {
    .mobile-nav-toggle {
        display: none;
    }
}

/* Projects Grid Refinements - Tighter Spacing & Initial Icons */
/* Projects Grid Refinements - Strict 3-Column Layout */

/* Projects Grid Refinements - Single Column Layout */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: stretch;
    /* crucial for equal height */
}


.project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-icon {
    width: 24px;
    height: 24px;
    fill: var(--color-primary);
}

/* Card Icons & Headers */
.card-header-with-icon,
.header-with-icon {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    object-fit: cover;
    /* or contain, depending on logos */
    border-radius: 8px;
    background: #fff;
    /* White bg for logos designed for white paper */
    padding: 2px;
    flex-shrink: 0;
}

.card-header-with-icon h3,
.header-with-icon h3 {
    margin-bottom: 0;
    line-height: 1.2;
}