/* =============================================
   VARIABLES
   ============================================= */
:root {
    --bg:           #FFFFFF;
    --bg-white:     #FFFFFF;
    --bg-alt:       #F9FAFB;
    --bg-teal:      #c5e3e5;
    --bg-dark:      #0f1e2e;
    --text:         #0d1b2a;
    --text-muted:   #4a6580;
    --purple:       #7C3AED;
    --teal:         #c5e3e5;
    --teal-deep:    #6db8be;
    --sky:          #38bdf8;
    --gradient:     linear-gradient(90deg, var(--purple), var(--sky));
    --border:       rgba(107,184,190,0.35);
    --border-dark:  rgba(255,255,255,0.08);
    --radius:       12px;
    --radius-lg:    20px;
    --max-w:        1100px;
    --font-code:    'Space Mono', monospace;
    --font-head:    'Syne', sans-serif;
    --font-body:    'Inter', sans-serif;
}

/* =============================================
   DARK MODE
   ============================================= */
[data-theme="dark"] {
    --bg:           #0d1117;
    --bg-white:     #0d1117;
    --bg-alt:       #111820;
    --bg-teal:      #0d1f2d;
    --text:         #dde4ee;
    --text-muted:   #7a90a8;
    --border:       rgba(107,184,190,0.12);
    --teal:         rgba(197,227,229,0.08);
}

[data-theme="dark"] header {
    background: rgba(13,17,23,0.92);
}

[data-theme="dark"] .project-info {
    background: #111820;
}

[data-theme="dark"] .project-card {
    border-color: rgba(107,184,190,0.10);
}

[data-theme="dark"] .project-detail-tags span {
    background: rgba(124,58,237,0.15);
    border-color: rgba(124,58,237,0.25);
}

[data-theme="dark"] .contact-link {
    border-color: rgba(107,184,190,0.12);
}

[data-theme="dark"] .edu-item {
    border-color: rgba(107,184,190,0.12);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

a { text-decoration: none; color: inherit; transition: color .2s; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
picture { display: block; }

.section-container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 80px 32px;
}

.section-container.compact { padding-top: 48px; padding-bottom: 48px; }

/* Gradient divider bar */
.gradient-bar {
    height: 2px;
    background: var(--gradient);
    border-radius: 2px;
    margin: 24px 0;
    width: 60px;
}

/* Section title — code style */
.section-title {
    font-family: var(--font-code);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 8px 0;
}

.bracket {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   NAVIGATION
   ============================================= */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.navbar {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 0;
}

.logo {
    font-family: var(--font-code);
    font-size: 1.1rem;
    font-weight: 700;
    margin-right: auto;
    color: var(--text);
}

.logo .tag {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 32px;
    margin-right: 24px;
}

.nav-links a {
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: color .2s;
    position: relative;
}

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

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

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient);
    border-radius: 2px;
}

/* Nav right group */
.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 24px;
}

/* Language toggle */
.lang-toggle {
    font-family: var(--font-code);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: border-color .2s, color .2s;
}

.lang-toggle:hover {
    border-color: var(--purple);
    color: var(--purple);
}

/* Séparateur vertical entre bouton et dot */
.nav-divider {
    width: 1px;
    height: 16px;
    background: var(--border);
    flex-shrink: 0;
}

/* Animated dot — theme toggle */
.nav-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gradient);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform .2s;
    border: none;
    padding: 0;
    outline-offset: 4px;
}

.nav-dot::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--gradient);
    opacity: 0.4;
    animation: halo 3s ease-in-out infinite;
    will-change: transform, opacity;
    z-index: -1;
}

.nav-dot:hover { transform: scale(1.4); }

[data-theme="dark"] .nav-dot {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

[data-theme="dark"] .nav-dot::before {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

@keyframes halo {
    0%, 100% { transform: scale(1);   opacity: 0.4; }
    50%      { transform: scale(1.6); opacity: 0.15; }
}

/* =============================================
   HERO
   ============================================= */
.hero {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
    min-height: calc(100vh - 60px);
    display: grid;
    grid-template-columns: 1fr 480px;
    align-items: center;
    gap: 0;
}

.hero-left {
    padding: 60px 0;
}

.hero-name {
    font-family: var(--font-code);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 20px;
}

.hero-role {
    font-family: var(--font-code);
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    letter-spacing: 0.02em;
}

.hero-socials {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.hero-socials a {
    color: var(--text-muted);
    transition: color .2s;
    display: flex;
    align-items: center;
}

.hero-socials a:hover { color: var(--purple); }

.hero-right {
    height: 100%;
    display: flex;
    align-items: stretch;
}

.hero-photo-wrap {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.hero-photo-wrap img {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 60px);
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* =============================================
   ABOUT
   ============================================= */
.about { background: var(--bg-alt); }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 72px;
    align-items: start;
    margin-top: 40px;
}

.about-text p {
    font-size: 0.98rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.75;
}

.about-text strong { color: var(--text); font-weight: 600; }

.about-footer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 28px;
}

.about-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.status-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal-deep);
    flex-shrink: 0;
}

.status-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--teal-deep);
    animation: pulse 2.5s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes pulse {
    0%   { transform: scale(1);   opacity: 0.6; }
    100% { transform: scale(2.8); opacity: 0; }
}

.btn-cv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--gradient);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: opacity .2s, transform .2s;
    align-self: flex-start;
}

.btn-cv:hover { opacity: .85; transform: translateY(-2px); }

.about-photo {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-teal);
}

.about-photo picture {
    display: block;
    width: 100%;
    height: 100%;
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* =============================================
   STACK / SKILLS
   ============================================= */
.stack { background: var(--bg); }

.stack-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 32px 0 48px;
    max-width: 560px;
    line-height: 1.7;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 48px;
}

.skill-num {
    font-family: var(--font-code);
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(13, 27, 42, 0.5);
    line-height: 1;
    margin-bottom: 12px;
    display: block;
}

.skill-bar {
    height: 4px;
    border-radius: 4px;
    background: var(--gradient);
    margin-bottom: 20px;
}

.skill-bar.pink   { background: linear-gradient(90deg, var(--teal-deep), var(--sky)); }
.skill-bar.indigo { background: linear-gradient(90deg, var(--sky), var(--purple)); }

.skill-group h3 {
    font-family: var(--font-code);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

.skill-list {
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 2.2;
}

.skill-list span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.7rem;
}

/* =============================================
   GITHUB
   ============================================= */
.github-activity {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.github-label {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.github-activity img {
    width: 100%;
    max-width: 900px;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* =============================================
   PROJECTS
   ============================================= */
.work { background: var(--bg); }

.projects-group-label {
    font-family: var(--font-code);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 48px 0 0;
    padding-bottom: 16px;
}

.projects-group-label + .projects-list {
    margin-bottom: 0;
}

.projects-subgroup-label {
    font-family: var(--font-code);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin: 28px 0 0;
    padding-bottom: 12px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

/* Carte horizontale : cover gauche, infos droite */
.project-card {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 210px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: inherit;
    transition: box-shadow .25s ease, transform .25s ease;
}

.project-card:hover {
    box-shadow: 0 8px 32px rgba(124,58,237,0.10);
    transform: translateY(-2px);
}

.project-preview {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background-size: cover;
    background-position: center;
}

.project-preview.personal  { background-color: #1a0a2e; background-image: linear-gradient(135deg, #1a0a2e 0%, #2d1b69 50%, #4c1d95 100%); }
.project-preview.gesture   { background-color: #0f172a; background-image: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%); }
.project-preview.academic  { background-color: #1f2937; background-image: linear-gradient(135deg, #1f2937 0%, #374151 50%, #4b5563 100%); }

.project-preview-title {
    font-family: var(--font-code);
    font-size: clamp(1rem, 2vw, 1.6rem);
    font-weight: 700;
    color: rgba(255,255,255,0.18);
    text-align: center;
    padding: 0 28px;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.project-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
}

/* Partie droite : infos toujours visibles */
.project-info {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid var(--border);
    background: var(--bg);
}

.project-info-top { display: flex; flex-direction: column; gap: 8px; }

.project-name {
    font-family: var(--font-code);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.project-description {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-info-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tags span {
    font-family: var(--font-code);
    font-size: 0.68rem;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(124,58,237,0.06);
    border: 1px solid rgba(124,58,237,0.18);
    color: var(--purple);
}

.project-see-more {
    font-family: var(--font-code);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color .2s;
}

.project-card:hover .project-see-more {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-date {
    font-family: var(--font-code);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--teal-deep);
    letter-spacing: 0.05em;
}

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

.contact-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 48px;
    line-height: 1.7;
    max-width: 500px;
}

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

.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    transition: padding-left .2s ease;
}

.contact-link:first-child { border-top: 1px solid var(--border); }

.contact-link:hover { padding-left: 8px; }

.contact-link-label {
    font-family: var(--font-code);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 100px;
}

.contact-link-value {
    font-family: var(--font-code);
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text);
    transition: color .2s;
}

.contact-link:hover .contact-link-value {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   EDUCATION
   ============================================= */
.education { background: var(--bg); }

.edu-list {
    display: flex;
    flex-direction: column;
}

.edu-item {
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}

.edu-item:first-child { padding-top: 0; }

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 10px;
}

.edu-item h3 {
    font-family: var(--font-code);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}

.edu-school {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.edu-date {
    font-family: var(--font-code);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 3px;
}

.edu-item > p {
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.edu-group-label {
    font-family: var(--font-code);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--purple);
    margin: 40px 0 8px;
}

.edu-group-label:first-of-type { margin-top: 0; }

/* project date */
.project-date {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

/* 4-col skills on wide screens */
@media (max-width: 900px) {
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    background: var(--text);
    padding: 24px 32px;
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.65);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .footer { flex-direction: column; text-align: center; gap: 6px; padding: 20px; }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .hero          { grid-template-columns: 1fr; min-height: auto; padding: 64px 32px; }
    .hero-right    { display: none; }
    .about-grid    { grid-template-columns: 1fr; gap: 40px; }
    .about-photo   { max-width: 300px; }
    .contact-grid  { grid-template-columns: 1fr; }
    .contact-photo-side { display: none; }
}

@media (max-width: 768px) {
    .section-container { padding: 60px 20px; }
    .hero              { padding: 52px 20px; }
    .hero-name         { font-size: 2rem; }
    .skills-grid       { grid-template-columns: 1fr; gap: 36px; }
    .nav-links         { display: none; }

    /* Cartes projet : layout vertical sur mobile */
    .project-card {
        grid-template-columns: 1fr;
        height: auto;
    }
    .project-preview {
        height: 180px;
        border-left: none;
        border-bottom: 1px solid var(--border);
    }
    .project-info {
        border-left: none;
        padding: 16px 20px;
    }
    .project-description {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    .project-info-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }
    .project-see-more { white-space: normal; }
}
