/* ===== PORTFOLIO - PRODUCTION CSS ===== */
/* Minimaliste & Optimisé - Baptiste Lavogiez */

/* ===== MINIMALIST PROFESSIONAL VARIABLES ===== */
:root {
    /* Custom typography */
    --font-hero: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
    --font-heading: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
    --font-sans: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    /* Tailored core palette */
    --primary: #f6f0e4;
    --secondary: #e4d8c7;
    --primary-light: #f2cfa4;
    --accent: #f09b60;
    --accent-hover: #db7f3e;
    
    /* Text colors - enhanced contrast */
    --text-primary: #f6f0e4;
    --text-secondary: #e0d6c8;
    --text-muted: #b9afa2;
    --text-light: #92877a;
    --text-inverse: #141a17;
    
    /* Modern professional backgrounds */
    --bg-primary: #0f1918;
    --bg-secondary: #172422;
    --bg-tertiary: #1f302e;
    --bg-dark: #0a1311;
    --bg-card: #182826;
    --bg-hover: #223732;
    
    /* Professional borders */
    --border: #28413b;
    --border-light: #375851;
    --border-dark: #121f1d;
    --border-accent: var(--accent);
    
    /* Enhanced shadows for depth */
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(240, 155, 96, 0.18);
    
    /* Gradients pour le thème sombre */
    --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-hover));
    
    /* Instant Transitions */
    --transition: 0.2s ease;
    --transition-fast: 0.1s ease;
    
    /* Minimal Radius */
    --radius: 4px;
    --radius-lg: 8px;
    
    /* Generous Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Horizontal layout dimensions */
    --media-width-horizontal: 40%;
    --media-height-fixed: 240px;
    --media-aspect-horizontal: 16/10;
    --project-max-width: 1200px;
    --projects-container-width: 1400px;

    /* Image optimization */
    --image-object-position: center;
    --image-overlay-gradient: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0.6) 100%);

    /* Legacy compact media dimensions for fallback */
    --media-height-compact: 240px;
    --media-height-desktop: 280px;
    --media-aspect-compact: 4/3;
    --media-aspect-mobile: 3/2;
}

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

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-weight: 400;
    overflow-x: hidden;
    max-width: 100vw;
    letter-spacing: 0;
    font-feature-settings: 'kern' 1, 'liga' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix pour le texte sélectionné */
::selection {
    background: var(--accent);
    color: var(--text-inverse);
}

::-moz-selection {
    background: var(--accent);
    color: var(--text-inverse);
}

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

/* ===== INSTANT ANIMATIONS ===== */
body:not(.loaded) {
    overflow: hidden;
}

body.loaded .hero-content > * {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Critical CSS inlining */
.hero-content {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

body.loaded .hero-content {
    opacity: 1;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== HEADER ===== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all var(--transition);
}

header.section-active {
    background: linear-gradient(135deg, rgba(42, 45, 58, 0.98) 0%, rgba(53, 53, 71, 0.98) 100%);
    border-bottom: 2px solid var(--accent);
    box-shadow: var(--shadow);
}

header.section-active::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

/* Removed fancy animations */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile menu toggle */

.menu-toggle {
    display: none;
    padding: 0 6px;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.menu-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--bg-hover); }

/* Legacy hamburger bars no longer used */
.menu-toggle .bar { display: none; }

.logo {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.logo-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-heading);
    letter-spacing: 0.01em;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    letter-spacing: 0;
}

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

.nav-links a.active {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

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

/* Remove pseudo arrows; use inline SVG */
.nav-arrow::before { content: none !important; }
.nav-arrow svg { pointer-events: none; }

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.lang-btn.active,
.lang-btn:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    color: var(--accent);
}

/* ===== HERO ===== */
main {
    margin-top: 80px;
}

.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    position: relative;
    padding: var(--space-3xl) 0;
}

/* Removed particles - too fancy */

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3xl);
    position: relative;
    z-index: 1;
}

.hero-greeting {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 400;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
    letter-spacing: 0;
}

.hero-title {
    font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif !important;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    white-space: nowrap;
}

.name {
    color: var(--text-primary) !important;
    display: inline !important;
    opacity: 1 !important;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0;
}

.hero-metrics {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.metric {
    text-align: center;
    min-width: 80px;
}

.metric-number {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0;
    font-weight: 500;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid var(--accent);
}

.cta-button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform: translateX(20px);
}

.profile-photo {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(10%);
    transition: var(--transition);
}

.profile-photo {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(10%);
    transition: var(--transition);
}

.profile-photo:hover {
    border-color: var(--accent);
}

.profile-photo:hover img {
    filter: grayscale(0%);
}

/* Removed floating card - too fancy */

/* ===== SECTIONS ===== */
section {
    padding: var(--space-3xl) 0;
    position: relative;
}

h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 50;
    text-align: center;
    margin-bottom: var(--space-2xl);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ===== ABOUT ===== */
.about {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.stat {
    text-align: center;
    padding: var(--space-xl);
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat:hover {
    border-color: var(--border-accent);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ===== JOURNEY ===== */
.journey {
    background: var(--bg-primary);
    padding: 5rem 0;
}

.journey-content {
    max-width: 900px;
    margin: 0 auto;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 50%, var(--accent) 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    opacity: 1;
    transform: translateX(0);
}

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--accent);
    z-index: 2;
    transition: var(--transition);
}

.timeline-marker.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(240, 155, 96, 0.35);
}

.timeline-marker.future {
    background: var(--bg-tertiary);
    border-color: var(--text-light);
    border-style: dashed;
}

.timeline-section-divider {
    position: relative;
    margin: 2rem 0 1.5rem 0;
    padding-left: 2rem;
}

.timeline-section-divider h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    position: relative;
    text-align: left;
}

.timeline-section-divider h3::before {
    content: '> ';
    color: var(--accent);
    font-family: var(--font-mono);
}

.timeline-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-left: 2rem;
    box-shadow: var(--shadow-subtle);
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.timeline-content h3 {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.timeline-details {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.specialty-badge {
    background: var(--accent);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-sans);
    letter-spacing: 0.5px;
}

.timeline-grade {
    margin-bottom: 1rem;
}

.grade-badge {
    background: var(--primary);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}


.timeline-institution {
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.8rem;
    font-style: italic;
}

.timeline-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

.skill-tag {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: var(--transition);
    font-family: var(--font-sans);
}

.skill-tag:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ===== PROJECTS ===== */
.projects {
    background: var(--bg-secondary);
    position: relative;
    padding: 5rem 0;
}

.projects-container {
    max-width: var(--projects-container-width);
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
}

.project-card {
    width: 100%;
    max-width: var(--project-max-width);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.35s ease;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.project-card.active {
    opacity: 1;
    transform: translateY(0);
}

/* Project transition animations */
.project-card.exiting {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
    transition: all 0.25s ease-in;
}

.project-card.entering {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition: all 0.25s ease-out;
}

.project-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
}

/* Removed fancy project animations */

.nav-arrow {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background: var(--accent);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.nav-arrow:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.nav-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--text-light);
}

.nav-arrow.prev::before { content: '‹'; }
.nav-arrow.next::before { content: '›'; }

.project-counter {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: inline-block;
    border: 1px solid var(--border);
}

.project-counter .current {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.2rem;
}

/* ===== PROJECT CARD ===== */
/* Media zone (left side) */
.project-media {
    flex: 0 0 var(--media-width-horizontal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-gallery {
    position: relative;
    /* Fixed height for horizontal layout */
    height: var(--media-height-fixed);
    overflow: hidden;
    background: var(--bg-secondary);
    flex: 1;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: box-shadow var(--transition);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--image-object-position);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: all 0.5s ease;
    filter: brightness(0.9);
    cursor: pointer;
    will-change: transform, filter;
}

.gallery-image.active {
    opacity: 1;
}

.project-card:hover .gallery-image.active {
    transform: scale(1.02);
    filter: brightness(1.05) contrast(1.05);
}

.project-card:hover .project-gallery {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
}

.gallery-nav {
    /* deprecated: dots moved outside media */
    display: none;
}

.gallery-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid rgba(255,255,255,0.6);
}

.gallery-dot.active {
    background: white;
    transform: scale(1.2);
}

/* External controls (dots + zoom) */
.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    backdrop-filter: blur(2px);
}

.gallery-dots {
    display: flex;
    gap: 0.5rem;
}

.gallery-zoom {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
}

.gallery-zoom:hover:not([disabled]) {
    transform: scale(1.1);
    background: var(--bg-hover);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.nav-arrow:focus-visible,
.gallery-zoom:focus-visible,
.gallery-dot:focus-visible {
    outline: 3px solid rgba(240,155,96,0.55);
    outline-offset: 2px;
}

.gallery-zoom[disabled], .gallery-zoom[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--image-overlay-gradient);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    z-index: 3;
    pointer-events: none;
    transition: opacity var(--transition);
}
/* When details are expanded, keep media fixed and move overlay content down */
.details-expanded .project-overlay {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.project-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.project-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

/* Content zone (right side) */
.project-content-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
}

.project-info {
    padding: 1.5rem;
    background: transparent;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== VIDEO PLAYER WRAPPER ===== */
.project-video-wrapper {
    position: relative;
    /* Fixed height for horizontal layout */
    height: var(--media-height-fixed);
    overflow: hidden;
    background: var(--bg-dark);
    flex: 1;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: box-shadow var(--transition);
}

.project-video-wrapper .plyr__video-embed,
.project-video-wrapper .plyr-video {
    width: 100%;
    height: 100%;
}

.project-video-wrapper .plyr__video-embed iframe,
.project-video-wrapper .plyr-video {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

/* Ensure video fills when inside the unified gallery */
.project-gallery .plyr__video-embed,
.project-gallery .plyr-video {
    width: 100%;
    height: 100%;
}

.project-gallery .plyr__video-embed iframe,
.project-gallery .plyr-video {
    width: 100%;
    height: 100%;
    border: none;
}

.project-gallery .plyr-video {
    object-fit: cover;
}

.project-video-wrapper .video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem;
    z-index: 10;
    pointer-events: none;
}

.project-video-wrapper .project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.project-video-wrapper .project-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* Plyr customization for dark theme */
.plyr {
    --plyr-color-main: var(--accent);
}

.plyr--video {
    border-radius: 0;
}

.tech-icons {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tech-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tech-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Tech colors */
.tech-icon.html { background: linear-gradient(135deg, #e34f26, #f16529); color: white; }
.tech-icon.css { background: linear-gradient(135deg, #1572b6, #33a9dc); color: white; }
.tech-icon.js { background: linear-gradient(135deg, #f7df1e, #f0db4f); color: #333; }
.tech-icon.react { background: linear-gradient(135deg, #61dafb, #21a9d8); color: white; }
.tech-icon.python { background: linear-gradient(135deg, #3776ab, #ffd343); color: white; }
.tech-icon.node { background: linear-gradient(135deg, #339933, #87bf3f); color: white; }
.tech-icon.flutter { background: linear-gradient(135deg, #02569b, #0175c2); color: white; }
.tech-icon.firebase { background: linear-gradient(135deg, #ffca28, #ffa000); color: white; }
.tech-icon.postgres { background: linear-gradient(135deg, #336791, #4a90a4); color: white; }
.tech-icon.redux { background: linear-gradient(135deg, #764abc, #9c4dcc); color: white; }
.tech-icon.websocket { background: linear-gradient(135deg, #010101, #333333); color: white; }
.tech-icon.redis { background: linear-gradient(135deg, #dc382d, #ff6b6b); color: white; }
.tech-icon.default { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; }


.project-content {
    margin-bottom: 1.5rem;
    flex: 1;
}

.project-summary {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: left;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1;
}

.project-details {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: left;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out, margin-top 0.3s ease-out;
    opacity: 0;
    margin-top: 0;
    text-rendering: optimizeLegibility;
}

.project-details.expanded {
    max-height: 500px;
    opacity: 1;
    margin-top: 1.5rem;
}

.project-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.expand-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    min-height: 44px;
    touch-action: manipulation;
}

.expand-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.expand-icon {
    transition: transform 0.3s ease;
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

.github-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.7rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: var(--transition);
}

.github-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.github-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== PHILOSOPHY ===== */
.philosophy {
    background: var(--bg-secondary);
    padding: 4rem 0;
}

.philosophy-content {
    max-width: 1200px;
    margin: 0 auto;
}

.philosophy-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.philosophy-intro h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    position: relative;
}

.philosophy-intro h3::before {
    content: '> ';
    color: var(--accent);
    font-family: var(--font-mono);
}

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

.philosophy-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.philosophy-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: var(--transition);
}

.philosophy-card {
    border: 2px solid var(--accent);
}

.philosophy-card.highlight {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(240, 155, 96, 0.12) 100%);
}

.philosophy-card.highlight::before {
    opacity: 1;
}

.philosophy-icon {
    display: none;
}

.philosophy-card h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0;
}

.philosophy-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.philosophy-card blockquote {
    background: var(--bg-primary);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-primary);
    position: relative;
    font-size: 1.1rem;
    line-height: 1.6;
}

.philosophy-card blockquote::before {
    content: '"';
    font-size: 3rem;
    color: var(--accent);
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-family: var(--font-sans);
    opacity: 0.3;
}

/* ===== SKILLS ===== */
.skills {
    background: var(--bg-primary);
}

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

.skills-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.skills-intro p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

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

.skill-category {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    text-align: center;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.skill-category.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.skill-category h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-family: var(--font-heading);
    letter-spacing: 0;
    font-size: 1.1rem;
}

.skill-category h3::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.skills-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.skill-icon {
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
}

.skill-icon:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.skill-icon-symbol {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-icon-symbol img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: var(--transition);
}

.tech-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: var(--transition);
}

.skill-icon-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    transition: var(--transition);
}

.skill-icon:hover .skill-icon-name {
    color: var(--primary-light);
}

/* Skill colors */
.skill-icon.frontend .skill-icon-symbol { color: #e34f26; }
.skill-icon.backend .skill-icon-symbol { color: #3776ab; }
.skill-icon.mobile .skill-icon-symbol { color: #02569b; }
.skill-icon.database .skill-icon-symbol { color: #336791; }
.skill-icon.devops .skill-icon-symbol { color: #ff6600; }
.skill-icon.design .skill-icon-symbol { color: #ff5722; }

/* Simple hover effects */
.skill-icon:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* Removed fancy text gradient - too fancy */

section {
    padding: var(--space-3xl) 0;
}

/* ===== CONTACT ===== */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.6;
}

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

.contact-link {
    padding: 1.2rem 2.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.contact-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.social-icon-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.social-icon-link svg {
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

.social-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cv-download-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: 2px solid var(--accent);
}

.cv-download-btn:hover {
    background: transparent;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.cv-download-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity var(--transition);
}

.lightbox.active {
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.lightbox-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 1;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Navigation buttons for lightbox */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 10001;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10001;
}

/* Image wrapper and zoom icon styles */
.image-wrapper {
    position: relative;
    display: none;
    width: 100%;
    height: 100%;
}

.image-wrapper:first-child {
    display: block;
}

.zoom-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 5;
    opacity: 0.9;
}

.zoom-icon:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.1);
}

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

/* Simple project cards */
.project-card {
    transform: translateX(0);
    opacity: 1;
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
    padding: 3rem 0;
    font-size: 0.9rem;
}

footer p {
    margin: 0;
    opacity: 0.8;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.5rem !important;
    }

    .hero-text {
        order: 2;
    }

    .hero-visual {
        order: 1;
        transform: none !important;
        width: 100%;
        justify-content: center;
    }

    nav { flex-wrap: wrap; }
    .menu-toggle { display: inline-flex; }

    /* Mobile dropdown nav with smooth expand */
    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
        border-top: 1px solid var(--border);
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transform: translateY(-6px);
        transition: max-height 0.2s ease, opacity 0.18s ease, transform 0.2s ease, padding 0.2s ease;
        padding: 0;
        gap: 0.25rem;
        pointer-events: none;
    }
    #nav-toggle:checked ~ .menu-toggle { border-color: var(--accent); color: var(--accent); background: var(--bg-hover); }
    #nav-toggle:checked ~ .nav-links {
        max-height: 300px;
        opacity: 1;
        transform: translateY(0);
        padding: 0.5rem 0 1rem;
        pointer-events: auto;
    }
    .nav-links a { padding: 0.9rem 0.5rem; font-size: 1.05rem; }

    .stats {
        flex-direction: column;
        gap: 2rem;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    header {
        overflow-x: hidden;
    }

    nav {
        padding: 1rem;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .container,
    .projects-container,
    .skills-container {
        padding: 0 1rem;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .projects-navigation {
        flex-direction: column;
        gap: 2rem;
    }

    .nav-arrow {
        order: 2;
    }

    .project-card {
        order: 1;
    }

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

    .profile-photo {
        width: 180px;
        height: 180px;
        margin: 0 auto;
    }

    .floating-card {
        display: none;
    }

    /* Switch to vertical layout on tablets */
    .project-card {
        flex-direction: column;
        max-width: 700px;
    }

    .project-media {
        flex: none;
        width: 100%;
    }

    .project-gallery,
    .project-video-wrapper {
        aspect-ratio: var(--media-aspect-compact);
        height: auto;
        min-height: var(--media-height-compact);
    }

    .project-content-zone {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero { min-height: auto; padding: var(--space-2xl) 0; }
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    h2 {
        font-size: 2rem;
    }

    .project-card {
        margin: 0 1rem;
        max-width: calc(100vw - 2rem);
        box-sizing: border-box;
    }

    .project-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .expand-toggle-btn {
        order: 2;
        align-self: flex-start;
    }

    .github-link {
        order: 1;
        align-self: center;
    }

    .tech-icons {
        gap: 0.5rem;
    }

    .tech-icon {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    /* Maintain vertical layout for mobile phones */
    .project-card {
        flex-direction: column;
        max-width: calc(100vw - 1rem);
        margin: 0 0.5rem;
        box-sizing: border-box;
    }

    .project-media {
        flex: none;
        width: 100%;
    }

    .project-gallery,
    .project-video-wrapper {
        aspect-ratio: var(--media-aspect-mobile);
        height: auto;
        min-height: 200px;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .project-content-zone {
        width: 100%;
    }

    .project-info {
        padding: 1rem;
    }

    .gallery-controls {
        margin: 0;
        gap: 0.8rem;
        padding: 0.75rem;
        border-radius: 0;
        backdrop-filter: none;
    }

    .gallery-dot {
        width: 16px;
        height: 16px;
        border: 3px solid rgba(255,255,255,0.8);
        background: rgba(255,255,255,0.4);
        padding: 14px;
        border-radius: 50%;
        cursor: pointer;
    }

    .gallery-dot.active {
        background: white;
        transform: scale(1.2);
    }


    .gallery-zoom {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        min-width: 44px;
        min-height: 44px;
    }

    .nav-arrow {
        width: 64px;
        height: 64px;
        border-radius: 12px;
        font-size: 1.8rem;
        min-width: 44px;
        min-height: 44px;
    }

    .project-actions {
        border-top: none;
        padding-top: 0.75rem;
    }
}

/* ===== NOUVELLE SECTION SKILLS ===== */
.skills-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.skill-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition);
    cursor: pointer;
    min-height: 50px;
}

.skill-badge:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.skill-badge img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.skill-badge span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .skills-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    
    .skill-badge {
        padding: 0.8rem 1.2rem;
        min-height: 45px;
    }
    
    .skill-badge span {
        font-size: 0.8rem;
    }
}

/* Skills note section styling */
.skills-special {
    grid-column: 1 / -1;
    margin-top: 2rem;
    text-align: center;
}

.skills-note {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}
