/* =====================================================================
   PORTFOLIO — Desmon Nankap
   Design premium : noir profond / bleu électrique / violet néon
   ===================================================================== */

:root {
    --black:        #05060a;
    --black-2:      #0a0c14;
    --surface:      #0e1019;
    --surface-2:    #141728;
    --border:       rgba(255, 255, 255, 0.08);
    --border-glow:  rgba(99, 102, 241, 0.35);

    --blue:         #2b6bff;
    --blue-bright:  #4f8bff;
    --violet:       #8b5cf6;
    --violet-neon:  #a855f7;
    --cyan:         #22d3ee;

    --text:         #eef0f7;
    --text-soft:    #aab0c4;
    --text-muted:   #6b7185;

    --grad-main:    linear-gradient(120deg, #2b6bff 0%, #8b5cf6 55%, #a855f7 100%);
    --grad-soft:    linear-gradient(135deg, rgba(43,107,255,0.18), rgba(168,85,247,0.18));
    --glow-blue:    0 0 40px rgba(43, 107, 255, 0.35);
    --glow-violet:  0 0 40px rgba(168, 85, 247, 0.35);

    --radius:       18px;
    --radius-sm:    12px;
    --container:    1180px;
    --font-head:    'Sora', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

/* ----- Décor de fond ----- */
.bg-grid {
    position: fixed; inset: 0; z-index: -2;
    background:
        radial-gradient(800px circle at 15% 0%, rgba(43,107,255,0.12), transparent 45%),
        radial-gradient(700px circle at 85% 15%, rgba(168,85,247,0.12), transparent 45%),
        linear-gradient(var(--black), var(--black-2));
}
.bg-grid::after {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 30%, transparent 80%);
}
.cursor-glow {
    position: fixed; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,0.10), transparent 65%);
    pointer-events: none; z-index: -1; transform: translate(-50%, -50%);
    transition: opacity .3s; opacity: 0;
}

/* ----- Layout ----- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 110px 0; position: relative; }
.section-sm { padding: 70px 0; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.35rem; }
p { color: var(--text-soft); }
a { color: inherit; text-decoration: none; }

.gradient-text {
    background: var(--grad-main);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--blue-bright); margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--blue-bright); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head p { margin-top: 14px; font-size: 1.05rem; }
.text-center { text-align: center; }
.text-center.section-head { margin-left: auto; margin-right: auto; }

/* ----- Boutons ----- */
.btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 14px 28px; border-radius: 100px; font-weight: 600; font-size: .95rem;
    font-family: var(--font-head); cursor: pointer; border: none;
    transition: transform .25s, box-shadow .25s, background .25s; position: relative;
}
.btn-primary { background: var(--grad-main); color: #fff; box-shadow: var(--glow-blue); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 55px rgba(99,102,241,0.55); }
.btn-ghost { background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-glow); transform: translateY(-3px); background: rgba(255,255,255,0.07); }
.btn-sm { padding: 10px 20px; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ----- Glass card ----- */
.glass {
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* =================== HEADER / NAV =================== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    transition: background .35s, border-color .35s, padding .35s;
    padding: 18px 0; border-bottom: 1px solid transparent;
}
.site-header.scrolled {
    background: rgba(8,9,14,0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border); padding: 12px 0;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; }
.brand-logo { height: 42px; width: auto; display: block; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.brand:hover .brand-logo { transform: scale(1.08) rotate(-4deg); }
.site-header.scrolled .brand-logo { height: 38px; }
.footer-brand .brand-logo { height: 52px; }
.admin-brand .brand-logo { height: 36px; }
.brand-mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
    background: var(--grad-main); color: #fff; font-weight: 800; font-size: .95rem;
    box-shadow: var(--glow-blue);
}
.brand-text { font-size: 1.05rem; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
    padding: 9px 16px; border-radius: 100px; font-size: .92rem; font-weight: 500;
    color: var(--text-soft); transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-links a.nav-cta { background: var(--grad-main); color: #fff; box-shadow: var(--glow-blue); }
.nav-links a.nav-cta:hover { transform: translateY(-2px); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =================== FLASH =================== */
.flash-wrap { position: fixed; top: 90px; left: 50%; transform: translateX(-50%); z-index: 200; width: 100%; max-width: 560px; }
.flash {
    padding: 14px 20px; border-radius: var(--radius-sm); margin-bottom: 10px; font-size: .92rem; font-weight: 500;
    border: 1px solid var(--border); backdrop-filter: blur(12px); animation: flashIn .4s ease;
}
.flash-success { background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.4); color: #86efac; }
.flash-error   { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }

/* =================== HERO =================== */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; padding-top: 110px; padding-bottom: 120px; overflow: hidden; }
.hero-hex {
    position: absolute; right: -70px; top: 50%; width: 540px; max-width: 58%;
    opacity: 0.10; z-index: 0; pointer-events: none;
    transform: translateY(-50%); transform-origin: center;
    animation: hexSpin 44s linear infinite;
}
@keyframes hexSpin { to { transform: translateY(-50%) rotate(360deg); } }
.hero-particles { position: absolute; inset: 0; z-index: 0; }
.hero-particle { position: absolute; border-radius: 50%; background: var(--blue-bright); opacity: .5; }
.hero-orb {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; z-index: 0;
}
.hero-orb.a { width: 480px; height: 480px; background: rgba(43,107,255,0.5); top: -120px; right: -80px; }
.hero-orb.b { width: 400px; height: 400px; background: rgba(168,85,247,0.45); bottom: -120px; left: -60px; }
.hero-inner { position: relative; z-index: 2; max-width: 880px; }
.hero h1 { margin-bottom: 24px; }
.hero .typed { color: var(--cyan); }
.hero-lead { font-size: 1.2rem; max-width: 620px; margin-bottom: 38px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 48px; margin-top: 64px; flex-wrap: wrap; }
.hero-stat .num { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; }
.hero-stat .label { color: var(--text-muted); font-size: .9rem; }
.scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); color: var(--text-muted); font-size: .8rem; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 2; }
.scroll-hint .mouse { width: 22px; height: 36px; border: 2px solid var(--text-muted); border-radius: 12px; position: relative; }
.scroll-hint .mouse::after { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 3px; height: 7px; background: var(--text-muted); border-radius: 2px; animation: scrollDot 1.5s infinite; }
@keyframes scrollDot { 0%{opacity:1;top:6px} 100%{opacity:0;top:16px} }

/* =================== CARDS / GRID =================== */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    position: relative; border-radius: var(--radius); padding: 30px;
    background: rgba(255,255,255,0.035); border: 1px solid var(--border);
    backdrop-filter: blur(14px); transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .4s, box-shadow .4s;
    overflow: hidden;
}
.card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: var(--grad-main); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .4s;
}
.card:hover { transform: translateY(-8px); box-shadow: 0 30px 60px -30px rgba(43,107,255,0.4); }
.card:hover::before { opacity: 1; }
.card-icon {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    font-size: 1.4rem; background: var(--grad-soft); border: 1px solid var(--border); margin-bottom: 20px; color: var(--blue-bright);
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: .96rem; }

/* Project card */
.project-card { padding: 0; }
.project-thumb {
    aspect-ratio: 16/10; background: var(--grad-soft); position: relative; overflow: hidden;
    display: grid; place-items: center;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project-card:hover .project-thumb img { transform: scale(1.07); }
.project-thumb .placeholder { font-family: var(--font-head); font-weight: 800; font-size: 2.2rem; color: rgba(255,255,255,0.18); letter-spacing: .1em; }
.project-badge { position: absolute; top: 14px; left: 14px; padding: 5px 12px; border-radius: 100px; font-size: .72rem; font-weight: 600; background: var(--grad-main); color: #fff; }
.project-body { padding: 24px; }
.project-body h3 { margin-bottom: 8px; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tech-tag { font-size: .74rem; padding: 4px 11px; border-radius: 100px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-soft); }

/* =================== TIMELINE =================== */
.timeline { position: relative; max-width: 760px; margin: 0 auto; }
.timeline::before { content: ''; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--blue), var(--violet-neon)); }
.timeline-item { position: relative; padding: 0 0 44px 60px; }
.timeline-item::before {
    content: ''; position: absolute; left: 10px; top: 4px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--black); border: 3px solid var(--blue-bright); box-shadow: var(--glow-blue);
}
.timeline-year { font-family: var(--font-head); font-weight: 700; color: var(--blue-bright); font-size: .95rem; }
.timeline-item h3 { margin: 4px 0 8px; }

/* About — portrait */
.about-intro { display: grid; grid-template-columns: 300px 1fr; gap: 50px; align-items: center; margin-bottom: 60px; }
.about-portrait {
    position: relative; aspect-ratio: 4/5; border-radius: 26px; overflow: hidden; margin: 0;
    background: var(--grad-soft); border: 1px solid var(--border);
    box-shadow: 0 34px 70px -34px rgba(79,70,229,0.55);
    animation: floaty 6s ease-in-out infinite;
}
.about-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-portrait::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px;
    background: var(--grad-main); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.about-portrait .portrait-ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 4rem; color: rgba(255,255,255,0.25); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 760px) {
    .about-intro { grid-template-columns: 1fr; gap: 28px; text-align: center; }
    .about-portrait { max-width: 260px; margin: 0 auto; }
    .about-intro-text .eyebrow { justify-content: center; }
}

/* Skills */
.skill { margin-bottom: 20px; }
.skill-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .92rem; font-weight: 500; }
.skill-bar { height: 8px; border-radius: 100px; background: rgba(255,255,255,0.06); overflow: hidden; }
.skill-fill { height: 100%; border-radius: 100px; background: var(--grad-main); width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }

/* =================== BLOG =================== */
.blog-layout { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; }
.article-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.article-thumb { aspect-ratio: 16/9; background: var(--grad-soft); display: grid; place-items: center; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-thumb .placeholder { font-size: 2.5rem; opacity: .25; }
.article-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.article-meta { display: flex; gap: 12px; font-size: .8rem; color: var(--text-muted); margin-bottom: 12px; align-items: center; }
.chip { font-size: .72rem; padding: 4px 11px; border-radius: 100px; background: var(--grad-soft); color: var(--blue-bright); border: 1px solid var(--border); }
.article-body h3 { margin-bottom: 10px; font-size: 1.2rem; }
.article-body .read-more { margin-top: auto; padding-top: 16px; color: var(--blue-bright); font-weight: 600; font-size: .9rem; }

.sidebar { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 24px; }
.widget { padding: 24px; }
.widget h4 { margin-bottom: 16px; font-size: 1rem; }
.widget .cat-link { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; color: var(--text-soft); }
.widget .cat-link:hover { color: var(--text); }
.widget .cat-link span { color: var(--text-muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; }

/* Article single */
.article-single { max-width: 800px; margin: 0 auto; }
.article-single .article-hero { aspect-ratio: 21/9; border-radius: var(--radius); overflow: hidden; margin-bottom: 36px; background: var(--grad-soft); display: grid; place-items: center; }
.article-content { font-size: 1.08rem; line-height: 1.85; }
.article-content h2 { margin: 38px 0 16px; }
.article-content p { margin-bottom: 18px; color: var(--text-soft); }
.article-content a { color: var(--blue-bright); }

/* Comments */
.comment { padding: 20px; margin-bottom: 14px; }
.comment-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.comment-author { font-weight: 600; font-family: var(--font-head); }
.comment-date { font-size: .8rem; color: var(--text-muted); }

/* =================== FORMS =================== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 500; color: var(--text-soft); }
input, textarea, select {
    width: 100%; padding: 13px 16px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04); border: 1px solid var(--border); color: var(--text);
    font-family: var(--font-body); font-size: .95rem; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43,107,255,0.18); }
textarea { resize: vertical; min-height: 140px; }
.field-error { color: #fca5a5; font-size: .82rem; margin-top: 6px; }
.honeypot { position: absolute; left: -9999px; }

/* =================== PAGINATION =================== */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 56px; }
.pagination a, .pagination span {
    display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04); border: 1px solid var(--border); font-size: .9rem; color: var(--text-soft);
}
.pagination a:hover { border-color: var(--border-glow); color: var(--text); }
.pagination .current { background: var(--grad-main); color: #fff; border-color: transparent; }

/* =================== CTA BANNER =================== */
.cta-banner { position: relative; border-radius: 28px; padding: 70px 50px; text-align: center; overflow: hidden; background: var(--grad-soft); border: 1px solid var(--border); }
.cta-banner h2 { margin-bottom: 16px; }
.cta-banner p { max-width: 520px; margin: 0 auto 30px; }

/* =================== FOOTER =================== */
.site-footer { border-top: 1px solid var(--border); padding: 70px 0 30px; margin-top: 60px; background: var(--black-2); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 40px; margin-bottom: 48px; }
.footer-brand p { margin-top: 16px; max-width: 240px; font-size: .92rem; }
.footer-col h4 { margin-bottom: 16px; font-size: .95rem; }
.footer-col a { display: block; padding: 6px 0; color: var(--text-soft); font-size: .9rem; }
.footer-col a:hover { color: var(--text); }
.footer-muted { font-size: .88rem; margin-bottom: 16px; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 26px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .82rem; flex-wrap: wrap; gap: 10px; }

/* =================== ANIM HELPERS =================== */
.reveal { opacity: 0; transform: translateY(40px); }
.error-page { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--font-head); font-size: clamp(6rem, 18vw, 12rem); font-weight: 800; line-height: 1; }

/* =================== RESPONSIVE =================== */
@media (max-width: 920px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .blog-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar .widget { flex: 1; min-width: 240px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    /* Évite le chevauchement de l'indicateur "Défiler" avec les stats */
    .scroll-hint { display: none; }
    .hero-hex { opacity: 0.06; max-width: 80%; }
    .hero { padding-bottom: 90px; }
}
@media (max-width: 720px) {
    .nav-links {
        position: fixed; inset: 0 0 0 auto; width: min(80%, 320px); flex-direction: column;
        background: rgba(10,12,20,0.96); backdrop-filter: blur(20px); padding: 100px 28px 40px;
        transform: translateX(100%); transition: transform .4s cubic-bezier(.2,.8,.2,1); align-items: stretch; gap: 4px;
        border-left: 1px solid var(--border);
    }
    .nav-links.open { transform: translateX(0); }
    .nav-links a { padding: 14px 18px; }
    .nav-toggle { display: flex; z-index: 101; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .section { padding: 80px 0; }
    .hero-stats { gap: 28px; }
}
