/* Les Douces Pâtisseries 72, maquette. Le design system de la marque : design.md. */

@font-face {
  font-family: "Young Serif";
  src: url("fonts/youngserif-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* palette */
  --vanille: #F7EEDC;
  --menthe: #7FD4B2;
  --encre: #081E23;
  --fraise: #A8383F;
  --or: #C8930E;
  --accent: var(--fraise);
  --fraise-appuye: color-mix(in srgb, var(--fraise) 85%, var(--encre));

  /* texte */
  --t-1: 52px;
  --t-2: 32px;
  --t-cite: 21px;
  --t-3: 20px;
  --t-texte: 17px;
  --t-petit: 14px;

  /* espacement */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 24px;
  --e-6: 32px;
  --e-7: 48px;
  --e-8: 80px;

  /* rayons */
  --r-1: 6px;
  --r-pill: 999px;

  /* le nappage, la seule courbe de la marque */
  --courbe: cubic-bezier(.2, .7, .2, 1);

  --gouttiere: var(--e-4);
  --bande: var(--e-7);
  --largeur: 1120px;
}
@media (max-width: 479px) {
  :root { --t-1: 40px; }
}
@media (min-width: 768px) {
  :root { --gouttiere: var(--e-6); --bande: var(--e-8); }
}

/* surfaces */
.s-vanille {
  --fond: var(--vanille);
  --texte: var(--encre);
  --texte-doux: color-mix(in srgb, var(--encre) 72%, var(--vanille));
  --filet: color-mix(in srgb, var(--encre) 18%, var(--vanille));
  --focus: var(--fraise);
}
.s-menthe {
  --fond: var(--menthe);
  --texte: var(--encre);
  --texte-doux: var(--encre);
  --filet: color-mix(in srgb, var(--encre) 30%, var(--menthe));
  --focus: var(--encre);
}
.s-encre {
  --fond: var(--encre);
  --texte: var(--vanille);
  --texte-doux: color-mix(in srgb, var(--vanille) 75%, var(--encre));
  --filet: color-mix(in srgb, var(--vanille) 20%, var(--encre));
  --focus: var(--vanille);
}
.s-vanille, .s-menthe, .s-encre {
  background-color: var(--fond);
  color: var(--texte);
}
/* la nappe de lin derrière les bandes vanille */
.s-vanille {
  position: relative;
  isolation: isolate;
}
.s-vanille::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("photos/nappe.webp") repeat;
  background-size: 512px;
  opacity: 0.35;
  pointer-events: none;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--encre);
}
body {
  margin: 0;
  font-family: "Figtree", system-ui, sans-serif;
  font-size: var(--t-texte);
  line-height: 1.5;
  font-weight: 400;
  background-color: var(--vanille);
  color: var(--encre);
}
h1, h2, h3, p, ul, ol, figure, blockquote, table, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; min-width: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.cadre {
  width: 100%;
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

h1 {
  font-family: "Young Serif", Georgia, serif;
  font-weight: 400;
  font-size: var(--t-1);
  line-height: 1.05;
}
h2 {
  font-family: "Young Serif", Georgia, serif;
  font-weight: 400;
  font-size: var(--t-2);
  line-height: 1.15;
}
h3 {
  font-size: var(--t-3);
  line-height: 1.3;
  font-weight: 600;
}
p { max-width: 62ch; }

.lien {
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  font-weight: 600;
}
.lien:active { text-decoration-thickness: 3px; }

/* le seul bouton plein */
.bouton {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 14px var(--e-5);
  border: 0;
  border-radius: var(--r-pill);
  background-color: var(--fraise);
  color: var(--vanille);
  font: inherit;
  font-size: var(--t-texte);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.bouton:active { background-color: var(--fraise-appuye); }
.bouton:focus-visible { outline-color: var(--encre); }

/* un titre de bande sombre porte un filet or de 2px */
.s-encre h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-top: var(--e-3);
  background-color: var(--or);
}

/* ---------- en-tête ---------- */
.entete { position: relative; z-index: 10; }
.entete-grille {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-4);
  padding-block: var(--e-4);
}
.logotype {
  display: grid;
  gap: var(--e-1);
  text-decoration: none;
}
.logotype-nom {
  font-family: "Young Serif", Georgia, serif;
  font-size: 22px;
  line-height: 1.15;
}
.logotype-sous {
  font-size: var(--t-petit);
  line-height: 1.4;
  font-weight: 500;
  color: var(--texte-doux);
}
.nav { position: relative; }
.nav-bouton {
  font: inherit;
  font-weight: 600;
  color: var(--encre);
  background: none;
  border: 1.5px solid var(--encre);
  border-radius: var(--r-pill);
  min-height: 44px;
  padding: 8px 18px;
  cursor: pointer;
}
.nav-bouton:active { background-color: color-mix(in srgb, var(--encre) 8%, var(--vanille)); }
.nav-liste {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + var(--e-2));
  z-index: 20;
  min-width: 230px;
  padding: var(--e-2) 0;
  background-color: var(--vanille);
  border: 1.5px solid var(--encre);
  border-radius: var(--r-1);
}
.nav.est-ouvert .nav-liste { display: block; }
.nav-liste a {
  display: block;
  padding: var(--e-3) var(--e-5);
  font-weight: 600;
  text-decoration: none;
}
.nav-liste a:active { text-decoration: underline; }
@media (min-width: 900px) {
  .nav-bouton { display: none; }
  .nav-liste {
    display: flex;
    position: static;
    gap: var(--e-6);
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
  }
  .nav-liste a { padding: var(--e-2) 0; }
}

/* ---------- premier écran ---------- */
.premier { padding-bottom: var(--bande); }
.hero {
  display: grid;
  grid-template-areas: "texte" "photo";
  row-gap: var(--e-6);
  padding-top: var(--e-4);
}
.hero-texte { grid-area: texte; }
.ligne-jour {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  font-size: var(--t-petit);
  line-height: 1.4;
  font-weight: 500;
  margin-bottom: var(--e-4);
}
.ligne-jour::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--fraise);
}
.hero h1 { max-width: 16ch; }
.hero-service {
  margin-top: var(--e-4);
  max-width: 36ch;
}
.hero-action { margin-top: var(--e-5); }
.hero-photo {
  grid-area: photo;
  width: 100%;
  border-radius: var(--r-1);
}
@media (min-width: 768px) {
  .hero {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-areas: "texte photo";
    column-gap: var(--e-6);
    align-items: center;
    padding-top: var(--e-5);
  }
}
@media (min-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--e-8);
  }
}

/* ---------- la signature, la date au plus tôt en perles ---------- */
.perles { margin-top: var(--e-6); max-width: 30rem; }
.perles-phrase {
  font-size: var(--t-3);
  line-height: 1.3;
  font-weight: 500;
}
.perles-phrase strong { font-weight: 700; }
.perles-rang {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: start;
  margin-top: var(--e-3);
  height: 52px;
}
.perles-rang li {
  display: grid;
  justify-items: center;
  grid-template-rows: 30px auto;
  align-items: center;
}
.perle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--encre);
  background-color: var(--encre);
}
.est-creux .perle {
  border-color: color-mix(in srgb, var(--encre) 40%, var(--vanille));
  background-color: transparent;
}
.est-premier .perle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background-color: var(--menthe);
  color: var(--encre);
  font-size: var(--t-petit);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.perle-jour {
  font-size: var(--t-petit);
  line-height: 1.4;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--texte-doux);
}
.est-aujourdhui .perle-jour { color: var(--encre); font-weight: 700; }
.perles-delai {
  margin-top: var(--e-1);
  font-size: var(--t-petit);
  line-height: 1.4;
  color: var(--texte-doux);
}

/* ---------- mes créations ---------- */
.creations { padding-block: var(--bande); }
.creations-tete {
  display: grid;
  gap: var(--e-4);
  margin-bottom: var(--e-6);
}
.creations-intro { color: var(--texte-doux); }
.grille {
  display: grid;
  gap: var(--e-6);
}
.grille img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r-1);
}
.grille h3 { margin-top: var(--e-3); }
.grille .prix { margin-top: var(--e-1); color: var(--texte-doux); }
@media (min-width: 600px) {
  .grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--e-5); }
}
@media (min-width: 1024px) {
  .creations-tete {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: end;
    column-gap: var(--e-7);
    margin-bottom: var(--e-7);
  }
}
.familles { margin-top: var(--e-7); }
.familles h3 { margin-bottom: var(--e-3); }
.familles-liste { border-top: 1px solid var(--filet); }
.familles-liste li {
  display: grid;
  gap: var(--e-1) var(--e-5);
  padding-block: var(--e-3);
  border-bottom: 1px solid var(--filet);
}
.familles-liste .nom { font-weight: 600; }
.familles-liste .prix { color: var(--texte-doux); }
@media (min-width: 768px) {
  .familles-liste li { grid-template-columns: 14rem minmax(0, 1fr); align-items: baseline; }
}

/* ---------- comment commander ---------- */
.commande { padding-block: var(--bande); }
.commande-grille {
  display: grid;
  gap: var(--e-6);
}
.commande h2 { margin-bottom: var(--e-5); }
.etapes { display: grid; gap: var(--e-4); }
.etapes li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: var(--e-4);
  align-items: start;
}
.pastille {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  border: 2px solid var(--fraise);
  background-color: var(--fraise);
  color: var(--vanille);
  font-weight: 700;
  line-height: 1;
}
.etapes p { padding-top: 6px; }
.commande-photo { width: 100%; border-radius: var(--r-1); }
.commande-fin { margin-top: var(--e-6); }
.commande-delai {
  font-size: var(--t-3);
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: var(--e-5);
}
@media (min-width: 768px) {
  .commande-grille {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    column-gap: var(--e-6);
    align-items: center;
  }
}
@media (min-width: 1024px) {
  .commande-grille { column-gap: var(--e-8); }
}

/* ---------- ce qu'on en dit ---------- */
.avis { padding-block: var(--bande); }
.avis-grille { display: grid; gap: var(--e-6); }
.avis h2 { margin-bottom: var(--e-5); }
.avis blockquote {
  font-family: "Young Serif", Georgia, serif;
  font-size: var(--t-cite);
  line-height: 1.4;
  max-width: 34ch;
}
.avis figcaption { margin-top: var(--e-4); font-size: var(--t-petit); line-height: 1.4; }
.avis figcaption .lien { font-weight: 600; }
.avis-diplome { max-width: 36ch; }
.avis-diplome p + p { margin-top: var(--e-3); }
@media (min-width: 1024px) {
  .avis-grille {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    column-gap: var(--e-8);
    align-items: end;
  }
}

/* ---------- retrait et contact ---------- */
.retrait { padding-top: var(--bande); }
.retrait-grille { display: grid; gap: var(--e-7); }
.retrait h2 { margin-bottom: var(--e-5); }
.retrait-ligne {
  font-size: var(--t-3);
  line-height: 1.3;
  font-weight: 600;
}
.retrait-livraison { margin-top: var(--e-2); color: var(--texte-doux); }
.bloc h3 { margin-bottom: var(--e-3); }
.jours { border-collapse: collapse; width: 100%; max-width: 22rem; }
.jours th, .jours td { padding: var(--e-1) 0; text-align: left; vertical-align: top; }
.jours th { font-weight: 400; color: var(--texte-doux); padding-right: var(--e-5); }
.jours td { font-variant-numeric: tabular-nums; }
.jours td span { display: block; }
.contact-liste { display: grid; gap: var(--e-2); }
.contact-liste .petit { color: var(--texte-doux); font-size: var(--t-petit); }
@media (min-width: 1024px) {
  .retrait-grille { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); column-gap: var(--e-7); }
}

/* ---------- pied ---------- */
.pied { padding-block: var(--e-7); }
.pied-grille {
  display: grid;
  gap: var(--e-4);
  margin-top: var(--bande);
  padding-top: var(--e-6);
  border-top: 1px solid var(--filet);
}
.pied-nom { font-family: "Young Serif", Georgia, serif; font-size: 22px; line-height: 1.15; }
.pied-legal { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-5); font-size: var(--t-petit); color: var(--texte-doux); }
.pied a { text-underline-offset: 0.2em; }
@media (min-width: 768px) {
  .pied-grille { grid-template-columns: 1fr auto; align-items: center; }
}

/* ---------- le bouton épinglé, téléphone seulement ---------- */
.bouton-epingle {
  position: fixed;
  left: 50%;
  bottom: var(--e-4);
  z-index: 30;
  transform: translate(-50%, 0);
  box-shadow: 0 0 0 3px var(--vanille);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease-out, visibility 0s linear 160ms;
}
.bouton-epingle.est-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms ease-out, visibility 0s;
}
@media (max-width: 767px) {
  .a-epingle .pied { padding-bottom: calc(var(--e-7) + 72px); }
}
@media (min-width: 768px) {
  .bouton-epingle { display: none; }
}

/* ---------- la page commander ---------- */
.tete { padding-bottom: var(--bande); }
.tete-grille {
  display: grid;
  gap: var(--e-7);
  padding-top: var(--e-4);
}
.tete h1 { max-width: 12ch; }
.tete-intro { margin-top: var(--e-4); }
.formulaire { display: grid; gap: var(--e-5); max-width: 34rem; }
.champ { display: grid; gap: var(--e-2); }
.champ > label, .champ legend, .libelle {
  font-size: var(--t-petit);
  line-height: 1.4;
  font-weight: 600;
}
.champ legend { padding: 0; margin-bottom: var(--e-2); }
.aide { font-size: var(--t-petit); line-height: 1.4; color: var(--texte-doux); }
.erreur { font-size: var(--t-petit); line-height: 1.4; font-weight: 600; color: var(--fraise); }
.erreur:empty { display: none; }
.formulaire input[type="text"], .formulaire input[type="tel"], .formulaire input[type="date"],
.formulaire select, .formulaire textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px var(--e-3);
  border: 1.5px solid var(--encre);
  border-radius: var(--r-1);
  background-color: var(--vanille);
  color: var(--encre);
  font: inherit;
  font-size: var(--t-texte);
}
.formulaire textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.formulaire [aria-invalid="true"] { border-color: var(--fraise); border-width: 2px; }
.deux { display: grid; gap: var(--e-5); align-items: start; }
@media (min-width: 480px) {
  .deux { grid-template-columns: 1fr 1fr; }
}
.choix { display: grid; gap: var(--e-2); }
.choix label {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  min-height: 44px;
  font-size: var(--t-texte);
  font-weight: 400;
  cursor: pointer;
}
.choix input { width: 20px; height: 20px; margin: 0; accent-color: var(--encre); }
.recap {
  padding-top: var(--e-4);
  border-top: 1px solid var(--filet);
  font-size: var(--t-3);
  line-height: 1.3;
  font-weight: 600;
}
.recap.est-vide { font-weight: 400; font-size: var(--t-texte); color: var(--texte-doux); }
.envoi { display: grid; gap: var(--e-3); justify-items: start; }
.envoi-etat { font-size: var(--t-petit); line-height: 1.4; }
.apres { display: grid; gap: var(--e-6); align-content: start; }
.apres .etapes { gap: var(--e-3); }
.tel { color: var(--fraise); }
@media (min-width: 1024px) {
  .tete-grille {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    column-gap: var(--e-8);
    align-items: start;
  }
}

/* ---------- le mouvement ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* le moment d'arrivée : le glaçage se pose, puis les perles se comptent */
  .js .premier:not(.est-arrive) .a-photo { clip-path: inset(0 0 100% 0); }
  .js .premier:not(.est-arrive) .a-monte,
  .js .premier:not(.est-arrive) .perles-phrase,
  .js .premier:not(.est-arrive) .perles-rang li { opacity: 0; }

  .premier.est-arrive .a-photo { animation: nappe 900ms var(--courbe) both; }
  .premier.est-arrive .a-monte { animation: monte 600ms var(--courbe) both; animation-delay: var(--depart, 250ms); }
  .premier.est-arrive .perles-rang li {
    animation: perle 200ms var(--courbe) both;
    animation-delay: calc(700ms + var(--i, 0) * 30ms);
  }
  .premier.est-arrive .perles-rang li.est-premier .perle { animation: pastille 300ms var(--courbe) 1000ms both; }
  .premier.est-arrive .perles-phrase { animation: apparait 300ms var(--courbe) 1000ms both; }

  @keyframes nappe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes monte { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes perle { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
  @keyframes pastille { from { transform: scale(0); } to { transform: none; } }
  @keyframes apparait { from { opacity: 0; } to { opacity: 1; } }

  /* au défilement, une fois : les créations montent */
  .js .grille li {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 400ms var(--courbe), transform 400ms var(--courbe);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .js .grille li.est-vu { opacity: 1; transform: none; }

  /* au défilement, une fois : les pastilles des étapes se remplissent de fraise */
  .js .commande .pastille {
    background-color: transparent;
    color: var(--fraise);
    transition: background-color 300ms var(--courbe), color 300ms var(--courbe);
    transition-delay: calc(var(--i, 0) * 120ms);
  }
  .js .commande .etapes.est-vu .pastille { background-color: var(--fraise); color: var(--vanille); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bouton-epingle, .bouton-epingle.est-visible { transition: none; }
}

/* la page commander, les compléments */
.tete .perles { margin-top: var(--e-4); margin-bottom: var(--e-6); }
.libelle-bloc {
  font-family: "Figtree", system-ui, sans-serif;
  font-size: var(--t-3);
  line-height: 1.3;
  font-weight: 600;
  margin-bottom: var(--e-3);
}
.apres .bloc h3 { font-size: var(--t-texte); margin-bottom: var(--e-2); }
.apres .jours { margin-top: var(--e-3); }
.pied-seul { margin-top: 0; padding-top: 0; border-top: 0; }
