/* Noire Sleep · landing page
   Noir absolu, un seul violet pour l'action, l'ambre pour ponctuer.
   La constellation (canvas #sky) est la seule image de la page. */

:root {
  --void: #000;
  --bone: #fff;
  --ash: #9a9a9a;
  --mist: #bdbdbd;
  --iris: #8052ff;
  --iris-lift: #9a7bff;
  --saffron: #ffb829;
  --verdant: #15846e;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body-weight: 200;

  --maxw: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.25);
  color-scheme: dark;
}

/* Le 200 est la signature, mais il devient trop maigre sur un écran non Retina. */
@media (max-resolution: 1.49dppx), (max-width: 760px) {
  :root { --body-weight: 300; }
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  font-weight: var(--body-weight);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 400; }

:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 4px;
  border-radius: 6px;
}

.sr-only {
  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 {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--bone);
  color: var(--void);
  font-weight: 600;
  font-size: 14px;
  transform: translateY(-160%);
  transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------------------------------------------------------------- ciel */

#sky {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
}

main, .foot { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- nav */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  transition: background-color .4s var(--ease);
}
.nav.scrolled { background: rgba(0, 0, 0, .78); }

.nav-in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
  margin-right: auto;
  min-height: 44px;
}
.brand img {
  width: 30px; height: 30px;
  border-radius: 8px;
  transition: transform .6s var(--spring);
}
.brand:hover img { transform: rotate(-10deg) scale(1.08); }

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  display: inline-block;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ash);
  transition: color .25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav-links a:hover,
.nav-links a[aria-current="true"] { color: var(--bone); }
.nav-links a:hover::after,
.nav-links a[aria-current="true"]::after { transform: scaleX(1); transform-origin: left; }

/* ---------------------------------------------------------------- boutons */

.pill {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 15px 26px;
  border-radius: 999px;
  background: var(--iris);
  color: var(--bone);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform .7s var(--spring);
  will-change: transform;
}
/* La tache claire naît sous le curseur et envahit la pastille. */
.pill::before {
  content: "";
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--iris-lift);
  transform: scale(0);
  transition: transform .6s var(--ease);
  z-index: -1;
}
.pill:hover::before { transform: scale(34); }
.pill:active { transform: scale(.96); }
.pill .mag-in { display: inline-flex; align-items: center; gap: 12px; transition: transform .7s var(--spring); }
.pill .arrow { width: 16px; height: 16px; transition: transform .45s var(--ease); }
.pill:hover .arrow { transform: translateX(4px); }
.pill.is-mag, .pill.is-mag .mag-in { transition-duration: .15s; transition-timing-function: linear; }
.pill-sm { min-height: 44px; padding: 12px 18px; font-size: 12px; }

.ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ash);
  transition: color .25s;
}
.ghost::after {
  content: "";
  position: absolute;
  left: 0; right: 26px; bottom: 8px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .45s var(--ease);
}
.ghost:hover { color: var(--bone); }
.ghost:hover::after { transform: scaleX(1); transform-origin: left; }
.ghost svg { width: 16px; height: 16px; }
.ghost.down svg { animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(4px); } }

.amber-link { color: var(--saffron); }
.amber-link::after { right: 0; }
.amber-link:hover { color: var(--bone); }

/* ---------------------------------------------------------------- typo */

.label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--saffron);
  font-variant-numeric: tabular-nums;
}

.display {
  font-size: clamp(52px, 8vw, 113px);
  line-height: .98;
  letter-spacing: -.045em;
}

.h2 {
  font-size: clamp(38px, 5.2vw, 78px);
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.lede {
  max-width: 500px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--bone);
}
.lede.mist { color: var(--mist); }

.note {
  max-width: 470px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--saffron);
}

/* ---------------------------------------------------------------- sections */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 112px 0 72px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  align-items: center;
}
.hero-copy { display: grid; gap: 30px; justify-items: start; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.micro { font-size: 13px; font-weight: 400; color: var(--ash); letter-spacing: .02em; }
.hero .stage { height: min(72vh, 640px); }

.sec {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0;
  scroll-margin-top: 40px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.split.flip .stage { order: -1; }
.copy { display: grid; gap: 26px; justify-items: start; }
.stage { width: 100%; height: clamp(420px, 44vw, 580px); }

/* Listes à survoler : chaque entrée redessine la constellation voisine. */
.tune { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.tune button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  font-size: clamp(22px, 2.1vw, 27px);
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--ash);
  text-align: left;
  transition: color .3s, transform .5s var(--ease);
}
.tune button::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--iris);
  transform: scale(0);
  transition: transform .45s var(--spring);
}
.tune button:hover { color: var(--bone); }
.tune button[aria-pressed="true"] { color: var(--bone); transform: translateX(6px); }
.tune button[aria-pressed="true"]::before { transform: scale(1); }
.tune-hint { font-size: 13px; font-weight: 400; color: var(--ash); }
.tune-detail { min-height: 1.5em; font-size: 16px; color: var(--mist); }


.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; font-size: 13px; font-weight: 400; color: var(--mist); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* Question tapée à la machine dans la section Luna. */
.ask {
  display: grid;
  max-width: 520px;
  font-size: clamp(22px, 2.2vw, 27px);
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--mist);
}
.ask > * { grid-area: 1 / 1; }
.ask .ghost-text { visibility: hidden; }
.ask .caret {
  display: inline-block;
  width: 2px; height: 1em;
  margin-left: 3px;
  vertical-align: -.12em;
  background: var(--saffron);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Intermède : les mots s'allument au fil du défilement. */
.interlude { min-height: 110vh; }
.stmt {
  max-width: 1100px;
  font-size: clamp(38px, 5.6vw, 84px);
  line-height: 1.06;
  letter-spacing: -.04em;
  font-weight: 400;
  text-wrap: balance;
}
.js .stmt .sw { color: rgba(255, 255, 255, .38); transition: color .5s var(--ease); }
.js .stmt .sw.lit { color: var(--bone); }
.js .stmt .sw.lit.hl { color: var(--saffron); }

/* ---------------------------------------------------------------- final */

.final { text-align: center; padding-bottom: 96px; }
.final .wrap { display: grid; justify-items: center; gap: 30px; }
.final .stage { height: clamp(280px, 34vw, 420px); max-width: 560px; }
.final .h2 { max-width: 980px; font-size: clamp(42px, 6.4vw, 96px); }
.final .lede { max-width: 540px; }

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px 44px;
  margin-top: 10px;
}
.app-row {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-size: 15px;
  font-weight: 400;
}
.app-row img { width: 60px; height: 60px; border-radius: 14px; }
.app-row small { display: block; font-size: 13px; color: var(--ash); }

.qr {
  display: none;
  align-items: center;
  gap: 18px;
  text-align: left;
}
.qr-tile {
  width: 132px;
  padding: 10px;
  border-radius: 16px;
  background: var(--bone);
  transition: transform .6s var(--spring);
}
.qr-tile svg { width: 100%; height: auto; shape-rendering: crispEdges; }
.qr:hover .qr-tile { transform: rotate(-3deg) scale(1.04); }
.qr p { max-width: 190px; font-size: 14px; font-weight: 400; color: var(--mist); }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .qr { display: flex; }
}

/* ---------------------------------------------------------------- pied */

.foot {
  padding: 72px 0 calc(96px + env(safe-area-inset-bottom));
  color: var(--ash);
  font-size: 14px;
  font-weight: 400;
}
.foot .wrap { display: grid; gap: 22px; }
.slogan { font-size: clamp(24px, 2.4vw, 36px); letter-spacing: -.03em; color: var(--bone); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; transition: color .25s; }
.foot-links a:hover { color: var(--saffron); }
.fine { font-size: 13px; color: var(--ash); max-width: 720px; }

/* ---------------------------------------------------------------- cookies */

/* Refuser et Accepter ont exactement le même poids, comme l'exige la CNIL. */
.consent {
  position: fixed;
  right: var(--gutter);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  gap: 14px;
  width: min(420px, calc(100% - 2 * var(--gutter)));
  padding: 18px 20px;
  border-radius: 24px;
  background: #0b0b0f;
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--mist);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.consent.on { opacity: 1; transform: none; }
.consent a { color: var(--saffron); text-decoration: underline; text-underline-offset: 3px; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bone);
  transition: background-color .25s, border-color .25s;
}
.consent button:hover { background: rgba(255, 255, 255, .08); border-color: var(--bone); }

/* ---------------------------------------------------------------- horloge */

.clock {
  position: fixed;
  left: var(--gutter);
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.clock.on { opacity: 1; transform: none; }
.clock-text { display: inline-flex; align-items: center; gap: 10px; }
.clock-time {
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.clock-cap {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ash);
  transition: opacity .3s;
}
.clock-cap.swap { opacity: 0; }
.orb-ico { position: relative; width: 14px; height: 14px; }
.orb-ico i {
  position: absolute; inset: 0;
  border-radius: 50%;
  transition: opacity .6s, transform .6s var(--ease);
}
.orb-ico .moon { background: #c4b5fd; -webkit-mask: radial-gradient(circle at 72% 32%, transparent 5px, #000 5.5px); mask: radial-gradient(circle at 72% 32%, transparent 5px, #000 5.5px); }
.orb-ico .sun { background: var(--saffron); transform: scale(.4); opacity: 0; }
.clock.day .moon { opacity: 0; transform: scale(.4); }
.clock.day .sun { opacity: 1; transform: scale(.8); }

/* ---------------------------------------------------------------- révélations */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].in { opacity: 1; transform: none; }

.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}
.w > span { display: inline-block; }
.js [data-split] .w > span {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms + var(--d, 0ms));
}
.js [data-split].in .w > span { transform: none; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-in { height: 64px; }

  /* En bas de l'écran, l'horloge masquerait le texte : elle monte dans la barre,
     à la place du nom, dès que la page défile. */
  .brand span { transition: opacity .3s; }
  .nav.scrolled .brand span { opacity: 0; }
  .clock {
    top: 0; bottom: auto;
    left: calc(var(--gutter) + 42px);
    height: 64px;
    padding: 0;
    background: none;
    z-index: 25;
    gap: 9px;
    transform: translateY(-8px);
  }
  .clock-text { display: grid; gap: 2px; line-height: 1.1; }
  .clock-time { font-size: 14px; }
  .clock-cap { font-size: 9px; letter-spacing: .08em; }

  .hero { align-items: flex-start; padding: 84px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero .stage { order: -1; height: 40svh; min-height: 250px; max-height: 380px; }
  .hero-copy { gap: 22px; }

  .sec { min-height: 0; padding: 84px 0; }
  .split { grid-template-columns: 1fr; gap: 26px; }
  .split .stage, .split.flip .stage { order: -1; height: 76vw; max-height: 400px; }
  .copy { gap: 20px; }
  .lede { font-size: 17px; }
  .interlude { min-height: 0; padding: 120px 0; }

  .final .stage { height: 64vw; max-height: 320px; }
  .consent { left: var(--gutter); right: var(--gutter); width: auto; }
  .get { flex-direction: column; gap: 26px; }
}

@media (max-width: 380px) {
  .pill { padding: 15px 20px; letter-spacing: .04em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal], .js [data-split] .w > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .ghost.down svg, .ask .caret { animation: none; }
  .pill, .pill::before, .tune button, .brand img, .qr-tile, .consent { transition: none; }
}
