/* ==========================================================================
   MYRIAGE — Base : reset, fond, typographie, mise en page, mouvement
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  background-color: var(--c-bg-page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--c-text);
  background-color: var(--c-bg-page);
  font-family: var(--f-main);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Fond : lueurs chaudes + grain. Posé sur un calque fixe plutôt qu'en
   background-attachment: fixed, qui force un repeint complet à chaque
   défilement et est ignoré par la plupart des navigateurs mobiles. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .7 0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(1100px 760px at 8% -8%, rgba(226, 172, 92, .17), rgba(226, 172, 92, 0) 62%),
    radial-gradient(900px 720px at 104% 38%, rgba(132, 156, 176, .075), rgba(132, 156, 176, 0) 60%),
    radial-gradient(1200px 900px at 38% 112%, rgba(170, 112, 62, .12), rgba(170, 112, 62, 0) 60%),
    radial-gradient(140% 120% at 50% 40%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .28) 100%);
}

body.is-locked { overflow: hidden; }

/* L'attribut hidden doit gagner sur tout display posé par un composant
   (.form, .alert…) : sans cela, form.hidden = true ne masquerait rien. */
[hidden] { display: none !important; }

img, svg, video, picture { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-accent); }

strong { font-weight: 700; }

::selection { background: var(--c-accent); color: var(--c-on-accent); }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

/* Le h1 reçoit le focus après une navigation, pour les lecteurs d'écran :
   pas de contour visible dans ce cas précis. */
h1[tabindex="-1"]:focus { outline: none; }

/* --------------------------------------------------------------------------
   Accessibilité
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-weight: 600;
}
.skip-link:focus { left: 16px; color: var(--c-on-accent); }

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

/* --------------------------------------------------------------------------
   Mise en page
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-top: var(--s-section); }
.section--first { padding-top: clamp(28px, 4vw, 48px); }
.section--close { padding-bottom: clamp(112px, 14vw, 200px); }

/* Chaque section s'ouvre sur un filet et deux étiquettes, à gauche et à droite */
.label-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 14px;
  border-top: 1px solid var(--c-line);
  margin-bottom: var(--s-label-gap);
}
/* Variante d'en-tête de page : filet en dessous */
.label-row--top {
  padding: 0 0 14px;
  border-top: 0;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 0;
}
.label-row a { color: var(--c-text); }
.label-row a:hover { color: var(--c-accent); }

/* Colonne d'étiquette à gauche, contenu à droite : repli naturel sans media query */
.split-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 48px;
}
.split-row > :first-child { flex: 1 1 220px; max-width: 300px; }
.split-row > :last-child  { flex: 999 1 min(100%, 420px); min-width: 0; }

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */
.label,
.label-row {
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

.mono {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.display {
  font-family: var(--f-main);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.025em;
  color: var(--c-accent);
  overflow-wrap: break-word;
}

.lead {
  font-size: clamp(20px, 1.9vw, 27px);
  line-height: 1.38;
  font-weight: 500;
  text-wrap: pretty;
}

.soft  { color: var(--c-text-soft); }
.muted { color: var(--c-text-muted); }
.pretty { text-wrap: pretty; }

/* --------------------------------------------------------------------------
   Emplacement « à venir » (portrait, projets) — hachures + libellé mono
   -------------------------------------------------------------------------- */
.placeholder {
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  border-radius: var(--r-sm);
  background: var(--c-placeholder);
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c-text-muted);
}

/* --------------------------------------------------------------------------
   Astérisque rotatif — motif graphique de la marque
   -------------------------------------------------------------------------- */
.asterisk {
  display: inline-block;
  position: relative;
  width: .46em;
  height: .46em;
  flex: none;
  color: var(--c-text);
  vertical-align: .42em;
  animation: spin 10s linear infinite;
}
.asterisk::before,
.asterisk::after,
.asterisk > i,
.asterisk > i::before {
  content: "";
  position: absolute;
  left: 42%;
  top: 0;
  width: 16%;
  height: 100%;
  border-radius: var(--r-pill);
  background: currentColor;
}
.asterisk::after      { transform: rotate(45deg); }
.asterisk > i         { transform: rotate(90deg); }
.asterisk > i::before { left: 0; width: 100%; transform: rotate(45deg); }
.asterisk--accent { color: var(--c-accent); }
.asterisk--slow   { animation-duration: 14s; }

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

/* --------------------------------------------------------------------------
   Titres qui montent ligne par ligne
   -------------------------------------------------------------------------- */
.line-mask {
  display: block;
  overflow: hidden;
  padding: .16em 0 .12em;
  margin: -.16em 0 -.12em;
}
.line-mask > span { display: block; }
.js .line-mask > span {
  animation: lineUp .9s var(--ease-out) both;
  animation-delay: calc(var(--line, 0) * 100ms + 50ms);
}
@keyframes lineUp { from { transform: translateY(105%); } to { transform: none; } }

/* --------------------------------------------------------------------------
   Apparition au défilement (pilotée par motion.js)
   Contrat : le contenu ne dépend JAMAIS d'une transition pour devenir
   visible. .is-in anime, .is-shown force l'état final sans transition —
   utilisé sous mouvement réduit et par le filet de sécurité de motion.js.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity .8s ease, transform .9s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal].is-shown {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Surlignage : un fond accent qui se déroule sous le texte */
[data-hl] {
  background: linear-gradient(var(--c-accent), var(--c-accent)) no-repeat 0 100% / 0% 100%;
  padding: 0 .12em;
  margin: 0 -.06em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .9s var(--ease-zoom), color .3s ease .35s;
}
[data-hl].is-lit { background-size: 100% 100%; color: var(--c-on-accent); }

/* Variante « trait » : un filet épais qui souligne le mot */
[data-hl="line"] {
  padding: 0 0 .04em;
  margin: 0;
  border-radius: 0;
  background-position: 0 96%;
  background-size: 0% var(--hl-th, .07em);
  transition: background-size 1.1s var(--ease-zoom), color .6s ease .3s;
}
[data-hl="line"].is-lit {
  background-size: 100% var(--hl-th, .07em);
  color: var(--c-accent);
}

/* Sans JavaScript, tout est lisible et déjà surligné */
html:not(.js) [data-hl] { background-size: 100% 100%; color: var(--c-on-accent); }
html:not(.js) [data-hl="line"] { background-size: 100% var(--hl-th, .07em); color: var(--c-accent); }

/* --------------------------------------------------------------------------
   Mouvement réduit : tout s'affiche, rien ne bouge
   -------------------------------------------------------------------------- */
@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;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .asterisk { animation: none !important; }
}
