/* Arthur&Samantha — Creative brand information for Humans & AIs
   One page, deux écrans : ouverture, contact.
   Les écrans .seq sont « collés » à la fenêtre le temps de leur défilement ;
   l'avancement de l'ouverture (--p, de 0 à 1) est calculé par site.js.
   Sans JavaScript ou avec « réduire les animations », tout s'affiche à plat. */

/* ---------- Polices (hébergées avec le site, licence OFL) ---------- */
@font-face { font-family: "EB Garamond"; src: url("../fonts/EBGaramond-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/EBGaramond-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-ExtraBold.woff") format("woff"); font-weight: 800; font-style: normal; font-display: swap; }

/* ---------- Réglages ---------- */
:root {
  --cream: #F7F5EF;
  --ink: #121212;
  --blue: #1D31B8;
  --mute: #6B6862;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --vh: 100svh;
  --vh-d: 100dvh;
  --vh-l: 100lvh; /* hauteur maximale (barres du navigateur repliées) */ /* hauteur visible réelle (mobile : suit l'apparition des barres du navigateur) */
  --gut: clamp(20px, 4vw, 56px);
  /* taille du monogramme A&S de fond (celle du monogramme d'ouverture à la fin de son mouvement) */
  --mono-w: calc(min(72vw, var(--vh) * 1.05, 1050px) * 1.35);
  color-scheme: light;
}
@supports not (height: 100svh) { :root { --vh: 100vh; } }
@supports not (height: 100dvh) { :root { --vh-d: var(--vh); --vh-l: var(--vh); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 18px/1.4 var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

/* ---------- Typographie ---------- */
.it { font-family: var(--serif); font-style: italic; font-weight: 400; }
.rg { font-family: var(--serif); font-style: normal; font-weight: 400; }
.caps { font-family: var(--sans); font-weight: 800; font-style: normal; text-transform: uppercase; letter-spacing: .005em; }
.caps .lc { text-transform: none; } /* le « s » de « AIs » reste en minuscule */

/* ---------- Marque ---------- */
.mono { display: block; width: 100%; height: auto; fill: var(--ink); }
.mono .m-amp { fill: var(--blue); }
.logo { display: block; width: clamp(220px, 26vw, 380px); height: auto; }
.logo .l-base { fill: var(--ink); }
.logo .l-amp { fill: var(--blue); }
.base { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.base .it { font-size: clamp(22px, 2.1vw, 32px); }
.base .caps { font-size: clamp(14px, 1.35vw, 20px); color: var(--blue); }

/* ---------- Barre fixe : monogramme et e-mail (masquée sur l'ouverture et le contact) ---------- */
.bar { position: fixed; z-index: 50; top: clamp(14px, 2.4vh, 24px); text-decoration: none; transition: opacity .5s; }
.bar:not(.bar--mail) { left: var(--gut); width: clamp(42px, 4vw, 56px); }
.bar--mail { right: var(--gut); font-size: clamp(14px, 1.1vw, 16px); padding-top: 4px; }
.bar--mail:hover { text-decoration: underline; text-underline-offset: 4px; }
html[data-bar="hide"] .bar { opacity: 0; pointer-events: none; }

/* ---------- Écrans ---------- */
.scr, .stage { position: relative; isolation: isolate; min-height: var(--vh); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
.scr { padding: 96px var(--gut); }
.stage { padding: 96px var(--gut) 64px; background: var(--cream); }
.center { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }

/* Monogramme de fond : un seul et même A&S. Chaque écran en montre un exemplaire fixé au même endroit
   de la fenêtre et découpé aux limites de l'écran (clip-path) : il passe d'un écran à l'autre sans bouger.
   --g : léger mouvement commun à tous les écrans au défilement. */
.ghost { position: absolute; inset: 0; z-index: -1; pointer-events: none; clip-path: inset(0); }
.ghost .mono { position: fixed; left: 50%; top: 50%; width: var(--mono-w); transform: translate(-50%, calc(-50% + var(--g, 0) * 1vh)); will-change: transform; }
.ghost .m-l, .ghost .m-amp { fill: rgba(0, 0, 40, .16); }
.ghost--lite .m-l { fill: rgb(18 18 18 / .045); }
.ghost--lite .m-amp { fill: rgb(29 49 184 / .07); }

/* Apparition au défilement */
.js .reveal { opacity: 0; translate: 0 40px; transition: opacity 1.1s var(--ease), translate 1.1s var(--ease); }
.js .reveal.in { opacity: 1; translate: 0 0; }

/* ---------- 1 · Ouverture ---------- */
/* deux couches superposées : le monogramme en couleurs, et dessous le même en filigrane ;
   au défilement, la couche couleur s'efface (opacité) : animation fluide, sans repeindre le dessin */
.hero__monos { display: grid; width: min(72vw, calc(var(--vh) * 1.05), 1050px); }
.hero__mono { grid-area: 1 / 1; }
.hero__mono.ghost--lite { visibility: hidden; }
.hero__brand { display: flex; flex-direction: column; align-items: center; gap: 42px; margin-top: 48px; }
.cue { display: none; position: absolute; left: 50%; bottom: clamp(18px, 4vh, 36px); translate: -50% 0; flex-direction: column; align-items: center; gap: 10px; color: var(--mute); }
.cue span { font: 600 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.cue i { display: block; width: 1px; height: 48px; background: linear-gradient(var(--ink), transparent); transform-origin: top; animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { 0% { scale: 1 0; } 50% { scale: 1 1; } 100% { scale: 1 1; opacity: 0; } }

/* ---------- 2 · Contact ---------- */
.scr--blue { background: var(--blue); color: #fff; }
/* dernier écran : toujours la hauteur maximale de l'écran, pour ne rien laisser voir du précédent sur mobile */
#contact { min-height: var(--vh-l); box-shadow: 0 50vh 0 var(--blue); } /* l'ombre prolonge le bleu sous la page (rebond, zone du bas d'écran) */
.end__lead { margin-bottom: clamp(14px, 2.4vh, 24px); padding-inline: .25em; font-size: clamp(24px, 2.4vw, 38px); } /* marge : le « ? » italique déborde de sa boîte et serait rogné sur Safari */
/* pendant le défilement des prénoms, la fin de phrase est figée à la largeur de « vous ? » */
.end__tail { white-space: nowrap; }
.end__tail.is-pinned { display: inline-block; text-align: left; }
.end__who.is-set { animation: who-in .5s var(--ease); }
@keyframes who-in { from { opacity: .4; } }
.end__mail { font-size: clamp(30px, 3.4vw, 56px); color: #fff; text-decoration: none; padding-bottom: 6px; background: linear-gradient(#fff, #fff) left bottom / 100% 2px no-repeat; transition: background-size .5s var(--ease); }
.end__mail:hover { background-size: 0 2px; background-position: right bottom; }

/* ==========================================================================
   Mouvement : uniquement avec JavaScript et sans « réduire les animations »
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js .seq { height: var(--len); }
  .js .seq .stage { position: sticky; top: 0; height: var(--vh-d); }

  /* Ouverture : le monogramme grossit et s'efface en filigrane, le logo arrive au premier plan */
  .js .seq--hero { --len: 230vh; }
  .js .seq--hero .stage { padding: 0 var(--gut); }
  /* fixé à la fenêtre ; les écrans suivants, opaques, passent par-dessus */
  .js .hero__monos { position: fixed; left: 50%; top: 50%; z-index: -1; will-change: transform;
    transform: translate(-50%, calc(-50% + var(--g, 0) * 1vh)) scale(calc(1 + var(--p, 0) * .35)); }
  .js .hero__mono.ghost--lite { visibility: visible; }
  .js .hero__mono--full { opacity: calc(1 - min(1, var(--p, 0) * 1.7)); will-change: opacity; }
  .js .hero__brand { margin: 0; opacity: clamp(0, calc((var(--p, 0) - .35) * 2.6), 1);
    translate: 0 calc((1 - clamp(0, calc((var(--p, 0) - .35) * 2.6), 1)) * 60px); }
  .js .hero__brand .logo { scale: calc(.92 + clamp(0, calc((var(--p, 0) - .35) * 2.6), 1) * .08); }
  .js .seq--hero .cue { display: flex; opacity: calc(1 - var(--p, 0) * 3); }
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 760px) {
  :root { --mono-w: calc(88vw * 1.35); }
  body { font-size: 17px; }
  .scr { padding: 84px 20px 72px; }
  .stage { padding: 72px 20px 56px; }
  .hero__monos { width: 88vw; }
  .logo { width: 230px; }
  .end__mail { font-size: 24px; }
}
