/* Chatchout — page « en cours de construction ».
   Une seule page, qui tient dans l'écran comme la vitrine de l'application : aucun défilement.
   Aucune ressource externe (ni police distante ni script) : la page se sert seule, et sa politique
   de sécurité peut tout interdire sauf ses propres fichiers. */

:root {
  --brand-800: #0d1932;
  --brand-500: #1f56a3;
  --accent-500: #c8873f;
  --ink-soft: rgb(255 255 255 / 0.78);
  --ink-faint: rgb(255 255 255 / 0.55);
  --sans:
    "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "DejaVu Serif", serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* une page, pas un document : rien ne défile */
}

body {
  background: var(--brand-800);
  color: #fff;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* --- Mise en page ------------------------------------------------------------------------- */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px)
    max(16px, env(safe-area-inset-bottom));
  isolation: isolate;
}

/* L'illustration de la vitrine. Sur téléphone, le haut lui appartient et le bas au texte ; sur
   ordinateur, elle occupe la droite et le texte la gauche — le même partage que l'application. */
.art {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(
      to bottom,
      transparent 0%,
      transparent 22%,
      color-mix(in srgb, var(--brand-800) 82%, transparent) 42%,
      var(--brand-800) 56%
    ),
    url("hero.webp") 70% 18% / cover no-repeat;
}

.top {
  display: flex;
  align-items: center;
}

.logo {
  width: clamp(120px, 30vw, 168px);
  height: auto;
}

.body {
  flex: 1;
  display: flex;
  align-items: flex-end;
  min-height: 0;
  padding-block: clamp(8px, 2vh, 24px);
}
.content {
  max-width: 34rem;
}

.badge {
  display: inline-block;
  margin: 0 0 clamp(10px, 1.8vh, 18px);
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-500) 70%, transparent);
  border-radius: 999px;
  color: var(--accent-500);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.6vw + 0.4rem, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.lead {
  margin: clamp(10px, 1.8vh, 18px) 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 0.7vw + 0.78rem, 1.08rem);
  line-height: 1.55;
}

/* Ce qu'on peut faire : le cœur de la page, gardé sur tous les écrans. Deux colonnes de pastilles,
   pour que six capacités tiennent là où une liste en prendrait le double de hauteur. */
.caps {
  margin: clamp(12px, 2.2vh, 24px) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.caps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 10px;
  background: rgb(13 25 50 / 0.55);
  font-size: clamp(0.82rem, 0.35vw + 0.76rem, 0.95rem);
  font-weight: 600;
  line-height: 1.25;
}
.caps li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-500);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding-top: 12px;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  font-size: 13px;
  color: var(--ink-faint);
}
.foot strong {
  color: #fff;
  font-weight: 600;
}

/* --- Pré-inscription ----------------------------------------------------------------------- */
/* Mêmes matières que les pastilles : bord fin translucide, fond de marque voilé, coins de 10 px.
   Le bouton prend l'accent cuivré, seule couleur vive de la page. */
.signup {
  margin: clamp(12px, 2.2vh, 24px) 0 0;
}
.offer,
.note {
  margin: 0;
  font-size: clamp(0.82rem, 0.35vw + 0.76rem, 0.95rem);
  line-height: 1.4;
  color: var(--ink-soft);
}
.offer strong {
  color: var(--accent-500);
}
.note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-faint);
}
.fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}
.fields input {
  grid-column: 1 / -1;
}
.fields input,
.fields select,
.fields button {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 10px;
  background: rgb(13 25 50 / 0.55);
  color: #fff;
  font: 600 clamp(0.88rem, 0.35vw + 0.8rem, 0.98rem) / 1 var(--sans);
}
.fields input::placeholder {
  color: var(--ink-faint);
}
.fields select:invalid {
  color: var(--ink-faint);
}
.fields option {
  background: var(--brand-800);
  color: #fff;
}
.fields input:focus-visible,
.fields select:focus-visible,
.fields button:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 1px;
}
.fields button {
  border-color: var(--accent-500);
  background: var(--accent-500);
  color: var(--brand-800);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.fields button:hover {
  background: color-mix(in srgb, var(--accent-500) 88%, #fff);
}

/* Le serveur répond par une redirection vers une ancre : seul le message visé s'affiche. Une fois
   l'inscription faite (ou déjà faite), le formulaire s'efface ; sur une erreur il reste là. */
.notice {
  display: none;
  margin: clamp(12px, 2.2vh, 24px) 0 0;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 10px;
  background: rgb(13 25 50 / 0.7);
  font-size: clamp(0.85rem, 0.35vw + 0.78rem, 0.98rem);
  line-height: 1.45;
}
.notice:target {
  display: block;
}
.notice.ok {
  border-color: color-mix(in srgb, var(--accent-500) 70%, transparent);
}
.notice.ok strong {
  color: var(--accent-500);
}
.notice.warn {
  border-color: rgb(255 140 120 / 0.6);
  color: #ffd2c8;
}
.content:has(.notice.ok:target) .signup {
  display: none;
}
.content:has(.notice.warn:target) .signup {
  margin-top: 10px;
}

.sr-only,
.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Ordinateur ---------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .art {
    background:
      linear-gradient(to right, var(--brand-800) 0%, var(--brand-800) 30%, transparent 68%),
      url("hero.webp") right center / cover no-repeat;
  }
  .body {
    align-items: center;
  }
  /* Assez de largeur pour que l'adresse, le plan et le bouton tiennent sur une ligne. */
  .content {
    max-width: 38rem;
  }
  .lead {
    max-width: 34rem;
  }
  .fields {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .fields input {
    grid-column: auto;
  }
}

/* --- Petits écrans : tout doit tenir, rien ne défile ---------------------------------------- */
@media (max-height: 760px) {
  /* Quand la place manque, ce sont les phrases d'appoint qui partent, jamais ce qu'on peut faire
     ni le formulaire. */
  .more,
  .note {
    display: none;
  }
}
@media (max-height: 680px) {
  .caps {
    gap: 6px;
  }
  .caps li {
    padding: 6px 10px;
  }
  /* Un message d'erreur prend la place de l'invitation, qui n'a plus rien à apprendre. */
  .content:has(.notice.warn:target) .offer {
    display: none;
  }
}

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