/* ============================================================
   PORTFOLIO ROMAIN LENOIR — DESIGN "WOW" v2
   Thème : sombre premium, glassmorphism, gradients, animations
   ============================================================ */

:root {
    --bg-color: #0a0e17;
    --bg-secondary: #0f1524;
    --card-bg: #141b2d;
    --card-hover: #1a2338;
    --text-main: #e8edf5;
    --text-dim: #8b94a7;
    --accent: #4f8cff;
    --accent-2: #7c5cff;
    --accent-3: #00d4a0;
    --accent-glow: rgba(79, 140, 255, 0.35);
    --border: #232d42;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Segoe UI', Roboto, -apple-system, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(ellipse at 20% -10%, rgba(79, 140, 255, 0.12), transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 92, 255, 0.08), transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 212, 160, 0.05), transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* ============ HEADER ============ */
header {
    background: rgba(10, 14, 23, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1rem 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

header.scrolled {
    border-bottom: 1px solid var(--border);
    background: rgba(10, 14, 23, 0.92);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-main);
}

.logo-dot {
    color: var(--accent);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.8rem;
    align-items: center;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

nav ul li a:not(.nav-cv-btn)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.3s;
}

nav ul li a:not(.nav-cv-btn):hover {
    color: var(--text-main);
}

nav ul li a:not(.nav-cv-btn):hover::after {
    width: 100%;
}

.nav-cv-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff !important;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.nav-cv-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
}

/* ============ HERO ============ */
.profile-section {
    min-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    padding: 5rem 8% 4rem;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 50%, rgba(79, 140, 255, 0.08), transparent 40%);
    pointer-events: none;
}

.profile-text {
    max-width: 620px;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-3);
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(0, 212, 160, 0.08);
    border: 1px solid rgba(0, 212, 160, 0.25);
    padding: 0.35rem 0.9rem;
    border-radius: 30px;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 160, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(0, 212, 160, 0); }
}

.profile-text h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.8rem;
    letter-spacing: -1.5px;
}

.gradient-text {
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.hero-role {
    color: var(--text-dim);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.hero-role i {
    color: var(--accent);
}

.hero-desc {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.cv-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff !important;
    padding: 0.8rem 1.6rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 20px var(--accent-glow);
    border: none;
    cursor: pointer;
}

.cv-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    color: var(--text-main) !important;
    padding: 0.8rem 1.6rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.contact-btn:hover {
    border-color: var(--accent);
    background: rgba(79, 140, 255, 0.08);
    transform: translateY(-3px);
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--text-main), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.profile-image {
    position: relative;
    z-index: 1;
}

.image-frame {
    width: 300px;
    height: 300px;
    border-radius: 24px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--card-bg);
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    padding: 2px;
    background: linear-gradient(135deg, var(--accent), transparent, var(--accent-2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tech-badge {
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: float 4s ease-in-out infinite;
}

.tech-1 { top: -15px; right: -10px; color: #f7c948; }
.tech-2 { bottom: 20px; left: -25px; color: var(--accent); animation-delay: 0.5s; }
.tech-3 { bottom: -18px; right: 30px; color: #e8a33d; animation-delay: 1s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ============ SECTIONS ============ */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-eyebrow {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.6rem;
}

.section-sub {
    color: var(--text-dim);
    max-width: 500px;
    margin: 0 auto;
}

.projects-section,
.skills-section,
.contact-section {
    padding: 5rem 8%;
    max-width: 1400px;
    margin: 0 auto;
}

.projects-section {
    border-top: 1px solid var(--border);
}

/* ============ PROJET VEDETTE ============ */
.featured-project {
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.12), rgba(124, 92, 255, 0.06));
    border: 1px solid rgba(79, 140, 255, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.featured-project:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 40px rgba(79, 140, 255, 0.15);
    transform: translateY(-3px);
}

.featured-project::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.15), transparent 70%);
    pointer-events: none;
}

.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.featured-content h3 {
    font-size: 1.7rem;
    margin-bottom: 0.6rem;
}

.featured-desc {
    color: var(--text-dim);
    margin-bottom: 1.2rem;
    max-width: 720px;
    line-height: 1.7;
}

.featured-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.featured-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--accent) !important;
    text-decoration: none;
    transition: var(--transition);
}

.featured-link:hover {
    gap: 0.8rem;
    color: var(--accent-3) !important;
}

.projects-subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin: 2rem 0 1.2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.projects-subtitle::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 2px;
}

/* ============ CARTES PROJETS ============ */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s;
}

.project-card:hover {
    background: var(--card-hover);
    border-color: rgba(79, 140, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-folder {
    font-size: 1.6rem;
    color: var(--accent);
}

.project-card-top .repo-link {
    color: var(--text-dim);
    font-size: 1.2rem;
    transition: var(--transition);
}

.project-card-top .repo-link:hover {
    color: var(--text-main);
}

.project-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: capitalize;
}

.project-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    flex-grow: 1;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.language-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(79, 140, 255, 0.12);
    color: var(--accent);
    border: 1px solid rgba(79, 140, 255, 0.25);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.loading-text, .error-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-dim);
    padding: 2rem;
}

.error-text a {
    color: var(--accent);
}

/* ============ COMPÉTENCES ============ */
.skills-section {
    border-top: 1px solid var(--border);
}

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

.skill-group {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.6rem;
    transition: var(--transition);
}

.skill-group:hover {
    border-color: rgba(79, 140, 255, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.skill-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.2), rgba(124, 92, 255, 0.2));
    color: var(--accent);
    margin-bottom: 1rem;
}

.skill-group h4 {
    margin-bottom: 0.9rem;
    font-size: 1.05rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.skill-tags span {
    background: rgba(79, 140, 255, 0.08);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
    transition: var(--transition);
}

.skill-tags span:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(79, 140, 255, 0.15);
}

/* ============ CONTACT ============ */
.contact-section {
    border-top: 1px solid var(--border);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.6rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(79, 140, 255, 0.15);
    background: var(--card-hover);
}

.contact-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.2), rgba(124, 92, 255, 0.2));
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.contact-card h4 {
    font-size: 1rem;
}

.contact-card p {
    color: var(--text-dim);
    font-size: 0.85rem;
    word-break: break-all;
}

.contact-cta {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.contact-cta p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.contact-cta p i {
    color: var(--accent);
    margin-right: 0.4rem;
}

/* ============ FOOTER ============ */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 8%;
    background: var(--bg-secondary);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
}

footer p {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-social {
    display: flex;
    gap: 0.8rem;
}

.footer-social a {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    transition: var(--transition);
}

.footer-social a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
}

/* ============ ANIMATIONS REVEAL ============ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .profile-section {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 3rem;
        gap: 2rem;
    }
    
    .profile-text h1 { font-size: 2.2rem; }
    .hero-desc { margin: 0 auto 2rem; }
    .hero-actions, .hero-stats { justify-content: center; }
    .profile-image { margin-bottom: 1rem; }
    .image-frame { width: 220px; height: 220px; }
    .tech-badge { width: 38px; height: 38px; font-size: 1.1rem; }
    
    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-secondary);
        padding: 1rem 8%;
        border-bottom: 1px solid var(--border);
        gap: 1rem;
    }
    
    nav ul.open { display: flex; }
    .menu-toggle { display: block; }
    
    .skills-section, .projects-section, .contact-section {
        padding: 3.5rem 6%;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== ICONES SVG INLINE ===== */
.ic {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: middle;
}

.ic-lg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.nav-cv-btn .ic { width: 14px; height: 14px; }
.hero-role .ic { width: 18px; height: 18px; color: var(--accent); }
.cv-download-btn .ic, .contact-btn .ic { width: 15px; height: 15px; }
.hero-stats .ic, .stat .ic { display: none; }
.featured-badge .ic { width: 13px; height: 13px; }
.featured-link .ic { width: 15px; height: 15px; transition: transform 0.3s; }
.featured-link:hover .ic { transform: translateX(4px); }
.project-folder { color: var(--accent); }
.project-card-top .repo-link { color: var(--text-dim); display: inline-flex; }
.project-card-top .repo-link:hover { color: var(--text-main); }
.contact-icon .ic-lg { width: 24px; height: 24px; }
.contact-cta .ic { color: var(--accent); margin-right: 0.3rem; }
.footer-social .ic { width: 16px; height: 16px; }
.menu-toggle .ic { width: 20px; height: 20px; }
.tech-badge .ic-lg { width: 20px; height: 20px; }
