:root {
    /* Color Palette - Dark Mode Default */
    --bg-base: #0f172a;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --bg-surface-hover: rgba(30, 41, 59, 0.9);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));

    --border-color: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-main: 'Outfit', sans-serif;

    /* Spacing & Sizes */
    --nav-height: 80px;
    --container-max: 1200px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);

    --text-main: #0f172a;
    --text-muted: #475569;

    --border-color: rgba(0, 0, 0, 0.1);

    --accent-primary: #2563eb;
    --accent-secondary: #7c3aed;
}

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

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

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

.section {
    padding: 6rem 0;
    position: relative;
    z-index: 2;
}

.pt-hero {
    padding-top: 10rem;
}

/* Background Effects */
.bg-gradient-1,
.bg-gradient-2 {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

.bg-gradient-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: var(--accent-secondary);
}

.bg-gradient-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.glass-panel:hover {
    background: var(--bg-surface-hover);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 100;
    transition: all var(--transition-normal);
}

header.scrolled {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.home-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.home-button:hover {
    transform: scale(1.05);
}

.menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.menu a {
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

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

.menu a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

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

[data-theme="light"] .light-icon {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.primary-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Typography Headings */
.section-header {
    margin-bottom: 4rem;
}

.reveal-text {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.about-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.profile-img-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    border: 3px solid var(--border-color);
}

.img-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent-gradient);
    filter: blur(20px);
    z-index: 1;
    opacity: 0.5;
}

.badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.bio-text {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.bio-text p {
    margin-bottom: 1rem;
}

/* Experience Card */
.experience-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.experience-header {
    padding: 2rem 3rem 1rem;
}

.mobil-inn-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: flex-end;
    min-height: 300px;
}

.mobil-inn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.mobil-inn-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fondu en bas, transparent au milieu, fondu en haut */
    background: linear-gradient(to bottom, var(--bg-base) 35%, rgba(15, 23, 42, 0.4) 100%, rgba(15, 23, 42, 0.4) 0%, var(--bg-base) 0%);
    z-index: 2;
}

[data-theme="light"] .mobil-inn-overlay {
    background: linear-gradient(to bottom, var(--bg-base) 35%, rgba(248, 250, 252, 0.4) 100%, rgba(248, 250, 252, 0.4) 0%, var(--bg-base) 0%);
}

.experience-content {
    position: relative;
    z-index: 3;
    padding: 2rem 3rem;
    width: 100%;
}

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

.company-logo {
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-fast);
}

.company-logo:hover {
    transform: scale(1.05);
}

.company-titles h3 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.project-name {
    color: var(--text-muted);
    font-weight: 500;
}

.tagline {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.role-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Portfolio Projects */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 3rem;
}

.project-card:nth-child(even) {
    grid-template-columns: 1fr 1fr;
}

.project-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.project-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tech-tag {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-main);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.project-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.visual-link {
    display: block;
    position: relative;
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .visual-link {
    background: rgba(0, 0, 0, 0.05);
}

.svg-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-main);
    transition: transform var(--transition-slow);
}

.overlay-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.visual-link:hover .overlay-hover {
    opacity: 0.9;
}

.visual-link:hover .svg-container {
    transform: scale(0.9);
}

/* Footer */
.footer {
    position: relative;
    z-index: 2;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.footer-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer-info p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 400px;
}

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

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    font-weight: 500;
}

.social-btn:hover {
    background: var(--text-main);
    color: var(--bg-base);
    transform: translateY(-3px);
}

.iut-link img {
    height: 60px;
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast);
}

.iut-link:hover img {
    transform: scale(1.05);
}

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

/* Contact Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.contact-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-muted);
}

.flex-col {
    flex-direction: column;
    align-items: flex-start;
}

.contact-form-card {
    padding: 3rem;
}

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

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

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

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-main);
    transition: border-color var(--transition-fast), outline var(--transition-fast);
}

[data-theme="light"] .form-input {
    background: rgba(0, 0, 0, 0.05);
}

.form-input:focus {
    outline: 2px solid var(--accent-primary);
    border-color: transparent;
}

.submit-btn {
    margin-top: 1rem;
    justify-content: center;
    width: 100%;
    font-size: 1.1rem;
}

/* Formation */
.formation-content {
    display: flex;
    padding: 2rem 3rem;
    gap: 2rem;
    align-items: center;
}

.formation-logo img {
    width: 100px;
    height: auto;
    border-radius: var(--radius-sm);
}

.formation-dates {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.bg-white {
    background-color: #fff;
}

.p-2 {
    padding: 0.5rem;
}

.rounded {
    border-radius: var(--radius-sm);
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.text-sm {
    font-size: 0.9rem;
}

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

/* LinkedIn */
.linkedin-content {
    padding: 2rem 3rem;
}

.linkedin-btn {
    background: #0077b5;
    color: white;
    border: none;
}

.linkedin-btn:hover {
    background: #005582;
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    padding: 1rem;
    border-radius: var(--radius-lg);
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 45px;
    height: 45px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: transform var(--transition-fast);
}

.close-modal:hover {
    transform: scale(1.1) rotate(90deg);
}

.iframe-container {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-base);
}

#projectIframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Reset button styles for visual-link */
button.visual-link {
    cursor: pointer;
    text-align: left;
}

/* Responsive Design */
@media (max-width: 992px) {

    .about-grid,
    .project-card,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        display: flex;
        flex-direction: column-reverse;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-info p {
        margin: 0 auto 2rem;
    }
}

@media (max-width: 768px) {
    .menu {
        display: none;
        /* In a real app, we'd add a hamburger menu */
    }

    .reveal-text {
        font-size: 2.5rem;
    }

    .about-card,
    .experience-header,
    .experience-content,
    .project-card,
    .formation-content,
    .linkedin-content,
    .contact-info,
    .contact-form-card {
        padding: 2rem;
    }

    .formation-content {
        flex-direction: column;
        text-align: center;
    }

    .company-top {
        flex-direction: column;
        text-align: center;
    }
}

/* Utilities */
.fade-up {
    opacity: 0;
    visibility: hidden;
}