
:root {
  --bg: #040611;          /* Thème sombre par défault (slate-950-ish) */
  --bg-elev: #11162b;     /* surfaces */
  --text: #e5e7eb;        /* texte principal */
  --muted: #a1a1aa;       /* texte secondaire */
  --accent: #6366f1;      /* indigo */
  --accent-2: #22d3ee;    /* cyan */
  --card: #0f172a;        /* cartes */
  --border: #29324d;      /* séparateurs */
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Thème clair */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f7f8fb;
  --text: #0b1020;
  --muted: #475569;
  --card: #ffffff;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  position: fixed; left: 16px; top: 16px; width: auto; height: auto; padding: 8px 12px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(8px); background: color-mix(in oklab, var(--bg) 70%, transparent); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-logo { width: 36px; height: 36px; border-radius: 10px; display: block; }
.brand-text { font-weight: 700; letter-spacing: 0.2px; }
.nav-links { display: flex; align-items: center; gap: 12px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { background: color-mix(in oklab, var(--card) 80%, transparent); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: transform .06s ease, background .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 90%, #fff 0%), color-mix(in oklab, var(--accent-2) 90%, #fff 0%)); color: #0b1020; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: var(--bg-elev); }
.btn-ghost { background: transparent; border-color: var(--border); }

/* Sections */
.section { padding: 72px 0; }
.section-title { font-family: Syne, Inter, system-ui; font-weight: 800; letter-spacing: -0.02em; font-size: clamp(24px, 3vw, 32px); margin: 0 0 20px; }

/* Hero */
.hero { padding-top: 96px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; }
.title { font-family: Syne, Inter, system-ui; font-size: clamp(36px, 6vw, 56px); line-height: 1.05; margin: 0 0 8px; letter-spacing: -0.02em; }
.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.lede { font-size: 1.05rem; color: color-mix(in oklab, var(--text) 90%, #000 10%); margin: 0 0 20px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.meta { display: flex; gap: 16px; list-style: none; padding: 0; margin: 8px 0 0; color: var(--muted); }
.hero-media { display: flex; justify-content: center; }
.avatar { border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); background: var(--card); }
.avatar img { width: 100%; height: 100%; display: block; }

/* Cards / Grid */
.grid { display: grid; gap: 18px; }
.projects-grid { grid-template-columns: repeat(12, 1fr); }
.project { grid-column: span 6; }
.project:nth-child(1) { grid-column: span 12; }
.card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: clip; box-shadow: var(--shadow); display: grid; grid-template-rows: auto 1fr; }
.card-media { position: relative; background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(34,211,238,.2)); border-bottom: 1px solid var(--border); height: clamp(120px, 22vw, 180px); }
.card-media::after { content: ""; position: absolute; inset: 0; background: radial-gradient(550px 150px at 20% 10%, rgba(255,255,255,.08), transparent 60%); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; top: 12px; left: 12px; font-size: 12px; padding: 6px 10px; border-radius: 999px; background: #0b1020; color: #dbeafe; border: 1px solid var(--border); }
.card-body { padding: 18px; display: grid; gap: 8px; }
.card-title { margin: 0; font-size: 20px; font-weight: 700; }
.card-text { margin: 0; color: var(--muted); }
.tags { display: flex; gap: 8px; list-style: none; padding: 0; margin: 6px 0 0; color: var(--muted); font-size: 13px; flex-wrap: wrap; word-break: break-word; }
.card-actions { margin-top: 8px; display: flex; gap: 10px; justify-content: flex-end; }

/* Add-new project card */
.card-overlay { position: absolute; inset: 0; z-index: 5; border-radius: inherit; }
.card-add .card-media-add { display: grid; place-items: center; border-bottom: 1px dashed color-mix(in oklab, var(--border) 80%, transparent); background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(34,211,238,.12)); }
.card-add .plus-icon { width: 72px; height: 72px; transition: transform .18s ease, filter .2s ease; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3)); }
.card-add:hover .plus-icon { transform: scale(1.07); }
.card-add .card-title { color: var(--text); }
.card-add .card-text { color: var(--muted); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-size: 14px; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill-block { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.skill-block h3 { margin: 0 0 8px; font-size: 16px; }
.skill-block ul { margin: 0; padding-left: 18px; color: var(--muted); }

/* Contact */
.section-contact { padding-top: 56px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.contact-info .lede { margin: 0 0 16px; color: var(--muted); }
.contact-cards { display: grid; gap: 10px; }
.contact-card { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); text-decoration: none; transition: transform .06s ease, background .2s ease; }
.contact-card:hover { transform: translateY(-1px); background: color-mix(in oklab, var(--bg-elev) 70%, transparent); }
.contact-card-title { font-weight: 700; }
.contact-card-text { color: var(--muted); font-size: 14px; }

.contact-form { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: span 2; }
.form-field label { font-size: 14px; color: var(--muted); }
.form-field input, .form-field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; }
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: color-mix(in oklab, var(--accent) 80%, #000 0%); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent); }
.form-actions { grid-column: span 2; display: flex; gap: 10px; align-items: center; }
.form-status { color: var(--muted); font-size: 14px; }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Tech Stack */
.stack-groups { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.stack-group { grid-column: span 6; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.stack-group h3 { margin: 0 0 10px; font-size: 16px; }
.stack-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.badge-tech { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #0b1020; border: 1px solid rgba(0,0,0,.08); }

/* Brand colors */
.t-js { background: #f7df1e; }
.t-ts { background: #3178c6; color: #fff; }
.t-python { background: #3776ab; color: #fff; }
.t-php { background: #777bb4; color: #fff; }
.t-html { background: #e34f26; color: #fff; }
.t-css { background: #1572b6; color: #fff; }
.t-ocaml { background: #ec6813; color: #0b1020; }
.t-pwsh { background: #012456; color: #fff; }

.t-react { background: #61dafb; }
.t-reactnative { background: #282c34; color: #61dafb; border-color: #61dafb33; }
.t-vite { background: #646cff; color: #fff; }
.t-tailwind { background: #06b6d4; color: #082f49; }
.t-bootstrap { background: #7952b3; color: #fff; }

.t-node { background: #68a063; }
.t-express { background: #000000; color: #ffffff; }
.t-socketio { background: #010101; color: #fff; }
.t-strapi { background: #2f2e8b; color: #fff; }
.t-symfony { background: #1a171b; color: #fff; }

.t-postgres { background: #336791; color: #fff; }
.t-mongo { background: #10aa50; color: #072b1a; }
.t-mysql { background: #00758f; color: #fff; }
.t-prisma { background: #0c344b; color: #fff; }

.t-git { background: #f05033; color: #fff; }
.t-github { background: #24292e; color: #fff; }
.t-docker { background: #2496ed; color: #fff; }
.t-figma { background: #f24e1e; color: #0b1020; }
.t-canva { background: #00c4cc; color: #0b1020; }
.t-postman { background: #ef5b25; color: #0b1020; }
.t-dotenv { background: #ecd53f; color: #0b1020; }
.t-markdown { background: #ffffff; color: #0b1020; }
.t-axios { background: #5a29e4; color: #fff; }
.t-notion { background: #ffffff; color: #0b1020; }
.t-npm { background: #cb0000; color: #fff; }

.t-pandas { background: #130654; color: #fff; }
.t-numpy { background: #4d77cf; color: #fff; }
.t-matplotlib { background: #11557c; color: #fff; }
.t-sklearn { background: #f89939; color: #0b1020; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; background: color-mix(in oklab, var(--bg) 80%, transparent); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top-link { color: var(--muted); text-decoration: none; }
.top-link:hover { color: var(--text); }

/* Dynamic section backgrounds */
:root { --grad-a-rgb: 99,102,241; --grad-b-rgb: 34,211,238; }
body {
  background:
    radial-gradient(1000px 700px at 20% 0%, rgba(var(--grad-a-rgb), 0.45), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(var(--grad-b-rgb), 0.30), transparent 60%),
    var(--bg);
  transition: background-color .5s ease, background-image .5s ease;
  will-change: background-image;
  background-attachment: fixed, fixed, scroll;
  background-repeat: no-repeat, no-repeat, repeat;
}
body.bg-default {
  background:
    radial-gradient(1000px 700px at 20% 0%, rgba(99,102,241, 0.45), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(34,211,238, 0.30), transparent 60%),
    var(--bg);
  background-attachment: fixed, fixed, scroll;
  background-repeat: no-repeat, no-repeat, repeat;
}
body.bg-projects {
  background:
    radial-gradient(1000px 700px at 20% 0%, rgba(139,92,246, 0.50), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(236,72,153, 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed, fixed, scroll;
  background-repeat: no-repeat, no-repeat, repeat;
}
body.bg-stack {
  background:
    radial-gradient(1000px 700px at 20% 0%, rgba(34,211,238, 0.50), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(16,185,129, 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed, fixed, scroll;
  background-repeat: no-repeat, no-repeat, repeat;
}
body.bg-contact {
  background:
    radial-gradient(1000px 700px at 20% 0%, rgba(59,130,246, 0.50), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(167,139,250, 0.35), transparent 60%),
    var(--bg);
  background-attachment: fixed, fixed, scroll;
  background-repeat: no-repeat, no-repeat, repeat;
}
body[data-bg="default"] { --grad-a-rgb: 99,102,241; --grad-b-rgb: 34,211,238; }
body[data-bg="projects"] { --grad-a-rgb: 139,92,246; --grad-b-rgb: 236,72,153; }
body[data-bg="stack"] { --grad-a-rgb: 34,211,238; --grad-b-rgb: 16,185,129; }
body[data-bg="contact"] { --grad-a-rgb: 59,130,246; --grad-b-rgb: 167,139,250; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .project, .project:nth-child(1) { grid-column: span 1; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .stack-groups { grid-template-columns: 1fr 1fr; }
  .stack-group { grid-column: span 1; }
  .contact-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}

@media (max-width: 560px) {
  .nav { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px; }
  .nav-links { flex-wrap: wrap; justify-content: flex-end; width: 100%; }
  .avatar { width: 180px; height: 180px; }
  .skills-grid { grid-template-columns: 1fr; }
  .stack-groups { grid-template-columns: 1fr; }
  .container { padding: 0 14px; }
  .btn { padding: 9px 12px; border-radius: 10px; }
  .card-body { padding: 14px; }
  .section-title { margin-bottom: 14px; }
  body,
  body.bg-default,
  body.bg-projects,
  body.bg-stack,
  body.bg-contact {
    background-attachment: scroll, scroll, scroll;
    background-repeat: no-repeat, no-repeat, repeat;
    background-image:
      radial-gradient(700px 450px at 20% 0%, rgba(99,102,241, 0.35), transparent 60%),
      radial-gradient(650px 420px at 80% 0%, rgba(34,211,238, 0.25), transparent 60%),
      none;
  }
}

@media (max-width: 400px) {
  .container { padding: 0 12px; }
  .btn { padding: 8px 10px; }
  .card { border-radius: 14px; }
  .badge { top: 10px; left: 10px; }
}
