/* ===== Variables : thème clair par défaut, sombre via [data-theme="dark"] ===== */
:root {
  --bg: #fafaf7;
  --bg-alt: #f0efe9;
  --surface: #ffffff;
  --text: #25272b;
  --muted: #5a5d63;
  --border: #dcdbd3;
  --accent: #f5c400;          /* jaune Ewelys */
  --accent-text: #25272b;     /* texte sur fond jaune (contraste > 10:1) */
  --link: #7a5c00;            /* jaune foncé lisible sur fond clair */
  --code-bg: #2b2d31;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --radius: 14px;
  --maxw: 1100px;
  --header-h: 68px;
}
[data-theme="dark"] {
  --bg: #1d1f23;
  --bg-alt: #24262b;
  --surface: #2b2d32;
  --text: #ecebe6;
  --muted: #b0b2b8;
  --border: #3b3e44;
  --link: #f5c400;
  --code-bg: #15161a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* ===== Base (mobile-first) ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font: 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: background .3s, color .3s;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-text); padding: .6rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 1rem; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 7vw, 4rem); }
h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--accent) 62%); }
[data-theme="dark"] h1 em { background: linear-gradient(transparent 62%, rgba(245, 196, 0, .45) 62%); }
h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
h3 { font-size: 1.25rem; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700;
  color: var(--muted); margin: 0 0 1rem;
}
.eyebrow::before { content: ""; display: inline-block; width: 2rem; height: 3px; background: var(--accent); margin-right: .7rem; vertical-align: middle; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }

/* ===== Boutons ===== */
.btn {
  display: inline-block; padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 1rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 18px rgba(245, 196, 0, .3); }
.btn-ghost { border-color: var(--text); color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-color: var(--border); }
.bar { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { font-weight: 800; font-size: 1.5rem; color: var(--text); text-decoration: none; letter-spacing: -.03em; }
.brand span { color: var(--accent); }
.actions { display: flex; align-items: center; gap: .6rem; }
.cta { display: none; padding: .55rem 1.1rem; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

/* Navigation : panneau déroulant sur mobile */
.nav {
  position: absolute; inset: var(--header-h) 0 auto 0; background: var(--bg);
  border-bottom: 1px solid var(--border); padding: .5rem 1.25rem 1rem; display: none;
}
.nav.open { display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { display: block; padding: .8rem 0; color: var(--text); text-decoration: none; font-weight: 600; }
.nav a[aria-current="true"] { color: var(--link); }

/* ===== Sections ===== */
.section { padding: clamp(4rem, 10vw, 8rem) 0; }
.section.alt { background: var(--bg-alt); }

/* Hero */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 8vw, 6rem); }
.hero-grid { display: grid; gap: 3rem; align-items: center; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.code-card {
  background: var(--code-bg); color: #e6e6e6; border-radius: var(--radius); padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow); overflow-x: auto;
}
.code-card pre { margin: 0; font: .9rem/1.7 ui-monospace, "Cascadia Code", Consolas, monospace; }
.code-dots { display: flex; gap: .4rem; margin-bottom: 1rem; }
.code-dots i { width: 11px; height: 11px; border-radius: 50%; background: #555; }
.code-dots i:first-child { background: var(--accent); }
.code-card .c { color: #8b8f98; } .code-card .k { color: #f5c400; }
.code-card .t { color: #8ec7ff; } .code-card .s { color: #a5d6a7; }

.chips, .tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.skills { margin-top: 4rem; }
.chips li, .tags li {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: .3rem .9rem; font-size: .9rem; font-weight: 600;
}
.pillars { display: grid; gap: 1.2rem; margin-top: 3rem; }
.pillar {
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 1.5rem;
}
.pillar p { margin: 0; color: var(--muted); }

/* Timeline clients */
.timeline { list-style: none; margin: 3rem 0 0; padding: 0 0 0 1.5rem; border-left: 3px solid var(--border); }
.timeline > li { position: relative; padding: 0 0 3rem 1.5rem; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -2.2rem; top: .35rem; width: 14px; height: 14px;
  background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px var(--bg-alt);
}
.timeline small { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-top: .3rem; }
.role { font-weight: 700; margin: 0 0 .6rem; }
.more { margin-top: 3rem; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; gap: 3rem; }
.form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; }
.field input, .field textarea {
  width: 100%; padding: .75rem .9rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px;
}
.field input:focus, .field textarea:focus { outline: 3px solid var(--accent); border-color: transparent; }
.field [aria-invalid="true"] { border-color: #d93025; }
.status { min-height: 1.5em; margin: 1rem 0 0; color: var(--muted); }

/* Footer */
.site-footer { background: var(--code-bg); color: #d6d7da; padding: 4rem 0 2rem; }
.site-footer a { color: #d6d7da; }
.site-footer a:hover { color: var(--accent); }
.site-footer .brand { color: #fff; }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer .social { display: flex; gap: .8rem; margin-top: 1rem; }
.site-footer .social a { display: block; line-height: 0; transition: transform .2s; }
.site-footer .social a:hover { transform: translateY(-3px); }
.foot-grid { display: grid; gap: 2rem; }
.legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid #3b3e44; font-size: .9rem; color: #9a9ca3; }

/* ===== Animations au scroll (activées seulement si JS présent) ===== */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }

/* ===== Transition entre "pages" : rideau jaune qui balaie l'écran ===== */
.page-wipe {
  position: fixed; inset: 0; z-index: 200; pointer-events: none; visibility: hidden;
  background: var(--accent); transform: translateY(100%);
}
.page-wipe::after { /* fine bande sombre en bord d'attaque */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--code-bg);
}
.page-wipe.cover { visibility: visible; transform: translateY(0); transition: transform .45s cubic-bezier(.77, 0, .18, 1); }
.page-wipe.leave { visibility: visible; transform: translateY(-100%); transition: transform .45s cubic-bezier(.77, 0, .18, 1); }

/* ===== Tablette / desktop ===== */
@media (min-width: 760px) {
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .foot-grid { grid-template-columns: 2fr 1fr 1fr; }
  .cta { display: inline-block; }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.2fr 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .menu-btn { display: none; }
  .nav { position: static; display: block; border: 0; padding: 0; background: none; }
  .nav ul { display: flex; gap: 1.8rem; }
  .nav a { padding: .4rem 0; border-bottom: 2px solid transparent; }
  .nav a:hover, .nav a[aria-current="true"] { border-color: var(--accent); }
}

/* ===== Mouvement réduit ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .page-wipe { display: none; }
}
