/* ==========================================================================
   Portfolio Ewan Menaheze — feuille de style commune à toutes les pages
   --------------------------------------------------------------------------
   1. Variables            5. Boutons, étiquettes     9. Formulaire de contact
   2. Base                 6. Page d'accueil         10. Pied de page
   3. Mise en page         7. Pages projet           11. Animations
   4. En-tête              8. Visionneuse d'images   12. Impression
   ========================================================================== */

/* 1. Variables ------------------------------------------------------------ */
/* Palette par défaut (accueil) : crème, terracotta, olive.
   Chaque couleur a un rôle ; les thèmes plus bas redéfinissent ces rôles page par page. */
:root {
  --bg: #f4f1e8;            /* fond de page */
  --surface: #e6ddd4;       /* fond des sections et des cadres teintés */
  --ink: #3c2e26;           /* texte, bordures, ombres */
  --ink-soft: #5e4d42;      /* texte secondaire */
  --accent: #d4744a;        /* couleur vive : filets, cadres, formes */
  --accent-ink: #9c4520;    /* version foncée de l'accent : texte et boutons (contraste AA) */
  --accent-2: #cc7722;      /* seconde couleur décorative */
  --accent-3: #8b956d;      /* troisième couleur décorative */
  --ok: #3f6b33;            /* message de succès */

  /* Typographie */
  --font-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  /* Mesures */
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --header-h: 68px;
}

/* Thèmes : chaque page projet a son propre code couleur.
   La classe .theme-xxx se place sur <body>. */
.theme-capsule     { --accent: #14b8a6; --accent-ink: #0d6b64;   /* turquoise */
                     --bg: #f4f1e8; --surface: #d5ece8; --ink: #134e4a; --ink-soft: #2f6560; --accent-2: #2dd4bf; --accent-3: #5eead4; }

.theme-cooperation  { --accent: #8b5cf6; --accent-ink: #6d28d9;   /* violet */
                     --bg: #f4f1e8; --surface: #e6defa; --ink: #2e1065; --ink-soft: #55437f; --accent-2: #a78bfa; --accent-3: #c4b5fd; }

.theme-poker       { --accent: #ec4899; --accent-ink: #be185d;   /* rose fuchsia */
                     --bg: #f4f1e8; --surface: #fbdfec; --ink: #4a0d2b; --ink-soft: #7a3555; --accent-2: #f472b6; --accent-3: #f9a8d4; }

.theme-ais         { --accent: #38bdf8; --accent-ink: #0369a1;   /* bleu ciel */
                     --bg: #f4f9fb; --surface: #dcf0f9; --ink: #02314a; --ink-soft: #2c5870; --accent-2: #60a5fa; --accent-3: #7dd3fc; }

.theme-morpion     { --accent: #16a34a; --accent-ink: #13753a;   /* vert */
                     --bg: #f4f1e8; --surface: #dfeedd; --ink: #14532d; --ink-soft: #2f6145; --accent-2: #22c55e; --accent-3: #4ade80; }

/* Bordure et ombre « rétro » : recalculées dans chaque thème pour suivre sa couleur --ink */
:root, [class*="theme-"] {
  --border: 3px solid var(--ink);
  --shadow: 8px 8px 0 var(--ink);
  --shadow-sm: 5px 5px 0 var(--ink);
}

/* 2. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: clip;            /* les cartes qui arrivent par le côté ne doivent pas élargir la page */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
strong { font-weight: 700; }
sup { font-size: .6em; line-height: 0; vertical-align: super; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
}

::selection { background: var(--accent); color: var(--bg); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 200;
  padding: 10px 16px; background: var(--ink); color: var(--bg);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--bg); }

/* Formes décoratives en arrière-plan */
.bg-shapes { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-shapes span { position: absolute; opacity: .1; }
.bg-shapes canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.shape-circle   { width: 300px; height: 300px; top: 12%; right: -100px; border-radius: 50%; background: var(--accent); }
.shape-triangle { top: 62%; left: -50px; border-left: 100px solid transparent; border-right: 100px solid transparent; border-bottom: 173px solid var(--accent-3); animation: spin 40s linear infinite reverse; }
.shape-square   { width: 200px; height: 200px; bottom: 18%; right: 18%; background: var(--accent-2); animation: spin 60s linear infinite; }
.shape-dot      { width: 150px; height: 150px; top: 32%; left: 5%; border-radius: 50%; background: var(--accent-ink); animation: bob 9s ease-in-out infinite; }

/* 3. Mise en page --------------------------------------------------------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.section { padding-block: clamp(56px, 9vw, 104px); }
.section--tint { background: var(--surface); border-block: var(--border); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.section-title {
  position: relative;
  margin-top: 6px;
  padding-bottom: 18px;
  font-size: clamp(1.75rem, 4.2vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.section-title::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 88px; height: 6px;
  background: var(--accent);
}

.section-intro { max-width: 62ch; margin-top: 18px; color: var(--ink-soft); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }

.lead { font-size: clamp(1.0625rem, 1.6vw, 1.2rem); color: var(--ink-soft); max-width: 58ch; }

.prose > * + * { margin-top: 1em; }
.prose h3 { margin-top: 1.8em; font-size: 1.2rem; line-height: 1.3; }
.prose h3:first-child { margin-top: 0; }
.prose ul { display: grid; gap: .45em; }
.prose li { position: relative; padding-left: 1.4em; }
.prose li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 9px; height: 9px; background: var(--accent);
}

/* Cadre « rétro » : bordure épaisse et ombre portée franche */
.frame { background: var(--surface); border: var(--border); box-shadow: var(--shadow); }

/* 4. En-tête -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--accent);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: var(--header-h);
}

.brand {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent-ink);
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 34px); }
.nav__list { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 34px); }
.nav__list a {
  position: relative;
  padding-block: 6px;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.nav__list a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0; height: 3px; background: var(--accent-2); transition: width .25s;
}
.nav__list a:hover::after, .nav__list a[aria-current]::after { width: 100%; }

.lang-switch {
  display: inline-flex; border: 2px solid var(--ink);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
}
.lang-switch a, .lang-switch span { padding: 4px 9px; text-decoration: none; color: var(--ink); }
.lang-switch span { background: var(--ink); color: var(--bg); }
.lang-switch a:hover { background: var(--surface); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 10px;
  background: none; border: 2px solid var(--ink); cursor: pointer;
}
.nav-toggle span { display: block; height: 3px; background: var(--ink); transition: transform .25s, opacity .25s; }
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--bg); border-bottom: var(--border);
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a { display: block; padding: 14px 0; border-bottom: 1px solid var(--surface); }
  .nav__list a::after { display: none; }
  .lang-switch { align-self: flex-start; margin-top: 16px; }
}

/* 5. Boutons, étiquettes -------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero .actions { gap: 12px; }
.hero .actions .btn { padding-inline: 20px; }   /* trois boutons sur une ligne */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  border: var(--border);
  font-size: .875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background-color .2s;
}
.btn:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-sm); }
.btn:active { transform: none; box-shadow: none; }
.btn--primary { background: var(--accent-ink); color: var(--bg); }
.btn--primary:hover { color: var(--bg); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; box-shadow: none; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 4px 11px;
  background: var(--bg);
  border: 2px solid var(--ink);
  font-family: var(--font-mono); font-size: .78rem; font-weight: 500; line-height: 1.5;
}
.tags--solid li { background: var(--ink); color: var(--bg); }

/* 6. Page d'accueil ------------------------------------------------------- */
.hero { padding-block: clamp(48px, 9vw, 110px) clamp(56px, 9vw, 110px); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: clamp(32px, 6vw, 80px); align-items: center;
}
.hero__title {
  margin-block: 14px 20px;
  font-size: clamp(2.5rem, 7.2vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  min-height: 1.05em;
}
.hero__title .accent, .page-hero h1 .accent { color: var(--accent-ink); }

.caret {
  display: inline-block; width: 3px; height: .9em; margin-left: 6px;
  background: var(--ink); vertical-align: -.06em;
  animation: blink .9s steps(1) infinite;
}
/* Machine à écrire : le titre reste masqué jusqu'au démarrage du script (sécurité : 2,5 s) */
.js [data-typewriter] { visibility: hidden; animation: reveal-failsafe 0s 2.5s forwards; }
.js [data-typewriter].is-typing { visibility: visible; animation: none; }
[data-typewriter] .char[hidden] { display: none; }

.status {
  display: inline-flex; align-items: flex-start; gap: 12px;
  margin-block: 26px 28px; padding: 12px 16px;
  background: var(--surface); border: 2px solid var(--ink);
  font-size: .95rem; font-weight: 600; line-height: 1.45;
}
.status__dot {
  flex: none; width: 12px; height: 12px; margin-top: .3em; border-radius: 50%;
  background: #4c8a3f; box-shadow: 0 0 0 0 rgba(76, 138, 63, .55);
  animation: pulse 2.2s ease-out infinite;
}

.hero__place { margin-top: 22px; font-family: var(--font-mono); font-size: .85rem; color: var(--ink-soft); }

.portrait {
  position: relative; justify-self: center; width: min(100%, 360px);
  padding: 14px; background: var(--surface);
  border: 6px solid var(--accent); box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(-2deg); transition: transform .3s;
}
.portrait:hover { transform: rotate(0); }
.portrait::after {
  content: ''; position: absolute; inset: 6px;
  border: 2px dashed var(--accent-3); pointer-events: none;
}
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* À propos */
.about__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px); align-items: start;
}
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.facts div { padding: 16px 18px; background: var(--bg); border: var(--border); box-shadow: var(--shadow-sm); }
.facts dt { font-family: var(--font-mono); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.facts dd { margin-top: 4px; font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--accent-ink); }

.skills { display: grid; gap: 22px; }
.skill-group { padding: 18px 20px 20px; background: var(--bg); border: var(--border); box-shadow: var(--shadow-sm); }
.skill-group h3 {
  margin-bottom: 12px;
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
}

/* Distinction */
.award { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 5vw, 56px); padding: clamp(24px, 4.5vw, 48px); align-items: center; }
.award h2 { margin-block: 8px 14px; font-size: clamp(1.5rem, 3.4vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; text-transform: uppercase; }
.award__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.award__stats li { padding: 18px 10px; background: var(--bg); border: var(--border); text-align: center; }
.award__stats strong { display: block; font-family: var(--font-mono); font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.1; color: var(--accent-ink); }
.award__stats span { display: block; margin-top: 6px; font-size: .78rem; font-weight: 600; line-height: 1.35; text-transform: uppercase; letter-spacing: .04em; }

.disclosure { grid-column: 1 / -1; border-top: 2px dashed var(--accent-3); padding-top: 18px; }
.disclosure summary {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-weight: 700; font-size: .875rem; letter-spacing: .08em; text-transform: uppercase;
}
.disclosure summary::before { content: '+'; display: grid; place-items: center; width: 26px; height: 26px; background: var(--ink); color: var(--bg); font-family: var(--font-mono); }
.disclosure[open] summary::before { content: '–'; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure ol { display: grid; gap: 10px; margin-top: 18px; counter-reset: exo; }
.disclosure li { position: relative; padding-left: 2.2em; counter-increment: exo; }
.disclosure li::before { content: counter(exo); position: absolute; left: 0; top: .1em; font-family: var(--font-mono); font-weight: 700; color: var(--accent-ink); }

/* Cartes projet : bloc sombre, photo encadrée posée de travers, étiquette « Voir le projet » */
.projects { display: grid; gap: clamp(48px, 7vw, 76px); counter-reset: project; }
.project-card {
  position: relative;
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(30px, 5vw, 64px); align-items: center;
  padding: clamp(24px, 4vw, 48px);
  background: var(--ink); color: var(--bg);
  box-shadow: 12px 12px 0 var(--accent);
  counter-increment: project;
  transition: transform .25s, box-shadow .25s;
}
.project-card:hover { transform: translate(-4px, -4px); box-shadow: 16px 16px 0 var(--accent-2); }
.project-card:nth-child(even) .project-card__media { order: 2; }

/* Photo : cadre terracotta, liseré en pointillés, légère rotation qui se redresse au survol */
.project-card__media { position: relative; display: block; color: inherit; text-decoration: none; transform: rotate(-2deg); transition: transform .3s; }
.project-card:nth-child(even) .project-card__media { transform: rotate(2deg); }
.project-card:hover .project-card__media { transform: rotate(0); }
.project-card__frame { position: relative; overflow: hidden; border: 5px solid var(--accent); background: var(--bg); }
.project-card__frame::after {
  content: ''; position: absolute; inset: 12px;
  border: 2px dashed var(--accent-3); pointer-events: none;
}
.project-card__frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .4s; }
.project-card:hover .project-card__frame img { transform: scale(1.05); }

/* Étiquette à cheval sur le coin de la photo */
.project-card__cta {
  position: absolute; right: -14px; bottom: -18px;
  padding: 10px 16px;
  background: var(--accent-ink); color: var(--bg);
  border: 3px solid var(--bg); box-shadow: 4px 4px 0 var(--accent-2);
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: transform .25s;
}
.project-card__cta::after { content: ' →'; display: inline-block; transition: transform .25s; }
.project-card:nth-child(even) .project-card__cta { right: auto; left: -14px; }
.project-card:hover .project-card__cta { transform: translate(-3px, -3px); }
.project-card:hover .project-card__cta::after { transform: translateX(5px); }

/* Texte clair sur fond sombre, numéro du projet en filigrane */
.project-card__body { position: relative; }
.project-card__body::before {
  content: counter(project, decimal-leading-zero);
  position: absolute; top: -9px; right: 0;
  font-family: var(--font-mono); font-size: 2rem; font-weight: 700; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px var(--accent);
}
.project-card .eyebrow { padding-right: 3.4rem; color: #e9a07c; }
.project-card h3 { margin-block: 8px 14px; font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.2; letter-spacing: -.01em; }
.project-card h3 a { color: var(--bg); text-decoration: none; }
.project-card h3 a::after { content: ''; position: absolute; inset: 0; }   /* toute la carte est cliquable */
.project-card h3 a:focus-visible { outline-color: var(--bg); }
.project-card__body > p:not(.eyebrow) { color: var(--surface); }
.project-card .tags { margin-top: 20px; }
.project-card .tags li { background: transparent; border-color: var(--accent); color: var(--bg); }

/* 7. Pages projet --------------------------------------------------------- */
.page-hero { padding-block: clamp(32px, 6vw, 72px) clamp(40px, 6vw, 72px); }
.page-hero__grid { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
.page-hero__grid.has-media { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.page-hero h1 { margin-block: 10px 18px; font-size: clamp(2rem, 5.4vw, 3.4rem); line-height: 1.06; letter-spacing: -.03em; }
.page-hero .tags { margin-top: 24px; }
.page-hero__media { padding: 10px; transform: rotate(1.5deg); }
.page-hero__media img { width: 100%; }

.breadcrumb { margin-bottom: 22px; font-family: var(--font-mono); font-size: .8rem; color: var(--ink-soft); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.breadcrumb li + li::before { content: '/'; margin-right: 10px; color: var(--accent-3); }

.subnav { position: sticky; top: var(--header-h); z-index: 50; background: var(--ink); }
.subnav ul { display: flex; gap: 6px 26px; overflow-x: auto; padding-block: 12px; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a {
  white-space: nowrap; text-decoration: none; color: var(--bg);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
.subnav a:hover { color: var(--bg); text-decoration: underline; text-decoration-thickness: 2px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px; }
.stats--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.stats li { padding: 26px 16px; background: var(--surface); border: var(--border); box-shadow: var(--shadow-sm); text-align: center; }
.stats strong { display: block; font-family: var(--font-mono); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.1; color: var(--accent-ink); }
.stats span { display: block; margin-top: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .06em; line-height: 1.4; text-transform: uppercase; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.card { padding: 22px; background: var(--bg); border: var(--border); box-shadow: var(--shadow-sm); }
.section:not(.section--tint) .card { background: var(--surface); }
.card h3 { font-size: 1.08rem; line-height: 1.3; }
.card p { margin-top: 8px; font-size: .95rem; color: var(--ink-soft); }
.card .note { margin-top: 12px; font-family: var(--font-mono); font-size: .75rem; color: var(--accent-ink); }
.card ul { display: grid; gap: 6px; margin-top: 10px; font-size: .95rem; color: var(--ink-soft); }
.card li { position: relative; padding-left: 1.2em; }
.card li::before { content: ''; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; background: var(--accent); }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 60px); align-items: start; }

.callout {
  margin-top: 20px; padding: 14px 18px;
  background: var(--bg); border-left: 6px solid var(--accent);
  font-size: .98rem;
}
.section:not(.section--tint) .callout { background: var(--surface); }

/* Étapes numérotées */
.steps { display: grid; gap: clamp(28px, 4.5vw, 44px); }
.step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: clamp(14px, 2.6vw, 28px); }
.step__num {
  display: grid; place-items: center; width: 56px; height: 56px;
  background: var(--accent-ink); color: var(--bg); border: var(--border);
  font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700;
}
.step h3 { padding-top: 10px; font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.25; }
.step p { margin-top: 10px; max-width: 72ch; color: var(--ink-soft); }
.step .figures { margin-top: 20px; }

/* Figures et galeries */
.figures { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); align-items: start; }
.figures--single { grid-template-columns: minmax(0, 760px); }
.figures--wide   { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.figures--small  { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.figures + .steps, .figures + .cards { margin-top: clamp(28px, 4vw, 40px); }

.figure { background: #fff; border: var(--border); box-shadow: var(--shadow-sm); }
.figure a { display: block; cursor: zoom-in; }
.figure img { width: 100%; }
.figure figcaption {
  padding: 9px 12px; border-top: 2px solid var(--ink); background: var(--bg);
  font-size: .82rem; line-height: 1.4; color: var(--ink-soft);
}

/* Onglets */
.tabs__list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(28px, 5vw, 48px); }
.tabs__list button {
  padding: 12px 22px; background: var(--bg); border: var(--border); cursor: pointer;
  font-size: .875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.tabs__list button:hover { background: var(--surface); }
.tabs__list button[aria-selected="true"] { background: var(--accent-ink); color: var(--bg); box-shadow: var(--shadow-sm); }
.tabs__panel > h3 { margin-bottom: 28px; font-size: clamp(1.4rem, 3vw, 1.9rem); text-transform: uppercase; letter-spacing: -.01em; }
.tabs__panel + .tabs__panel { margin-top: 64px; }
.tabs__panel[hidden] + .tabs__panel, .tabs__panel[hidden] { margin-top: 0; }

/* Téléchargements */
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.download {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px;
  background: var(--bg); border: var(--border); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s;
}
.download:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); color: var(--ink); }
.download strong::after { content: ' ↓'; color: var(--accent-ink); }
.download span { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-soft); }

/* Navigation entre projets */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding-block: clamp(40px, 7vw, 72px); }
.pager a { text-decoration: none; font-weight: 700; color: var(--ink); }
.pager a:hover { color: var(--accent-ink); }
.pager small { display: block; font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.pager__next { text-align: right; }

/* 8. Visionneuse d'images ------------------------------------------------- */
.lightbox {
  max-width: min(96vw, 1400px); max-height: 94vh; padding: 0;
  background: var(--bg); border: var(--border); box-shadow: var(--shadow);
}
.lightbox::backdrop { background: rgba(30, 24, 20, .86); }
.lightbox img { max-width: 100%; max-height: calc(94vh - 70px); margin-inline: auto; object-fit: contain; background: #fff; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-top: 2px solid var(--ink); }
.lightbox__bar p { font-size: .88rem; color: var(--ink-soft); }
.lightbox__close { flex: none; padding: 6px 14px; background: var(--ink); color: var(--bg); border: 0; cursor: pointer; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }

/* 9. Formulaire de contact ------------------------------------------------ */
.contact__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact-list { display: grid; gap: 16px; margin-top: 30px; }
.contact-list a {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 14px 16px; background: var(--bg); border: var(--border); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s;
}
.contact-list a:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.contact-list svg { width: 46px; height: 46px; padding: 11px; background: var(--accent-ink); color: var(--bg); }
.contact-list strong { display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.contact-list span { display: block; font-family: var(--font-mono); font-size: .85rem; overflow-wrap: anywhere; color: var(--ink-soft); }

.form { padding: clamp(20px, 3.6vw, 36px); background: var(--bg); border: var(--border); box-shadow: var(--shadow); }
.field + .field { margin-top: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px;
  background: #fff; border: 2px solid var(--ink); border-radius: 0;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--accent-ink); }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { width: 100%; margin-top: 22px; }
.form__status { min-height: 1.5em; margin-top: 14px; font-weight: 600; font-size: .95rem; }
.form__status[data-state="ok"] { color: var(--ok); }
.form__status[data-state="error"] { color: #a1261d; }

/* 10. Pied de page -------------------------------------------------------- */
.site-footer { padding-block: 32px; background: var(--ink); color: var(--surface); font-family: var(--font-mono); font-size: .82rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-footer a { color: var(--bg); }
.site-footer a:hover { color: #fff; }

/* Page 404 */
.notfound { min-height: 62vh; display: grid; place-items: center; text-align: center; padding-block: 60px; }
.notfound strong { display: block; font-family: var(--font-mono); font-size: clamp(4rem, 16vw, 9rem); line-height: 1; color: var(--accent-ink); }
.notfound h1 { margin-block: 12px; font-size: clamp(1.4rem, 3.4vw, 2rem); }
.notfound .actions { justify-content: center; margin-top: 28px; }

/* 11. Animations ---------------------------------------------------------- */
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes bob    { 50% { transform: translateY(-20px); } }
@keyframes blink  { 50% { opacity: 0; } }
@keyframes pulse  { 70% { box-shadow: 0 0 0 10px rgba(76, 138, 63, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 138, 63, 0); } }
@keyframes reveal-failsafe { to { visibility: visible; } }

/* Apparition au défilement : active uniquement quand le script a démarré (.reveal-on) */
.reveal-on .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .9, .25, 1); }
.reveal-on .reveal.is-visible { opacity: 1; transform: none; }
/* Les cartes projet arrivent par le côté, une fois à gauche, une fois à droite */
.reveal-on .project-card.reveal { transform: translateX(-60px); }
.reveal-on .project-card.reveal:nth-child(even) { transform: translateX(60px); }
.reveal-on .project-card.reveal.is-visible { transform: none; }
.reveal-on .project-card.reveal.is-visible:hover { transform: translate(-4px, -4px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-on .reveal { opacity: 1; transform: none; }
  .js [data-typewriter] { visibility: visible; }
}

/* Mises en page étroites */
@media (max-width: 860px) {
  .hero__grid, .about__grid, .contact__grid, .award, .split,
  .project-card, .page-hero__grid.has-media { grid-template-columns: minmax(0, 1fr); }
  .project-card:nth-child(even) .project-card__media { order: 0; }
  .project-card:nth-child(even) .project-card__cta { left: auto; right: -8px; }
  .project-card__cta { right: -8px; }
  .portrait { width: min(52%, 220px); padding: 8px; border-width: 4px; box-shadow: var(--shadow-sm); }
  .portrait::after { inset: 3px; }
  .hero__grid .portrait { order: -1; justify-self: start; }
  .page-hero__media { transform: none; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  :root, [class*="theme-"] { --shadow: 6px 6px 0 var(--ink); --shadow-sm: 4px 4px 0 var(--ink); }
  .facts, .award__stats { grid-template-columns: minmax(0, 1fr); }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step__num { width: 46px; height: 46px; font-size: 1.1rem; }
  .step h3 { padding-top: 0; }
  .btn { width: 100%; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager__all { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .bg-shapes span { transform: scale(.6); }
}

/* 12. Impression ---------------------------------------------------------- */
@media print {
  .site-header, .subnav, .bg-shapes, .pager, .form, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .frame, .card, .figure, .project-card, .stats li { box-shadow: none; }
  .tabs__panel[hidden] { display: block !important; }
}
