/* ==========================================================================
   Polices, hébergées avec le site.
   On ne passe pas par Google Fonts : chaque visite enverrait l'adresse IP
   du visiteur à Google. Les licences (OFL) sont dans le dossier fontes.
   ========================================================================== */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fontes/fraunces-latin-500-normal-6BGZRP0.woff2") format('woff2');
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fontes/fraunces-latin-600-normal-AQmZ6pP.woff2") format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fontes/plus-jakarta-sans-latin-400-normal-tDW4avw.woff2") format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fontes/plus-jakarta-sans-latin-500-normal-VfU7g6I.woff2") format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fontes/plus-jakarta-sans-latin-600-normal-KPedrvW.woff2") format('woff2');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fontes/plus-jakarta-sans-latin-700-normal-VErgjQa.woff2") format('woff2');
}

/* La police manuscrite de la signature, la même que sur les autres applis Jeedo. */
@font-face {
  font-family: 'Mrs Saint Delafield';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fontes/mrs-saint-delafield-latin-400-normal-PVm-_rK.woff2") format('woff2');
}

/* ==========================================================================
   Les couleurs, déclarées une seule fois.
   La page est sombre (l'obscur) et l'écran du téléphone, crème, l'éclaire (le clair).
   Les couleurs de l'écran sont celles de la palette « Cocon » de la maquette.
   ========================================================================== */
:root {
  /* La page */
  --nuit: #1c1816;
  --nuit-claire: #27211e;
  --lumiere: #f4efe8;
  --lumiere-douce: #d9cfc4;
  --peche: #e9b999;
  --trait-nuit: #3a322d;

  /* L'écran du téléphone (palette Cocon) */
  --fond: #f4efe8;
  --surface: #fffcf8;
  --encre: #2a2522;
  --encre-douce: #6b625b;
  --doux: #ede6dc;
  --attente-fond: #fbeadf;
  --attente: #9a4a24;
  --attente-fort: #7e3b1b;
  --fait-fond: #ddedf0;
  --fait: #22606e;
  --fait-fort: #1a4c58;
  --sarcelle: #2b7385;
  --ombre-tuile: 0 1px 2px rgb(42 37 34 / 4%), 0 10px 28px rgb(42 37 34 / 7%);

  --titre: 'Fraunces', Georgia, serif;
  --texte: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Le téléphone : l'écran fait la taille de la maquette (390 x 844), le cadre l'entoure. */
  --cadre: 14px;
  --ecran-largeur: 390px;
  --ecran-hauteur: 844px;
  --telephone-largeur: calc(var(--ecran-largeur) + 2 * var(--cadre));

  /* L'animation « au toucher de velours » : lente, qui ralentit en arrivant. */
  --velours: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

body {
  margin: 0;
  background: var(--nuit);
  color: var(--lumiere-douce);
  font-family: var(--texte);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

/* Caché à l'œil, mais lu par les lecteurs d'écran. */
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ==========================================================================
   La page
   ========================================================================== */
.page {
  max-width: 76rem;
  margin: 0 auto;
  padding: 4rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
}

.intro {
  max-width: 38rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.intro-etat {
  padding: 0.25rem 0.875rem;
  border: 1px solid var(--trait-nuit);
  border-radius: 999px;
  color: var(--peche);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-titre {
  color: var(--lumiere);
  font-family: var(--titre);
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

/* « K9 » en petit et en couleur : le nom se lit « Harry », le K9 le complète. */
.intro-k9 {
  color: var(--peche);
  font-family: var(--texte);
  font-size: 0.32em;
  font-weight: 700;
  letter-spacing: 0.06em;
  vertical-align: super;
}

.intro-sous-titre {
  color: var(--lumiere);
  font-family: var(--titre);
  font-size: 1.5rem;
  font-weight: 500;
}

/* ==========================================================================
   La scène : le téléphone et les explications
   Petit écran (par défaut) : le téléphone, puis les explications en dessous.
   ========================================================================== */
.scene {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.telephone {
  position: relative;
  flex: none;
  width: var(--telephone-largeur);
  padding: var(--cadre);
  border-radius: 56px;
  background: #0e0c0b;
  /* Le halo derrière le téléphone : l'écran éclaire la pièce sombre. */
  box-shadow:
    0 0 0 1px #3a322d,
    0 30px 80px rgb(0 0 0 / 55%),
    0 0 140px rgb(244 239 232 / 9%);
}

/* Sur un téléphone étroit, le téléphone dessiné ne tiendrait pas : on le réduit.
   zoom réduit aussi la place qu'il occupe, contrairement à transform: scale().
   Le calcul : le téléphone fait 418 px, plus 14 px de numéro qui dépasse de chaque côté,
   soit 446 px, auxquels s'ajoutent les 2 x 16 px de marge de la page.
   Chaque palier garde cet ensemble plus étroit que l'écran, jusqu'à 320 px de large. */
@media (max-width: 30rem) {
  .telephone {
    zoom: 0.82;
  }
}

@media (max-width: 25rem) {
  .telephone {
    zoom: 0.72;
  }
}

@media (max-width: 22.5rem) {
  .telephone {
    zoom: 0.62;
  }
}

/* ==========================================================================
   L'écran bento, recopié de la maquette « Accueil bento · Cocon »
   ========================================================================== */
.ecran {
  width: var(--ecran-largeur);
  height: var(--ecran-hauteur);
  padding: 24px 16px 20px;
  border-radius: 42px;
  overflow: hidden;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 15px;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.texte-doux {
  color: var(--encre-douce);
  font-size: 13px;
  font-weight: 500;
}

.texte-petit {
  font-size: 12px;
  line-height: 1.4;
}

.etiquette {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ecran-entete {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 4px;
}

.ecran-salut {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ecran-salut .texte-doux {
  font-size: 14px;
}

.ecran-maison {
  font-family: var(--titre);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}

.puce-attente {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--attente-fond);
  color: var(--attente);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.point {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* La grille bento : deux colonnes, certaines tuiles prennent toute la largeur. */
.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tuile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--ombre-tuile);
}

.tuile-large {
  grid-column: span 2;
  gap: 12px;
  border-radius: 28px;
}

.tuile-sombre {
  background: var(--encre);
  color: var(--lumiere-douce);
}

.tuile-haut {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.tuile-nom {
  font-family: var(--titre);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.05;
}

.animal {
  display: flex;
  gap: 12px;
  align-items: center;
}

.animal-texte {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.animal-nom {
  font-family: var(--titre);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* L'anneau pêche autour de l'avatar signale « en attente ». */
.avatar-anneau {
  flex: none;
  width: 54px;
  height: 54px;
  padding: 3px;
  border: 3px solid var(--peche);
  border-radius: 50%;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #d9c7b3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-petit {
  width: 44px;
  height: 44px;
}

.avatar-sauge {
  background: #c9d3c4;
}

.coche {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sarcelle);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.repas {
  display: flex;
  gap: 6px;
}

.repas-case {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: 16px;
}

.repas-valeur {
  font-size: 15px;
  font-weight: 700;
}

.repas-fait {
  background: var(--fait-fond);
  color: var(--fait);
}

.repas-fait .repas-valeur {
  color: var(--fait-fort);
}

.repas-attente {
  background: var(--attente-fond);
  color: var(--attente);
}

.repas-attente .repas-valeur {
  color: var(--attente-fort);
}

.bouton-nourri,
.bouton-question {
  border-radius: 999px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.bouton-nourri {
  height: 52px;
  background: var(--encre);
  color: var(--surface);
  font-size: 16px;
}

.bouton-question {
  grid-column: span 2;
  height: 58px;
  background: var(--doux);
  box-shadow: var(--ombre-tuile);
  font-size: 15px;
}

.chiffre-grand {
  color: var(--surface);
  font-family: var(--titre);
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
}

.chiffre-moyen {
  font-family: var(--titre);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}

.unite {
  color: var(--encre-douce);
  font-family: var(--texte);
  font-size: 14px;
}

.puce-delai {
  align-self: flex-start;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--attente-fond);
  color: var(--attente-fort);
  font-size: 11px;
  font-weight: 700;
}

.membres {
  display: flex;
  margin: 4px 0;
}

.membre {
  width: 34px;
  height: 34px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--teinte);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Une teinte par membre. Elle est réglée ici, et non dans le HTML,
   parce que la règle de sécurité CSP refuse les styles écrits dans la page. */
.membre-1 { --teinte: #d9c7b3; }
.membre-2 { --teinte: #c9d3c4; }
.membre-3 { --teinte: #e6d3c3; }
.membre-4 { --teinte: #d6cfc4; }

.membre + .membre {
  margin-left: -10px;
}

.ecran-pied {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--encre-douce);
  font-size: 12px;
}

/* ==========================================================================
   Les numéros sur le bord du téléphone
   ========================================================================== */
.reperes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.repere {
  position: absolute;
  /* --y compte depuis le haut de l'écran : on ajoute l'épaisseur du cadre. */
  top: calc(var(--cadre) + var(--y) * 1px);
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 50%;
  background: var(--peche);
  color: var(--nuit);
  font-size: 13px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
  box-shadow: 0 0 0 4px var(--nuit);
}

/* La hauteur de chaque repère, en pixels depuis le haut de l'écran du téléphone,
   et son rang dans l'ordre d'apparition des explications.
   Les numéros (sur le téléphone) et les explications (autour) partagent ces classes :
   la flèche tombe ainsi pile sur son numéro. */
.position-1 { --y: 52;  --rang: 1; }
.position-2 { --y: 264; --rang: 2; }
.position-3 { --y: 392; --rang: 3; }
.position-4 { --y: 500; --rang: 4; }
.position-5 { --y: 535; --rang: 5; }
.position-6 { --y: 663; --rang: 6; }
.position-7 { --y: 815; --rang: 7; }

/* Le numéro est à cheval sur le cadre, du côté de son explication. */
.repere-gauche {
  left: -14px;
}

.repere-droite {
  right: -14px;
}

/* ==========================================================================
   Les explications
   ========================================================================== */
.notes {
  width: 100%;
  max-width: 40rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 1.5rem 2rem;
}

.note {
  position: relative;
  padding-left: 2.5rem;
}

.note-numero {
  position: absolute;
  left: 0;
  top: 0.125rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--peche);
  color: var(--nuit);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.75rem;
  text-align: center;
}

.note-titre {
  color: var(--lumiere);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
}

.note-texte {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ==========================================================================
   Grand écran : les explications se placent autour du téléphone,
   chacune à la hauteur de ce qu'elle décrit, reliée par une flèche.
   ========================================================================== */
@media (min-width: 72rem) {
  .scene {
    /* La scène prend la hauteur du téléphone, plus de la place pour la dernière explication,
       qui descend sous le bas du téléphone : posée en absolu, elle ne pousse pas la suite. */
    height: calc(var(--ecran-hauteur) + 2 * var(--cadre) + 5rem);
    --note-largeur: 16.5rem;
    --fleche: 4.5rem;
  }

  .telephone {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
  }

  .notes {
    position: absolute;
    inset: 0;
    max-width: none;
    display: block;
  }

  .note {
    position: absolute;
    width: var(--note-largeur);
    /* Le haut de l'explication est aligné sur son numéro, moins une demi-ligne de titre. */
    top: calc(var(--cadre) + var(--y) * 1px - 0.8rem);
    padding-left: 0;
  }

  /* Le numéro est déjà sur le téléphone : inutile de le répéter à côté du texte. */
  .note-numero {
    display: none;
  }

  /* À gauche : l'explication finit à une flèche de distance du téléphone. */
  .note-gauche {
    right: calc(50% + var(--telephone-largeur) / 2 + var(--fleche));
    text-align: right;
  }

  .note-droite {
    left: calc(50% + var(--telephone-largeur) / 2 + var(--fleche));
  }

  /* La flèche : un trait qui part du texte et finit sur le numéro du téléphone. */
  .note::after {
    content: '';
    position: absolute;
    top: 0.8rem;
    width: calc(var(--fleche) - 1rem);
    height: 1px;
    background: linear-gradient(to right, transparent, var(--peche));
  }

  .note-gauche::after {
    left: calc(100% + 0.75rem);
  }

  .note-droite::after {
    right: calc(100% + 0.75rem);
    background: linear-gradient(to left, transparent, var(--peche));
  }
}

/* ==========================================================================
   Pour qui, et les principes
   ========================================================================== */
.section-titre {
  margin-bottom: 1.5rem;
  color: var(--lumiere);
  font-family: var(--titre);
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
}

.publics {
  width: 100%;
  max-width: 52rem;
}

.publics-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: 1.25rem;
}

.public {
  padding: 1.5rem;
  border: 1px solid var(--trait-nuit);
  border-radius: 1.5rem;
  background: var(--nuit-claire);
}

.public-titre {
  margin-bottom: 0.5rem;
  color: var(--lumiere);
  font-family: var(--titre);
  font-size: 1.375rem;
  font-weight: 600;
}

.public-bientot {
  margin-left: 0.5rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--trait-nuit);
  color: var(--peche);
  font-family: var(--texte);
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

.principes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

/* Des pastilles posées un peu de travers, comme des autocollants. */
.pastilles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pastilles li {
  padding: 0.375rem 1rem;
  border-radius: 999px;
  background: var(--lumiere);
  color: var(--encre);
  font-size: 0.9375rem;
  font-weight: 700;
  transform: rotate(-3deg);
}

.pastilles li:nth-child(2) {
  transform: rotate(2deg);
}

.pastilles li:nth-child(3) {
  transform: rotate(-1.5deg);
}

.principes-texte {
  max-width: 30rem;
  font-size: 0.9375rem;
}

/* La signature en bas à droite, comme sur une toile. */
.pied {
  align-self: stretch;
  display: flex;
  justify-content: flex-end;
}

.signature {
  color: var(--lumiere);
  font-family: 'Mrs Saint Delafield', cursive;
  font-size: 2.75rem;
  line-height: 1;
  text-decoration: none;
  transform: rotate(-5deg);
}

/* ==========================================================================
   Les animations, seulement si le visiteur n'a pas demandé à les réduire.
   Le téléphone apparaît doucement, puis les explications une à une (--rang).
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @keyframes apparaitre {
    from {
      opacity: 0;
      translate: 0 1.25rem;
    }
  }

  .intro,
  .telephone {
    animation: apparaitre 1.6s var(--velours) both;
  }

  .telephone {
    animation-delay: 0.3s;
  }

  .note {
    animation: apparaitre 1.4s var(--velours) both;
    animation-delay: calc(0.9s + var(--rang) * 0.18s);
  }
}
