/* Aeterran — feuille de style partagée, pages de compte
   Jetons repris de aeterran-design-system-v2.md §2. Aucune valeur
   littérale de couleur, taille ou espacement en dehors de ce fichier. */

@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces */
  --surface-void: #080C17;
  --surface-deep: #0D1425;
  --surface-panel: #141D33;
  --surface-panel-raised: #1A2440;
  --surface-inset: #0A1020;

  /* Traits */
  --line-hair: #2C3A5C;
  --line-hair-soft: #212C48;

  /* Encre */
  --ink-primary: #E8EDF7;
  --ink-dim: #8595B8;
  --ink-faint: #5B6A8C;
  --ink-on-accent: #1A1204;

  /* Accent et états */
  --accent-amber: #E0A83C;
  --accent-amber-light: #EFBA4D;
  --accent-amber-deep: #8A641D;
  --state-energy: #35D6C4;
  --state-danger: #E0526B;
  --state-success: #4FBF8B;

  /* Espacement — 6 · 8 · 10 · 12 · 14 · 18, rien d'autre */
  --space-1: 6px;
  --space-2: 8px;
  --space-3: 10px;
  --space-4: 12px;
  --space-5: 14px;
  --space-6: 18px;

  /* Coupes de coin (haut-droite / bas-gauche) */
  --cut-tuile: 12px;
  --cut-panneau: 14px;
}

/* Rayon de bordure zéro partout — l'arrondi est remplacé par le coin
   coupé. Certains navigateurs appliquent un arrondi par défaut aux
   champs et boutons ; on le retire explicitement. */
* {
  box-sizing: border-box;
  border-radius: 0;
}

html, body {
  margin: 0;
  padding: 0;
}

/* Mobile : un navigateur de téléphone agrandit parfois le texte de lui-même
   en paysage ; on le fige. Les mots plus longs que la colonne se coupent au
   lieu d'élargir la page. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-wrap: break-word;
}

/* Aucune image ne dépasse sa colonne, quelle que soit sa taille d'origine. */
img {
  max-width: 100%;
  height: auto;
}

/* Liens. Sans règle, le navigateur impose son bleu et son violet « visité »
   (#551A8B), quasi illisible sur fond sombre. Accent ambre (≈ 8,6:1 sur
   --surface-deep, AA), souligné ; « visité » reste lisible mais se distingue
   (encre atténuée). Les liens qui ont leur propre habillage (bouton, pied
   de page) le redéclarent plus bas pour les quatre états. */
a {
  color: var(--accent-amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:visited {
  color: var(--ink-dim);
}

a:hover,
a:focus {
  color: var(--accent-amber-light);
}

body {
  background: var(--surface-deep);
  color: var(--ink-primary);
  font-family: "Space Mono", monospace;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* Colonne unique, centrée, 480px maximum */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-6) var(--space-5);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* En-tête : monogramme + bandeau */
.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-5);
}

.masthead__mark {
  color: var(--ink-primary);
  width: 40px;
  height: 40px;
}

.masthead__mark svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
}

.masthead__band {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-primary);
  white-space: nowrap;
}

.masthead__band .ornament {
  color: var(--accent-amber-deep);
}

/* Panneau dominant */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface-panel-raised), var(--surface-panel));
  border: 1px solid var(--line-hair-soft);
  padding: var(--space-5) var(--space-5) var(--space-5) var(--space-5);
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut-panneau)) 0,
    100% var(--cut-panneau),
    100% 100%,
    var(--cut-panneau) 100%,
    0 calc(100% - var(--cut-panneau))
  );
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Équerre d'accent : 2px sur 16px, haut-gauche, un seul panneau dominant par écran */
.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--accent-amber);
}

.panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 16px;
  background: var(--accent-amber);
}

.panel__heading {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-primary);
  margin: 0;
}

.panel__body {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-dim);
  margin: 0;
}

.panel__body strong {
  color: var(--ink-primary);
  font-weight: 700;
}

/* Bouton d'action primaire — pleine largeur, capitales, sans icône */
.button-primary {
  appearance: none;
  border: none;
  width: 100%;
  height: 48px;
  background: linear-gradient(180deg, var(--accent-amber-light), var(--accent-amber));
  color: var(--ink-on-accent);
  font-family: "Space Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut-tuile)) 0,
    100% var(--cut-tuile),
    100% 100%,
    var(--cut-tuile) 100%,
    0 calc(100% - var(--cut-tuile))
  );
  box-shadow: 0 0 18px 0 rgba(224, 168, 60, 0.30);
}

.button-primary:disabled {
  cursor: default;
  background: #1E283F;
  color: var(--ink-faint);
  box-shadow: none;
}

.button-primary:not(:disabled):hover {
  background: linear-gradient(180deg, var(--accent-amber-light), var(--accent-amber-light));
}

/* Formulaire */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field__label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field__input {
  appearance: none;
  border: 1px solid var(--line-hair-soft);
  background: var(--surface-inset);
  color: var(--ink-primary);
  font-family: "Space Mono", monospace;
  font-size: 15px;
  height: 44px;
  padding: 0 var(--space-4);
  border-radius: 0;
}

.field__input:focus {
  outline: none;
  border-color: var(--accent-amber);
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Message d'état local (validation, erreurs) */
.notice {
  font-size: 13px;
  font-weight: 400;
  margin: 0;
}

.notice--danger {
  color: var(--state-danger);
}

.notice--wait {
  color: var(--accent-amber);
}

.notice--success {
  color: var(--state-success);
}

@media (prefers-reduced-motion: no-preference) {
  .button-primary {
    transition: background 120ms ease;
  }
}

/* Pages légales — colonne de lecture, 720px au lieu de 480 */
.page.page--wide {
  max-width: 720px;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.legal-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
  margin: 0;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.legal-section__heading {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-primary);
  margin: 0;
}

/* Vide dessiné (§7 du cahier design) : cadre en tirets, marque hachurée.
   Remplace un texte juridique tant qu'il n'a pas été rédigé et relu. */
.legal-placeholder {
  border: 1px dashed var(--line-hair);
  background:
    repeating-linear-gradient(
      135deg,
      var(--surface-inset) 0,
      var(--surface-inset) 6px,
      var(--surface-panel) 6px,
      var(--surface-panel) 12px
    );
  padding: var(--space-4);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legal-placeholder__label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--state-danger);
  margin: 0;
}

/* Pied de page — liens vers les pages légales */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /* Pas d'espace entre les lignes : chaque lien a déjà 44 px de haut, un
     « gap » vertical s'y ajoutait et espaçait les lignes de façon bancale. */
  gap: 0 var(--space-4);
  padding: var(--space-3) 0;
}

/* Cible tactile : 44 px de haut au moins, le texte restant à 11 px. */
.footer__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-2);
  font-size: 11px;
  font-weight: 400;
}

/* --ink-faint (≈ 3,4:1) n'atteint pas AA sur ce fond : encre atténuée
   (≈ 6:1), soulignée, avec les quatre états déclarés. */
a.footer__link,
a.footer__link:visited {
  color: var(--ink-dim);
  text-decoration: underline;
}

a.footer__link:hover,
a.footer__link:focus {
  color: var(--ink-primary);
  text-decoration: underline;
}

/* Ligne de version / date, sous le titre de page. */
.legal-meta {
  margin: 0 0 var(--space-6);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Listes à puces dans le corps des sections légales. */
.legal-list {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
  list-style: none;
}

.legal-list > li {
  position: relative;
  margin-bottom: var(--space-2);
  padding-left: var(--space-5);
}

/* Puce carrée, pas ronde : cohérent avec le rayon zéro du système. */
.legal-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  background: currentColor;
  opacity: 0.55;
}

.legal-list > li:last-child {
  margin-bottom: 0;
}

/* Corps de texte dans les sections : lecture longue, pas formulaire. */
.legal-section p {
  margin: 0 0 var(--space-4);
  line-height: 1.7;
  color: var(--ink-dim);
}

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

.legal-section strong {
  color: var(--ink-primary);
  font-weight: 700;
}

.legal-section a {
  color: var(--accent-amber);
}

/* Texte explicatif ajouté dans le bandeau de brouillon. Le
   .legal-placeholder__label garde son traitement d'origine ; ceci ne vise
   que le paragraphe qui le suit. */
.legal-placeholder p:not(.legal-placeholder__label) {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* Accueil — même colonne de lecture que les pages légales (page--wide). */
.home {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.hero {
  align-items: center;
  text-align: center;
}

.hero__title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
  margin: 0;
}

.hero__tagline {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-primary);
  margin: 0;
}

.hero__cta {
  width: 100%;
  max-width: 320px;
}

/* Bouton Google Play : un lien, présent seulement si le lien existe. */
.hero__cta .button-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

/* Un bouton-lien garde son encre sombre sur l'ambre, quel que soit l'état
   (sans cela, « a:visited » la rendrait claire sur fond ambre). */
a.button-primary,
a.button-primary:visited,
a.button-primary:hover,
a.button-primary:focus {
  color: var(--ink-on-accent);
  text-decoration: none;
}

.button-primary:focus-visible {
  outline: 2px solid var(--ink-on-accent);
  outline-offset: -6px;
}

.section-heading {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 var(--space-4) 0;
}

.features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  background: var(--surface-panel);
  border: 1px solid var(--line-hair-soft);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut-tuile)) 0,
    100% var(--cut-tuile),
    100% 100%,
    var(--cut-tuile) 100%,
    0 calc(100% - var(--cut-tuile))
  );
}

.feature__heading {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-amber);
  margin: 0;
}

/* Carrousel des captures (assets/carousel.js). SANS JavaScript, c'est une
   bande horizontale que l'on fait glisser : chaque diapositive se cale
   (scroll-snap) au centre. Le script ajoute les flèches (boutons « hidden »
   dans le HTML), le clavier et le défilement automatique.
   Une diapositive = une capture CENTRÉE et sa légende. Téléphone : une
   diapositive visible, capture de 460 px de haut en largeur « auto » (rapport
   540 × 960 donné par width/height : jamais la largeur native). Le conteneur
   coupe (overflow), la piste défile DANS lui : la page ne déborde jamais. */
.carousel {
  position: relative;
  max-width: 100%;
  overflow: hidden;
}

.carousel__track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  /* Pas de barre de défilement sous les captures (bureau) : on fait défiler au
     doigt, à la souris, au clavier ou avec les flèches. */
  scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: -2px;
}

.carousel__slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: 0 var(--space-2);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.carousel__slide img {
  flex: none;
  width: auto;
  max-width: none;
  height: 460px;
  border: 1px solid var(--line-hair-soft);
}

.carousel__caption {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: center;
}

/* Flèches : 44 × 44 px, posées sur les marges vides à côté de la capture. */
.carousel__btn {
  appearance: none;
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 1px solid var(--line-hair);
  background: var(--surface-panel-raised);
  color: var(--accent-amber);
  cursor: pointer;
}

/* L'attribut hidden perd contre « display: flex » ci-dessus sans cette règle. */
.carousel__btn[hidden] {
  display: none;
}

.carousel__btn--prev {
  left: 0;
}

.carousel__btn--next {
  right: 0;
}

.carousel__btn:hover {
  color: var(--accent-amber-light);
  border-color: var(--accent-amber);
}

.carousel__btn:focus-visible {
  outline: 2px solid var(--ink-primary);
  outline-offset: 2px;
}

/* Mouvement réduit : bande à glisser, sans flèches (le script ne les montre
   pas non plus), sans défilement animé. */
@media (prefers-reduced-motion: reduce) {
  .carousel__track {
    scroll-behavior: auto;
  }

  .carousel__btn {
    display: none;
  }
}

.studio {
  font-size: 13px;
  color: var(--ink-dim);
  text-align: center;
  margin: 0;
}

@media (min-width: 600px) {
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Trois diapositives visibles ; la flèche avance d'UNE diapositive. Les
     flèches sortent de la bande (marges de 52 px) au lieu de recouvrir les
     captures, et l'image se dimensionne par la largeur : 207 px au plus
     (la hauteur reste 460 px), moins si la colonne est étroite — jamais
     déformée, le rapport vient de width/height. */
  .carousel {
    padding: 0 52px;
  }

  .carousel__slide {
    flex-basis: 33.3333%;
  }

  .carousel__slide img {
    width: min(100%, 207px);
    height: auto;
  }
}

/* Sélecteur de langue du pied de page : sur sa propre ligne, centré, « Français
   · English ». Les DEUX éléments (la langue courante en texte, l'autre en lien)
   ont exactement les mêmes métriques — même police, même taille, même hauteur
   de ligne, même boîte de 44 px, même marge — sinon la ligne de base se
   décale (le lien est une boîte flex à min-height, le texte simple ne l'était
   pas : il montait). La langue courante se distingue par la graisse et la
   couleur, et n'est pas soulignée. */
.footer__lang {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer__lang-item,
.footer__lang-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  margin: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}

.footer__lang-item {
  padding: 0 var(--space-3);
}

.footer__lang-sep {
  padding: 0;
  color: var(--ink-dim);
}

.footer__lang > span[aria-current="true"] {
  color: var(--ink-primary);
  font-weight: 700;
  text-decoration: none;
}
