@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fira Code"; src: url("/fonts/fira-code.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #110809;
  --panel: #180d0f;
  --line: #2c1a1c;
  --text: #c9b4b5;
  --muted: #8a7476;
  --title: #f4e6e6;
  --accent: #ff3b4f;
  --green: #3ecf6e;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Fira Code", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #faf6f2;
  --panel: #f2ebe5;
  --line: #e3d7d0;
  --text: #3b2e2f;
  --muted: #85777a;
  --title: #160c0d;
  --accent: #d1192e;
  --green: #1f9d4c;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  border-top: 3px solid var(--accent);
}
a { color: var(--title); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { color: var(--title); font-weight: 600; }
strong { color: var(--title); font-weight: 500; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { width: min(980px, 100% - 40px); margin: 0 auto; }
.skip { position: absolute; left: 12px; top: -50px; padding: 8px 12px; background: var(--accent); color: #fff; }
.skip:focus { top: 12px; }
.sr-copy { position: fixed; top: 0; left: 0; opacity: 0; }

/* ===== En-tête ===== */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding: 30px 0; font-family: var(--mono); font-size: 13px; }
.top .name { color: var(--title); text-decoration: none; font-weight: 600; }
.top .name::after { content: "_"; color: var(--accent); }
.top nav { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; }
.top nav a, .top nav button { color: var(--muted); text-decoration: none; font-size: 13px; }
.top nav a:hover, .top nav button:hover { color: var(--accent); }
.top nav b { color: var(--title); font-weight: 500; }

/* ===== Intro ===== */
.intro { display: grid; grid-template-columns: 1fr 250px; gap: 64px; align-items: center; padding: 80px 0 90px; border-bottom: 1px solid var(--line); }
.meta { font-family: var(--mono); color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.meta span { color: var(--accent); }
.intro h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -.03em; }
.intro h1 .dot { color: var(--accent); }
.intro h1 em { font-style: normal; color: var(--muted); }
.lead { max-width: 540px; margin-top: 26px; font-size: 18px; }
.now { margin-top: 18px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.pulse { position: relative; display: inline-block; width: 7px; height: 7px; margin-right: 10px; vertical-align: 1px; border-radius: 50%; background: var(--green); }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--green); opacity: .45; }
.links { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 34px; font-family: var(--mono); font-size: 14px; }
.links a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.links a:hover { border-color: var(--accent); }
.intro-text > * { animation: rise .7s var(--ease) both; }
.intro-text > :nth-child(2) { animation-delay: .06s } .intro-text > :nth-child(3) { animation-delay: .12s }
.intro-text > :nth-child(4) { animation-delay: .18s } .intro-text > :nth-child(5) { animation-delay: .24s }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Carte de joueur */
.player {
  padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  font-family: var(--mono); font-size: 12px;
  transform: rotate(2deg); transition: transform .4s var(--ease), border-color .3s;
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .7);
  animation: deal .8s var(--ease) .2s both;
}
.player:hover { transform: rotate(0) translateY(-4px); border-color: var(--accent); }
@keyframes deal { from { opacity: 0; transform: rotate(8deg) translateY(20px); } }
.player-top { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.player-top b { color: var(--accent); font-weight: 500; }
.player img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: center 25%; border-radius: 6px; }
.player h2 { margin: 12px 0 2px; font-family: var(--sans); font-size: 20px; letter-spacing: -.02em; }
.player .role { color: var(--muted); margin-bottom: 10px; }
.player dl div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); }
.player dt { color: var(--muted); }
.player dd { color: var(--title); text-align: right; }
.player dd.ok { color: var(--green); }

/* ===== Sections ===== */
.row { display: grid; grid-template-columns: 170px 1fr; gap: 24px 40px; padding: 70px 0; border-bottom: 1px solid var(--line); }
.label { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); padding-top: 4px; }
.label::before { content: attr(data-n) " "; color: var(--accent); }
@media (min-width: 761px) { .label { position: sticky; top: 28px; align-self: start; } }

.prose { max-width: 640px; font-size: 17px; }
.prose p + p { margin-top: 14px; }

.do li { display: grid; grid-template-columns: 200px 1fr; gap: 6px 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.do li:first-child { border-top: 0; padding-top: 0; }
.do h3 { font-size: 16px; font-weight: 500; }
.do p { color: var(--muted); }

/* Projets principaux */
.projects { counter-reset: p; }
.projects > li { counter-increment: p; position: relative; display: grid; grid-template-columns: 44px 1fr 150px; gap: 6px 20px; padding: 28px 0; border-top: 1px solid var(--line); }
.projects > li:first-child { border-top: 0; padding-top: 0; }
.projects > li::before { content: counter(p, decimal-leading-zero); font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 9px; transition: color .2s; }
.projects > li::after { content: ""; position: absolute; left: 0; top: -1px; width: 0; height: 1px; background: var(--accent); transition: width .5s var(--ease); }
.projects > li:first-child::after { display: none; }
.projects > li:hover::after { width: 100%; }
.projects > li:hover::before { color: var(--accent); }
.projects h3 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.025em; line-height: 1.2; }
.projects h3 a { text-decoration: none; }
.projects h3 a::after { content: " ↗"; font-size: .6em; color: var(--muted); display: inline-block; transition: transform .2s, color .2s; }
.projects h3 a:hover::after { transform: translate(2px, -2px); color: var(--accent); }
.projects p { margin-top: 8px; max-width: 560px; }
.projects .stack { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.projects .side { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; padding-top: 10px; line-height: 1.8; }
.projects .side b { display: block; color: var(--title); font-weight: 500; }
.tag { display: inline-block; margin-left: 10px; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 99px; color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0; vertical-align: 5px; }

/* Petits projets */
.side-title { margin: 40px 0 14px; font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--muted); }
.small { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.small li { padding: 20px 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .2s; }
.small li:nth-child(2n) { border-right: 0; }
.small li:nth-last-child(-n+2) { border-bottom: 0; }
.small li:hover { background: var(--panel); }
.small h4 { color: var(--title); font-size: 16px; font-weight: 600; }
.small p { margin-top: 4px; font-size: 15px; color: var(--muted); }
.small span { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Parcours */
.xp li { display: grid; grid-template-columns: 170px 1fr; gap: 4px 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.xp li:first-child { border-top: 0; padding-top: 0; }
.xp .when { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 2px; }
.xp li:first-child .when { color: var(--accent); }
.xp h3 { font-size: 16px; font-weight: 500; }
.xp h3 span { color: var(--accent); }
.xp p { color: var(--muted); margin-top: 2px; }

/* Stack */
.stack-list div { display: grid; grid-template-columns: 140px 1fr; gap: 4px 20px; padding: 8px 0; }
.stack-list dt { color: var(--muted); font-family: var(--mono); font-size: 13px; padding-top: 2px; }
.stack-list dd { color: var(--title); }

/* Contact */
.contact h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -.025em; line-height: 1.2; max-width: 620px; }
.contact p { margin-top: 14px; max-width: 520px; }
.copy { margin-top: 26px; padding: 12px 18px; border: 1px solid var(--title); border-radius: 6px; color: var(--title); font-family: var(--mono); font-size: 14px; transition: background .15s, color .15s, border-color .15s; }
.copy:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.copy-done { display: inline-block; margin-left: 14px; font-family: var(--mono); font-size: 13px; color: var(--accent); opacity: 0; transition: opacity .2s; }
.copy-done.show { opacity: 1; }

/* Footer */
footer { padding: 70px 0 40px; font-family: var(--mono); color: var(--muted); }
.sign { font-family: var(--sans); font-size: clamp(64px, 17vw, 190px); font-weight: 700; letter-spacing: -.06em; line-height: .8; color: color-mix(in srgb, var(--title) 7%, transparent); user-select: none; }
.sign span { color: var(--accent); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 30px; font-size: 12px; }
.foot a { color: var(--muted); }

/* 404 */
.notfound { padding: 140px 0; }
.notfound h1 { font-size: clamp(40px, 8vw, 72px); letter-spacing: -.03em; }
.notfound p { margin: 16px 0 28px; font-size: 18px; }

/* ===== Mobile ===== */
@media (max-width: 760px) {
  .intro { grid-template-columns: 1fr; gap: 48px; padding: 50px 0 60px; }
  .player { max-width: 260px; }
  .row { grid-template-columns: 1fr; gap: 20px; padding: 50px 0; }
  .do li, .xp li, .stack-list div { grid-template-columns: 1fr; gap: 2px; }
  .projects > li { grid-template-columns: 1fr; gap: 4px; }
  .projects > li::before { padding-top: 0; }
  .projects .side { text-align: left; padding-top: 6px; }
  .projects .side b { display: inline; margin-right: 8px; }
  .small { grid-template-columns: 1fr; }
  .small li { border-right: 0; }
  .small li:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
