/* =========================================================
   PORTFOLIO « ATELIER », règle 60-30-10 :
   60 % noir doux · 30 % gris · 10 % blanc (actions)
   Mode sombre : un cadre est plus CLAIR que ce qu'il y a derrière
   ========================================================= */
:root {
  color-scheme: dark;       /* barre de défilement sombre */
  --fond: #121212;          /* page : noir doux, pas noir pur */
  --creux: #262626;         /* cadre à l'intérieur d'un cadre */
  --surface: #1c1c1c;
  --ligne: #3a3a3a;
  --texte: #ededed;
  --texte-2: #b3b3b3;

  --nuit: #0c0c0c;
  --nuit-texte-2: #b3b3b3;

  --accent: #ededed;         /* fonds de boutons */
  --encre: #141414;          /* texte posé sur du clair */
  --accent-texte: #ffffff;   /* liens et chiffres */
  --accent-hover: #cfcfcf;

  /* Les 6 tailles de texte du site */
  --t-sm: 14px;
  --t-base: 16px;
  --t-md: 20px;
  --t-lg: 28px;
  --t-xl: clamp(32px, 4.4vw, 48px);
  --t-2xl: clamp(38px, 6.6vw, 80px);

  --r-btn: 10px;
  --r-carte: 16px;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: "Geist", "Segoe UI", system-ui, sans-serif;
  font-size: var(--t-base);
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
}

h1, h2, h3, p { margin: 0; }
h1, h2 { font-weight: 600; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; }
h1 { font-size: var(--t-2xl); letter-spacing: -.045em; line-height: 1; }
h2 { font-size: var(--t-xl); }
h3 { margin-bottom: 4px; font-size: var(--t-md); font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }

.container { width: min(1216px, 100% - 48px); margin-inline: auto; }

/* ===== LES CADRES =====
   .panneau = grand cadre autour de chaque partie de la page */
.panneau { margin-block: 32px; padding: 48px; border: 1px solid var(--ligne); border-radius: 24px; background: var(--surface); }
/* Petits cadres teintés, à l'intérieur des grands */
.hero__bas, .scene__tete, .scene__pied, .etapes li { border: 1px solid var(--ligne); border-radius: var(--r-carte); background: var(--creux); }

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-texte); outline-offset: 3px; }

/* ===== BOUTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--encre);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn--small { padding: 8px 16px; }
.btn--ghost { background: var(--surface); border-color: var(--ligne); color: var(--texte); }
.btn--ghost:hover { background: var(--fond); }

/* ===== EN-TÊTE ===== */
.header { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--ligne); }
.header__inner { display: flex; justify-content: space-between; align-items: center; min-height: 72px; }
.logo { font-size: var(--t-md); font-weight: 600; letter-spacing: -.02em; color: inherit; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a:not(.btn) { padding-block: 8px; color: var(--texte-2); text-decoration: none; transition: color .15s; }
.nav a:not(.btn):hover, .nav a[aria-current]:not(.btn) { color: var(--accent-texte); }

/* ===== ACCROCHE : un titre géant, rien d'autre ===== */
.hero h1 { max-width: 13em; }
.hero__bas { display: flex; justify-content: space-between; align-items: center; gap: 32px; margin-top: 40px; padding: 32px; }
.hero__text { max-width: 36rem; font-size: var(--t-md); color: var(--texte-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ===== CARTES VERS LES DÉMOS : chacune aux couleurs de son commerce ===== */
.visites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 32px 0 48px; }
.visite { display: grid; justify-items: start; padding: 32px; border-radius: var(--r-carte); text-decoration: none; transition: transform .1s; }
.visite--boulangerie { --bouton: #b8401f; --bouton-hover: #9c3418; --bouton-texte: #fff; background: #f2d7a9; color: #2a1b12; }
.visite--snack { --bouton: #f2b632; --bouton-hover: #f9cb62; --bouton-texte: #1d1a17; background: #b02a18; color: #fff; }
.visite--barbier { --bouton: #d9a85b; --bouton-hover: #e8bf7d; --bouton-texte: #14251d; background: #123a2c; color: #f1f6f1; }
.visite__nom { font-size: var(--t-lg); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.visite__bouton { margin-top: 32px; padding: 12px 24px; border-radius: var(--r-btn); background: var(--bouton); color: var(--bouton-texte); font-weight: 500; transition: background .15s; }
.visite:hover .visite__bouton { background: var(--bouton-hover); }
.visite:active { transform: translateY(1px); }

/* ===== LA SCÈNE ===== */
.scene__tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; padding: 20px 24px; }
.scene__tete h3 { margin: 0; }
.reglages { display: flex; flex-wrap: wrap; gap: 12px; }

/* Interrupteur à deux positions */
.choix { display: flex; padding: 4px; border-radius: 12px; background: var(--nuit); }
.choix button {
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--texte-2);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.choix button:hover { color: var(--texte); }
.choix button:active { transform: translateY(1px); }
.choix button[aria-pressed="true"] { background: var(--ligne); color: var(--texte); }

.scene { display: grid; place-items: center; height: 720px; padding: 32px; border-radius: 24px; background: var(--nuit); }

.cadre { width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: #fff; }
.ecran { position: relative; width: 100%; height: 100%; overflow: hidden; }

/* main.js calcule --l (largeur simulée) et --z (zoom) pour que le site tienne dans le cadre */
.ecran iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--l, 100%);
  height: calc(100% / var(--z, 1));
  border: 0;
  transform: scale(var(--z, 1));
  transform-origin: 0 0;
}

/* Mode téléphone : le cadre devient un téléphone */
.scene[data-ecran="tel"] .cadre { width: min(320px, 100%); padding: 8px; border-radius: 40px; background: #000; }
.scene[data-ecran="tel"] .ecran { border-radius: 32px; }

.scene__pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 20px; padding: 16px 24px; color: var(--texte-2); }
.scene__pied a { color: var(--accent-texte); font-weight: 500; text-underline-offset: 4px; }

/* ===== SERVICES : quatre cadres de texte, un petit dessin à gauche ===== */
.cartes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 40px; }
.carte { display: flex; align-items: flex-start; gap: 24px; padding: 32px; border: 1px solid var(--ligne); border-radius: var(--r-carte); background: var(--creux); }
.carte h3 { margin-bottom: 8px; font-size: var(--t-lg); line-height: 1.2; }
.carte p { color: var(--texte-2); }
.dessin { width: 36px; height: 36px; flex-shrink: 0; fill: none; stroke: var(--texte); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ===== MÉTHODE : titre à gauche, étapes à droite ===== */
.methode { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; }
.etapes { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: etape; }
.etapes li { position: relative; padding: 24px 24px 24px 72px; counter-increment: etape; }
.etapes li::before { content: counter(etape); position: absolute; left: 28px; font-size: var(--t-lg); font-weight: 600; line-height: 1; color: var(--accent-texte); }
.etapes p { color: var(--texte-2); }

/* ===== CONTACT : le seul grand bloc gris clair de la page ===== */
.contact { margin-top: 64px; padding-block: 64px; background: var(--creux); color: var(--encre); }
.contact__cadre { padding: 48px; border-radius: 24px; background: #dedede; }
.contact p { margin-top: 12px; font-size: var(--t-md); }
.contact__mail { display: inline-block; margin-block: 40px; font-size: var(--t-xl); font-weight: 600; letter-spacing: -.03em; line-height: 1.2; color: inherit; text-decoration-thickness: 2px; text-underline-offset: 8px; overflow-wrap: anywhere; }
.contact a:focus-visible, .contact button:focus-visible { outline-color: var(--encre); }
.btn--noir { background: var(--encre); color: #fff; }
.btn--noir:hover { background: #3a3a3a; }
.btn--contour:hover { background: var(--accent-hover); }
.btn--contour { min-width: 176px; background: transparent; border-color: rgb(0 0 0 / .5); }

.footer { padding-block: 32px; font-size: var(--t-sm); color: var(--nuit-texte-2); background: var(--nuit); }
/* Lien discret, mais encore lisible (contraste d'environ 5:1) */
.footer__legal { font-size: 12px; color: #858585; text-decoration: none; }
.footer__legal:hover { text-decoration: underline; }

/* ===== PAGE MENTIONS LÉGALES ===== */
.legal { max-width: 720px; }
.legal a { color: var(--accent-texte); overflow-wrap: anywhere; }
.legal h1 { margin-top: 32px; font-size: var(--t-xl); line-height: 1.15; }
.legal h2 { margin: 32px 0 8px; font-size: var(--t-md); }
.legal p { color: var(--texte-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ===== TABLETTE ===== */
@media (max-width: 900px) {
  .hero__bas { flex-direction: column; align-items: flex-start; }
  .scene { height: 600px; }
  .cartes, .methode, .visites { grid-template-columns: 1fr; }
  .methode { gap: 32px; }
}

/* ===== TÉLÉPHONE ===== */
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .nav a:not(.btn) { display: none; }   /* page courte : il reste le bouton Contact */
  .panneau, .contact__cadre { padding: 24px 16px; border-radius: 20px; }
  .panneau { margin-block: 16px; }
  .hero__bas { margin-top: 24px; padding: 20px 16px; gap: 24px; }
  .scene__tete, .scene__pied { padding: 16px; }
  .scene { padding: 12px; }
  .hero__actions, .hero__actions .btn { width: 100%; }
  .visites { gap: 16px; margin: 24px 0 40px; }
  .visite { padding: 24px; }
  .visite__bouton { margin-top: 20px; }
  .reglages, .choix { width: 100%; }
  .choix button { flex: 1; padding: 12px 8px; }
  .carte { padding: 24px 20px; gap: 16px; }
  .carte h3 { font-size: var(--t-md); }
  .contact { margin-top: 32px; padding-block: 32px; }
  .contact__mail { font-size: var(--t-md); }
}

/* =========================================================
   ANIMATIONS AU DÉFILEMENT (moteur : animations.js)
   --p va de 0 à 1 pendant le défilement
   ========================================================= */
/* Les cartes démos arrivent : gauche, bas, droite */
.visite--boulangerie { --x: -64px; --y: 0px; }
.visite--barbier { --x: 64px; --y: 0px; }

/* La scène et le contact grandissent en arrivant */
.scene { scale: calc(.86 + .14 * var(--p, 1)); }
.contact__cadre { scale: calc(.9 + .1 * var(--p, 1)); }

/* Les petits dessins se tracent */
.js .carte.visible .dessin { animation: dessiner 1.8s ease-out calc(var(--delai, 0s) + .2s) backwards; }

/* Méthode : un trait blanc descend le long des étapes */
.etapes { position: relative; padding-left: 28px; }
.etapes::before, .etapes::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--ligne); }
.etapes::after { background: var(--accent-texte); transform: scaleY(var(--p, 1)); transform-origin: top; }
@media (max-width: 640px) { .etapes { padding-left: 16px; } }
@media (min-width: 901px) { .methode h2 { position: sticky; top: 120px; align-self: start; } }
