:root {
  --bg: #0a0a0c;
  --ink: #f5f2ea;
  --muted: rgba(245, 242, 234, 0.68);
  --faint: rgba(245, 242, 234, 0.4);
  --line: rgba(245, 242, 234, 0.16);
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

:focus-visible {
  outline: 1px solid rgba(245, 242, 234, 0.6);
  outline-offset: 4px;
}

/* ---- Grain ---- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

/* ---- Langue ---- */

.lang {
  position: fixed;
  top: 26px;
  right: 30px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fade-in 1.2s ease forwards 2.8s;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 4px 2px;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: color 240ms ease;
}

.lang-btn:hover {
  color: var(--muted);
}

.lang-btn.is-active {
  color: var(--ink);
}

.lang-sep {
  width: 1px;
  height: 12px;
  background: var(--line);
  transform: rotate(18deg);
}

/* ---- Héro ---- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 96px;
}

.hero-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform, opacity;
}

.eclipse {
  position: relative;
  width: clamp(260px, 46vmin, 430px);
  aspect-ratio: 1;
}

/* lueur ambiante derrière le disque — occultée par lui, comme une couronne */
.eclipse::before {
  content: "";
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 242, 234, 0.09), transparent 62%);
  opacity: 0;
  animation: fade-in 2.4s ease forwards 2s;
}

.eclipse-inner {
  position: relative;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.eclipse-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: breathe 9s ease-in-out infinite 3.5s;
}

/* le croissant se dessine au chargement */
.eclipse-ring {
  stroke-dasharray: 1006;
  stroke-dashoffset: 1006;
  animation: draw 2.6s var(--ease-out) forwards 0.4s;
}

.eclipse-halo {
  opacity: 0;
  animation: halo-in 2s ease forwards 2.1s;
}

/* ---- Wordmark ---- */

.wordmark {
  margin: 40px 0 0;
  display: flex;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  letter-spacing: 0;
}

.wordmark span {
  display: inline-block;
  padding-right: 0.42em;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.9s var(--ease-out) forwards;
}

.wordmark span:last-child {
  padding-right: 0;
  margin-right: -0.06em;
}

.wordmark span:nth-child(1) { animation-delay: 1.35s; }
.wordmark span:nth-child(2) { animation-delay: 1.42s; }
.wordmark span:nth-child(3) { animation-delay: 1.49s; }
.wordmark span:nth-child(4) { animation-delay: 1.56s; }
.wordmark span:nth-child(5) { animation-delay: 1.63s; }
.wordmark span:nth-child(6) { animation-delay: 1.7s; }
.wordmark span:nth-child(7) { animation-delay: 1.77s; }
.wordmark span:nth-child(8) { animation-delay: 1.84s; }
.wordmark span:nth-child(9) { animation-delay: 1.91s; }

.tagline {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 1.1s var(--ease-out) forwards 2.35s;
}

/* ---- Indice de défilement ---- */

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  opacity: 0;
  animation: fade-in 1.4s ease forwards 3s;
}

.scroll-cue-line {
  position: relative;
  width: 1px;
  height: 58px;
  background: var(--line);
  overflow: hidden;
}

.scroll-cue-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -50%;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, transparent, var(--ink));
  animation: cue 2.6s ease-in-out infinite;
}

.scroll-cue-label {
  color: var(--faint);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  transition: color 240ms ease;
}

.scroll-cue:hover .scroll-cue-label {
  color: var(--muted);
}

/* ---- Manifeste ---- */

.manifesto {
  padding: 22vh 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.2em;
}

.manifesto-p {
  margin: 0;
  max-width: 34em;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.85;
  color: var(--muted);
  text-align: center;
  text-wrap: pretty;
}

/* ---- Le plateau ---- */

.scene {
  position: relative;
  overflow: hidden;
  margin: 6vh 0;
}

.scene img {
  display: block;
  width: 100%;
  height: clamp(340px, 78vh, 740px);
  object-fit: cover;
  object-position: center 38%;
  filter: saturate(0.6) contrast(1.03) brightness(0.95);
}

/* bords fondus dans le noir de la page */
.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    transparent 22%,
    transparent 78%,
    var(--bg) 100%
  );
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 160px 70px var(--bg);
}

/* lent zoom arrière à la révélation */
.js .scene img {
  transform: scale(1.07);
  transition: transform 3s var(--ease-out);
}

.js .scene.is-visible img {
  transform: scale(1);
}

/* ---- La question ---- */

.question {
  min-height: 82vh;
  min-height: 82svh;
  padding: 10vh 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.4em;
  text-align: center;
}

.question-lead {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}

.question-text {
  margin: 0;
  max-width: 24ch;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.9rem, 5.4vw, 3.7rem);
  line-height: 1.3;
  text-wrap: balance;
}

/* ---- Inscription ---- */

.signup {
  padding: 10vh 24px 18vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rule {
  width: 1px;
  height: 64px;
  background: var(--line);
  margin-bottom: 8vh;
}

.signup-lead {
  margin: 0 0 3em;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--muted);
}

.signup-form {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.signup-form input {
  width: min(340px, 80vw);
  padding: 10px 2px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  outline: none;
  border-radius: 0;
  transition: border-color 300ms ease;
}

.signup-form input::placeholder {
  color: var(--faint);
}

.signup-form input:focus {
  border-color: rgba(245, 242, 234, 0.55);
}

.signup-form button {
  padding: 12px 26px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 300ms ease, color 300ms ease, border-color 300ms ease;
}

.signup-form button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.form-message {
  min-height: 1.6em;
  margin-top: 26px;
  font-size: 0.85rem;
  color: var(--muted);
}

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

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 30px 30px 34px;
  border-top: 1px solid rgba(245, 242, 234, 0.07);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.footer a {
  color: var(--faint);
  text-decoration: none;
  transition: color 240ms ease;
}

.footer a:hover {
  color: var(--ink);
}

/* ---- Révélations au défilement ---- */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 1s ease var(--d, 0s),
    transform 1.1s var(--ease-out) var(--d, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Divers ---- */

.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;
}

/* ---- Animations ---- */

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes halo-in {
  to { opacity: 0.5; }
}

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

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

@keyframes cue {
  0% { top: -50%; }
  60%, 100% { top: 110%; }
}

/* ---- Mobile ---- */

@media (max-width: 560px) {
  .lang {
    top: 18px;
    right: 20px;
  }

  .hero {
    padding-bottom: 110px;
  }

  .manifesto {
    padding: 16vh 24px;
  }

  .signup-form {
    flex-direction: column;
    align-items: center;
    gap: 26px;
  }
}

/* ---- Mouvement réduit ---- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .eclipse-ring {
    animation: none;
    stroke-dashoffset: 0;
  }

  .eclipse-halo {
    animation: none;
    opacity: 0.5;
  }

  .eclipse::before,
  .lang,
  .scroll-cue {
    animation: none;
    opacity: 1;
  }

  .eclipse-svg {
    animation: none;
  }

  .scroll-cue-line::after {
    animation: none;
  }

  .wordmark span,
  .tagline {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js .scene img {
    transform: none;
    transition: none;
  }
}
