/*
 * Feuille de style du site Contraction Zen.
 *
 * Deux règles fixent tout le reste :
 *
 * 1. **Aucune requête externe.** Pas de Google Fonts, pas de CDN, pas de script
 *    tiers. Un site qui héberge une politique de confidentialité n'a pas à
 *    déposer de traceur pour l'afficher — et le chargement de polices Google
 *    depuis l'Europe est juridiquement contesté. D'où la pile de polices
 *    système, et les maquettes de téléphone dessinées en CSS plutôt qu'en
 *    images.
 * 2. **Mêmes jetons que l'application** (src/theme/tokens.ts), pour que le site
 *    et l'app se reconnaissent.
 */

:root {
  --bg: #0a0813;
  --bg-alt: #100d1c;
  --surface: #16132a;
  --surface-alt: #1e1a38;
  --border: #272242;
  --text: #f4f1ff;
  --text-secondary: #a9a2cc;
  --text-muted: #6f688f;
  --accent: #ff5f8f;
  --accent-alt: #ff9a6b;
  --calm: #2fd9a8;
  --violet: #7b61ff;

  --radius: 16px;
  --radius-lg: 22px;
  --max: 1040px;
  --measure: 680px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf9fe;
    --bg-alt: #f2f0fb;
    --surface: #ffffff;
    --surface-alt: #f2f0fb;
    --border: #e7e3f6;
    --text: #151130;
    --text-secondary: #575178;
    --text-muted: #8b85a8;
    --accent: #de2c67;
    --accent-alt: #e9682f;
    --calm: #0c8f6c;
    --violet: #5a3edc;
  }
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Ni défilement animé, ni carte qui se soulève au survol. */
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .feature:hover {
    transform: none;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Halo décoratif, repris de l'en-tête des écrans de l'app. */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 460px;
  background: radial-gradient(
    ellipse 120% 100% at 50% 0%,
    color-mix(in srgb, var(--violet) 22%, transparent),
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* La prose reste étroite même quand la page est large : au-delà d'environ
   70 caractères par ligne, l'œil perd le début de la ligne suivante. */
.prose {
  max-width: var(--measure);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 24px;
  top: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

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

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.3px;
}

header.site nav {
  display: flex;
  gap: 22px;
  font-size: 15px;
}

header.site nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

header.site nav a:hover {
  color: var(--accent);
}

@media (max-width: 620px) {
  header.site nav {
    display: none;
  }
}

/* ————————————————————————————————————————————————————— Héros */

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(0, 300px);
  gap: 56px;
  align-items: center;
  padding: 48px 0 72px;
}

.hero__text {
  max-width: 30em;
}

h1 {
  font-size: clamp(34px, 5.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -1.4px;
  margin: 0 0 18px;
}

.lede {
  font-size: 19px;
  color: var(--text-secondary);
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--calm) 14%, transparent);
  color: var(--calm);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    padding-bottom: 48px;
  }
  .hero__text {
    max-width: none;
  }
  .hero .phone {
    margin: 0 auto;
  }
}

/* ———————————————————————————————————————————— Badges de téléchargement

   Les deux fichiers font 646 × 250, dont 168 px d'artwork centré : à hauteur
   de toile égale, les deux badges s'alignent d'eux-mêmes. On fixe donc la
   hauteur et on laisse la largeur suivre — les deux boutiques interdisent de
   déformer leur badge.

   L'artwork occupe 67 % de la toile : une toile de 74 px donne un badge de
   50 px, largement au-dessus du minimum de 40 px exigé par Apple. */

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.store {
  display: inline-flex;
  border-radius: 12px;
}

.store img {
  display: block;
  height: 74px;
  width: auto;
}

/* Sans `href`, l'élément n'est ni cliquable ni focusable : le badge est visible
   mais inerte tant que l'app n'est pas publiée. Dès qu'un lien est posé, il
   redevient interactif et cette règle s'applique. */
.store[href]:hover img {
  opacity: 0.86;
}

@media (max-width: 860px) {
  .stores {
    justify-content: center;
  }
}

/* ——————————————————————————————————————————— Maquettes de téléphone

   Dessinées entièrement en CSS : pas d'image de cadre à charger, et le rendu
   suit le thème clair ou sombre du visiteur.

   Pour changer de capture, il suffit de renseigner `--shot` sur l'élément :

       <div class="phone__screen" style="--shot: url('assets/screenshots/chrono.webp')">

   Sans elle, l'écran reste vide — un dégradé neutre aux couleurs de l'app. */

.phone {
  --phone-width: 280px;
  width: var(--phone-width);
  margin: 0;
  flex: none;
}

.phone__frame {
  position: relative;
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(160deg, #3a3550, #16131f 45%, #2a2540);
  box-shadow:
    0 30px 70px -20px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone__screen {
  position: relative;
  /* Rapport d'un écran de smartphone récent. Les captures du simulateur
     (1242 × 2688) en sont à 0,4 % près : `cover` rogne moins d'un pixel de
     chaque côté. Une image d'un tout autre rapport, elle, serait recadrée. */
  aspect-ratio: 1320 / 2868;
  border-radius: 36px;
  overflow: hidden;
  background-color: var(--bg-alt);
  background-image: var(
    --shot,
    radial-gradient(
      ellipse 120% 80% at 50% 0%,
      color-mix(in srgb, var(--violet) 28%, transparent),
      transparent 62%
    )
  );
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* Pastille de caméra, posée par-dessus l'écran. */
.phone__island {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 22px;
  border-radius: 999px;
  background: #0a0810;
  z-index: 2;
}

.phone figcaption {
  margin-top: 20px;
  text-align: center;
}

.phone figcaption strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.phone figcaption span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ————————————————————————————————————————————————————— Contenu */

main {
  padding-bottom: 72px;
}

section {
  padding: 24px 0;
}

h2 {
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -0.6px;
  margin: 40px 0 14px;
}

h3 {
  font-size: 18px;
  letter-spacing: -0.2px;
  margin: 32px 0 8px;
}

p,
li {
  color: var(--text-secondary);
}

p {
  margin: 0 0 16px;
  max-width: var(--measure);
}

ul {
  padding-left: 22px;
  margin: 0 0 16px;
  max-width: var(--measure);
}

li {
  margin-bottom: 8px;
}

strong {
  color: var(--text);
  font-weight: 600;
}

a {
  color: var(--accent);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ————————————————————————————————————————— En-tête de section centré

   Le reste de la page est aligné à gauche sur une colonne étroite. Centrer les
   en-têtes des sections du bas casse cette verticale et signale un changement
   de registre : on quitte l'argumentaire pour l'inventaire. */

.section-head {
  text-align: center;
  max-width: 34em;
  margin: 40px auto 0;
}

.section-head h2 {
  margin: 8px 0 12px;
}

.section-head .lede {
  font-size: 17px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ————————————————————————————————————————————————— Fonctionnalités */

.features__grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 40px;
}

.feature {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px 24px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

/* Filet coloré en haut de carte : il reprend la teinte de l'icône et relie les
   deux sans peindre tout le fond. */
.feature::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--tint),
    transparent
  );
  opacity: 0.55;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tint) 40%, var(--border));
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint) 14%, transparent);
  color: var(--tint);
}

.feature__icon svg {
  width: 23px;
  height: 23px;
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
}

.feature p {
  margin: 0;
  font-size: 15px;
  max-width: none;
}

/* ————————————————————————————————————— Les deux promesses, côte à côte */

.panels {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 48px;
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 28px;
  border-radius: 26px;
  border: 1px solid color-mix(in srgb, var(--tint) 24%, var(--border));
  background:
    radial-gradient(
      ellipse 90% 70% at 0% 0%,
      color-mix(in srgb, var(--tint) 11%, transparent),
      transparent 70%
    ),
    var(--surface);
}

.panel__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--tint) 16%, transparent);
  color: var(--tint);
}

.panel__icon svg {
  width: 24px;
  height: 24px;
}

.panel h2 {
  margin: 18px 0 10px;
  font-size: clamp(21px, 2.4vw, 25px);
}

.panel p {
  max-width: none;
}

/* Repoussé en bas de panneau pour que deux panneaux de longueurs différentes
   gardent leur note de pied alignée. */
.panel__foot {
  margin: auto 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
  color: var(--text-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 4px 0 22px;
  max-width: none;
}

.chips li {
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  color: color-mix(in srgb, var(--tint) 78%, var(--text));
  font-size: 13.5px;
  font-weight: 600;
}

/* ——————————————————————————————————————————————— Appel final */

.cta {
  margin-top: 56px;
  padding: 48px 32px;
  border-radius: 28px;
  text-align: center;
  border: 1px solid var(--border);
  background:
    radial-gradient(
      ellipse 80% 120% at 50% 0%,
      color-mix(in srgb, var(--violet) 16%, transparent),
      transparent 70%
    ),
    var(--bg-alt);
}

.cta h2 {
  margin: 0 0 10px;
}

.cta p {
  margin: 0 auto;
  max-width: 34em;
}

.stores--center {
  justify-content: center;
}

/* ————————————————————————————————————————————————— Tableaux de faits */

.facts {
  width: 100%;
  max-width: var(--measure);
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 15.5px;
}

.facts th,
.facts td {
  text-align: left;
  vertical-align: top;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.facts th {
  width: 42%;
  padding-right: 20px;
  font-weight: 600;
  color: var(--text-muted);
}

.facts td {
  color: var(--text);
}

@media (max-width: 520px) {
  .facts th {
    width: 46%;
  }
}

/* Bandeau en deux colonnes : un texte et une maquette côte à côte. */
.split {
  display: grid;
  grid-template-columns: 1fr minmax(0, 260px);
  gap: 56px;
  align-items: center;
  padding: 40px 0;
}

/* Inverser l'ordre ne suffit pas : il faut inverser les colonnes, sinon le
   texte hérite de la colonne étroite prévue pour la maquette. */
.split--reverse {
  grid-template-columns: minmax(0, 260px) 1fr;
}

.split--reverse .phone {
  order: -1;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .split--reverse {
    grid-template-columns: 1fr;
  }
  .split--reverse .phone {
    order: 0;
  }
  .split .phone {
    margin: 0 auto;
  }
}

.note {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  margin: 32px 0;
  max-width: var(--measure);
}

.note p:last-child {
  margin-bottom: 0;
}

/* Variante « avertissement » : même bandeau, mais avec le picto d'alerte posé
   à gauche du texte. Les paragraphes restent bornés par la règle globale `p`,
   donc élargir le bloc n'allonge pas les lignes. */
.note--flag {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: none;
  padding: 24px 26px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.note__icon {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}

.note__icon svg {
  display: block;
  width: 26px;
  height: 26px;
}

@media (max-width: 520px) {
  .note--flag {
    gap: 14px;
    padding: 20px;
  }
}

.meta {
  color: var(--text-muted);
  font-size: 14px;
}

dl.faq dt {
  color: var(--text);
  font-weight: 600;
  margin-top: 24px;
}

dl.faq dd {
  margin: 8px 0 0;
  color: var(--text-secondary);
  max-width: var(--measure);
}

/* ————————————————————————————————————————————————————— Pied */

footer.site {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--text-muted);
  font-size: 14px;
}

footer.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

footer.site a {
  color: var(--text-secondary);
  text-decoration: none;
}

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

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }
  /* Deux badges de 64 px tiennent à 1 px près sur un écran de 390 px : trop
     juste. À 60 px l'artwork mesure encore 40 px de haut — le minimum imposé
     par les règles d'Apple — et il reste une vraie marge. */
  .store img {
    height: 60px;
  }
}
