/* ============================================================
   Portfolio — Johan Leroy, développeur fullstack
   Thème sombre par défaut (:root), thème clair via [data-theme="light"].
   Aucune dépendance réseau (polices auto-hébergées).
   ============================================================ */

/* ---------- Polices auto-hébergées (sous-ensemble latin) ---------- */
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/inter-400.woff2') format('woff2');}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/inter-500.woff2') format('woff2');}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/inter-600.woff2') format('woff2');}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/inter-700.woff2') format('woff2');}
@font-face{font-family:'Inter';font-style:normal;font-weight:800;font-display:swap;src:url('/fonts/inter-800.woff2') format('woff2');}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/jetbrains-mono-400.woff2') format('woff2');}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/jetbrains-mono-500.woff2') format('woff2');}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/jetbrains-mono-600.woff2') format('woff2');}

/* ---------- Variables de thème ---------- */
:root{
  --bg:#09090b; --surface:#18181b; --surface-2:rgba(24,24,27,.55); --border:#27272a; --border-soft:#1c1c1f;
  --text:#f4f4f5; --text-muted:#a1a1aa; --text-dim:#52525b;
  --accent:#34d399; --accent-solid:#059669; --accent-hover:#10b981; --coffee:#f59e0b;
  --info:#7dd3fc; --warn:#fcd34d; --danger:#f87171;
  --halo:.12; --grain:.025; --shadow:0 24px 48px -20px rgba(0,0,0,.65);
  --font-sans:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,monospace;
  --maxw:1120px; --header-h:88px;
}
html[data-theme="light"]{
  --bg:#fafafa; --surface:#ffffff; --surface-2:#f4f4f5; --border:#e4e4e7; --border-soft:#ececee;
  --text:#18181b; --text-muted:#52525b; --text-dim:#a1a1aa;
  --accent:#059669; --accent-solid:#059669; --accent-hover:#047857; --coffee:#d97706;
  --info:#0284c7; --warn:#d97706; --danger:#dc2626;
  --halo:.06; --grain:.02; --shadow:0 18px 38px -22px rgba(24,24,27,.22);
}

/* ---------- Base ---------- */
*{box-sizing:border-box;}
html{scroll-behavior:smooth;scroll-padding-top:var(--header-h);}
html,body{margin:0;padding:0;background:var(--bg);}
body{font-family:var(--font-sans);color:var(--text);-webkit-font-smoothing:antialiased;overflow-x:hidden;line-height:1.5;}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;border:0;background:none;cursor:pointer;}
img{max-width:100%;}
h1,h2,h3,h4,p,ul{margin:0;}
*,*::before,*::after{transition:background-color .22s ease,border-color .22s ease,color .22s ease,fill .22s ease;}
::selection{background:var(--accent);color:var(--bg);}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px;}
.mono{font-family:var(--font-mono);}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* ---------- Animations ---------- */
@keyframes jl-pulse{0%,100%{box-shadow:0 0 0 0 rgba(52,211,153,.55);}50%{box-shadow:0 0 0 5px rgba(52,211,153,0);}}
@keyframes jl-blink{0%,49%{opacity:1;}50%,100%{opacity:0;}}

/* ---------- Overlays décoratifs (halo + grain) ---------- */
.halo{position:fixed;top:-40px;left:50%;transform:translateX(-50%);width:1100px;max-width:140vw;height:560px;background:radial-gradient(50% 60% at 50% 0%,var(--accent) 0%,transparent 70%);opacity:var(--halo);pointer-events:none;z-index:0;filter:blur(18px);}
.grain{position:fixed;inset:0;background-image:radial-gradient(var(--text) 1px,transparent 1px);background-size:34px 34px;opacity:var(--grain);pointer-events:none;z-index:0;-webkit-mask-image:linear-gradient(to bottom,#000,transparent 70%);mask-image:linear-gradient(to bottom,#000,transparent 70%);}
.page{position:relative;z-index:1;}

/* ---------- Structure de page ---------- */
.container{max-width:var(--maxw);margin:0 auto;padding-left:24px;padding-right:24px;}
.section{padding-top:clamp(56px,8vw,96px);padding-bottom:clamp(56px,8vw,96px);}
.eyebrow{font-family:var(--font-mono);font-size:13px;color:var(--accent);margin-bottom:12px;}
.h2{font-size:clamp(28px,4vw,40px);font-weight:700;letter-spacing:-.03em;color:var(--text);}
.label-mono{font-family:var(--font-mono);font-size:12px;color:var(--text-dim);text-transform:uppercase;letter-spacing:.08em;}

/* ---------- Apparition au scroll ---------- */
.reveal{opacity:0;transform:translateY(22px);transition:opacity .7s ease,transform .7s ease;}
.reveal.is-visible{opacity:1;transform:none;}

/* ---------- Icônes (fill/stroke posés en attribut sur chaque <svg>) ---------- */
.ic{flex:none;}

/* ---------- En-tête / navigation ---------- */
.site-header{position:sticky;top:0;z-index:50;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);background:var(--surface-2);border-bottom:1px solid var(--border);}
.nav{max-width:var(--maxw);margin:0 auto;padding:13px 24px;display:flex;align-items:center;gap:18px;}
.nav-logo{display:flex;align-items:center;flex:none;}
.nav-logo img{height:29px;width:auto;display:block;}
.nav-links{display:flex;align-items:center;gap:6px;margin-left:6px;}
.nav-link{font-family:var(--font-mono);font-size:13px;color:var(--text-muted);padding:7px 11px;border-radius:8px;}
.nav-link:hover{color:var(--text);}
.nav-link.is-active{color:var(--accent);}
.nav-actions{margin-left:auto;display:flex;align-items:center;gap:9px;}

.btn-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:9px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted);}
.btn-icon:hover{color:var(--accent);border-color:var(--accent);}

/* Bascule d'icône thème : soleil en sombre, lune en clair (CSS pur) */
.icon-moon{display:none;}
.icon-sun{display:block;}
html[data-theme="light"] .icon-sun{display:none;}
html[data-theme="light"] .icon-moon{display:block;}

.btn-coffee{display:inline-flex;align-items:center;gap:7px;padding:8px 13px;border-radius:9px;border:1px solid var(--coffee);color:var(--coffee);font-size:13px;font-weight:600;}
.btn-coffee:hover{background:color-mix(in srgb,var(--coffee) 12%,transparent);transform:translateY(-1px);}

.burger{display:none;align-items:center;justify-content:center;width:40px;height:40px;border-radius:9px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);}

/* Menu mobile (déplié sous l'en-tête) */
.mobile-menu{display:none;border-top:1px solid var(--border);background:var(--surface);padding:14px 24px 18px;flex-direction:column;gap:4px;}
.mobile-menu.is-open{display:flex;}
.mobile-link{font-family:var(--font-mono);font-size:15px;color:var(--text);padding:11px 4px;border-bottom:1px solid var(--border-soft);}
.mobile-cta{display:flex;gap:10px;margin-top:14px;}
.mobile-cta a{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px;border-radius:9px;font-size:14px;font-weight:600;}
.mobile-cta .m-coffee{border:1px solid var(--coffee);color:var(--coffee);}

/* ---------- Hero ---------- */
.hero-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:clamp(32px,5vw,56px);align-items:center;}
.badge{display:inline-flex;align-items:center;gap:8px;padding:6px 13px;border:1px solid var(--border);border-radius:999px;background:var(--surface-2);font-family:var(--font-mono);font-size:12px;color:var(--text-muted);}
.badge-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);animation:jl-pulse 2.2s infinite;}
.hero h1{font-size:clamp(42px,7.2vw,70px);font-weight:800;letter-spacing:-.04em;line-height:1;margin-top:20px;color:var(--text);}
.hero-role{font-size:clamp(18px,2.4vw,22px);font-weight:600;color:var(--accent);margin-top:12px;}
.hero-lede{font-size:17px;color:var(--text-muted);margin-top:20px;max-width:48ch;line-height:1.62;}
.cta-row{display:flex;flex-wrap:wrap;gap:12px;margin-top:28px;}
.btn{display:inline-flex;align-items:center;gap:9px;padding:13px 21px;border-radius:11px;font-weight:600;font-size:15px;}
.btn-primary{background:var(--accent-solid);color:#fff;border:1px solid var(--accent-solid);}
.btn-primary:hover{background:var(--accent-hover);transform:translateY(-1px);}
.btn-secondary{background:transparent;color:var(--text);border:1px solid var(--border);}
.btn-secondary:hover{border-color:var(--accent);color:var(--accent);transform:translateY(-1px);}
.social-row{display:flex;gap:10px;margin-top:26px;}
.social-link{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted);}
.social-link:hover{color:var(--accent);border-color:var(--accent);transform:translateY(-2px);}

/* Mockup terminal */
.terminal{border:1px solid var(--border);border-radius:14px;background:var(--surface);box-shadow:var(--shadow);overflow:hidden;}
.terminal-bar{display:flex;align-items:center;gap:7px;padding:12px 14px;border-bottom:1px solid var(--border);background:var(--surface-2);}
.terminal-bar .dot{width:11px;height:11px;border-radius:50%;}
.dot-r{background:#f87171;} .dot-y{background:#fbbf24;} .dot-g{background:#34d399;}
.terminal-label{margin-left:8px;font-family:var(--font-mono);font-size:12px;color:var(--text-dim);}
.terminal-avatar{margin-left:auto;width:28px;height:28px;border-radius:50%;object-fit:cover;border:1px solid var(--border);}
.terminal-body{margin:0;padding:18px 20px;font-family:var(--font-mono);font-size:13.5px;line-height:1.72;color:var(--text-muted);white-space:pre-wrap;word-break:break-word;min-height:312px;}
.caret{display:inline-block;width:8px;height:15px;background:var(--accent);vertical-align:-2px;margin-left:2px;animation:jl-blink 1.05s steps(1) infinite;}

/* ---------- À propos (portrait + texte) + stats ---------- */
.about-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(28px,5vw,48px);align-items:center;}
@media(min-width:760px){.about-grid{grid-template-columns:288px 1fr;}}
.about-portrait{position:relative;border-radius:16px;overflow:hidden;border:1px solid var(--border);box-shadow:var(--shadow);max-width:320px;justify-self:center;}
.about-portrait img{display:block;width:100%;height:auto;}
.about-portrait::after{content:"";position:absolute;inset:0;border-radius:16px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 22%,transparent);pointer-events:none;}
.about-h2{margin:0 0 18px;max-width:20ch;}
.about-p{font-size:17px;color:var(--text-muted);line-height:1.65;max-width:62ch;}
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-top:36px;}
.stat{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);padding:20px;}
.stat-n{font-family:var(--font-mono);font-size:clamp(24px,3vw,30px);font-weight:700;color:var(--accent);}
.stat-l{font-size:13px;color:var(--text-muted);margin-top:6px;}

/* ---------- Projets ---------- */
.grid-projects{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:18px;}
.card{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:14px;background:var(--surface-2);overflow:hidden;transition:transform .25s ease,border-color .25s ease,box-shadow .25s ease;}
.card:hover{transform:translateY(-4px);border-color:var(--accent);box-shadow:var(--shadow);}
.card--link{cursor:pointer;text-decoration:none;color:inherit;}
.card--link:focus-visible{outline:2px solid var(--accent);outline-offset:3px;}
.card-media{position:relative;height:168px;overflow:hidden;background:var(--surface);padding:16px 20px;}
.card-media img{width:100%;height:100%;object-fit:contain;display:block;}
/* Swap du logo selon le thème (:root = sombre → on montre la variante claire/blanche). */
.card-media--themed .logo-light{display:none;}
[data-theme="light"] .card-media--themed .logo-light{display:block;}
[data-theme="light"] .card-media--themed .logo-dark{display:none;}
.card-mono{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(120% 130% at 0% 0%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 58%),var(--surface);}
.card-mono span{font-family:var(--font-mono);font-size:44px;font-weight:700;color:var(--accent);opacity:.92;}
.card-body{padding:18px 18px 20px;display:flex;flex-direction:column;gap:11px;flex:1;}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.status{display:inline-flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:11px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;}
.status-dot{width:7px;height:7px;border-radius:50%;}
.ext-link{color:var(--text-muted);display:inline-flex;transition:color .25s ease;}
.card--link:hover .ext-link{color:var(--accent);}
.card-title{font-size:19px;font-weight:700;letter-spacing:-.02em;color:var(--text);}
.card-sub{font-family:var(--font-mono);font-size:12px;color:var(--accent);}
.card-desc{font-size:14px;color:var(--text-muted);line-height:1.55;}
.chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto;padding-top:6px;}
.chip{font-family:var(--font-mono);font-size:11px;padding:4px 9px;border:1px solid var(--border);border-radius:999px;color:var(--text-muted);background:var(--bg);}

/* ---------- Parcours (timeline + formation) ---------- */
.timeline{position:relative;padding-left:70px;}
.timeline-line{position:absolute;left:23px;top:6px;bottom:6px;width:2px;background:var(--border);}
.exp{position:relative;margin-bottom:34px;}
.exp:last-child{margin-bottom:0;}
.exp-logo{position:absolute;left:-70px;top:0;width:48px;height:48px;border-radius:50%;background:#fff;border:1px solid var(--border);display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:0 0 0 5px var(--bg);}
.exp-logo img{width:34px;height:34px;object-fit:contain;}
.exp-card{border:1px solid var(--border);border-radius:14px;background:var(--surface-2);padding:18px 20px;}
.exp-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px 12px;}
.exp-role{font-size:17px;font-weight:700;color:var(--text);}
.exp-company{display:inline-flex;align-items:center;gap:7px;font-weight:600;color:var(--accent);font-size:14px;}
.exp-period{font-family:var(--font-mono);font-size:12px;color:var(--text-dim);margin-top:7px;}
.exp-desc{font-size:14px;color:var(--text-muted);line-height:1.55;margin-top:12px;}
.exp-missions{margin-top:12px;padding-left:18px;display:flex;flex-direction:column;gap:5px;}
.exp-missions li{font-size:13.5px;color:var(--text-muted);line-height:1.45;}
.exp-card .chips{margin-top:14px;}
.formation-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(238px,1fr));gap:14px;}
.formation-card{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);padding:18px;}
.formation-period{font-family:var(--font-mono);font-size:11px;color:var(--accent);margin-bottom:9px;}
.formation-title{font-size:15px;font-weight:700;margin-bottom:4px;color:var(--text);line-height:1.3;}
.formation-school{font-size:13px;color:var(--text-muted);}
.formation-desc{font-size:12.5px;color:var(--text-dim);line-height:1.5;margin-top:10px;}

/* ---------- Stack & compétences ---------- */
/* Masonry en CSS pur : packing vertical (pas de cartes à moitié vides) ;
   colonnes auto selon la largeur, comme l'ancien auto-fit. */
.stack-grid{columns:284px;column-gap:16px;}
.stack-group{border:1px solid var(--border);border-radius:14px;background:var(--surface-2);padding:18px;break-inside:avoid;margin-bottom:16px;}
.stack-group-label{display:flex;align-items:center;justify-content:center;gap:8px;font-family:var(--font-mono);font-size:11px;color:var(--text-dim);text-transform:uppercase;letter-spacing:.06em;}
.stack-group-count{font-size:10px;color:var(--text-dim);border:1px solid var(--border);border-radius:999px;padding:1px 7px;}
.tiles{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:14px;}
.tile{display:flex;align-items:center;gap:9px;padding:7px 11px 7px 9px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text-muted);cursor:default;transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background-color .2s ease;}
.tile:hover{transform:translateY(-2px);border-color:var(--accent);background:color-mix(in srgb,var(--brand,var(--accent)) 7%,var(--bg));box-shadow:0 8px 20px -10px color-mix(in srgb,var(--brand,var(--accent)) 55%,transparent);}
.tile .ic{width:18px;height:18px;transition:color .2s ease;}
.tile:hover .ic{color:var(--brand,var(--accent));}
.tile-mono{width:24px;height:24px;border-radius:7px;background:var(--accent-solid);color:#fff;display:flex;align-items:center;justify-content:center;flex:none;font-family:var(--font-mono);font-size:11px;font-weight:600;}
.tile:hover .tile-mono{background:var(--accent-hover);}
.tile-name{font-family:var(--font-mono);font-size:13px;color:var(--text);white-space:nowrap;}

.soft{margin-top:40px;display:grid;gap:24px;}
@media(min-width:760px){.soft{grid-template-columns:1fr 1fr;gap:32px;}}
.soft-label{font-family:var(--font-mono);font-size:11px;color:var(--text-dim);margin-bottom:11px;}
.pills{display:flex;flex-wrap:wrap;gap:8px;}
.pill{font-size:13px;padding:6px 12px;border:1px solid var(--border);border-radius:999px;color:var(--text-muted);background:var(--surface-2);transition:transform .2s ease,border-color .2s ease,color .2s ease;}
.pill::before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--accent);margin-right:7px;vertical-align:middle;opacity:.45;transition:opacity .2s ease;}
.pill:hover{border-color:var(--accent);color:var(--text);transform:translateY(-1px);}
.pill:hover::before{opacity:1;}

/* ---------- Centres d'intérêt ---------- */
.interests{display:grid;grid-template-columns:repeat(auto-fit,minmax(216px,1fr));gap:14px;}
.interest{display:flex;flex-direction:column;gap:11px;padding:20px;border:1px solid var(--border);border-radius:14px;background:var(--surface-2);transition:border-color .25s,transform .25s;}
.interest:hover{border-color:var(--accent);transform:translateY(-3px);}
.interest-ic{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:10px;background:var(--bg);border:1px solid var(--border);color:var(--accent);}
.interest-name{font-weight:600;font-size:15px;color:var(--text);}
.interest-note{font-family:var(--font-mono);font-size:11px;color:var(--text-dim);}

/* ---------- Contact ---------- */
.contact-card{border:1px solid var(--border);border-radius:18px;background:var(--surface-2);padding:clamp(28px,5vw,52px);text-align:center;}
.contact-h2{font-size:clamp(28px,4.6vw,44px);font-weight:800;letter-spacing:-.03em;margin:0 auto;color:var(--text);max-width:18ch;}
.contact-p{font-size:16px;color:var(--text-muted);margin:18px auto 0;max-width:52ch;line-height:1.6;}
.contact-cta{display:flex;flex-wrap:wrap;gap:12px;justify-content:center;margin-top:30px;}
.btn-email{display:inline-flex;align-items:center;gap:9px;padding:14px 24px;border-radius:11px;background:var(--accent-solid);color:#fff;font-weight:600;font-size:15px;border:1px solid var(--accent-solid);}
.btn-email:hover{background:var(--accent-hover);transform:translateY(-1px);}
.contact-social{display:flex;gap:10px;justify-content:center;margin-top:20px;}
.contact-social .social-link{background:var(--bg);}
.echo{font-family:var(--font-mono);font-size:13px;color:var(--text-dim);margin-top:28px;}
.echo b{color:var(--accent);font-weight:400;}
.coffee-box{margin-top:34px;padding-top:30px;border-top:1px solid var(--border);display:flex;flex-direction:column;align-items:center;gap:16px;}
.coffee-box p{font-size:14.5px;color:var(--text-muted);max-width:46ch;line-height:1.6;}
.btn-coffee-lg{display:inline-flex;align-items:center;gap:9px;padding:12px 22px;border-radius:11px;background:transparent;color:var(--coffee);font-weight:600;font-size:15px;border:1px solid var(--coffee);}
.btn-coffee-lg:hover{background:color-mix(in srgb,var(--coffee) 12%,transparent);transform:translateY(-1px);}

/* ---------- Pied de page ---------- */
.site-footer{border-top:1px solid var(--border);}
.footer-inner{max-width:var(--maxw);margin:0 auto;padding:28px 24px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;}
.footer-brand{display:flex;align-items:center;gap:12px;}
.footer-brand img{height:26px;width:auto;display:block;}
.footer-brand span{font-family:var(--font-mono);font-size:13px;color:var(--text-muted);}
.footer-credit{font-family:var(--font-mono);font-size:12px;color:var(--text-dim);}

/* ---------- Responsive : repli nav < 820px ---------- */
@media (max-width:819px){
  .nav-links,.btn-coffee--header{display:none;}
  .burger{display:inline-flex;}
}
@media (max-width:560px){
  .timeline{padding-left:58px;}
  .exp-logo{left:-58px;width:42px;height:42px;}
  .exp-logo img{width:28px;height:28px;}
  .timeline-line{left:20px;}
}

/* ---------- Respect de prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;}
  .reveal{opacity:1;transform:none;}
}
