/* ==========================================================================
   AEMYA, feuille de style principale
   Police : Saira (variable, axes graisse + largeur), licence SIL OFL
   ========================================================================== */

@font-face {
  font-family: "Saira";
  src: url("../fonts/saira-variable.woff2") format("woff2-variations"),
       url("../fonts/saira-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Couleurs */
  --noir: #000000;
  --blanc: #ffffff;
  --brume: #d7dce2;        /* texte courant sur image */
  --lune: #9aa3ad;         /* texte secondaire */
  --atmosphere: #8dbbea;   /* focus clavier uniquement */
  --filet: rgba(255, 255, 255, 0.22);

  /* Typographie */
  --font: "Saira", "Helvetica Neue", Arial, sans-serif;
  --wide: 125%;            /* largeur « logo » pour les titres */
  --semi-wide: 112%;

  /* Mise en page */
  --gutter: clamp(1rem, 5vw, 5rem);
  --header-h: clamp(4.5rem, 9vh, 6rem);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--noir);
}

body {
  margin: 0;
  background: var(--noir);
  color: var(--blanc);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button,
input,
textarea { font: inherit; color: inherit; }

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

::selection { background: var(--blanc); color: var(--noir); }

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

.skip-link {
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--blanc);
  color: var(--noir);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* --- Bouton (contour, remplissage au survol) ----------------------------- */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 2.5rem;
  border: 2px solid var(--blanc);
  border-radius: 0;
  background: transparent;
  color: var(--blanc);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  font-stretch: var(--semi-wide);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.35s var(--ease);
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--blanc);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s var(--ease);
}

.button:hover,
.button:focus-visible { color: var(--noir); }

.button:hover::before,
.button:focus-visible::before { transform: scaleY(1); }

/* --- En-tête ------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--header-h);
  padding: 0 var(--gutter);
  transition: transform 0.45s var(--ease), background-color 0.45s var(--ease);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -2.5rem 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-hidden { transform: translateY(-100%); }

.site-header__logo {
  flex: none;
  display: block;
  width: clamp(7.5rem, 11vw, 10rem);
}

.site-header__logo img { width: 100%; height: auto; }

.site-nav { margin-left: auto; }

.site-nav ul {
  display: flex;
  gap: clamp(1.25rem, 2.4vw, 2.5rem);
}

.site-nav a {
  position: relative;
  display: block;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  font-weight: 500;
  font-stretch: var(--semi-wide);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blanc);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.2rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }

/* Bouton menu : trois barres, en écho au « E » du logo */
.menu-button {
  display: none;
  margin-left: auto;
  padding: 0.75rem;
  margin-right: -0.75rem;
  border: 0;
  background: none;
  color: var(--blanc);
  cursor: pointer;
}

.menu-button__bars {
  display: grid;
  gap: 5px;
  width: 1.75rem;
}

.menu-button__bars span {
  display: block;
  height: 3px;
  border-radius: 1.5px;
  background: currentColor;
}

/* --- Menu latéral -------------------------------------------------------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.menu[hidden] { display: none; }

.menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.menu__panel {
  position: absolute;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(26rem, 100%);
  padding: var(--header-h) clamp(1.5rem, 6vw, 3rem) 2.5rem;
  background: var(--noir);
  border-left: 1px solid var(--filet);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease);
}

.menu.is-open .menu__backdrop { opacity: 1; }
.menu.is-open .menu__panel { transform: none; }

.menu__close {
  position: absolute;
  top: calc(var(--header-h) / 2 - 1.5rem);
  right: clamp(0.5rem, 4vw, 2.25rem);
  width: 3rem;
  height: 3rem;
  border: 0;
  background: none;
  color: var(--blanc);
  cursor: pointer;
}

.menu__close span:first-child::before,
.menu__close span:first-child::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 1.6rem;
  height: 3px;
  border-radius: 1.5px;
  background: currentColor;
}
.menu__close span:first-child::before { transform: translate(-50%, -50%) rotate(45deg); }
.menu__close span:first-child::after { transform: translate(-50%, -50%) rotate(-45deg); }

.menu__list {
  margin-top: 2rem;
  border-top: 1px solid var(--filet);
}

.menu__list a {
  display: block;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--filet);
  font-size: 1rem;
  font-weight: 500;
  font-stretch: var(--wide);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease), padding-left 0.3s var(--ease);
}

.menu__list a:hover,
.menu__list a:focus-visible {
  color: var(--lune);
  padding-left: 0.5rem;
}

/* --- Accueil (vidéo) ----------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: start;
  overflow: hidden;
  isolation: isolate;
  background: var(--noir);
}

.hero__video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 60%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 30%);
}

.hero__content {
  width: 100%;
  max-width: calc(50rem + 2 * var(--gutter));
  padding: calc(var(--header-h) + clamp(2rem, 11vh, 8rem)) var(--gutter) 6rem;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55);
}

.hero__title {
  font-size: clamp(1.625rem, 6vw + 0.5rem, 4.5rem);
  font-weight: 500;
  font-stretch: var(--wide);
  line-height: 1.04;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.hero__text {
  max-width: 30rem;
  margin-top: 1.5rem;
  color: var(--brume);
  font-size: clamp(1rem, 0.4vw + 0.9rem, 1.1875rem);
}

.hero__button { margin-top: 2.5rem; }

/* Pause vidéo (accessibilité : contenu animé de plus de 5 s) */
.video-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(1.5rem, 5vh, 3rem);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--blanc);
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.video-toggle:hover { border-color: var(--blanc); background: rgba(0, 0, 0, 0.5); }

/* Icône pause : deux barres ; lecture : triangle */
.video-toggle__icon {
  width: 10px;
  height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.video-toggle[aria-pressed="true"] .video-toggle__icon {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
  border-right: 0;
}

/* Séquence d'ouverture : un seul moment orchestré */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__video { animation: fade-in 1.6s var(--ease) both; }
  .js .hero__title { animation: title-in 1.8s var(--ease) 0.2s both; }
  .js .hero__text,
  .js .hero__button { animation: fade-in 1.2s var(--ease) 1s both; }
}

@keyframes title-in {
  from { opacity: 0; letter-spacing: 0.5em; }
  to { opacity: 1; letter-spacing: 0.02em; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Panneaux plein écran ------------------------------------------------ */

.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  background: var(--noir);
}

.panel__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.panel__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos-x, 50%) 50%;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.3) 42%, rgba(0, 0, 0, 0) 68%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 45%);
}

.panel--right::after {
  background:
    linear-gradient(270deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.3) 42%, rgba(0, 0, 0, 0) 68%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 45%);
}

.panel--center::after {
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 40%),
    radial-gradient(60% 50% at 50% 35%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
}

.panel__content {
  width: 100%;
  max-width: calc(34rem + 2 * var(--gutter));
  padding: 6rem var(--gutter) clamp(4rem, 13vh, 8.5rem);
}

.panel--right .panel__content { justify-self: end; }

.panel--center { align-items: start; }

.panel--center .panel__content {
  justify-self: center;
  max-width: calc(40rem + 2 * var(--gutter));
  padding-top: calc(var(--header-h) + clamp(2rem, 9vh, 6rem));
  padding-bottom: clamp(4rem, 12vh, 8rem);
  text-align: center;
}

.panel__title {
  font-size: clamp(1.75rem, 2.6vw + 0.9rem, 3rem);
  font-weight: 500;
  font-stretch: var(--wide);
  line-height: 1.08;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.panel__content p {
  margin-top: 1.25rem;
  color: var(--brume);
  text-wrap: pretty;
}

.panel__content .button { margin-top: 2.25rem; }

/* --- Formulaire de contact ---------------------------------------------- */

.contact-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
  text-align: left;
}

.contact-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.field label {
  color: var(--brume);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.field__optional { color: var(--lune); font-weight: 400; }

.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--blanc);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.field textarea { min-height: 9rem; resize: vertical; }

.field input:hover,
.field textarea:hover { border-color: rgba(255, 255, 255, 0.6); }

.field input:focus,
.field textarea:focus {
  border-color: var(--blanc);
  background: rgba(0, 0, 0, 0.85);
  outline: 2px solid var(--atmosphere);
  outline-offset: 2px;
}

.field [aria-invalid="true"] { border-color: #f1a7a0; }

.field--trap {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__footer {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  text-align: center;
}

.contact-form__footer .button { margin-top: 0; }

.button[disabled] { opacity: 0.6; cursor: progress; }

.contact-form__status:empty { display: none; }

.contact-form__status {
  font-size: 0.9375rem;
  color: var(--blanc);
}

.contact-form__status.is-error { color: #f1a7a0; }

.contact-form__note {
  color: var(--lune);
  font-size: 0.8125rem;
}

.contact-form__note a {
  border-bottom: 1px solid currentColor;
  transition: color 0.3s var(--ease);
}

.contact-form__note a:hover { color: var(--blanc); }

/* Champs du formulaire sur une colonne en mobile */
@media (max-width: 560px) {
  .contact-form__row { grid-template-columns: 1fr; }
  .contact-form__footer .button { width: 100%; }
}

/* --- Approche ------------------------------------------------------------ */

.approach {
  padding: clamp(6rem, 18vh, 11rem) var(--gutter);
  background: var(--noir);
}

.approach__title {
  max-width: 40rem;
  font-size: clamp(1.75rem, 2.6vw + 0.9rem, 3rem);
  font-weight: 500;
  font-stretch: var(--wide);
  line-height: 1.08;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.approach__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: clamp(3rem, 8vh, 5rem);
}

.approach__steps li {
  padding-top: 1.5rem;
  border-top: 1px solid var(--filet);
}

.approach__steps h3 {
  font-size: clamp(1.125rem, 0.8vw + 0.9rem, 1.5rem);
  font-weight: 500;
  font-stretch: var(--wide);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.approach__steps p {
  margin-top: 0.75rem;
  max-width: 22rem;
  color: var(--lune);
}

/* --- Pied de page -------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding: 2.5rem var(--gutter) max(2.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--noir);
}

.site-footer__logo { width: 6.5rem; height: auto; opacity: 0.85; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.25rem;
  color: var(--lune);
  font-size: 0.75rem;
  font-weight: 500;
  font-stretch: var(--semi-wide);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer__links a { transition: color 0.3s var(--ease); }
.site-footer__links a:hover { color: var(--blanc); }

/* --- Page secondaire (mentions légales) ---------------------------------- */

.legal {
  max-width: calc(44rem + 2 * var(--gutter));
  margin: 0 auto;
  padding: calc(var(--header-h) + 4rem) var(--gutter) 6rem;
}

.legal h1 {
  font-size: clamp(1.75rem, 2.6vw + 0.9rem, 3rem);
  font-weight: 500;
  font-stretch: var(--wide);
  line-height: 1.08;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.legal h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--filet);
  font-size: 1.125rem;
  font-weight: 500;
  font-stretch: var(--wide);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal p,
.legal ul { margin-top: 1rem; color: var(--brume); }
.legal li + li { margin-top: 0.25rem; }
.legal a { border-bottom: 1px solid var(--filet); }
.legal a:hover { border-color: currentColor; }
.legal .todo { color: var(--atmosphere); }

.site-header--solid { background: var(--noir); }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1100px) {
  .site-nav:not(.site-nav--always) { display: none; }
  .menu-button { display: block; }
}

@media (max-width: 760px) {
  .panel { align-items: end; }

  .panel::after,
  .panel--right::after {
    background:
      linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.55) 35%, rgba(0, 0, 0, 0) 65%);
  }

  .panel--right .panel__content { justify-self: start; }

  .panel__content { padding-bottom: clamp(3rem, 9vh, 5rem); }

  .panel--center { align-items: start; }

  .panel--center::after {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 55%);
  }

  .panel--center .panel__content { padding-top: calc(var(--header-h) + 2.5rem); }

  .approach__steps { grid-template-columns: 1fr; }

  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* Écrans portrait : la Terre descend, le texte reste dans le ciel noir */
@media (max-aspect-ratio: 4/5) {
  .hero__video {
    top: 24%;
    height: 76%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
  }
}

@media (max-width: 380px) {
  .hero__title { font-stretch: var(--semi-wide); }
  .button { padding: 0 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
