/* ==========================================================================
   Meli's Coffee — landing page
   Mobile first. Brand: blanc cassé #F7EAD9 / bordeaux #871313.
   ========================================================================== */

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Panchi Mono";
  src: url("../fonts/PanchiMono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #F7EAD9;
  --cream-deep: #EFDCC5;
  --bordeaux: #871313;
  --bordeaux-deep: #6E0F0F;

  --font-display: "Barlow", "Arial Narrow", system-ui, sans-serif;
  --font-mono: "Panchi Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(1rem, 4.5vw, 3.5rem);
  --header-h: 4rem;
  --max: 78rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

@media (min-width: 48rem) {
  :root { --header-h: 5rem; }
}

/* --- Base ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--cream);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--cream);
  color: var(--bordeaux);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }

/* L'attribut hidden l'emporte toujours sur un display défini en CSS. */
[hidden] { display: none !important; }

a { color: inherit; }

::selection { background: var(--bordeaux); color: var(--cream); }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--bordeaux);
  color: var(--cream);
  text-decoration: none;
}
.skip-link:focus { top: calc(0.75rem + var(--safe-top)); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

main:focus { outline: none; }

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: var(--safe-top) calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
  background: color-mix(in srgb, var(--cream) 0%, transparent);
  transition: background-color 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--bordeaux) 14%, transparent);
}

.site-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(0.75rem, 5vw, 4.5rem);
  height: var(--header-h);
  max-width: var(--max);
  margin: 0 auto;
}

.brand {
  display: block;
  width: clamp(2.25rem, 9vw, 3rem);
}
.brand img { width: 100%; height: auto; }

.nav-link {
  position: relative;
  font-family: var(--font-mono);
  font-size: clamp(0.625rem, 2.6vw, 0.8125rem);
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 0.6rem;
}
.nav-link--left { justify-self: end; text-align: right; }
.nav-link--right { justify-self: start; text-align: left; }

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.35rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transition: transform 0.5s var(--ease-out);
}
.nav-link--left::after { transform-origin: right; }
.nav-link--right::after { transform-origin: left; }
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  display: grid;
  /* minmax(0, 1fr) : un mot trop long ne peut pas élargir la colonne et décaler la page. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    calc(var(--header-h) + var(--safe-top) + 1rem)
    calc(var(--gutter) + var(--safe-right))
    calc(1.5rem + var(--safe-bottom))
    calc(var(--gutter) + var(--safe-left));
  text-align: center;
}

/* Centré dans l'espace entre le header et le titre. */
.hero-kicker {
  align-self: center;
  margin: 0 0 1rem;
  font-size: clamp(0.6875rem, 2.8vw, 0.875rem);
  letter-spacing: 0.04em;
}

/*
  Mobile portrait: 4 stacked lines (DID / NAME / SMILE / TODAY?).
  The widest line is the longest name (~4.0em) so the size is derived from
  the available width, and capped by the height for short screens.
*/
.hero-title {
  --fs: min(calc((100vw - 2 * var(--gutter) - var(--safe-left) - var(--safe-right)) / 4.2), 15svh);
  --lh: 1; /* laisse la place aux accents (LÉA, INÈS…) */
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs);
  line-height: var(--lh);
  letter-spacing: -0.005em;
  text-transform: uppercase;
  font-kerning: normal;
}

.ht-line { display: block; }
.ht-word,
.ht-slot { display: block; }

.ht-slot {
  position: relative;
  height: calc(var(--lh) * 1em);
  margin-inline: auto;
  transition: width 0.8s var(--ease-in-out);
}

.ht-name {
  display: inline-block;
  white-space: nowrap;
  line-height: var(--lh);
}

/* Une fois le JS prêt, les prénoms se superposent dans le créneau. */
.ht-slot.is-live .ht-name {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* centré, même si le prénom est réduit */
}

.ht-name > span {
  display: inline-block;
  will-change: transform, opacity, filter;
}

/* Wider screens: 2 lines (DID NAME / SMILE TODAY?) — widest ~6.6em. */
@media (min-width: 37.5em), (orientation: landscape) {
  .hero-title {
    --fs: min(calc((100vw - 2 * var(--gutter) - var(--safe-left) - var(--safe-right)) / 6.9), 30svh, 12rem);
  }
  .ht-word,
  .ht-slot { display: inline-block; vertical-align: top; }
  .ht-slot { margin-inline: 0; }
}

.hero-foot {
  align-self: end;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.hero-foot .hero-cue { grid-column: 2; }
.hero-foot .motion-toggle { grid-column: 3; justify-self: end; }

.hero-cue {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.hero-cue__line {
  position: relative;
  width: clamp(2rem, 10vw, 3.5rem);
  height: 1px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bordeaux) 25%, transparent);
}
.hero-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bordeaux);
  transform: translateX(-100%);
  animation: cue 2.8s var(--ease-in-out) infinite;
}

/* Bouton pause / lecture des animations (WCAG 2.2.2) */
.motion-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--bordeaux);
  cursor: pointer;
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
.motion-toggle[hidden] { display: none; }
.motion-toggle:hover { background: var(--bordeaux); color: var(--cream); }

/* Icône pause (deux barres) ↔ lecture (triangle), dessinée en CSS. */
.motion-toggle__icon {
  width: 0.75rem;
  height: 0.75rem;
  background:
    linear-gradient(currentColor, currentColor) left / 32% 100% no-repeat,
    linear-gradient(currentColor, currentColor) right / 32% 100% no-repeat;
}
.motion-toggle.is-paused .motion-toggle__icon {
  background: currentColor;
  clip-path: polygon(15% 0, 100% 50%, 15% 100%);
}

.motion-paused .hero-cue__line::after,
.motion-paused .nf-zero__ring { animation-play-state: paused; }

@keyframes cue {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* --- Sections ------------------------------------------------------------ */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding:
    clamp(4.5rem, 12vw, 9rem)
    calc(var(--gutter) + var(--safe-right))
    clamp(4.5rem, 12vw, 9rem)
    calc(var(--gutter) + var(--safe-left));
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 8.5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* About */

.about {
  display: grid;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
  border-top: 1px solid color-mix(in srgb, var(--bordeaux) 18%, transparent);
}

.about-photo { margin: 0; }

.photo-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  width: 100%;
  max-width: 32rem;
  margin-inline: auto;
  padding: clamp(0.75rem, 3vw, 1.25rem);
  padding-top: clamp(2rem, 7vw, 2.75rem);
  background: #FCF6EE;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--bordeaux) 10%, transparent),
    0 30px 60px -30px color-mix(in srgb, var(--bordeaux-deep) 45%, transparent);
  transform: rotate(-1.2deg);
}

.photo-placeholder::before {
  content: "";
  position: absolute;
  inset: clamp(2rem, 7vw, 2.75rem) clamp(0.75rem, 3vw, 1.25rem) clamp(0.75rem, 3vw, 1.25rem);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--bordeaux) 7%, transparent) 0 1px,
      transparent 1px 14px),
    var(--cream-deep);
}

.photo-placeholder > * { position: relative; }

.photo-placeholder__date {
  position: absolute;
  top: clamp(0.6rem, 2.4vw, 0.9rem);
  right: clamp(0.75rem, 3vw, 1.25rem);
  font-size: 0.75rem;
}

.photo-placeholder__mark {
  width: clamp(3.5rem, 14vw, 5rem);
  height: auto;
  opacity: 0.9;
}

.photo-placeholder__label {
  position: absolute;
  bottom: clamp(1.5rem, 5vw, 2.25rem);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-text { max-width: 36rem; }
.about-text p:not(.eyebrow) { margin: 0 0 1.1rem; }

/* Location */

.location {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  border-top: 1px solid color-mix(in srgb, var(--bordeaux) 18%, transparent);
}

.location-address {
  margin: 0 0 1.5rem;
  font-style: normal;
  font-size: 1.0625rem;
}

.location-hours {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 2rem;
  max-width: 22rem;
}
.location-hours div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--bordeaux) 30%, transparent);
}
.location-hours dt,
.location-hours dd { margin: 0; }

/* Bouton plein bordeaux (tous les boutons du site). */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.95rem 1.4rem;
  border: 1.5px solid var(--bordeaux);
  border-radius: 999px;
  background: var(--bordeaux);
  color: var(--cream);
  font: inherit;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.45s var(--ease-out),
    color 0.45s var(--ease-out),
    box-shadow 0.45s var(--ease-out),
    transform 0.45s var(--ease-out);
}
.btn span { transition: transform 0.45s var(--ease-out); }
.btn:hover,
.btn:focus-visible {
  background: var(--bordeaux-deep);
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--bordeaux-deep) 70%, transparent);
  transform: translateY(-2px);
}
.btn:hover span,
.btn:focus-visible span { transform: translate(2px, -2px); }
.btn:active { transform: translateY(0) scale(0.98); }

.map-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 75svh;
  width: 100%;
  padding: clamp(0.5rem, 1.6vw, 0.75rem);
  border: 2px solid var(--bordeaux);
  border-radius: clamp(1.25rem, 4vw, 2rem);
  background: var(--cream);
  box-shadow: 0 30px 60px -35px color-mix(in srgb, var(--bordeaux-deep) 55%, transparent);
}

.map-consent {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.9rem;
  height: 100%;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  border-radius: clamp(0.75rem, 2.8vw, 1.35rem);
  text-align: center;
  /* Évocation discrète d'un plan de ville. */
  background:
    linear-gradient(28deg, transparent 47%, color-mix(in srgb, var(--bordeaux) 10%, transparent) 47.5% 49.5%, transparent 50%),
    linear-gradient(-62deg, transparent 58%, color-mix(in srgb, var(--bordeaux) 8%, transparent) 58.3% 59.6%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 46px, color-mix(in srgb, var(--bordeaux) 6%, transparent) 46px 48px),
    repeating-linear-gradient(90deg, transparent 0 62px, color-mix(in srgb, var(--bordeaux) 6%, transparent) 62px 64px),
    var(--cream-deep);
}
.map-consent p { margin: 0; max-width: 26rem; }
.map-consent__pin { width: 3.5rem; height: auto; }
.map-consent__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.125rem, 4vw, 1.5rem);
  line-height: 1.1;
  text-transform: uppercase;
}
.map-consent__text { font-size: 0.8125rem; }
.map-consent__note { font-size: 0.6875rem; }

.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: clamp(0.75rem, 2.8vw, 1.35rem);
  filter: grayscale(1) contrast(1.05) brightness(1.02);
}

/* Teinte crème + bordeaux posée sur la carte, sans bloquer l'interaction. */
.map-tint {
  position: absolute;
  inset: clamp(0.5rem, 1.6vw, 0.75rem);
  border-radius: clamp(0.75rem, 2.8vw, 1.35rem);
  pointer-events: none;
  background: var(--cream);
  mix-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bordeaux) 25%, transparent);
}
.map-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--bordeaux);
  mix-blend-mode: screen;
  opacity: 0.12;
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  background: var(--bordeaux);
  color: var(--cream);
  padding:
    clamp(3.5rem, 9vw, 6rem)
    calc(var(--gutter) + var(--safe-right))
    calc(2rem + var(--safe-bottom))
    calc(var(--gutter) + var(--safe-left));
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

.footer-brand { display: block; width: clamp(9rem, 38vw, 14rem); }

.wordmark {
  display: block;
  aspect-ratio: 1464.48 / 403.93;
  background: currentColor;
  -webkit-mask: url("../img/melis-wordmark.svg") center / contain no-repeat;
  mask: url("../img/melis-wordmark.svg") center / contain no-repeat;
}

.footer-cols {
  display: grid;
  gap: 2rem;
  font-size: 0.875rem;
}
.footer-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.78;
}
.footer-cols p,
.footer-cols address { margin: 0; font-style: normal; }

.site-footer a { text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.footer-cols a,
.footer-legal a { display: inline-block; padding-block: 0.2rem; }
.site-footer a:hover { text-decoration-color: transparent; }
.site-footer :focus-visible { outline-color: var(--cream); }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--cream) 25%, transparent);
  font-size: 0.75rem;
}
.footer-legal p { margin: 0; }
.footer-legal ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Reveal on scroll ---------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal + .reveal { transition-delay: 0.12s; }

/* --- Breakpoints --------------------------------------------------------- */

@media (min-width: 40rem) {
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}

/* Tablettes, foldables dépliés (format quasi carré) et desktop. */
@media (min-width: 44rem) {
  .about { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .location { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .map-frame { aspect-ratio: 4 / 3.4; }
}

@media (min-width: 64rem) {
  body { font-size: 1rem; }
  .footer-inner { grid-template-columns: auto 1fr; align-items: start; }
  .footer-legal { grid-column: 1 / -1; }
  .footer-cols { justify-self: end; gap: 4rem; }
}

/* Écrans très bas (paysage téléphone, foldable semi-plié en mode tente…) */
@media (max-height: 30rem) and (orientation: landscape) {
  :root { --header-h: 3.25rem; }
  .brand { width: 2.25rem; }
  .hero-kicker { margin-bottom: 0.75rem; }
  .map-frame { max-height: 85svh; }
}

/* --- Foldables (Viewport Segments API) -----------------------------------
   Déplié avec charnière verticale (livre) : chaque moitié a son contenu,
   rien ne tombe dans la charnière. */
@media (horizontal-viewport-segments: 2) {
  :root {
    --seg-left: env(viewport-segment-width 0 0, 50vw);
    --hinge: calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw));
  }

  .site-nav {
    max-width: none;
    grid-template-columns: 1fr auto 1fr;
  }

  .hero {
    grid-template-columns: var(--seg-left) var(--hinge) 1fr;
    grid-template-rows: 1fr auto;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
  }
  .hero-kicker { grid-column: 3; grid-row: 1; align-self: center; padding-inline: var(--gutter); }
  .hero-title {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: center;
    --fs: min(calc((var(--seg-left) - 2 * var(--gutter)) / 4.2), 15svh);
  }
  .hero-title .ht-word,
  .hero-title .ht-slot { display: block; }
  .hero-title .ht-slot { margin-inline: auto; }
  .hero-foot { grid-column: 3; grid-row: 2; padding-inline: var(--gutter); }

  .section,
  .site-footer {
    max-width: none;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
  }
  .about,
  .location,
  .footer-inner {
    grid-template-columns: var(--seg-left) 1fr;
    column-gap: var(--hinge);
    max-width: none;
  }
  .about > *,
  .location > *,
  .footer-inner > * { padding-inline: var(--gutter); }
  .footer-legal { grid-column: 1 / -1; }
}

/* Semi-plié avec charnière horizontale (mode « laptop ») :
   le hero occupe la moitié haute, la suite défile dessous. */
@media (vertical-viewport-segments: 2) {
  :root {
    --seg-top: env(viewport-segment-height 0 0, 50vh);
  }
  .hero {
    min-height: var(--seg-top);
    grid-template-rows: auto 1fr auto;
  }
  .hero-title {
    --fs: min(calc((100vw - 2 * var(--gutter)) / 6.9), calc((var(--seg-top) - var(--header-h)) / 3.4));
    align-self: center;
  }
  .hero-title .ht-word,
  .hero-title .ht-slot { display: inline-block; vertical-align: top; }
  .hero-title .ht-slot { margin-inline: 0; }
  .hero-kicker { align-self: start; margin-bottom: 0; }
}

/* --- Accessibilité : couleurs forcées (Windows contraste élevé) --------- */

@media (forced-colors: active) {
  .wordmark { background: CanvasText; forced-color-adjust: none; }
  .map-tint { display: none; }
  .btn,
  .motion-toggle { border-color: ButtonText; }
  .motion-toggle__icon { forced-color-adjust: none; color: ButtonText; }
}

/* --- Impression ----------------------------------------------------------- */

@media print {
  .site-header,
  .hero-foot,
  .map-frame,
  .skip-link { display: none !important; }
  .hero { min-height: auto; padding-top: 1rem; }
  .js .reveal { opacity: 1; transform: none; }
  .site-footer { background: none; color: #000; }
}

/* --- Accessibilité : mouvement réduit ------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* --- Pages légales ------------------------------------------------------- */

.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding:
    calc(var(--header-h) + var(--safe-top) + clamp(3rem, 10vw, 6rem))
    calc(var(--gutter) + var(--safe-right))
    clamp(4rem, 10vw, 7rem)
    calc(var(--gutter) + var(--safe-left));
}
.legal h1 {
  margin: 0 0 2.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.25rem, 9vw, 4rem);
  line-height: 0.95;
  text-transform: uppercase;
  text-wrap: balance;
}
.legal h2 {
  margin: 2.75rem 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.legal p,
.legal li { margin: 0 0 0.9rem; }
.legal ul { padding-left: 1.2rem; }
.legal .todo {
  background: color-mix(in srgb, var(--bordeaux) 10%, transparent);
  padding: 0 0.25em;
}
.legal .updated { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }

/* --- Page 404 ------------------------------------------------------------ */

.not-found {
  display: grid;
  place-content: center;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding:
    calc(var(--header-h) + var(--safe-top) + 2rem)
    calc(var(--gutter) + var(--safe-right))
    calc(3rem + var(--safe-bottom))
    calc(var(--gutter) + var(--safe-left));
  text-align: center;
}

/*
  « 4 [logo] 4 » : chaque 4 fait ~0,6em, le logo ~1,14em (son smiley central
  a alors la hauteur des capitales). Largeur totale ≈ 2,45em.
*/
.nf-code {
  --fs: min(calc((100vw - 2 * var(--gutter) - var(--safe-left) - var(--safe-right)) / 2.5), 36svh, 16rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.03em;
  margin: 0 0 clamp(1.5rem, 5svh, 2.75rem);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs);
  line-height: 1;
}

.nf-zero {
  position: relative;
  display: block;
  width: 1.14em;
  aspect-ratio: 304.79 / 305.01;
  /* Centre optique : aligne le smiley sur le milieu des capitales. */
  transform: translateY(0.05em);
}

.nf-zero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.nf-zero__ring { animation: nf-spin 28s linear infinite; }

.nf-zero__smiley { transition: transform 0.8s var(--ease-out); }
.nf-code:hover .nf-zero__smiley { transform: rotate(-10deg); }

@keyframes nf-spin { to { transform: rotate(360deg); } }

.nf-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.375rem, 5.5vw, 2.25rem);
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}

.nf-text {
  max-width: 30rem;
  margin: 0 0 2rem;
  text-wrap: pretty;
}

.site-footer--compact { padding-top: 1rem; }
.site-footer--compact .footer-legal { border-top: 0; }

@media (max-height: 30rem) and (orientation: landscape) {
  .nf-code { --fs: min(calc((100vw - 2 * var(--gutter)) / 2.5), 30svh); margin-bottom: 0.75rem; }
  .nf-text { margin-bottom: 1rem; }
}

/* --- Consentement (page confidentialité) & pause sur la 404 -------------- */

.consent-box {
  display: grid;
  justify-items: start;
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 1.25rem;
  border: 1.5px solid var(--bordeaux);
  border-radius: 1rem;
}
.consent-box p { margin: 0; }

.nf-motion { margin-top: 1.5rem; }

/* --- Bandeau cookies ------------------------------------------------------ */

.cookie-banner {
  position: fixed;
  z-index: 80;
  left: calc(var(--gutter) + var(--safe-left));
  right: calc(var(--gutter) + var(--safe-right));
  bottom: calc(1rem + var(--safe-bottom));
  max-width: 62rem;
  margin-inline: auto;
  color: var(--bordeaux);
  animation: cookie-in 0.7s var(--ease-out) both;
}
.cookie-banner[hidden] { display: none; }

@keyframes cookie-in {
  from { opacity: 0; transform: translateY(1.5rem); }
  to   { opacity: 1; transform: none; }
}

.cookie-banner__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
  max-height: calc(100svh - 2rem - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  padding: clamp(1.1rem, 4vw, 1.6rem);
  background: #FCF6EE;
  border: 1.5px solid var(--bordeaux);
  border-radius: 1.25rem;
  box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--bordeaux-deep) 55%, transparent);
}

.cookie-banner__icon { width: 2.5rem; height: auto; }

.cookie-banner__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.25rem, 4.5vw, 1.6rem);
  line-height: 1;
  text-transform: uppercase;
}
.cookie-banner__title:focus { outline: none; }
.cookie-banner__title:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 4px; }

.cookie-banner__text,
.cookie-banner__current { margin: 0 0 0.5rem; font-size: 0.8125rem; line-height: 1.55; }
.cookie-banner__current { font-style: italic; }
.cookie-banner__more { font-size: 0.8125rem; display: inline-block; padding-block: 0.2rem; }

/* Les deux choix ont exactement le même poids visuel (exigence CNIL). */
.cookie-banner__actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.cookie-banner__actions .btn { justify-content: center; width: 100%; }

@media (min-width: 48rem) {
  .cookie-banner__inner { grid-template-columns: auto 1fr auto; align-items: center; }
  .cookie-banner__actions { grid-column: auto; grid-template-columns: 1fr; min-width: 13rem; }
}

html.has-cookie-banner { scroll-padding-bottom: calc(var(--cookie-banner-h, 0px) + 2rem); }

/* Bouton qui ressemble à un lien (« Gérer les cookies » du footer). */
.link-button {
  display: inline-block;
  padding: 0.2rem 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.link-button:hover { text-decoration-color: transparent; }

/* Reçu de consentement (page confidentialité). */
.consent-box__title { font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; }
.consent-box__list { display: grid; gap: 0.35rem; margin: 0; width: 100%; }
.consent-box__list div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--bordeaux) 30%, transparent);
}
.consent-box__list dt,
.consent-box__list dd { margin: 0; }
.consent-box__list dd { overflow-wrap: anywhere; }

@media print { .cookie-banner { display: none !important; } }

/* --- Menu burger (mobile) ------------------------------------------------- */

.brand { grid-column: 2; }
.menu-toggle { display: none; }

@media (max-width: 47.999rem) {
  .js .nav-link { display: none; }

  .js .menu-toggle {
    grid-column: 3;
    justify-self: end;
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--bordeaux);
    cursor: pointer;
  }
}

/* Deux traits qui se croisent en X à l'ouverture. */
.menu-toggle__bars {
  position: relative;
  width: 1.5rem;
  height: 0.5rem;
}
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.45s var(--ease-out), top 0.45s var(--ease-out);
}
.menu-toggle__bars::before { top: 0; }
.menu-toggle__bars::after { top: calc(100% - 1.5px); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { top: calc(50% - 0.75px); transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { top: calc(50% - 0.75px); transform: rotate(-45deg); }

html.menu-open { overflow: hidden; }
html.menu-open .site-header {
  background: var(--cream);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(2rem, 7svh, 3.5rem);
  padding:
    calc(var(--header-h) + var(--safe-top) + 1rem)
    calc(var(--gutter) + var(--safe-right))
    calc(2rem + var(--safe-bottom))
    calc(var(--gutter) + var(--safe-left));
  background: var(--cream);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.mobile-menu.is-open { opacity: 1; }

.mobile-menu__nav {
  display: grid;
  justify-items: center;
  gap: clamp(1rem, 4svh, 1.75rem);
}

.mobile-menu__link,
.mobile-menu__tagline {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(0.08s + var(--i, 0) * 0.07s);
}
.mobile-menu.is-open .mobile-menu__link,
.mobile-menu.is-open .mobile-menu__tagline { opacity: 1; transform: none; }

.mobile-menu__link {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 10vw, 3.25rem);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  padding-block: 0.25rem;
}
.mobile-menu__link:hover,
.mobile-menu__link:focus-visible { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.12em; }

.mobile-menu__tagline {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 48rem) {
  .mobile-menu { display: none !important; }
}
