/* =====================================================================
   MAISON SÉQUANE · BASE
   Polices, remise à zéro, typographie, univers, accessibilité,
   transitions de page. Les valeurs viennent de tokens.css.
   ===================================================================== */

/* ── Polices auto-hébergées (sous-ensemble latin, WOFF) ──────────────
   Fraunces s'ajoutera ici à la mise en production ; l'aperçu de la page
   de style la charge depuis Google Fonts. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-600.woff") format("woff");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/inter-display-700.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/inter-display-900.woff") format("woff");
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ── Remise à zéro ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 112px;
  background: var(--ms-creme);
  scrollbar-color: var(--ms-brun) var(--ms-calcaire);
  accent-color: var(--ms-brun);
  caret-color: var(--ms-brun);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--police-texte);
  font-size: var(--taille-texte);
  line-height: var(--interligne-texte);
  color: var(--ms-encre);
  background: var(--ms-creme);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
strong, b { font-weight: 600; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
figure { margin: 0; }

/* ── Titres ───────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--police-serif);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: var(--interligne-titre);
  letter-spacing: var(--approche-titre);
  color: var(--titre, var(--ms-brun));
  text-wrap: balance;
}

/* ── Liens ────────────────────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color var(--duree-micro) var(--courbe-signature);
}
a:hover { text-decoration-color: currentColor; }

/* ── Focus clavier : toujours visible, couleur de l'univers ──────── */
:focus-visible {
  outline: 2px solid var(--focus, var(--ms-brun));
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Sélection de texte, par univers ──────────────────────────────── */
::selection { background: var(--ms-or-clair); color: var(--ms-encre); }
.univers-maison-brun ::selection { background: var(--ms-or-clair); color: var(--ms-brun-fonce); }
.univers-frelock ::selection,
.univers-frelock-clair ::selection { background: var(--fl-jaune); color: var(--fl-noir); }
.univers-frelock-jaune ::selection { background: var(--fl-noir); color: var(--fl-jaune); }

/* ── Univers : chaque section déclare le sien ─────────────────────── */
.univers-maison {
  --fond: var(--ms-creme);
  --texte: var(--ms-encre);
  --texte-doux: var(--ms-encre-douce);
  --titre: var(--ms-brun);
  --accent: var(--ms-or-fonce);
  --filet-couleur: var(--ms-calcaire);
  --focus: var(--ms-brun);
  background-color: var(--fond);
  color: var(--texte);
}
.univers-maison-brun {
  --fond: var(--ms-brun);
  --texte: var(--ms-creme);
  --texte-doux: color-mix(in srgb, var(--ms-creme) 80%, var(--ms-brun));
  --titre: var(--ms-creme);
  --accent: var(--ms-or-clair);
  --filet-couleur: color-mix(in srgb, var(--ms-creme) 18%, var(--ms-brun));
  --focus: var(--ms-or-clair);
  background-color: var(--fond);
  color: var(--texte);
}
.univers-frelock {
  --fond: var(--fl-noir);
  --texte: var(--fl-blanc);
  --texte-doux: color-mix(in srgb, var(--fl-blanc) 72%, var(--fl-noir));
  --titre: var(--fl-blanc);
  --accent: var(--fl-jaune);
  --filet-couleur: color-mix(in srgb, var(--fl-blanc) 16%, var(--fl-noir));
  --focus: var(--fl-jaune);
  background-color: var(--fond);
  color: var(--texte);
}
.univers-frelock-clair {
  --fond: var(--fl-blanc);
  --texte: var(--fl-noir);
  --texte-doux: color-mix(in srgb, var(--fl-noir) 72%, var(--fl-blanc));
  --titre: var(--fl-noir);
  --accent: var(--fl-noir);
  --filet-couleur: color-mix(in srgb, var(--fl-noir) 14%, var(--fl-blanc));
  --focus: var(--fl-noir);
  background-color: var(--fond);
  color: var(--texte);
}
.univers-frelock-jaune {
  --fond: var(--fl-jaune);
  --texte: var(--fl-noir);
  --texte-doux: color-mix(in srgb, var(--fl-noir) 80%, var(--fl-jaune));
  --titre: var(--fl-noir);
  --accent: var(--fl-noir);
  --filet-couleur: var(--fl-noir);
  --focus: var(--fl-noir);
  background-color: var(--fond);
  color: var(--texte);
}

/* Titres FRELOCK : une seule famille, Inter Display Black. */
.univers-frelock :is(h1, h2, h3, h4),
.univers-frelock-clair :is(h1, h2, h3, h4),
.univers-frelock-jaune :is(h1, h2, h3, h4) {
  font-family: var(--police-display);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 0.98;
}

/* ── Matière : grain léger, seulement sur la crème et le brun ────── */
.grain { position: relative; isolation: isolate; }
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../img/grain.png");
  background-size: 180px 180px;
  opacity: var(--grain-opacite);
  mix-blend-mode: multiply;
}
.univers-maison-brun.grain::before { mix-blend-mode: soft-light; opacity: 0.22; }

/* ── Mise en page ─────────────────────────────────────────────────── */
.conteneur {
  width: min(100% - 2 * var(--marge-page), var(--largeur-max));
  margin-inline: auto;
}
.section { padding-block: var(--espace-section); }
.mesure { max-width: var(--mesure-texte); }

/* ── Styles de texte (charte) ─────────────────────────────────────── */
.grand-titre {
  font-family: var(--police-serif);
  font-size: var(--taille-grand-titre);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.titre-1 { font-size: var(--taille-titre-1); }
.titre-2 { font-size: var(--taille-titre-2); }
.titre-3 { font-size: var(--taille-titre-3); line-height: 1.2; }
:is(.grand-titre, .titre-1, .titre-2, .titre-3) em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.accroche {
  font-family: var(--police-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--taille-accroche);
  line-height: 1.4;
  color: var(--texte, var(--ms-encre));
}
.surtitre {
  font-family: var(--police-texte);
  font-weight: 600;
  font-size: var(--taille-surtitre);
  line-height: 1.4;
  letter-spacing: var(--approche-surtitre);
  text-transform: uppercase;
  color: var(--texte-doux, var(--ms-encre-douce));
}
.texte-doux { color: var(--texte-doux); }
.petit { font-size: var(--taille-petit); line-height: 1.55; }
.chiffres { font-variant-numeric: tabular-nums; }

.fl-geant {
  font-family: var(--police-display);
  font-weight: 900;
  font-size: var(--taille-fl-geant);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.cadre-geant { container-type: inline-size; }
/* Le grand titre FRELOCK ne dépasse jamais son bloc : « PROTÉGEZ. » = 5,64 em. */
.cadre-geant .fl-geant { font-size: min(var(--taille-fl-geant), 17cqi); }
.fl-titre {
  font-family: var(--police-display);
  font-weight: 900;
  font-size: var(--taille-fl-titre);
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.fl-accroche {
  font-family: var(--police-display);
  font-weight: 700;
  font-size: var(--taille-fl-accroche);
  line-height: 1.3;
  letter-spacing: var(--approche-fl);
  text-transform: uppercase;
}
/* Le nom FRELOCK dans un titre Maison passe en Inter Display Black. */
.mot-frelock {
  font-family: var(--police-display);
  font-weight: 900;
  font-style: normal;
  letter-spacing: -0.01em;
}
/* Symbole ® après la première mention : affiché quand l'enregistrement
   est confirmé (passer --marque-enregistree à « inline »). */
:root { --marque-enregistree: none; }
.marque-r { display: var(--marque-enregistree); font-size: 0.55em; vertical-align: super; line-height: 0; }

/* ── Accessibilité ────────────────────────────────────────────────── */
.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.lien-evitement {
  position: fixed;
  left: var(--espace-2);
  top: var(--espace-2);
  z-index: calc(var(--plan-intro) + 1);
  padding: 12px 18px;
  background: var(--ms-brun);
  color: var(--ms-creme);
  border-radius: var(--angle-controle);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--duree-micro) var(--courbe-signature);
}
.lien-evitement:focus { transform: none; }

/* ── Animations réduites : réglage du système ou bouton du site ──── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;   /* 0 et non 0,01 ms : visibility et zoom changent tout de suite */
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
html[data-mouvement="reduit"] *,
html[data-mouvement="reduit"] *::before,
html[data-mouvement="reduit"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;   /* 0 et non 0,01 ms : visibility et zoom changent tout de suite */
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

/* ── Transitions entre les pages (API View Transitions) ───────────── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 360ms cubic-bezier(0.64, 0, 0.78, 0) both vt-sortie; }
::view-transition-new(root) { animation: 600ms cubic-bezier(0.22, 1, 0.36, 1) both vt-entree; }
@keyframes vt-sortie { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-entree { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
/* Repli pour les navigateurs sans View Transitions : fondu à l'arrivée. */
html.sans-vt body { animation: page-entree 500ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes page-entree { from { opacity: 0; } }
