/* 
 * Portfolio Kilian Jeny — V2 Refonte
 * Aesthetic: Dark Editorial / Refined Cyber
 * Fonts: Sora (display) + DM Sans (body)
 */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

:root {
    --bg-color: #060608;
    --bg-secondary: #0c0c10;
    --surface-color: #111116;
    --surface-hover: #1a1a22;
    --surface-elevated: #16161e;
    --text-primary: #f0f0f5;
    --text-secondary: #8a8a9a;
    --text-tertiary: #55556a;
    --accent-color: #00e676;
    --accent-soft: #00c864;
    --accent-glow: rgba(0, 230, 118, 0.15);
    --accent-glow-strong: rgba(0, 230, 118, 0.3);
    --accent-bg: rgba(0, 230, 118, 0.06);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --font-display: 'Sora', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(0, 230, 118, 0.08);
    --header-height: 72px;
}

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

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-color); color: var(--bg-color); }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 2rem; border-bottom: none; display: inline-block; padding-bottom: 0; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { color: var(--text-secondary); margin-bottom: 1rem; font-size: 0.95rem; line-height: 1.8; }
a { text-decoration: none; color: inherit; transition: color var(--transition-fast); }
ul { list-style: none; }

/* Section title accent line */
.section-title { position: relative; display: inline-block; margin-bottom: 3rem; padding-bottom: 0.75rem; }
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 60px; height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 2px;
}

/* ── Utility ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.section {
    padding: 100px 0;
    position: relative;
}
.section::before {
    content: ''; position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 0;
}
.section > .container { position: relative; z-index: 1; }
.section-alt { background-color: var(--bg-secondary); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px;
    background-color: transparent;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-display);
    font-weight: 600; font-size: 0.82rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative; overflow: hidden;
}
.btn::before {
    content: ''; position: absolute; inset: 0;
    background: var(--accent-color);
    transform: translateY(100%);
    transition: transform var(--transition-base);
    z-index: -1;
}
.btn:hover { color: var(--bg-color); border-color: var(--accent-color); box-shadow: var(--shadow-glow); }
.btn:hover::before { transform: translateY(0); }

.btn-primary { background-color: var(--accent-color); color: var(--bg-color); border-color: var(--accent-color); }
.btn-primary::before { background: var(--accent-soft); }
.btn-primary:hover { color: var(--bg-color); box-shadow: 0 0 40px var(--accent-glow-strong); transform: translateY(-2px); }

.btn-voir { font-size: 0.75rem; padding: 8px 18px; margin-top: 15px; }

/* ── Header ── */
header {
    position: fixed; top: 0; width: 100%; height: var(--header-height);
    background-color: rgba(6, 6, 8, 0.85);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all var(--transition-base);
}
header.scrolled { background-color: rgba(6, 6, 8, 0.95); box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
header .container { display: flex; justify-content: space-between; align-items: center; height: 100%; }

.logo {
    font-family: var(--font-display); font-size: 1.25rem; font-weight: 800;
    color: var(--text-primary); letter-spacing: 3px; text-transform: uppercase; white-space: nowrap;
}
.logo span { color: var(--accent-color); text-shadow: 0 0 20px var(--accent-glow); }

nav ul { display: flex; gap: 6px; }
nav a {
    font-family: var(--font-display); font-size: 0.78rem; font-weight: 500;
    color: var(--text-secondary); padding: 8px 14px; border-radius: var(--radius-sm);
    transition: all var(--transition-fast); letter-spacing: 0.5px; text-transform: uppercase;
}
nav a:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
nav a.active { color: var(--accent-color); background: var(--accent-bg); }

.lang-switch {
    display: flex; gap: 4px; background: var(--surface-color);
    padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-color);
}
.lang-btn {
    background: none; border: none; color: var(--text-tertiary);
    padding: 6px 12px; cursor: pointer; font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 600; border-radius: 6px;
    transition: all var(--transition-fast); letter-spacing: 1px;
}
.lang-btn.active { background: var(--accent-color); color: var(--bg-color); }
.lang-btn:hover:not(.active) { color: var(--text-primary); }

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    padding: 8px; z-index: 1100; background: none; border: none;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-primary); transition: all var(--transition-base); border-radius: 2px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Hero ── */
.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; padding-top: var(--header-height);
    position: relative; overflow: hidden;
}
.hero::after {
    content: ''; position: absolute; width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 0; animation: heroPulse 6s ease-in-out infinite;
}
@keyframes heroPulse {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.15); }
}
.hero-bg-grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px; z-index: 0;
}
.hero-content { max-width: 820px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.5rem); margin-bottom: 1.5rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; }
.hero h1 span { color: var(--accent-color); text-shadow: 0 0 40px var(--accent-glow); }
.hero p { font-size: 1.15rem; margin-bottom: 2.5rem; color: var(--text-secondary); max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── About ── */
.about-grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: 60px; align-items: start; }
.about-text p { font-size: 1rem; line-height: 1.85; }
.about-image { display: flex; justify-content: center; align-items: center; }
.about-image img {
    border-radius: 50%; border: 3px solid var(--accent-color);
    box-shadow: 0 0 40px var(--accent-glow), 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: cover; transition: all var(--transition-slow);
}
.about-image img:hover { transform: scale(1.05); box-shadow: 0 0 60px var(--accent-glow-strong), 0 20px 60px rgba(0, 0, 0, 0.5); }

/* ── Education & Experience Timelines ── */
.education-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }

.education-timeline, .experience-timeline { position: relative; padding-left: 36px; }
.education-timeline::before, .experience-timeline::before {
    content: ''; position: absolute; left: 0; top: 8px; bottom: 0; width: 2px;
    background: linear-gradient(to bottom, var(--accent-color), var(--border-color)); border-radius: 2px;
}

.education-item, .experience-item {
    position: relative; margin-bottom: 36px; padding: 20px 24px;
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); transition: all var(--transition-base);
}
.education-item:hover, .experience-item:hover { border-color: var(--border-hover); transform: translateX(4px); box-shadow: var(--shadow-card); }

.education-item::before, .experience-item::before {
    content: ''; position: absolute; left: -42px; top: 26px;
    width: 12px; height: 12px; background-color: var(--bg-color);
    border: 2.5px solid var(--accent-color); border-radius: 50%;
    transition: all var(--transition-base); z-index: 1;
}
.education-item:hover::before, .experience-item:hover::before { background-color: var(--accent-color); box-shadow: 0 0 15px var(--accent-glow-strong); }
.education-item:last-child, .experience-item:last-child { margin-bottom: 0; }
.education-item h3, .experience-item h3 { font-size: 1.05rem; margin-bottom: 6px; color: var(--text-primary); }
.education-item .date, .experience-item .date {
    display: inline-block; margin-bottom: 8px; font-family: var(--font-display);
    font-size: 0.78rem; font-weight: 600; color: var(--accent-color);
    background: var(--accent-bg); padding: 3px 10px; border-radius: 20px; letter-spacing: 0.5px;
}

/* ── Project Cards ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.project-card {
    background: var(--surface-color); padding: 18px; border-radius: var(--radius-md);
    border: 1px solid var(--border-color); display: flex; flex-direction: column;
    justify-content: space-between; transition: all var(--transition-base);
    position: relative; overflow: hidden;
}
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    opacity: 0; transition: opacity var(--transition-base);
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow-card), var(--shadow-glow); }
.project-card:hover::before { opacity: 1; }
.project-card h3 { font-size: 0.95rem; margin-bottom: 8px; color: var(--text-primary); }
.project-card h3 i { color: var(--accent-color); margin-right: 8px; font-size: 0.95rem; }
.project-card h4 { color: var(--accent-color); margin-bottom: 12px; font-size: 1rem; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.tag {
    font-family: var(--font-display); font-size: 0.7rem; font-weight: 600;
    padding: 5px 12px; background: var(--accent-bg); border: 1px solid rgba(0, 230, 118, 0.15);
    border-radius: 20px; color: var(--accent-color); letter-spacing: 0.5px; text-transform: uppercase;
}
.mission-card { border-left: 3px solid var(--accent-color); }

/* ── Skill Lists ── */
.skill-list li {
    margin-bottom: 10px; display: flex; align-items: flex-start; gap: 10px;
    color: var(--text-secondary); font-size: 0.92rem; line-height: 1.6;
}
.skill-list li::before { content: "›"; color: var(--accent-color); font-weight: 700; font-size: 1.2rem; line-height: 1.4; flex-shrink: 0; }
.skill-list li i { color: var(--accent-color); flex-shrink: 0; margin-top: 3px; }

/* ── Certifications ── */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.cert-card {
    background: var(--surface-color); padding: 32px 24px; border-radius: var(--radius-md);
    border: 1px solid var(--border-color); text-align: center;
    transition: all var(--transition-base); position: relative; overflow: hidden;
}
.cert-card::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: var(--accent-color); transform: scaleX(0); transition: transform var(--transition-base);
}
.cert-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow-card); }
.cert-card:hover::after { transform: scaleX(1); }
.cert-card h4 { font-family: var(--font-display); font-size: 1rem; color: var(--text-primary); margin-bottom: 6px; }
.cert-card p { font-size: 0.85rem; color: var(--text-tertiary); }
.cert-status {
    display: inline-block; margin: 12px 0; padding: 5px 16px; border-radius: 20px;
    font-family: var(--font-display); font-size: 0.72rem; font-weight: 600;
    background: var(--accent-bg); color: var(--accent-color); letter-spacing: 0.5px; text-transform: uppercase;
}

/* ── Contact ── */
.contact-container { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-info a {
    display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 1rem;
    color: var(--text-secondary); padding: 12px 16px; border-radius: var(--radius-sm);
    transition: all var(--transition-fast); border: 1px solid transparent;
}
.contact-info a:hover { color: var(--accent-color); background: var(--accent-bg); border-color: rgba(0, 230, 118, 0.1); }

form input, form textarea {
    width: 100%; padding: 14px 16px; margin-bottom: 16px;
    background-color: var(--surface-color); border: 1.5px solid var(--border-color);
    color: var(--text-primary); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 0.92rem; transition: all var(--transition-fast);
}
form input:focus, form textarea:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-glow); }
form input::placeholder, form textarea::placeholder { color: var(--text-tertiary); }

/* ── Tables ── */
table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--radius-md); overflow: hidden; font-size: 0.88rem; }
thead tr { background: linear-gradient(135deg, var(--accent-bg), rgba(0, 230, 118, 0.03)); }
thead th {
    padding: 14px 16px; color: var(--accent-color); font-family: var(--font-display);
    font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
    text-align: left; border-bottom: 2px solid rgba(0, 230, 118, 0.15);
}
tbody td { padding: 14px 16px; color: var(--text-secondary); background: var(--surface-color); border-bottom: 1px solid var(--border-color); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover td { background: var(--surface-hover); }

/* ── Footer ── */
footer {
    text-align: center; padding: 40px 0; border-top: 1px solid var(--border-color);
    color: var(--text-tertiary); font-size: 0.85rem; font-family: var(--font-display); letter-spacing: 0.5px;
}

/* ── PDF Modal ── */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.92); backdrop-filter: blur(10px);
    z-index: 2000; justify-content: center; align-items: center;
}
.modal-content {
    width: 98%; height: 95%; max-width: none; background-color: var(--surface-color);
    position: relative; border-radius: var(--radius-lg); display: flex; flex-direction: column;
    border: 1px solid var(--border-color); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); overflow: hidden;
}
@keyframes scaleIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.close-modal {
    position: absolute; top: 10px; right: 10px; color: var(--text-primary); font-size: 2rem;
    cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: all var(--transition-fast); background: rgba(0, 0, 0, 0.5); z-index: 10;
}
.close-modal:hover { background: rgba(0, 0, 0, 0.7); transform: rotate(90deg); }
iframe { width: 100%; flex: 1; border: none; border-radius: var(--radius-lg); min-height: 0; }

/* ── Language ── */
body.lang-fr [data-lang="en"] { display: none !important; }
body.lang-en [data-lang="fr"] { display: none !important; }

/* ── Scroll-to-top ── */
.scroll-top {
    position: fixed; bottom: 32px; right: 32px; width: 48px; height: 48px;
    background: var(--accent-color); color: var(--bg-color); border: none; border-radius: 50%;
    cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all var(--transition-base); z-index: 999; box-shadow: 0 4px 20px var(--accent-glow-strong);
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { transform: translateY(-4px); box-shadow: 0 8px 30px var(--accent-glow-strong); }

/* ── Scroll Reveal Animations ── */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-right.visible { opacity: 1; transform: translateX(0); }

.stagger-children > * { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; }
.stagger-children.visible > * { opacity: 1; transform: translateY(0); }

/* ── E5 Page ── */
.page-e5 { padding-top: calc(var(--header-height) + 40px); }
.e5-title { text-align: center; margin-bottom: 1rem; }
.presentation-box {
    background: var(--surface-color); border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color); padding: 24px 28px;
    border-radius: var(--radius-md); margin-bottom: 40px;
}

/* Summary box */
.summary-box {
    background: var(--accent-bg); border: 1px solid rgba(0, 230, 118, 0.15);
    padding: 24px; border-radius: var(--radius-md);
}
.summary-box h4 { color: var(--accent-color); margin-bottom: 16px; font-family: var(--font-display); }

/* ── Keyframes ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 992px) {
    nav ul { flex-wrap: wrap; justify-content: center; gap: 4px; }
    nav a { font-size: 0.72rem; padding: 6px 10px; }
    .about-grid, .education-grid, .contact-container { grid-template-columns: 1fr; gap: 40px; }
    .projects-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
    :root { --header-height: 64px; }
    .section { padding: 70px 0; }

    nav {
        position: fixed; top: 0; right: -100%; width: 80%; max-width: 320px; height: 100vh;
        background: var(--bg-secondary); border-left: 1px solid var(--border-color);
        padding: 100px 32px 40px; transition: right var(--transition-base); z-index: 1050; overflow-y: auto;
    }
    nav.open { right: 0; }
    nav ul { flex-direction: column; gap: 4px; }
    nav a { display: block; font-size: 0.88rem; padding: 14px 16px; border-radius: var(--radius-sm); }
    .hamburger { display: flex; }

    .nav-overlay {
        position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 1040;
        opacity: 0; visibility: hidden; transition: all var(--transition-base);
    }
    .nav-overlay.visible { opacity: 1; visibility: visible; }

    header .container { padding: 0 16px; }
    .hero h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
    .hero p { font-size: 1rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 280px; justify-content: center; }
    .about-grid, .education-grid, .contact-container { grid-template-columns: 1fr; gap: 30px; }
    .about-image { order: -1; }
    .projects-grid, .cert-grid { grid-template-columns: 1fr; }
    .scroll-top { bottom: 20px; right: 20px; width: 42px; height: 42px; }
    table { font-size: 0.8rem; }
    thead th, tbody td { padding: 10px 12px; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero h1 { font-size: 1.6rem; }
    .project-card { padding: 20px; }
    .education-item, .experience-item { padding: 16px; }
}

@media print {
    header, .scroll-top, .hamburger, .nav-overlay, .lang-switch { display: none !important; }
    .section { padding: 20px 0; }
    body { background: white; color: black; }
}
