/* =========================================================
   Hugo Fief — Portfolio (refonte, sans framework)
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --bg: #0b0b12;
  --bg-2: #11111b;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --fg: #f4f1ec;
  --muted: #9b99a8;
  --accent: #f57d69;          /* corail : couleur historique du site */
  --accent-2: #8b6cff;        /* violet */
  --accent-3: #36d6e7;        /* cyan */
  --grad: linear-gradient(120deg, var(--accent) 0%, #ff9f7a 35%, var(--accent-2) 100%);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 20px;
  --radius-sm: 12px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --nav-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
html:focus-within { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: var(--bg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.02em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 10000;
  padding: 10px 16px; border-radius: 999px;
  background: var(--accent); color: var(--bg); font-weight: 600;
  transform: translateY(-200%); transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- Fond : WebGL, fallback, grain ---------- */
#webgl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
.bg-fallback {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40vw 40vw at 75% 30%, rgba(245,125,105,.25), transparent 60%),
    radial-gradient(35vw 35vw at 20% 80%, rgba(139,108,255,.18), transparent 60%);
  opacity: 0;
  transition: opacity 1s ease;
}
.no-webgl .bg-fallback { opacity: 1; }
.no-webgl #webgl { display: none; }

.grain {
  position: fixed; inset: -50%; z-index: 9990; pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); }
  80% { transform: translate(6%, 2%); }
}

main, .footer { position: relative; z-index: 1; }
main { overflow-x: clip; } /* "clip" (et non "hidden") pour ne pas casser position: sticky */

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 9995;
  display: grid; place-items: center;
  pointer-events: none;
}
.loader::before {
  content: ""; position: absolute; inset: 0; background: var(--bg);
  transition: transform 1.1s var(--ease-in-out) .15s;
  transform-origin: top;
}
.loader__inner {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: opacity .5s ease, transform .8s var(--ease-out);
}
.loader__label { color: var(--muted); text-transform: uppercase; letter-spacing: .2em; }
.loader__count {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(4rem, 14vw, 9rem); line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.loader__bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  transition: opacity .4s ease;
}
.loader__bar span {
  display: block; height: 100%; width: 100%;
  background: var(--grad);
  transform: scaleX(0); transform-origin: left;
}
.is-ready .loader::before { transform: scaleY(0); }
.is-ready .loader__inner { opacity: 0; transform: translateY(-40px); }
.is-ready .loader__bar { opacity: 0; }
.is-ready .loader { visibility: hidden; transition: visibility 0s 1.4s; }

/* ---------- Curseur ---------- */
.cursor { display: none; }
.has-cursor .cursor { display: block; }
.has-cursor, .has-cursor a, .has-cursor button { cursor: none; }
.has-cursor input, .has-cursor textarea { cursor: text; }

.cursor__dot, .cursor__ring {
  position: fixed; top: 0; left: 0; z-index: 9998;
  pointer-events: none; border-radius: 50%;
  will-change: transform;
}
.cursor__dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: var(--fg);
  mix-blend-mode: difference;
}
.cursor__ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(255,255,255,.45);
  display: grid; place-items: center;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out),
              background-color .35s ease, border-color .35s ease;
}
.cursor__label {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500; color: var(--bg);
  opacity: 0; transform: scale(.6); transition: opacity .25s ease, transform .35s var(--ease-out);
}
.cursor.is-hover .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--accent); background: rgba(245,125,105,.12); }
.cursor.is-label .cursor__ring { width: 86px; height: 86px; margin: -43px 0 0 -43px; background: var(--accent); border-color: var(--accent); }
.cursor.is-label .cursor__label { opacity: 1; transform: none; }
.cursor.is-label .cursor__dot { opacity: 0; }
.cursor.is-down .cursor__ring { transform: scale(.85); }
.cursor.is-hidden .cursor__dot, .cursor.is-hidden .cursor__ring { opacity: 0; }

/* ---------- Barre de progression ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9000; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; background: var(--grad);
  transform: scaleX(0); transform-origin: left;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 8000;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-inline: var(--gutter);
  transition: transform .6s var(--ease-out), background-color .4s ease;
}
.nav.is-hidden { transform: translateY(-110%); }
.nav.is-scrolled { background: linear-gradient(to bottom, rgba(11,11,18,.85), rgba(11,11,18,0)); }

.nav__logo { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; }
.nav__logo-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: var(--grad); color: var(--bg); font-size: .95rem; letter-spacing: -.02em;
  box-shadow: 0 8px 30px -8px rgba(245,125,105,.6);
}
.nav__logo-text { font-size: 1.05rem; }

.nav__links {
  position: relative;
  display: flex; gap: 4px; padding: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(17,17,27,.55);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.nav__links a {
  position: relative; z-index: 1;
  padding: 8px 16px; border-radius: 999px;
  font-size: .9rem; color: var(--muted);
  transition: color .3s ease;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--fg); }
.nav__indicator {
  position: absolute; top: 6px; bottom: 6px; left: 0; width: 0;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  opacity: 0;
  transition: transform .5s var(--ease-out), width .5s var(--ease-out), opacity .3s ease;
}

.nav__burger { display: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); position: relative; z-index: 2; }
.nav__burger span {
  position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--fg);
  transition: transform .45s var(--ease-out), top .45s var(--ease-out);
}
.nav__burger span:first-child { top: 19px; }
.nav__burger span:last-child { top: 26px; }
.menu-open .nav__burger span:first-child { top: 22px; transform: rotate(45deg); }
.menu-open .nav__burger span:last-child { top: 22px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 7999;
  background: rgba(11,11,18,.96);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  display: flex; align-items: center;
  padding: var(--nav-h) var(--gutter) var(--gutter);
  clip-path: circle(0 at calc(100% - var(--gutter) - 23px) calc(var(--nav-h) / 2));
  transition: clip-path .8s var(--ease-in-out);
  visibility: hidden;
}
.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - var(--gutter) - 23px) calc(var(--nav-h) / 2)); visibility: visible; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.mobile-menu a {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3.2rem); font-weight: 600; line-height: 1.2;
  padding-block: 4px; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(30px);
  transition: opacity .5s ease, transform .7s var(--ease-out);
}
.mobile-menu a .mono { color: var(--accent); }
.menu-open .mobile-menu a { opacity: 1; transform: none; transition-delay: calc(.25s + var(--i) * .06s); }

/* ---------- Boutons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 28px; border-radius: 999px;
  font-weight: 600; font-size: .98rem;
  isolation: isolate;
  transition: translate .5s var(--ease-out), box-shadow .4s ease, border-color .3s ease;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--ease-out); }
.btn:hover svg { transform: translate(3px, -3px); }
.btn--primary {
  background: var(--grad); color: #160d0b;
  box-shadow: 0 12px 40px -12px rgba(245,125,105,.7);
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease-out);
}
.btn--primary:hover::after { transform: translateX(120%); }
.btn--primary:hover { box-shadow: 0 18px 50px -12px rgba(245,125,105,.9); }
.btn--ghost { border: 1px solid var(--line-strong); background: rgba(255,255,255,.02); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn--ghost::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--fg); transform: translateY(101%); transition: transform .5s var(--ease-out);
}
.btn--ghost:hover { color: var(--bg); border-color: var(--fg); }
.btn--ghost:hover::before { transform: none; }
.btn--small { height: 44px; padding: 0 20px; font-size: .9rem; border: 1px solid var(--line-strong); }
.btn--small:hover { border-color: var(--accent); color: var(--accent); }
.btn--block { width: 100%; }

/* ---------- Typo commune ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted);
  margin-bottom: 20px;
}
.eyebrow .mono { color: var(--accent); }
.eyebrow::after { content: ""; width: 48px; height: 1px; background: var(--line-strong); }

.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 5.2vw, 4.2rem);
  line-height: 1.04; letter-spacing: -.035em;
  max-width: 18ch;
}
.section { position: relative; padding-block: clamp(6rem, 12vw, 10rem); }
.section-head { margin-bottom: clamp(3rem, 6vw, 5rem); }

.chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; border: 1px solid var(--line-strong); color: var(--muted);
  white-space: nowrap;
}
.chip--accent { border-color: rgba(245,125,105,.5); color: var(--accent); background: rgba(245,125,105,.08); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-family: var(--font-mono); font-size: .74rem; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }

/* ---------- Animations d'apparition ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(40px); filter: blur(8px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out), filter 1s var(--ease-out);
  transition-delay: var(--rd, 0s);
}
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }

[data-intro] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .9s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(.55s + var(--d, 0) * .09s);
}
.is-ready [data-intro] { opacity: 1; transform: none; }

/* Lettres découpées par JS */
.char {
  display: inline-block;
  transform: translateY(115%) rotate(10deg);
  transition: transform 1.2s var(--ease-out);
  transition-delay: calc(.6s + var(--ci) * .055s);
}
.is-ready .char { transform: none; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--nav-h) + 24px); padding-bottom: 32px;
}
.hero__inner { position: relative; }
.hero__fallback {
  display: none;
  position: absolute; right: 2vw; bottom: 0; z-index: 0;
  height: 86%; width: auto; max-width: 48vw; object-fit: contain; object-position: bottom;
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 16%); mask-image: linear-gradient(to top, transparent 0%, #000 16%);
  pointer-events: none;
}
.no-webgl .hero__fallback { display: block; }
.hero__status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(17,17,27,.5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: .85rem; color: var(--muted);
  margin-bottom: clamp(20px, 4vh, 36px);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #46e08a; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #46e08a;
  animation: pulse 2s var(--ease-out) infinite;
}
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }

.hero__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(4rem, 15vw, 12.5rem);
  line-height: .86; letter-spacing: -.06em;
  text-transform: uppercase;
}
.hero__hello {
  display: block; font-size: clamp(1rem, 1.6vw, 1.25rem); font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--muted);
  margin-bottom: 14px; line-height: 1.4;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .04em; }
.line--outline { -webkit-text-stroke: 1.5px var(--fg); color: transparent; padding-left: .5em; }

.hero__role {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35em;
  margin-top: clamp(20px, 3vh, 32px);
  font-family: var(--font-display); font-size: clamp(1.35rem, 2.6vw, 2.1rem); font-weight: 500; letter-spacing: -.02em;
}
.hero__role-main {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__amp { color: var(--accent); font-weight: 400; }
.rotator { display: inline-grid; overflow: hidden; vertical-align: bottom; }
.rotator > span {
  grid-area: 1 / 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: translateY(100%); opacity: 0;
  transition: transform .8s var(--ease-out), opacity .5s ease;
}
.rotator > span.is-active { transform: none; opacity: 1; }
.rotator > span.is-leaving { transform: translateY(-100%); opacity: 0; }

.hero__lead { max-width: 46ch; margin-top: 16px; color: var(--muted); font-size: clamp(1rem, 1.2vw, 1.1rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(28px, 4vh, 44px); }

.hero__meta {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-top: auto; padding-top: 48px; color: var(--muted);
}
.scroll-hint { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-hint__line { position: relative; width: 1px; height: 56px; background: var(--line-strong); overflow: hidden; }
.scroll-hint__line::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 40%;
  background: var(--accent); animation: scrollLine 2s var(--ease-in-out) infinite;
}
@keyframes scrollLine { from { transform: translateY(-100%); } to { transform: translateY(260%); } }

/* ---------- Marquee ---------- */
.marquee {
  position: relative; z-index: 1;
  border-block: 1px solid var(--line);
  background: rgba(11,11,18,.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding-block: 22px; overflow: hidden;
}
.marquee__track {
  display: flex; align-items: center; gap: 36px; width: max-content;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  letter-spacing: -.03em; white-space: nowrap;
  animation: marquee 32s linear infinite;
}
.marquee__track span:nth-of-type(even) { -webkit-text-stroke: 1px var(--fg); color: transparent; }
.marquee__track i { font-style: normal; color: var(--accent); font-size: .6em; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- À propos ---------- */
.about__grid {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 7vw, 110px); align-items: center;
}
.about__visual { position: relative; }
.tilt-card { perspective: 1000px; }
[data-tilt] { perspective: 1000px; }
.tilt-card__inner {
  position: relative; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s var(--ease-out);
  will-change: transform;
}
[data-tilt].is-tilting > .tilt-card__inner,
[data-tilt].is-tilting .tilt-card__inner { transition: transform .12s linear; }
.tilt-card__glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.18), transparent 45%);
  opacity: 0; transition: opacity .4s ease; mix-blend-mode: overlay;
}
[data-tilt].is-tilting .tilt-card__glare { opacity: 1; }

.about .tilt-card__inner {
  border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 30% 0%, #ff9f7a 0%, transparent 60%),
    linear-gradient(160deg, var(--accent) 0%, #c55a8c 55%, var(--accent-2) 100%);
  box-shadow: 0 40px 80px -30px rgba(245,125,105,.45);
}
.about__photo {
  aspect-ratio: 4 / 5;
  background-size: cover; background-position: center bottom; background-repeat: no-repeat;
  transform: translateZ(30px) scale(1.02);
}
.about__badge {
  position: absolute; left: 18px; bottom: 18px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(11,11,18,.7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transform: translateZ(60px);
}
.about__orbit { position: absolute; inset: -10%; z-index: -1; pointer-events: none; }
.about__orbit span {
  position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255,255,255,.12);
  animation: spin 40s linear infinite;
}
.about__orbit span:last-child { inset: 12%; border-style: solid; border-color: rgba(245,125,105,.18); animation-duration: 26s; animation-direction: reverse; }
.about__orbit span:last-child::after {
  content: ""; position: absolute; top: 50%; left: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 20px var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

.about__text { margin-top: 28px; color: var(--muted); font-size: 1.08rem; max-width: 58ch; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 48px; border-top: 1px solid var(--line);
}
.stats li { padding: 24px 16px 0 0; display: flex; flex-direction: column; }
.stats strong {
  display: flex; align-items: baseline; gap: 2px;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 4.5vw, 3.6rem); line-height: 1;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.stats small { color: var(--accent); font-size: .38em; letter-spacing: 0; }
.stats em { font-style: normal; color: var(--muted); font-size: .88rem; margin-top: 8px; }

/* ---------- Compétences ---------- */
.skills__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px); align-items: center;
}
.tag-sphere {
  position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; margin-inline: auto;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.tag-sphere:active { cursor: grabbing; }
.tag-sphere::before {
  content: ""; position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,125,105,.25), rgba(139,108,255,.1) 50%, transparent 70%);
  filter: blur(30px);
}
.tag-sphere__tag {
  position: absolute; top: 50%; left: 50%;
  font-family: var(--font-display); font-weight: 600; white-space: nowrap;
  font-size: clamp(.95rem, 1.6vw, 1.3rem);
  will-change: transform, opacity;
  transition: color .3s ease;
}
.tag-sphere__tag.is-front { color: var(--fg); }
.tag-sphere__tag:hover { color: var(--accent); }

.skill-list { display: grid; gap: 22px; }
.skill { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; }
.skill__name { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; }
.skill__val { color: var(--muted); align-self: end; }
.skill__bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.skill__bar span {
  display: block; height: 100%; border-radius: inherit; background: var(--grad);
  width: calc(var(--v) * 1%);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.6s var(--ease-out);
}
.skill-list.is-in .skill__bar span { transform: scaleX(1); }
.skill-list .skill:nth-child(1) .skill__bar span { transition-delay: .1s; }
.skill-list .skill:nth-child(2) .skill__bar span { transition-delay: .17s; }
.skill-list .skill:nth-child(3) .skill__bar span { transition-delay: .24s; }
.skill-list .skill:nth-child(4) .skill__bar span { transition-delay: .31s; }
.skill-list .skill:nth-child(5) .skill__bar span { transition-delay: .38s; }
.skill-list .skill:nth-child(6) .skill__bar span { transition-delay: .45s; }
.skill-list .skill:nth-child(7) .skill__bar span { transition-delay: .52s; }
.skill-list .skill:nth-child(8) .skill__bar span { transition-delay: .59s; }
.skill-list .skill:nth-child(9) .skill__bar span { transition-delay: .66s; }

/* ---------- Timeline ---------- */
.timeline {
  --date-w: 210px; --dot-w: 48px;
  position: relative; display: grid; gap: 28px;
}
.timeline__line {
  position: absolute; top: 8px; bottom: 8px;
  left: calc(var(--date-w) + var(--dot-w) / 2); width: 1px;
  background: var(--line);
}
.timeline__line span {
  position: absolute; inset: 0; background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  transform: scaleY(var(--p, 0)); transform-origin: top;
}
.tl-item {
  position: relative;
  display: grid; grid-template-columns: var(--date-w) var(--dot-w) minmax(0, 1fr); align-items: start;
}
.tl-item__date { padding-top: 26px; color: var(--muted); text-align: right; padding-right: 8px; }
.tl-item__dot {
  grid-column: 2; grid-row: 1; justify-self: center; margin-top: 28px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-strong);
  transition: border-color .5s ease, box-shadow .5s ease, background-color .5s ease;
}
.tl-item.is-in .tl-item__dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 6px rgba(245,125,105,.15), 0 0 24px var(--accent); }
.tl-item__date { grid-column: 1; grid-row: 1; }
.tl-card { grid-column: 3; }

.tl-card, .edu-card .tilt-card__inner {
  position: relative; overflow: hidden;
  padding: 26px 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color .4s ease, transform .5s var(--ease-out);
}
[data-spotlight]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx, -100%) var(--my, -100%), rgba(245,125,105,.13), transparent 60%);
  opacity: 0; transition: opacity .4s ease;
}
[data-spotlight]:hover::before { opacity: 1; }
.tl-card:hover { border-color: var(--line-strong); transform: translateX(6px); }
.tl-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.tl-card h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -.02em; line-height: 1.2; }
.tl-card__company { margin-top: 6px; font-weight: 500; }
.tl-card__company span { color: var(--muted); font-weight: 400; }
.tl-card__note { margin-top: 10px; font-size: .9rem; color: var(--muted); }

/* Carte mise en avant (poste actuel) avec plusieurs rôles */
.tl-card--featured { border-color: rgba(245,125,105,.35); background: linear-gradient(160deg, rgba(245,125,105,.07), rgba(139,108,255,.04) 60%, var(--surface)); }
.tl-card--featured:hover { transform: none; border-color: rgba(245,125,105,.55); }
.tl-roles { display: grid; gap: 22px; margin-top: 22px; }
.tl-role { position: relative; padding-left: 20px; border-left: 1px solid var(--line-strong); }
.tl-role::before {
  content: ""; position: absolute; left: -4px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.tl-role__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.tl-role__title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; }
.tl-role__date { color: var(--accent); }
.tl-role__summary { margin-top: 6px; color: var(--muted); font-size: .94rem; }
.tl-role .tl-card__details { margin-top: 10px; }

/* Détail dépliable de chaque expérience (contenu présent dans le HTML : lisible par Google) */
.tl-card__details { margin-top: 14px; }
.tl-card__details summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  font-family: var(--font-mono); font-size: .78rem; color: var(--accent);
}
.tl-card__details summary::-webkit-details-marker { display: none; }
.tl-card__details summary::after { content: "+"; font-size: 1rem; line-height: 1; transition: transform .4s var(--ease-out); }
.tl-card__details[open] summary::after { transform: rotate(45deg); }
.tl-card__details[open] summary { margin-bottom: 14px; }
.tl-card__details p, .tl-card__details li { color: var(--muted); font-size: .94rem; }
.tl-card__details p + p { margin-top: 10px; }
.tl-card__details h4 {
  margin: 18px 0 8px; font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .14em; color: var(--fg);
}
.tl-card__details ul { display: grid; gap: 6px; }
.tl-card__details li { position: relative; padding-left: 18px; }
.tl-card__details li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--grad); }
.tl-card__details[open] > *:not(summary) { animation: detailsIn .5s var(--ease-out) both; }
@keyframes detailsIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Formation ---------- */
.school__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.edu-card .tilt-card__inner { min-height: 300px; padding: 30px; display: flex; flex-direction: column; gap: 6px; }
.edu-card:hover .tilt-card__inner { border-color: rgba(245,125,105,.35); }
.edu-card__year { color: var(--accent); margin-bottom: 18px; }
.edu-card h3 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; letter-spacing: -.03em; transform: translateZ(30px); }
.edu-card__spec { font-weight: 500; transform: translateZ(20px); }
.edu-card__school { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.edu-card .tags { margin-top: auto; transform: translateZ(25px); }
.edu-card__num {
  position: absolute; right: -6px; bottom: -28px;
  font-family: var(--font-display); font-weight: 700; font-size: 8rem; line-height: 1; letter-spacing: -.06em;
  -webkit-text-stroke: 1px rgba(255,255,255,.08); color: transparent;
  pointer-events: none; transition: -webkit-text-stroke-color .5s ease;
}
.edu-card:hover .edu-card__num { -webkit-text-stroke-color: rgba(245,125,105,.35); }

/* ---------- Projets (scroll horizontal) ---------- */
.projects { position: relative; z-index: 1; }
.projects__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(24px, 4vh, 48px);
  overflow: hidden;
  padding-top: var(--nav-h);
}
.projects__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; column-gap: 24px; }
.projects__head .eyebrow { width: 100%; }
.projects__hint { color: var(--muted); }
.projects__track {
  display: flex; gap: clamp(16px, 2vw, 28px);
  padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
  width: max-content;
  will-change: transform;
}
.project {
  flex: 0 0 auto; width: clamp(280px, 30vw, 400px);
  display: block;
}
.project .tilt-card__inner {
  border-radius: var(--radius); overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: transform .6s var(--ease-out), border-color .4s ease;
}
.project:hover .tilt-card__inner { border-color: rgba(245,125,105,.4); }
.project__media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  /* fond blanc : les logos et visuels des projets ont été conçus pour un fond clair */
  background: #ffffff;
  display: grid; place-items: center;
}
.project__media img {
  width: 100%; height: 100%; object-fit: contain; padding: 12%;
  transform: scale(1); transition: transform 1s var(--ease-out), filter .6s ease;
  /* aucune retouche : l'image est affichée telle quelle, à 100 % de sa luminosité */
}
.project:hover .project__media img { transform: scale(1.08); filter: brightness(1.08) contrast(1.04); }
.project__body { position: relative; padding: 22px 24px 24px; transform: translateZ(30px); }
.project__num { color: var(--accent); }
.project h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; letter-spacing: -.02em; margin-top: 6px; }
.project p { color: var(--muted); font-size: .94rem; }
.project__link { display: inline-block; margin-top: 16px; color: var(--fg); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: color .3s ease, border-color .3s ease; }
.project:hover .project__link { color: var(--accent); border-color: var(--accent); }

.projects__progress { height: 2px; }
.projects__progress::before { content: ""; display: block; height: 2px; background: var(--line); }
.projects__progress span {
  display: block; height: 2px; margin-top: -2px; background: var(--grad);
  transform: scaleX(var(--hp, 0)); transform-origin: left;
}

/* Fallback : pas de pin (mobile / reduced motion) */
.projects.is-static { height: auto !important; }
.projects.is-static .projects__sticky { position: relative; height: auto; padding-block: clamp(6rem, 12vw, 10rem); }
.projects.is-static .projects__track {
  width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px;
  transform: none !important; scrollbar-width: none;
}
.projects.is-static .projects__track::-webkit-scrollbar { display: none; }
.projects.is-static .project { scroll-snap-align: center; width: min(82vw, 380px); }
.projects.is-static .projects__progress { display: none; }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 110px); align-items: start; }
.contact__intro > p:not(.eyebrow) { color: var(--muted); margin-top: 22px; max-width: 46ch; }
.contact__title em {
  font-style: italic; font-weight: 500;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .08em;
}
.email-copy {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  margin-top: 36px; text-align: left;
}
.email-copy__text {
  position: relative;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2.6vw, 2rem); letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.email-copy__text::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--grad);
  transform: scaleX(0); transform-origin: right; transition: transform .6s var(--ease-out);
}
.email-copy:hover .email-copy__text::after, .email-copy:focus-visible .email-copy__text::after { transform: scaleX(1); transform-origin: left; }
.email-copy__feedback { color: var(--muted); transition: color .3s ease; }
.email-copy.is-copied .email-copy__feedback { color: #46e08a; }

.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.socials a {
  display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); font-size: .9rem;
  transition: translate .5s var(--ease-out), border-color .3s ease, color .3s ease;
}
.socials a:hover { border-color: var(--accent); color: var(--accent); }

.form {
  padding: clamp(24px, 3vw, 40px); border-radius: 28px;
  background: var(--surface); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: grid; gap: 14px;
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 26px 18px 10px; border-radius: var(--radius-sm);
  background: rgba(11,11,18,.55); border: 1px solid var(--line);
  outline: none; resize: vertical;
  transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease;
}
.field textarea { min-height: 150px; }
.field label {
  position: absolute; left: 18px; top: 18px; color: var(--muted); pointer-events: none;
  transform-origin: left top;
  transition: transform .35s var(--ease-out), color .3s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); background: rgba(11,11,18,.8); box-shadow: 0 0 0 4px rgba(245,125,105,.12); }
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(.75); color: var(--accent);
}
.field.is-invalid input, .field.is-invalid textarea { border-color: #ff6b6b; }
.form__error { min-height: 1.2em; color: #ff8a8a; font-size: .88rem; }
.form__status { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .92rem; }
.form__status--success { background: rgba(70,224,138,.1); border: 1px solid rgba(70,224,138,.35); color: #7cf0ae; }
.form__status--error { background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.35); color: #ff9a9a; }

/* ---------- Footer ---------- */
.footer { padding-top: clamp(4rem, 10vw, 8rem); padding-bottom: 32px; border-top: 1px solid var(--line); background: linear-gradient(to bottom, rgba(11,11,18,.4), var(--bg) 60%); }
.footer__big {
  display: flex; flex-wrap: wrap; column-gap: .25em;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.8rem, 11vw, 9.5rem); line-height: .9; letter-spacing: -.06em;
}
.footer__big-outline {
  -webkit-text-stroke: 1.5px var(--fg); color: transparent;
  background: var(--grad) no-repeat; background-size: 0% 100%;
  -webkit-background-clip: text; background-clip: text;
  transition: background-size .9s var(--ease-out);
}
.footer__big:hover .footer__big-outline { background-size: 100% 100%; -webkit-text-stroke-color: transparent; }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px;
  margin-top: clamp(3rem, 6vw, 5rem); padding-top: 24px; border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer__links { display: flex; align-items: center; gap: 22px; font-size: .92rem; }
.footer__links a:not(.to-top):hover { color: var(--fg); }
.to-top {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-strong); color: var(--fg); font-size: 1.1rem;
  transition: translate .5s var(--ease-out), background-color .3s ease, color .3s ease;
}
.to-top:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .school__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .about__grid, .skills__grid, .contact__grid { grid-template-columns: 1fr; }
  .about__visual { max-width: 380px; width: 100%; margin-inline: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tag-sphere { max-width: 380px; }
  .timeline { --date-w: 0px; --dot-w: 28px; }
  .timeline__line { left: 13px; }
  .tl-item { grid-template-columns: 28px minmax(0, 1fr); row-gap: 6px; }
  .tl-item__dot { grid-column: 1; grid-row: 1 / span 2; margin-top: 4px; }
  .tl-item__date { grid-column: 2; grid-row: 1; text-align: left; padding: 0 0 0 14px; }
  .tl-card { grid-column: 2; grid-row: 2; margin-left: 14px; }
  .tl-card:hover { transform: none; }
  .hero__meta > .mono { display: none; }
  .hero__meta { justify-content: center; padding-top: 28px; margin-top: 0; }
  /* la zone haute (42% de l'écran) est réservée au portrait 3D dessiné par js/scene.js */
  .hero { justify-content: flex-start; padding-top: calc(var(--nav-h) + 42vh); padding-top: calc(var(--nav-h) + 42svh); }
  .hero__title { font-size: clamp(4rem, 23vw, 8rem); }
  .hero__fallback { top: var(--nav-h); bottom: auto; right: 50%; transform: translateX(50%); height: 42vh; height: 42svh; max-width: 90vw; }
}

@media (max-width: 600px) {
  .school__grid { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .tl-card { padding: 20px; }
  .tl-card__head { flex-direction: column; gap: 10px; }
  .line--outline { -webkit-text-stroke-width: 1px; padding-left: .3em; }
  .hero__actions .btn { flex: 1 1 auto; }
  .stats li { padding-right: 8px; }
}

/* ---------- Accessibilité : réduire les animations ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  html:focus-within { scroll-behavior: auto; }
  [data-reveal], [data-intro], .char { opacity: 1 !important; transform: none !important; filter: none !important; }
  .grain { display: none; }
}
