:root {
  --bg: oklch(17% .035 170);
  --panel: oklch(21% .04 170);
  --panel-2: oklch(25% .045 170);
  --line: oklch(100% 0 0 / .09);
  --fg: oklch(93% .015 100);
  --dim: oklch(70% .03 165);
  --gold: oklch(78% .125 85);
  --gold-soft: oklch(90% .07 90);
  --green: oklch(82% .14 150);
  --cyan: oklch(82% .1 200);
  --orange: oklch(78% .14 55);
  --pink: oklch(78% .12 350);
  --comment: oklch(60% .035 165);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { background: var(--bg); color: var(--fg); font-family: var(--mono); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; padding-bottom: 34px; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
::selection { background: oklch(78% .125 85 / .35); }

/* Coloration syntaxique */
.k { color: var(--pink); } .s { color: var(--green); } .n { color: var(--orange); }
.p { color: var(--cyan); } .v { color: var(--gold); } .f { color: var(--gold); }
.c, .comment { color: var(--comment); font-style: italic; }
.prompt { color: var(--gold); font-weight: 700; }

/* Fond quadrillé animé */
.grid-bg { position: fixed; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%); animation: gridMove 24s linear infinite; }
@keyframes gridMove { to { background-position: 44px 44px; } }
.scroll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 60; background: linear-gradient(90deg, var(--gold), var(--green)); transform: scaleX(0); transform-origin: left; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: stretch; gap: 16px; padding: 0 20px; background: oklch(17% .035 170 / .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.back { display: flex; align-items: center; gap: 8px; padding: 14px 0; font-size: .85rem; color: var(--dim); white-space: nowrap; transition: color .2s; }
.back:hover { color: var(--gold); }
.tabs { display: flex; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 14px 16px; font-size: .82rem; color: var(--dim); border-left: 1px solid var(--line); border-top: 2px solid transparent; white-space: nowrap; transition: color .2s, background .2s; }
.tab:last-child { border-right: 1px solid var(--line); }
.tab:hover { color: var(--fg); background: var(--panel); }
.tab.active { color: var(--gold); background: var(--panel); border-top-color: var(--gold); }

main { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
section { padding: 72px 0; }
h2 { font-family: var(--mono); font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 700; margin-bottom: 26px; }
h2 .hash { color: var(--gold); }
h2 .count { font-size: .8rem; font-weight: 400; color: var(--comment); margin-left: 10px; }

/* Fenêtres */
.window { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 70px -30px #000; }
.window-bar, .pcard-bar { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--dim); }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: oklch(68% .19 25); }
.dots i:nth-child(2) { background: oklch(82% .15 85); }
.dots i:nth-child(3) { background: oklch(75% .17 145); }
.fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: .85rem; flex-shrink: 0; }

.editor { padding: 18px 0; font-size: .9rem; overflow-x: auto; }
.line { display: flex; padding-right: 18px; white-space: pre; transition: background .15s; }
.line:hover { background: oklch(100% 0 0 / .04); }
.ln { width: 46px; flex-shrink: 0; text-align: right; padding-right: 16px; color: oklch(100% 0 0 / .22); user-select: none; }
.editor.typing .line { opacity: 0; animation: lineIn .35s both; animation-delay: calc(.5s + var(--i) * .14s); }
@keyframes lineIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.editor .chips { display: inline-flex; flex-wrap: wrap; gap: 8px; white-space: normal; vertical-align: top; padding: 4px 0; }
.editor .line:has(.chips) { white-space: normal; }
.editor .line:has(.chips) .code { padding-left: 2.4em; }
.tok { padding: 2px 10px; border: 1px solid var(--line); border-radius: 6px; background: oklch(100% 0 0 / .03); transition: transform .2s, border-color .2s, background .2s; }
.tok:hover { transform: translateY(-3px); border-color: var(--green); background: oklch(82% .14 150 / .1); }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; min-height: calc(100vh - 90px); padding: 56px 0; }
.hero-text > * { animation: fadeUp .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-text > :nth-child(2) { animation-delay: .1s; } .hero-text > :nth-child(3) { animation-delay: .2s; }
.hero-text > :nth-child(4) { animation-delay: .3s; } .hero-text > :nth-child(5) { animation-delay: .4s; }
.hero-text > :nth-child(6) { animation-delay: .5s; }
.hero-text > :nth-child(7) { animation-delay: .6s; } .hero-text > :nth-child(8) { animation-delay: .7s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hero h1 { font-family: var(--display); font-weight: 900; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: -.02em; margin: 6px 0 14px; background: linear-gradient(100deg, var(--fg) 30%, var(--gold) 50%, var(--fg) 70%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: fadeUp .8s .1s both, shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }
.typed { font-size: clamp(1rem, 2.2vw, 1.25rem); color: var(--green); min-height: 1.8em; }
.caret { display: inline-block; width: .6em; height: 1.1em; background: var(--gold); vertical-align: text-bottom; margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { color: var(--dim); margin: 16px 0 26px; font-size: .92rem; max-width: 520px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { padding: 11px 18px; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; font-weight: 500; background: var(--panel); transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 10px 26px -12px var(--gold); }
.btn.primary { background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 700; }
.stats { display: flex; gap: 34px; margin-top: 34px; padding-top: 24px; border-top: 1px dashed var(--line); }
.stats strong { display: block; font-family: var(--display); font-size: 2rem; color: var(--gold); line-height: 1; }
.stats span { font-size: .75rem; color: var(--comment); }
.hero-window { animation: fadeUp .9s .3s both, float 7s 1.2s ease-in-out infinite; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

.photo-wrap { position: relative; width: 132px; height: 132px; margin-bottom: 22px; }
.photo-wrap::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(var(--gold), var(--green), var(--cyan), var(--gold)); animation: spin 6s linear infinite; }
.photo { position: relative; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); display: block; }
.online { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); border: 4px solid var(--bg); animation: ping 2s ease-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 oklch(82% .14 150 / .6); } 100% { box-shadow: 0 0 0 12px oklch(82% .14 150 / 0); } }
img.avatar { object-fit: cover; border: 1px solid var(--gold); }

/* README */
.readme { padding: 26px; font-size: .92rem; }
.readme p { color: var(--dim); margin-bottom: 14px; max-width: 760px; }
.readme .md-h { color: var(--gold); font-weight: 700; margin-top: 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { padding: 3px 12px; border-radius: 999px; background: oklch(78% .125 85 / .12); color: var(--gold); border: 1px solid oklch(78% .125 85 / .3); font-size: .8rem; }

/* Projets */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s; }
.pcard::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), oklch(78% .125 85 / .14), transparent 70%); }
.pcard:hover::before { opacity: 1; }
.pcard:hover { transform: translateY(-6px); border-color: oklch(78% .125 85 / .55); box-shadow: 0 24px 50px -24px #000; }
.pcard-body { padding: 16px 18px 18px; font-size: .82rem; display: flex; flex-direction: column; flex: 1; }
.pcard-body p { overflow-wrap: anywhere; }
.pcard h3 { font-family: var(--mono); font-size: 1.02rem; font-weight: 700; color: var(--fg); }
.pcard h3 .c { font-weight: 400; }
.pcard .desc { margin-bottom: 0; }
.pcard .stack { margin-top: 12px; color: var(--dim); }
.pcard .open { margin-top: auto; padding-top: 14px; color: var(--dim); }
.arrow { display: inline-block; color: var(--gold); transition: transform .25s; }
.pcard:hover .arrow, .term a:hover .arrow { transform: translateX(6px); }

/* Parcours */
.headline { color: var(--gold); font-size: .85rem; margin-top: 10px; }
.cgrid { columns: 2; column-gap: 20px; }
.cblock { break-inside: avoid; margin-bottom: 20px; }
.window-bar .cnt { margin-left: auto; padding: 0 8px; border-radius: 999px; background: oklch(78% .125 85 / .15); color: var(--gold); font-weight: 700; }
.clist { list-style: none; padding: 8px 20px 14px; }
.clist li { position: relative; padding: 12px 0 12px 20px; border-bottom: 1px dashed var(--line); transition: transform .2s; }
.clist li:last-child { border-bottom: 0; }
.clist li::before { content: ""; position: absolute; left: 0; top: 21px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px oklch(78% .125 85 / .15); }
.clist li:hover { transform: translateX(4px); }
.chead { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; justify-content: space-between; }
.chead strong { color: var(--fg); font-size: .92rem; }
.cmeta { font-size: .75rem; color: var(--green); white-space: nowrap; }
.csub { font-size: .82rem; color: var(--cyan); }
.ctext { font-size: .82rem; color: var(--dim); margin-top: 4px; }
.pbadge { margin-left: auto; padding: 1px 9px; border-radius: 999px; background: var(--gold); color: var(--bg); font-weight: 700; font-size: .7rem; white-space: nowrap; }
div.pcard { cursor: default; }

/* CV */
.cv-actions { margin-left: auto; display: flex; gap: 8px; }
.cv-actions .btn { padding: 5px 12px; font-size: .76rem; }
.cv-frame { display: block; width: 100%; height: min(1100px, 85vh); border: 0; background: #fff; }
.cv-fallback { display: none; padding: 20px; font-size: .85rem; }

/* Terminal */
.term { padding: 22px; font-size: .9rem; }
.term p { margin-bottom: 8px; }
.term a { display: block; padding: 8px 12px; margin: 4px 0; border-radius: 8px; border: 1px solid transparent; white-space: pre-wrap; overflow-wrap: anywhere; transition: background .2s, border-color .2s, transform .2s; }
.term a:hover { background: oklch(100% 0 0 / .05); border-color: var(--line); transform: translateX(4px); }
.term .c { margin-top: 14px; }

/* Barre d'état */
.statusbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; display: flex; gap: 18px; align-items: center; padding: 6px 16px; background: var(--gold); color: var(--bg); font-size: .75rem; font-weight: 700; }
.statusbar .spacer { flex: 1; }
.statusbar a:hover { text-decoration: underline; }

/* Apparition */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1) var(--d, 0ms), transform .7s cubic-bezier(.2,.7,.2,1) var(--d, 0ms), border-color .25s, box-shadow .25s; }
.reveal.visible { opacity: 1; transform: none; }
.pcard.reveal.visible:hover { transform: translateY(-6px); transition-delay: 0ms; transition-duration: .25s; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 34px; }
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .cgrid { columns: 1; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  main { padding: 0 16px; }
  section { padding: 52px 0; }
  .topbar { padding: 0 12px; gap: 10px; }
  .back { font-size: .75rem; }
  .tab { padding: 14px 12px; }
  .pgrid { grid-template-columns: 1fr; }
  .cv-frame { display: none; }
  .cv-fallback { display: block; }
  .ln { width: 34px; padding-right: 10px; }
  .editor { font-size: .78rem; }
  .stats { gap: 24px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; }
  .reveal, .editor.typing .line { opacity: 1; transform: none; transition: none; }
}
