/* ==========================================================
   base.css — palette (sombre chaud / clair crème + accent cuivre),
   reset, en-tête, menu plein écran, préchargeur, rideau de transition
   ========================================================== */
:root {
  color-scheme: light;
  /* Thème clair : crème chaud, texte brun très foncé, accent orange brûlé */
  --bg: #f7f3ec;
  --bg-alt: #efe8dc;
  --surface: #fffdf8;
  --line: #e3d9ca;
  --line-strong: #cdbfaa;
  --text: #17120d;
  --muted: #6a5f53;
  --faint: #9a8d7d;
  --accent: #d2600a;          /* fonds, barres, points */
  --accent-text: #b34c03;     /* texte coloré (contraste AA) */
  --accent-2: #a56433;
  --accent-soft: rgb(210 96 10 / .10);
  --glow: rgb(236 109 15 / .20);
  --on-accent: #ffffff;
  --ok: #15803d;
  --header-bg: rgb(247 243 236 / .82);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --radius: 14px;
  --header-h: 80px;
  --pad: clamp(20px, 4vw, 56px);
  --gutter: max(var(--pad), calc(50vw - 640px));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* Thème sombre : noir chaud, texte crème, accent orange cuivre */
  --bg: #0b0a09;
  --bg-alt: #13100e;
  --surface: #1a1613;
  --line: #29231e;
  --line-strong: #3d342b;
  --text: #f4eee6;
  --muted: #aa9f93;
  --faint: #70665b;
  --accent: #ec6d0f;
  --accent-text: #f08a3c;
  --accent-2: #a56433;
  --accent-soft: rgb(236 109 15 / .14);
  --glow: rgb(236 109 15 / .20);
  --on-accent: #120a03;
  --ok: #4ade80;
  --header-bg: rgb(11 10 9 / .78);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
html:not(.lenis) { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html.menu-open, html.modal-open, html.is-loading-page { overflow: hidden; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html.theme-anim body, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .5s ease, color .5s ease, border-color .5s ease, fill .5s ease !important;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.skip { position: fixed; left: 16px; top: -60px; z-index: 400; background: var(--accent); color: var(--on-accent); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: top .2s; }
.skip:focus { top: 14px; }

/* ---------- Transition native entre les pages (Chrome / Edge / Safari récents) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .38s cubic-bezier(.55, 0, 1, .45) both vt-out; }
::view-transition-new(root) { animation: .7s cubic-bezier(.22, 1, .36, 1) .08s both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px) scale(.995); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(22px); } }
.header { view-transition-name: site-header; }
.progress { view-transition-name: site-progress; }
::view-transition-group(site-header), ::view-transition-group(site-progress) { animation-duration: 0s; }

/* ---------- Curseur personnalisé (souris uniquement) ---------- */
.c-aura, .c-ring, .c-dot { position: fixed; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .35s; will-change: transform; }
.c-aura { z-index: 0; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); }
.c-ring, .c-dot { z-index: 700; }
.cursor-on .c-aura { opacity: .75; }
.cursor-on .c-ring, .cursor-on .c-dot { opacity: 1; }
.c-in { --s: 40px; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center; background: transparent; transition: width .55s var(--ease), height .55s var(--ease), margin .55s var(--ease), background .4s, border-color .4s, box-shadow .6s var(--ease); }
.c-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--on-accent); opacity: 0; transform: scale(.6); transition: opacity .3s, transform .5s var(--ease); white-space: nowrap; }
.c-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent); transition: opacity .35s, scale .35s var(--ease); }
/* survol d'un élément cliquable : grand cercle avec zone d'ombre lumineuse */
.cursor-hover .c-in { --s: 84px; border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: radial-gradient(circle, var(--accent-soft), transparent 72%); box-shadow: 0 0 60px 18px var(--glow), 0 18px 50px rgb(0 0 0 / .28); }
.cursor-hover .c-dot { scale: 0; }
/* survol d'un projet : bouton plein avec libellé */
.cursor-view .c-in { --s: 104px; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 70px 20px var(--glow), 0 20px 50px rgb(0 0 0 / .3); }
.cursor-view .c-label { opacity: 1; transform: none; }
.cursor-view .c-dot { scale: 0; }
.cursor-down .c-in { --s: 30px; }
.cursor-down.cursor-hover .c-in { --s: 64px; }
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor.modal-open, html.has-cursor.modal-open * { cursor: auto !important; }
html.modal-open .c-ring, html.modal-open .c-dot { display: none; }

/* ---------- Barre de progression ---------- */
.progress { position: fixed; left: 0; top: 0; right: 0; height: 3px; z-index: 120; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

/* ---------- Préchargeur (première visite de la session) ---------- */
.preloader { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: grid; place-items: center; transition: transform 1s var(--ease-io); }
.preloader.done { transform: translateY(-100%); }
.pl-in { display: grid; gap: 10px; width: min(640px, 86vw); }
.pl-count { font-size: 14px; font-weight: 700; letter-spacing: .3em; color: var(--accent); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; }
.pl-name { font-size: clamp(1.5rem, 6.2vw, 3.6rem); font-weight: 900; letter-spacing: .14em; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.pl-name span { display: inline-block; transform: translateY(110%); animation: plrise .9s var(--ease) forwards; }
.pl-bar { height: 2px; background: var(--line); margin-top: 18px; overflow: hidden; }
.pl-bar i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
@keyframes plrise { to { transform: none; } }
.no-js .preloader { display: none; }

/* ---------- Rideau de transition entre pages ---------- */
.curtain { position: fixed; inset: 0; z-index: 450; background: var(--accent); transform: translateY(100%); pointer-events: none; transition: transform .7s var(--ease-io); }
.curtain.cover { transform: none; pointer-events: all; }
.curtain.exit { transform: translateY(-100%); }
.curtain.instant { transition: none; }

/* ---------- En-tête ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  transition: transform .6s var(--ease);
}
.header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--header-bg); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .4s; }
.header.scrolled::before { opacity: 1; }
.header.hide { transform: translateY(-100%); }
html.menu-open .header { transform: none !important; transition: none; }
html.menu-open .header::before { opacity: 0; }

.brand { position: relative; z-index: 2; display: inline-flex; align-items: center; white-space: pre; font-size: 15px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; }
.brand b { font-weight: 900; }
.brand::before { content: ""; margin-right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transition: transform .5s var(--ease); }
.brand:hover::before { transform: scale(1.8); }

.head-right { position: relative; z-index: 2; display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--muted); transition: color .25s; }
.lang-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.lang-switch:hover { color: var(--accent-text); }

.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted); transition: color .25s, border-color .25s, background .25s; }
.icon-btn:hover { color: var(--accent-text); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.theme-wrap { position: relative; }
.theme-toggle .i-sun, .theme-toggle .i-moon, .theme-toggle .i-auto { display: none; }
:root[data-pref="auto"] .theme-toggle .i-auto, :root[data-pref="light"] .theme-toggle .i-sun, :root[data-pref="dark"] .theme-toggle .i-moon { display: block; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 12px); min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 50px -20px rgb(0 0 0 / .45); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .4s var(--ease), visibility .25s; }
.theme-menu.open { opacity: 1; visibility: visible; transform: none; }
.theme-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 14px; color: var(--muted); text-align: left; }
.theme-menu button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-menu button:hover { background: var(--accent-soft); color: var(--text); }
.theme-menu button[aria-checked="true"] { color: var(--text); }
.theme-menu .tick { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: 0; }
.theme-menu button[aria-checked="true"] .tick { opacity: 1; }

/* Bouton « Menu » */
.menu-toggle { display: inline-flex; align-items: center; gap: 12px; height: 36px; padding: 0 4px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-text); }
.menu-toggle .mt-label { position: relative; display: grid; overflow: hidden; height: 1.2em; line-height: 1.2em; }
.menu-toggle .mt-label span { grid-area: 1 / 1; transition: transform .6s var(--ease); }
.menu-toggle .mt-label span + span { transform: translateY(110%); }
.menu-toggle[aria-expanded="true"] .mt-label span:first-child { transform: translateY(-110%); }
.menu-toggle[aria-expanded="true"] .mt-label span + span { transform: none; }
.menu-toggle .mt-lines { position: relative; width: 26px; height: 12px; }
.menu-toggle .mt-lines i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .6s var(--ease), top .6s var(--ease), width .4s var(--ease); }
.menu-toggle .mt-lines i:first-child { top: 0; }
.menu-toggle .mt-lines i:last-child { top: 10px; width: 60%; right: auto; }
.menu-toggle:hover .mt-lines i:last-child { width: 100%; }
.menu-toggle[aria-expanded="true"] .mt-lines i:first-child { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .mt-lines i:last-child { top: 5px; width: 100%; transform: rotate(-45deg); }

/* ---------- Menu plein écran ---------- */
.nav { position: fixed; inset: 0; z-index: 1; visibility: hidden; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; transition: visibility 0s 1.1s; }
.nav.open { visibility: visible; transition: none; }
/* deux rideaux : orange d'abord, puis le fond sombre qui le suit */
.nav-wipe, .nav::before { content: ""; position: fixed; inset: 0; clip-path: inset(0 0 100% 0); }
.nav::before { background: var(--accent); transition: clip-path .9s var(--ease-io) .12s; }
.nav-wipe { background: var(--bg); transition: clip-path .9s var(--ease-io); }
.nav.open::before { clip-path: inset(0); transition: clip-path .9s var(--ease-io); }
.nav.open .nav-wipe { clip-path: inset(0); transition: clip-path .9s var(--ease-io) .14s; }
.nav-glow { position: fixed; right: -12vw; bottom: -22vh; width: 66vw; height: 66vw; background: radial-gradient(closest-side, var(--glow), transparent); opacity: 0; pointer-events: none; transition: opacity .8s; }
.nav.open .nav-glow { opacity: 1; transition-delay: .6s; }

.nav-in { position: relative; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: center; padding: calc(var(--header-h) + 20px) var(--gutter) 44px; }
.nav-links { display: grid; }
.nav-links a { position: relative; display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); padding: .04em 0; border-top: 1px solid var(--line); color: var(--text); text-transform: uppercase; font-weight: 900; letter-spacing: -.03em; line-height: 1.12; font-size: clamp(2.1rem, min(5.4vw, 8.6vh), 5rem); white-space: nowrap; transition: color .4s, opacity .4s, padding .6s var(--ease); }
.nav-links a:last-child { border-bottom: 1px solid var(--line); }
.nav-links a i { font-style: normal; font-size: clamp(.75rem, 1.1vw, .95rem); font-weight: 700; letter-spacing: .2em; color: var(--accent-text); min-width: 2.4em; }
.nl-mask { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.nl-mask > span { display: block; transform: translateY(112%); transition: transform .5s var(--ease); }
.nav.open .nl-mask > span { transform: none; transition: transform 1s var(--ease) calc(.38s + var(--i, 0) * .07s); }
.nav-links a::after { content: "→"; margin-left: auto; padding-right: 6px; font-weight: 400; color: var(--accent-text); opacity: 0; transform: translateX(-16px); transition: opacity .4s, transform .6s var(--ease); }
.nav-links a:hover::after, .nav-links a:focus-visible::after { opacity: 1; transform: none; }
@media (hover: hover) { .nav.open .nav-links:hover a:not(:hover) { opacity: .3; } }
.nav-links a:hover { color: var(--accent-text); padding-left: clamp(8px, 1.4vw, 22px); }
.nav-links a[aria-current="page"] { color: var(--accent-text); }
.nav-links a[aria-current="page"] i::after { content: " ●"; font-size: .7em; }

.nav-side { display: grid; gap: 22px; align-content: center; opacity: 0; transform: translateY(40px); transition: opacity .4s, transform .5s var(--ease); }
.nav.open .nav-side { opacity: 1; transform: none; transition: opacity 1s var(--ease) .65s, transform 1.2s var(--ease) .65s; }
.nav-photo { position: relative; margin: 0; aspect-ratio: 4 / 5; max-height: 46vh; width: min(100%, 340px); border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); box-shadow: 14px 14px 0 -2px var(--accent-soft), 0 0 0 1px var(--line-strong); }
.nav-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.nav-tag { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); max-width: 30ch; line-height: 1.6; }
.nav-foot { display: grid; gap: 4px; font-size: 15px; }
.nav-foot a { width: fit-content; color: var(--muted); padding: 3px 0; border-bottom: 1px solid transparent; transition: color .3s, border-color .3s; }
.nav-foot a:first-child { color: var(--text); font-weight: 500; font-size: 17px; }
.nav-foot a:hover { color: var(--accent-text); border-color: var(--accent); }
.nav-foot .nav-soc { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 6px; }

@media (max-width: 880px) {
  .nav-in { grid-template-columns: 1fr; align-items: start; gap: 28px; padding-top: calc(var(--header-h) + 8px); }
  .nav-links a { font-size: clamp(1.7rem, min(8.6vw, 8vh), 3.4rem); }
  .nav-photo { display: none; }
}
@media (max-height: 700px) { .nav-photo { display: none; } }

/* ---------- Pied de page ---------- */
.footer { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 30px var(--gutter); border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.footer a { color: var(--muted); display: inline-flex; gap: 8px; font-weight: 500; transition: color .25s; }
.footer a:hover { color: var(--accent-text); }

/* ---------- Boutons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 30px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; border: 1.5px solid transparent; isolation: isolate; transition: color .4s, border-color .4s, transform .5s var(--ease); }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--text); transform: translateY(101%); transition: transform .5s var(--ease); }
.btn:hover::before { transform: none; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--bg); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); }
.btn-ghost::before { background: var(--accent); }
.btn-ghost:hover { border-color: var(--accent); color: var(--on-accent); }

/* ---------- Apparition (repli sans GSAP) ---------- */
.m-reveal { opacity: 0; transform: translate3d(0, 32px, 0); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.m-reveal.in { opacity: 1; transform: none; }
.no-js .m-reveal { opacity: 1; transform: none; }

/* ---------- Mots découpés (titres animés) ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.wi { display: inline-block; will-change: transform; }

/* ---------- Indicateur de chargement des images ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } to { box-shadow: 0 0 0 9px transparent; } }
.is-loading { position: relative; }
.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; z-index: 4; pointer-events: none; }
.is-loading img { opacity: 0; }

@media (max-width: 640px) {
  :root { --header-h: 68px; }
  .brand { letter-spacing: .14em; font-size: 13px; }
  .lang-switch span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .m-reveal { opacity: 1; transform: none; }
  .is-loading::after { animation: spin 1.6s linear infinite !important; animation-duration: 1.6s !important; }
}
