/* 
 * PORTFOLIO 2025 - TECH EDITION (REFINED)
 * Theme: Dark / Cyber / Pro / Clean
 */

/* Fonts loaded via preconnect in HTML for better performance */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@300;400;500;600;700&display=swap');

/* Fallback fonts while loading */
@font-face {
    font-family: 'Inter';
    font-display: swap;
}

@font-face {
    font-family: 'Fira Code';
    font-display: swap;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    /* Preferred icon size */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

/* --- VARIABLES --- */
:root {
    /* Colors - Dark Tech Theme (Premium) */
    --bg-dark: #0f172a;
    --bg-mesh-1: radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
    --bg-mesh-2: radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.15) 0px, transparent 50%);

    --bg-glass: rgba(30, 41, 59, 0.7);
    --bg-glass-strong: rgba(15, 23, 42, 0.85);

    --primary: #06b6d4;
    /* Cyan 500 */
    --primary-dim: rgba(6, 182, 212, 0.1);
    --primary-glow: #06b6d4;

    --secondary: #6366f1;
    /* Indigo 500 */

    --accent: #f472b6;
    /* Pink 400 - for subtle highlights */

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-dim: #64748b;
    /* Slate 500 */

    --border-light: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.1);

    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Spacing & Layout */
    --section-spacing: 8rem;
    --container-width: 1200px;
    --header-height: 80px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* --- RESET & BASIC SETUP --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Accessibility: Skip to content link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--text-main);
    outline-offset: 2px;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

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

    /* Dynamic Mesh Background */
    background-image:
        var(--bg-mesh-1),
        var(--bg-mesh-2),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 50px 50px, 50px 50px;
    background-repeat: no-repeat, no-repeat, repeat, repeat;
    background-attachment: fixed;
}

/* Typography Refinements */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}

h2 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2.25rem;
    color: var(--text-main);
    letter-spacing: -0.03em;
}

h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

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

ul {
    list-style: none;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.mono {
    font-family: var(--font-mono);
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- GLASSMORPHISM NAVBAR --- */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: var(--container-width);
    height: 70px;

    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border: 1px solid var(--border-glass);
    border-radius: 100px;
    /* Pill shape */

    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    border-color: rgba(6, 182, 212, 0.3);
}

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

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

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

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    z-index: 2;
}

.terminal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: rgba(6, 182, 212, 0.08);
    /* Minimal tint */
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 100px;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Shine effect on badge */
.terminal-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 1.5rem 0 2.5rem;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
}

/* =========================================
   Glitch & Animations
   ========================================= */

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(-1deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 80px, 0);
    }

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

    40% {
        clip: rect(10px, 9999px, 90px, 0);
    }

    60% {
        clip: rect(50px, 9999px, 30px, 0);
    }

    80% {
        clip: rect(90px, 9999px, 20px, 0);
    }

    100% {
        clip: rect(30px, 9999px, 60px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(80px, 9999px, 120px, 0);
    }

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

    40% {
        clip: rect(90px, 9999px, 30px, 0);
    }

    60% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    80% {
        clip: rect(60px, 9999px, 40px, 0);
    }

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

.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    /* Match background to hide original */
}

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

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

/* Button Glitch Hover Effect */
.btn-glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    overflow: hidden;
    display: none;
    /* Hidden by default */
}

.btn-primary:hover .btn-glitch {
    display: block;
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.btn-primary:hover .btn-glitch::before,
.btn-primary:hover .btn-glitch::after {
    display: block;
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    /* subtle flash */
    opacity: 0.1;
}

.btn-primary:hover .btn-glitch::before {
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.btn-primary:hover .btn-glitch::after {
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

/* Section Reveal Animation */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay for staggered reveal */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

/* Polished Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    min-width: 160px;
}

.btn-primary {
    background: var(--primary);
    color: #0f172a;
    /* Dark text on bright button for readability */
    border: 1px solid var(--primary);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* --- PROJECTS GRID & FILTER --- */
.projects-filter {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--bg-glass);
    padding: 0.75rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-light);
    width: fit-content;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.filter-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    padding: 0.6rem 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--bg-dark);
    font-weight: 600;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn.active::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
    transform: scale(0);
    animation: ripple 0.6s ease-out forwards;
}

@keyframes ripple {
    to {
        transform: scale(1);
        opacity: 0;
    }
}

/* --- TYPEWRITER & ANIMATIONS --- */
.cursor-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- CHART (SKILLS) --- */
.chart-container {
    position: relative;
    z-index: 10;
}

.btn-primary:hover {
    background: #0891b2;
    /* Cyan 600 */
    border-color: #0891b2;
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--bg-surface-hover);
}

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

/* Terminal Visual Refinement */
.terminal-window {
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-light);
    font-family: var(--font-mono);
    overflow: hidden;
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: transform 0.3s ease;
}

.terminal-window:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.terminal-header {
    background: #0f172a;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.terminal-buttons {
    display: flex;
    gap: 6px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #334155;
}

.terminal-buttons .close {
    background: #ef4444;
}

.terminal-buttons .minimize {
    background: #f59e0b;
}

.terminal-buttons .maximize {
    background: #22c55e;
}

.terminal-title {
    flex-grow: 1;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.terminal-body {
    padding: 20px;
    min-height: 300px;
    font-size: 0.9rem;
    color: #a5b3ce;
}

.code-line {
    margin-bottom: 8px;
}

.prompt {
    color: var(--secondary);
    margin-right: 8px;
}

.cmd {
    color: var(--text-main);
}

.text-success {
    color: #22c55e;
}

.text-dim {
    color: var(--text-dim);
}

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--primary);
    font-weight: bold;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- CARDS & GRID --- */
.projects-grid,
.skills-grid,
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card,
.service-card,
.skill-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
}

/* Glow on hover */
.project-card::before,
.service-card::before,
.skill-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.3s;
    pointer-events: none;
}

.project-card:hover,
.service-card:hover,
.skill-card:hover {
    transform: translateY(-8px) scale(1.01);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.5),
        0 0 20px -5px rgba(6, 182, 212, 0.2);
    /* Cyan Glow */
}

.project-card:hover::before,
.service-card:hover::before,
.skill-card:hover::before {
    opacity: 1;
}

/* Refined Titles in Cards */
.project-card h3,
.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.project-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-surface-hover);
    color: var(--primary);
    border-radius: 4px;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.btn-view-project {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: 6px;
    color: var(--primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view-project:hover {
    background: var(--primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* --- ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 960px) {
    .about-grid {
        grid-template-columns: 1.5fr 1fr;
        align-items: start;
    }
}

.about-text p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-text p:last-of-type {
    margin-bottom: 0;
}

.founder-note {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-body);
}

.founder-note h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.founder-note p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.founder-link {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 4px;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: var(--bg-surface);
}

.stat-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* --- TIMELINE (Parcours) --- */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Vertical Line */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 60px;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: 11px;
    top: 24px;
    width: 20px;
    height: 20px;
    background: var(--bg-dark);
    border: 2px solid var(--primary);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px var(--primary-dim);
    transition: all 0.3s;
}

.timeline-item:hover .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary);
}

.timeline-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.timeline-item:hover .timeline-content {
    transform: translateX(10px);
    border-color: var(--primary);
}

.timeline-date {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--primary);
    background: var(--primary-dim);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.timeline-role {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.timeline-company {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 1rem;
    display: block;
}

.timeline-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.timeline-tag {
    font-size: 0.75rem;
    color: var(--text-dim);
    border: 1px solid var(--border-light);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

/* --- FOOTER --- */
footer {
    margin-top: 6rem;
    padding: 4rem 0 2rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.footer-section h4 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* --- RESPONSIVE --- */
@media (max-width: 960px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

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

    .terminal-window {
        margin-top: 2rem;
        transform: none;
        /* Simplify on mobile */
    }

    .terminal-window:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 2rem;
        gap: 0;
        border-bottom: 1px solid var(--border-light);
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links .nav-link {
        display: block;
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links li:last-child .nav-link {
        border-bottom: none;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        z-index: 1001;
        padding: 5px;
        background: transparent;
        border: none;
    }

    .hamburger span {
        display: block;
        width: 25px;
        height: 2px;
        background: var(--text-main);
        margin: 4px 0;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    h1 {
        font-size: 2.5rem;
    }

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

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

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

/* =========================================
   PROJECT MODAL
   ========================================= */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(6, 182, 212, 0.15);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-modal.active .modal-container {
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
}

/* Modal Navigation */
.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
    z-index: 10;
}

.modal-nav-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav-btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    transform: scale(1.1);
}

.modal-prev {
    margin-left: -22px;
}

.modal-next {
    margin-right: -22px;
}

/* Modal Content */
.modal-content {
    max-height: 85vh;
    overflow-y: auto;
    padding: 2.5rem;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Modal Header */
.modal-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-icon {
    font-size: 2.5rem;
}

.modal-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-badge-active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.modal-badge-completed {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.modal-header h2 {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.meta-item {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Modal Body Sections */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.modal-section h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.project-excerpt-large {
    font-style: italic;
    color: var(--text-dim);
    margin-top: 1rem;
}

/* Objectives & Results Lists */
.objectives-list,
.results-list {
    list-style: none;
    padding: 0;
}

.objectives-list li,
.results-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.objectives-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.results-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #22c55e;
}

/* Tech Grid */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.tech-item:hover {
    border-color: var(--primary);
    background: var(--primary-dim);
}

.tech-icon {
    font-size: 1.25rem;
}

.tech-name {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        max-height: 90vh;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .modal-navigation {
        display: none;
    }

    .modal-nav-btn {
        position: fixed;
        bottom: 1rem;
    }

    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================
   CONTACT PAGE
   ========================================= */
.contact-section {
    padding-top: 140px;
    padding-bottom: 4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

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

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

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: 0 0 20px var(--primary-dim);
}

.contact-card-icon {
    font-size: 1.75rem;
}

.contact-card-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: 0.25rem;
}

.contact-card-value {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
}

/* Contact Form */
.contact-form-container {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.contact-form-container h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.85rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    cursor: pointer;
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--primary);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    transform: translateY(-3px);
}

/* =========================================
   CERTIFICATIONS SECTION
   ========================================= */
.certifications-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-light);
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.certification-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.75rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.certification-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cert-icon {
    font-size: 2rem;
    line-height: 1;
}

.cert-content h4 {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.cert-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.cert-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(6, 182, 212, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}