:root {
    --bg:           #F9F9F7;
    --bg-alt:       #F1F0EB;
    --fg:           #0A0A08;
    --fg-muted:     #6A6A65;
    --accent:       #E63C00;
    --border:       rgba(10, 10, 8, 0.09);
    --border-strong:rgba(10, 10, 8, 0.18);
    --glass:        rgba(249, 249, 247, 0.82);

    --font-display: "Bitcount Grid Double Ink", monospace;
    --font-mono:    "DM Mono", monospace;
    --font-ui:      "Syne", sans-serif;

    --nav-h: 62px;
    --r:     8px;
    --r-lg:  14px;
    --max-w: 1180px;
}

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

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

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-mono);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(10,10,8,0.055) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

/* 
   nav
 */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 200;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: var(--glass);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--fg);
    font-family: var(--font-display);
    font-size: 1.15rem;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.navbar-brand:hover { opacity: 0.65; }
#titre-nav { cursor: pointer; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-link {
    display: block;
    padding: 0.4rem 0.9rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg-muted);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    position: relative;
}
.nav-link:hover { color: var(--fg); }
.nav-link.active { color: var(--fg); }
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0.9rem; right: 0.9rem;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.nav-social a { display: flex; opacity: 0.55; transition: opacity 0.2s; }
.nav-social a:hover { opacity: 1; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 201;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--fg);
    border-radius: 2px;
    transition: all 0.3s;
}

/* 
   accueil
 */
.accueil {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: calc(var(--nav-h) + 5rem) 2rem 5rem;
    position: relative;
    z-index: 1;
}

.accueil-bg-grid { display: none; } /* handled by body::before */


.accueil-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--fg-muted);
    letter-spacing: 0.06em;
    margin-bottom: 1.4rem;
}

.label-dot {
    width: 8px; height: 8px;
    background: #22C55E;
    border-radius: 50%;
    animation: pulseGreen 2.2s ease-in-out infinite;
}
@keyframes pulseGreen {
    0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
    50%      { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
}

.accueil-name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6.5vw, 5.5rem);
    line-height: 1.0;
    letter-spacing: -0.02em;
    margin-bottom: 0.8rem;
}
.name-first { display: block; color: var(--fg); }
.name-last  { display: block; color: var(--accent); }

.accueil-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1rem;
    color: var(--fg-muted);
    margin-bottom: 1.4rem;
    min-height: 1.7em;
}
.title-prefix { color: var(--accent); font-weight: 500; }
.cursor-blink {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

.accueil-desc {
    font-size: 0.88rem;
    color: var(--fg-muted);
    line-height: 1.85;
    max-width: 460px;
    margin-bottom: 2rem;
}

.accueil-actions {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.6rem 1.4rem;
    border-radius: var(--r);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
}
.btn-primary {
    background: var(--fg);
    color: var(--bg);
}
.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230,60,0,0.25);
}
.btn-outline {
    background: transparent;
    color: var(--fg);
    border: 1.5px solid var(--border-strong);
}
.btn-outline:hover {
    border-color: var(--fg);
    transform: translateY(-2px);
}
.btn-light {
    background: var(--bg);
    color: var(--fg);
}
.btn-light:hover {
    background: var(--accent);
    color: var(--bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230,60,0,0.3);
}
.btn-large { padding: 0.85rem 2rem; font-size: 0.95rem; }

.accueil-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--fg-muted);
}

/* ── Terminal ── */
.accueil-terminal {
    background: #0F0F0D;
    border-radius: 13px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.04);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #1A1A17;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.red    { background: #FF5F57; }
.term-dot.yellow { background: #FEBC2E; }
.term-dot.green  { background: #28C840; }
.term-title {
    margin: 0 auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.28);
}

.terminal-body {
    padding: 1.4rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.83rem;
    line-height: 2;
}
.term-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: rgba(255,255,255,0.78);
}

.term-prompt { color: #22C55E; font-weight: 600; flex-shrink: 0; }
.term-cmd { color: #93C5FD; }
.term-output { padding-left: 20px; color: rgba(255,255,255,0.45); }
.term-output.accent { color: #FDE68A; }
.term-cursor {
    color: rgba(255,255,255,0.7);
    animation: blink 1s step-end infinite;
}

/* 
   sections
 */
.section { padding: 5.5rem 0; position: relative; z-index: 1; }
.section-alt { background: var(--bg-alt); }

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

.section-header { margin-bottom: 3rem; }
.section-tag {
    display: block;
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.9rem);
    letter-spacing: -0.02em;
}

/* 
   parcours
 */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 5px; top: 14px; bottom: 0;
    width: 1px;
    background: var(--border-strong);
}
.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 2.8rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -17px; top: 5px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--fg-muted);
    border: 2px solid var(--bg);
    z-index: 1;
}
.timeline-dot.current {
    background: var(--accent);
    border-color: var(--bg);
    box-shadow: 0 0 0 4px rgba(230,60,0,0.18);
}

.timeline-date {
    font-size: 0.7rem;
    color: var(--fg-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
.timeline-title {
    font-family: var(--font-ui);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.timeline-place {
    font-size: 0.83rem;
    color: var(--fg-muted);
    margin-bottom: 0.9rem;
}
.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.tag {
    display: inline-block;
    padding: 0.18rem 0.65rem;
    background: rgba(230,60,0,0.07);
    border: 1px solid rgba(230,60,0,0.22);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.timeline-details { list-style: none; }
.timeline-details li {
    font-size: 0.83rem;
    color: var(--fg-muted);
    line-height: 1.75;
    padding-left: 1rem;
    position: relative;
    margin-bottom: 0.2rem;
}
.timeline-details li::before {
    content: '–';
    position: absolute; left: 0;
    color: var(--accent);
}

/* 
   compétences
 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.skill-category {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.6rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.skill-category:hover {
    border-color: var(--border-strong);
    box-shadow: 0 8px 28px rgba(0,0,0,0.06);
}

.skill-cat-title {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0.02em;
}

.skill-items { display: flex; flex-direction: column; gap: 0; }
.skill-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.skill-item:last-child { border-bottom: none; padding-bottom: 0; }
.skill-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg);
}
.skill-detail {
    font-size: 0.7rem;
    color: var(--fg-muted);
}

.soft-skills { margin-top: 0.5rem; }
.soft-title {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 1rem;
}
.soft-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.soft-tag {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    font-size: 0.78rem;
    color: var(--fg-muted);
    transition: border-color 0.2s, color 0.2s;
}
.soft-tag:hover { border-color: var(--fg); color: var(--fg); }

/* 
   projets
 */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.project-card {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.8rem;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    overflow: hidden;
}
.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.project-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 14px 44px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}
.project-card:hover::after { opacity: 1; }

.project-card.featured {
    grid-column: 1 / -1;
    border-color: rgba(230,60,0,0.2);
    background: linear-gradient(135deg, var(--bg) 0%, rgba(230,60,0,0.025) 100%);
}
.project-card.featured:hover {
    border-color: rgba(230,60,0,0.4);
    box-shadow: 0 16px 48px rgba(230,60,0,0.08);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
}
.project-type {
    font-size: 0.68rem;
    color: var(--fg-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}
.project-link:hover { opacity: 0.7; }

.project-title {
    font-family: var(--font-display);
    font-size: 1.55rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.65rem;
    color: var(--fg);
}
.project-desc {
    font-size: 0.83rem;
    color: var(--fg-muted);
    line-height: 1.8;
    margin-bottom: 1.1rem;
}
.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}
.stack-tag {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.68rem;
    color: var(--fg-muted);
    transition: border-color 0.2s;
}
.project-card:hover .stack-tag { border-color: var(--border-strong); }

.project-highlights {
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.highlight {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: 0.78rem;
    color: var(--fg-muted);
    line-height: 1.7;
}
.hl-arrow { color: var(--accent); font-weight: 700; flex-shrink: 0; }

/* IUT  */
.academic-section {
    grid-column: 1 / -1;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
}
.academic-title {
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.04em;
    margin-bottom: 1.1rem;
}
.academic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.academic-item {
    padding: 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--r);
    transition: border-color 0.2s;
}
.academic-item:hover { border-color: var(--border-strong); }
.ac-header {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}
.ac-name {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.35;
}
.ac-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag-sm {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.63rem;
    color: var(--fg-muted);
}
.ac-desc {
    font-size: 0.78rem;
    color: var(--fg-muted);
    line-height: 1.7;
}

/* 
   contacts
 */
.section-dark { background: var(--fg); }

.contact-inner { max-width: 620px; }

.section-dark .section-tag { color: rgba(249,249,247,0.35); }

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.9rem);
    color: var(--bg);
    margin: 0.7rem 0 1rem;
    letter-spacing: -0.02em;
    line-height: 1.08;
}

.contact-desc {
    font-size: 0.88rem;
    color: rgba(249,249,247,0.5);
    line-height: 1.85;
    margin-bottom: 2.2rem;
}
.contact-desc strong { color: rgba(249,249,247,0.82); }

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.contact-links {
    display: flex;
    align-items: center;
    gap: 1.8rem;
    flex-wrap: wrap;
}
.contact-social {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.83rem;
    color: rgba(249,249,247,0.45);
    text-decoration: none;
    transition: color 0.2s;
}
.contact-social:hover { color: var(--bg); }
.contact-social img {
    filter: invert(1) brightness(0.55);
    transition: filter 0.2s;
}
.contact-social:hover img { filter: invert(1); }
.status-green { color: #22C55E; font-size: 0.7rem; }

/* 
   footer
 */
.footer {
    background: var(--fg);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 1.4rem 0;
    position: relative;
    z-index: 1;
}
.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-brand {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: rgba(249,249,247,0.35);
}
.footer-copy {
    font-size: 0.72rem;
    color: rgba(249,249,247,0.25);
}
.footer-links { display: flex; gap: 0.7rem; }
.footer-links a { opacity: 0.35; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; }
.footer-links img { display: block; filter: invert(1); }


/* 
   responsivité
 */
@media (max-width: 960px) {
    .accueil { grid-template-columns: 1fr; min-height: auto; }
    .accueil-terminal { display: none; }
    .projects-grid { grid-template-columns: 1fr; }
    .academic-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--nav-h); left: 0; right: 0;
        background: var(--glass);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border);
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 199;
    }
    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    .nav-links { flex-direction: column; width: 100%; gap: 0; }
    .nav-link {
        padding: 0.8rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }
    .nav-link.active::after { display: none; }
    .nav-toggle { display: flex; }

    .accueil { padding-top: calc(var(--nav-h) + 2.5rem); }
    .accueil-meta { flex-direction: column; gap: 0.6rem; }
    .academic-grid { grid-template-columns: 1fr; }
    .contact-links { flex-direction: column; gap: 1rem; }
    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .accueil-name { font-size: clamp(2.5rem, 13vw, 3.5rem); }
    .section { padding: 4rem 0; }
    .skills-grid { grid-template-columns: 1fr; }
}
