@font-face {
  font-family: "Archivo";
  src: url("/assets/archivo-latin-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #0a0b0e;
  --paper-2: #14161b;
  --ink: #edeff3;
  --muted: #a7adb8;
  --line: #343843;
  --accent: #3fc6ec;
  --button: #f4f5f7;
  --on-button: #0a0b0e;
  --danger: #ff9a9a;
  --gutter: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

[hidden] { display: none !important; }

/* La page est un clip vertical : image plein écran, sous-titre, puis formulaire */
.clip {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  overflow: hidden;
}

.clip__stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--paper-2);
  container-type: size;
}

.clip__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgb(10 11 14 / 0.82) 0,
    rgb(10 11 14 / 0) 15%,
    rgb(10 11 14 / 0) 30%,
    rgb(10 11 14 / 0.82) 47%,
    var(--paper) 62%
  );
}

.clip__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 73% 40%;
}

@supports (width: 1cqw) {
  .clip__stage img {
    --image-w: max(100cqw, 190cqh);
    --image-h: calc(var(--image-w) * 0.66);
    inset: auto;
    left: clamp(calc(100cqw - var(--image-w)), calc(50cqw - var(--image-w) * 0.728), 0px);
    top: clamp(calc(100cqh - var(--image-h)), calc(25cqh - var(--image-h) * 0.39), 0px);
    width: var(--image-w);
    height: var(--image-h);
    transform-origin: 0 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #clip-image {
    opacity: 0;
    animation: appear 0.2s 1.2s forwards;
  }

  #clip-image.is-reframing {
    opacity: 1;
    animation: reframe 1.15s cubic-bezier(0.72, 0, 0.18, 1) 0.6s both;
  }
}

@keyframes appear {
  to { opacity: 1; }
}

@keyframes reframe {
  from { transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(var(--from-scale, 1)); }
  to { transform: none; }
}

.clip__content {
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding:
    calc(env(safe-area-inset-top) + 16px)
    calc(env(safe-area-inset-right) + var(--gutter))
    calc(env(safe-area-inset-bottom) + 14px)
    calc(env(safe-area-inset-left) + var(--gutter));
}

.logo {
  display: block;
  width: 118px;
  height: auto;
}

.clip__copy {
  width: 100%;
  max-width: 480px;
  margin: auto auto 0;
  padding-top: 12svh;
}

.nowrap { white-space: nowrap; }

.caption {
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(2.65rem, 12.4vw, 3.5rem);
  font-stretch: 70%;
  font-weight: 850;
  line-height: 0.96;
  letter-spacing: -0.008em;
  text-wrap: balance;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.55), 0 0 22px rgb(0 0 0 / 0.5);
}

.caption__word { transition: color 90ms linear; }
.caption__word.is-spoken { color: var(--accent); }

.lede {
  max-width: 44ch;
  margin: 0 0 18px;
  color: #d3d7de;
  font-size: 0.97rem;
  line-height: 1.42;
}

.join {
  display: grid;
  gap: 10px;
}

.join__label {
  font-size: 0.875rem;
  font-weight: 650;
}

.join__input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid #5a606c;
  border-radius: 10px;
  background: #15171d;
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16 px : évite le zoom automatique sur iPhone */
}

.join__input::placeholder { color: #858c98; }
.join__input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 2px var(--accent); }
.join__input[aria-invalid="true"] { border-color: var(--danger); }

.join__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.join__consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 3px 0;
  color: #c4c9d2;
  font-size: 0.82rem;
  line-height: 1.38;
  cursor: pointer;
}

.join__consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.join__error {
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 550;
}

.join__submit {
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--button);
  color: var(--on-button);
  font: inherit;
  font-size: 1.04rem;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
}

.join__submit:hover { background: var(--accent); }
.join__submit:active { transform: translateY(1px); }
.join__submit:disabled { background: #9ba1ac; cursor: progress; }

.success {
  padding: 16px;
  border-left: 3px solid var(--accent);
  background: rgb(20 22 27 / 0.92);
  outline: 0;
}

.success h2 {
  margin: 0 0 4px;
  font-size: 1.65rem;
  font-stretch: 72%;
  font-weight: 800;
  line-height: 1.05;
}

.success p { margin: 0; color: #d3d7de; overflow-wrap: anywhere; }
.success strong { color: var(--ink); }

.legal {
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 18px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.legal a { padding: 4px 0; }

/* Page de confirmation */
.clip--confirmed .clip__copy { padding-top: 46svh; }
.clip--confirmed .lede { margin-bottom: 0; }

/* Pages légales */
.doc {
  max-width: 68ch;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) var(--gutter) 48px;
}

.doc .logo { margin-bottom: 40px; }

.doc h1 {
  margin: 0 0 8px;
  font-size: clamp(2.3rem, 9vw, 3.4rem);
  font-stretch: 72%;
  font-weight: 850;
  line-height: 1;
}

.doc h2 {
  margin: 34px 0 8px;
  font-size: 1.22rem;
  line-height: 1.25;
}

.doc p, .doc li { color: #cdd1d9; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc__date { color: var(--muted); font-size: 0.9rem; }
.doc__back { display: inline-block; margin-top: 28px; font-weight: 650; }

/* Navigateur intégré d'Instagram : le bouton doit rester visible sans faire défiler */
@media (max-width: 759px) and (max-height: 760px) {
  .clip:not(.clip--confirmed) .lede { display: none; }
  .clip:not(.clip--confirmed) .clip__copy { padding-top: 8svh; }
  .caption {
    margin-bottom: 14px;
    font-size: clamp(2.35rem, 11vw, 3rem);
  }
}

/* Grand écran : le clip devient un téléphone à côté du texte */
@media (min-width: 760px) {
  :root { --gutter: 40px; }

  .clip {
    align-items: center;
    justify-content: center;
    gap: clamp(40px, 7vw, 104px);
    padding: 28px var(--gutter);
    flex-direction: row-reverse;
  }

  .clip__stage {
    position: relative;
    inset: auto;
    z-index: 0;
    flex: none;
    height: min(calc(100svh - 56px), 820px);
    min-height: 480px;
    aspect-ratio: 9 / 16;
    border-radius: 18px;
  }

  .clip__stage::after {
    background: linear-gradient(to bottom, rgb(10 11 14 / 0) 72%, rgb(10 11 14 / 0.42));
  }

  .clip__content {
    width: min(100%, 500px);
    min-height: 0;
    padding: 0;
  }

  .logo { width: 138px; }

  .clip__copy,
  .clip--confirmed .clip__copy {
    max-width: none;
    margin: 42px 0 0;
    padding-top: 0;
  }

  .caption {
    margin-bottom: 20px;
    font-size: clamp(3.4rem, 6.2vw, 5.25rem);
    text-shadow: none;
  }

  .lede { font-size: 1.08rem; margin-bottom: 24px; }
  .legal { max-width: none; margin: 18px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
