/* Base : polices, variables, reset, typo, formes, motion */

@font-face {
  font-family: "Gloock";
  src: url("../fonts/gloock.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Logo */
  --c-sand: #ebe2d9;
  --c-ivory: #f8f7f2;
  --c-brown: #5f3e22;
  --c-copper: #ca8850;
  --c-chair: #8aa8ab;

  /* Palette couleurs_industrie_luxe.jpg */
  --c-gold: #dbb574;
  --c-bordeaux: #853744;     /* erreurs de formulaire uniquement */
  --c-water: #9ab3b3;        /* vert d'eau : Mobilier sur mesure */
  --c-water-deep: #456262;   /* vert d'eau assombri pour le texte, 5,2:1 sur sable */
  --c-orange: #c9824e;       /* orange du logo : Spa */
  --c-orange-deep: #8a4f20;  /* orange assombri pour le texte, 5,1:1 sur sable */
  --c-taupe: #b0a086;

  /* Dérivés lisibles */
  --c-ink: #4a2f1a;          /* 9,6:1 sur sable */
  --c-soft: #6b5344;         /* 5,6:1 sur sable */
  --c-copper-deep: #8a4f20;  /* 5,1:1 sur sable */
  --c-night: #2e1d10;
  --c-footer: #86664f;        /* brun clair du pied de page, 4,9:1 avec l'ivoire */

  /* Rôles */
  --bg: var(--c-sand);
  --text: var(--c-ink);
  --text-soft: var(--c-soft);
  --heading: var(--c-brown);
  --accent: var(--c-copper-deep);
  --line: rgb(95 62 34 / 0.2);

  /* Typographie */
  --font-display: "Gloock", "Didot", "Bodoni 72", Georgia, serif;
  --font-sans: "Montserrat", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --fs-display: clamp(2.75rem, 1rem + 4.6vw, 7rem);
  --fs-h1: clamp(2.75rem, 1rem + 4.6vw, 6.25rem);
  --fs-h2: clamp(2.25rem, 1rem + 3.2vw, 4.5rem);
  --fs-h3: clamp(1.5rem, 1.1rem + 1vw, 2.125rem);
  --fs-lead: clamp(1.1rem, 1rem + 0.35vw, 1.3rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.72rem;

  /* Espace & formes */
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --gap: clamp(1.25rem, 2.4vw, 2.5rem);
  --space-section: clamp(5rem, 3rem + 7vw, 10rem);
  --container: 88rem;
  --header-h: 6.25rem;
  --radius: 1.25rem;
  --arch: 100vmax 100vmax 0 0;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 250ms;
  --dur-slow: 1300ms;
}

/* Univers : --u fond, --u-on texte dessus, --u-text texte sur fond clair */
.u-menuiserie { --u: var(--c-water); --u-bg: var(--c-water); --u-on: #fff; --u-on-soft: #fff; --u-text: var(--c-water-deep); --u-accent: #fff; --u-line: rgb(255 255 255 / 0.5); }
.u-spa { --u: var(--c-orange); --u-bg: var(--c-orange); --u-on: #fff; --u-on-soft: #fff; --u-text: var(--c-orange-deep); --u-accent: #fff; --u-line: rgb(255 255 255 / 0.5); }

/* Fonds */
.bg-ivory { --bg: var(--c-ivory); }
.bg-chair { --bg: var(--c-chair); --text: var(--c-night); --text-soft: #2f3b3c; --heading: var(--c-night); --accent: var(--c-night); --line: rgb(46 29 16 / 0.25); }
.bg-u {
  --bg: var(--u-bg);
  --text: var(--u-on);
  --text-soft: var(--u-on-soft);
  --heading: var(--u-on);
  --accent: var(--u-accent);
  --line: var(--u-line);
  font-weight: 500;
}
.bg-u .label, .bg-u .chips li { font-weight: 700; }

/* ------------------------------------------------------------------ Reset */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font: 400 var(--fs-body) / 1.75 var(--font-sans);
  color: var(--text);
  background: var(--c-sand);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body:has(dialog[open]) { overflow: hidden; }

img, svg, picture { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }

::selection { background: var(--c-gold); color: var(--c-night); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--c-brown);
  color: var(--c-ivory);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.top-sentinel { position: absolute; top: 0; width: 1px; height: 3rem; pointer-events: none; }

/* ------------------------------------------------------------- Typographie */

.display, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--heading);
  text-wrap: balance;
}
.display { font-size: var(--fs-display); line-height: 0.98; letter-spacing: -0.02em; }
.h1 { font-size: var(--fs-h1); line-height: 1; letter-spacing: -0.02em; }
.h2 { font-size: var(--fs-h2); line-height: 1.04; letter-spacing: -0.015em; }
.h3 { font-size: var(--fs-h3); line-height: 1.15; letter-spacing: -0.005em; }
.display em, .h1 em, .h2 em, .h3 em { font-style: normal; color: var(--accent); }

.lead { font-size: var(--fs-lead); line-height: 1.65; color: var(--text); text-wrap: pretty; }
.soft { color: var(--text-soft); }

/* Petites capitales espacées, comme « MADE LOKAL » sous le wordmark */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font: 600 var(--fs-label) / 1.3 var(--font-sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.is-placeholder {
  display: inline-block;
  padding: 0.05em 0.5em;
  border-radius: 999px;
  font: 600 0.78em / 1.5 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--c-night);
  background: var(--c-gold);
}

/* ------------------------------------------------------------------ Layout */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  position: relative;
  padding-block: var(--space-section);
  color: var(--text);
  background: var(--bg);
}
.section-head { display: grid; gap: 1.5rem; margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.section-head__intro { max-width: 40ch; color: var(--text-soft); }
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: 1fr minmax(0, 26rem); align-items: end; column-gap: var(--gutter); }
}

/* ------------------------------------------------------------ Boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem 1.6rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 0.76rem / 1 var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.btn .arrow { flex: none; transition: transform 450ms var(--ease-out); }
.btn:hover .arrow, .btn:focus-visible .arrow { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }

.btn--brown { background: var(--c-brown); color: var(--c-ivory); }
.btn--brown:hover { background: var(--c-night); }
.btn--ivory { background: var(--c-ivory); color: var(--c-brown); }
.btn--ivory:hover { background: var(--c-gold); color: var(--c-night); }
.btn--u { background: var(--u); color: var(--u-on); }
.btn--u { font-weight: 700; }
.btn--u:hover { background: var(--c-night); color: var(--c-ivory); }
.btn--sm { padding: 0.8rem 1.2rem; font-size: 0.68rem; }
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; line-height: 1.35; }
}

.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-block: 0.35rem;
  font: 600 0.76rem / 1 var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heading);
}
.link::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1.5px;
  background: currentColor;
  transform-origin: right;
  transition: transform 600ms var(--ease-out);
}
.link:hover::after { transform: scaleX(0); }

.nowrap { white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-small);
  line-height: 1.3;
  color: var(--text);
}

/* ------------------------------------------------------- Feuilles au trait */

.leaf {
  display: block;
  color: var(--c-copper);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.leaves { position: absolute; pointer-events: none; }
.leaves .leaf { position: absolute; width: var(--w, 3rem); height: auto; aspect-ratio: 100 / 150; transform: rotate(var(--r, 0deg)); }

/* ----------------------------------------------------- Photos & emplacements */

.media { position: relative; }
.media__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--ratio, auto);
  background: var(--c-taupe);
}
.media--arch .media__frame { border-radius: var(--arch); }
.media--round .media__frame { border-radius: var(--radius); }
.media--circle .media__frame { border-radius: 50%; aspect-ratio: 1; }
.media__frame picture { height: 100%; }
.media__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--ease-out); }
a:hover .media__frame img,
.media:hover .media__frame img { transform: scale(1.04); }

.media__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding-top: 0.9rem;
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--text);
}
.media__title { font: 400 1.2rem / 1.25 var(--font-display); color: var(--heading); }
.media__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 600 0.66rem / 1.3 var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.ph {
  display: grid;
  place-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--ph-ratio, 4/5);
  padding: 1.5rem;
  text-align: center;
  color: var(--c-night);
  background: var(--c-taupe);
}
.ph__label { font: 700 0.7rem / 1 var(--font-sans); letter-spacing: 0.18em; }
.ph__desc { max-width: 28ch; font: 400 1rem / 1.35 var(--font-display); }

/* ------------------------------------------------------------------ Motion */

.lines .line { display: block; overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.lines .line > span { display: inline-block; }
.js .lines[data-reveal] .line > span {
  transform: translateY(105%);
  transition: transform 1000ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms + var(--delay, 0s));
}
.js .lines[data-reveal].is-in .line > span { transform: none; }

.js [data-reveal]:not(.lines, [data-reveal="image"]) {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal].is-in:not(.lines, [data-reveal="image"]) { opacity: 1; transform: none; }

.js [data-reveal="image"] .media__frame {
  clip-path: inset(100% 0 0 0);
  transition: clip-path var(--dur-slow) var(--ease-out) var(--delay, 0s);
}
.js [data-reveal="image"] .media__frame picture {
  transform: scale(1.1);
  transition: transform 1800ms var(--ease-out) var(--delay, 0s);
}
.js [data-reveal="image"].is-in .media__frame { clip-path: inset(0); }
.js [data-reveal="image"].is-in .media__frame picture { transform: none; }

.js [data-reveal-leaves] .leaf { opacity: 0; transform: rotate(var(--r, 0deg)) scale(0.85); transition: opacity 1200ms var(--ease-out), transform 1600ms var(--ease-out); }
.js [data-reveal-leaves].is-in .leaf { opacity: 1; transform: rotate(var(--r, 0deg)); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 280ms ease both page-out; }
  ::view-transition-new(root) { animation: 560ms var(--ease-out) both page-in; }

  @supports (animation-timeline: view()) {
    .parallax img {
      scale: 1.12;
      animation: parallax linear both;
      animation-timeline: view();
      animation-range: cover;
    }
  }
}

@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
@keyframes parallax { from { translate: 0 -5%; } to { translate: 0 5%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
