/* Le cadran des heures miroirs : un grand miroir rond nacré sur l'axe,
   les 1 440 minutes gravées sur son pourtour, l'heure qui s'y reflète.
   Jetons du thème seulement ; rayons par --rad. Contrastes : encre et gris
   du thème (14,2:1 et 6,9:1 sur perle), rose foncé #9A5446 en texte (5,1:1),
   rose poudre jamais en texte. */

.hm-ouv { padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.hm-chapo { margin: 0.9rem auto 0; max-width: 34em; color: var(--gris); font-size: var(--t-corps); }

/* ---------- La scène : génie | miroir | réduction ---------- */
.hm-scene { margin-top: clamp(2.2rem, 4.5svh, 3.2rem); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: clamp(2rem, 5vw, 5rem); }
.hm-aile { display: grid; gap: 0.55rem; max-width: 16rem; }
.hm-aile--g { justify-self: end; justify-items: end; text-align: right; }
.hm-aile--d { justify-self: start; justify-items: start; text-align: left; }
.hm-petit { font-size: var(--t-xs); color: var(--gris); font-weight: 400; }
.hm-valeur { font-family: var(--f-titre); font-weight: 300; font-size: var(--t-xl); line-height: 1; letter-spacing: -0.01em; }
.hm-detail { font-size: var(--t-s); color: var(--gris); line-height: 1.45; }

.hm-miroir { --d: min(52svh, 31rem, 84vw); position: relative; width: var(--d); }
.hm-miroir .glace__anneau { width: calc(var(--d) + 1.8rem); }
.hm-disque {
  --rad: var(--r-rond);
  position: relative; z-index: 1; width: var(--d); aspect-ratio: 1; border-radius: var(--rad); overflow: hidden; container-type: inline-size;
  background: radial-gradient(circle at 34% 28%, var(--blanc) 0%, var(--nacre) 36%, var(--tablette) 70%, var(--argent) 100%);
  box-shadow: inset 0 0 0 1px rgb(31 35 39 / 0.18), inset 0 6px 22px rgb(31 35 39 / 0.16);
}
.hm-disque .scene__nacre { z-index: 1; }
.hm-cadran { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; overflow: visible; cursor: crosshair; touch-action: manipulation; }
.hm-cadran:focus { outline: none; }
.hm-cadran:focus-visible { outline: none; }
.hm-miroir:has(.hm-cadran:focus-visible) .glace__anneau::after { border-color: var(--encre); border-width: 2px; }
.hm-cadran__min { fill: none; stroke: var(--gris); stroke-width: 14; opacity: 0.4; }
.hm-cadran__cinq { fill: none; stroke: var(--gris); stroke-width: 24; opacity: 0.55; }
.hm-cadran__h { fill: none; stroke: var(--encre); stroke-width: 34; opacity: 0.55; }
.hm-cadran__rem { fill: none; stroke: var(--rose-f); stroke-width: 3.2; stroke-linecap: round; }
.hm-cadran__genie { fill: var(--rose); opacity: 0.55; }
.hm-cadran__art circle { fill: var(--rose-f); }
.hm-cadran__lab text { font-family: var(--f-texte); font-size: 30px; fill: var(--gris); text-anchor: middle; dominant-baseline: central; }
.hm-cadran__point, .hm-cadran__fantome, .hm-cadran__now { transform-box: view-box; transform-origin: 500px 500px; }
.hm-cadran__point { transform: rotate(var(--a, 0deg)); transition: transform 1.1s var(--ease); }
.hm-cadran__point circle { fill: var(--encre); stroke: var(--nacre); stroke-width: 5; }
.hm-cadran__fantome { opacity: 0; transition: opacity 0.3s; }
.hm-cadran__fantome circle { fill: none; stroke: var(--encre); stroke-width: 3; }
.hm-cadran.est-survole .hm-cadran__fantome { opacity: 0.7; }
.hm-cadran__now circle { fill: var(--nacre); stroke: var(--rose-f); stroke-width: 4; }

/* L'heure et son reflet, au centre de la glace */
.hm-famille, .hm-heure, .hm-reflet { position: absolute; left: 0; right: 0; z-index: 3; text-align: center; pointer-events: none; }
.hm-famille { top: 29%; font-family: var(--f-titre); font-style: italic; font-weight: 300; font-size: clamp(0.95rem, 5.4cqi, 1.45rem); color: var(--rose-f); }
.hm-heure { top: 50%; translate: 0 -74%; font-family: var(--f-titre); font-weight: 300; font-size: 21cqi; line-height: 1; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.hm-heure output { display: inline-block; }
.hm-reflet {
  top: 50%; translate: 0 22%; font-family: var(--f-titre); font-weight: 300; font-size: 21cqi; line-height: 1; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; color: var(--argent-f);
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 35%, rgb(0 0 0 / 0.7) 100%);
  mask-image: linear-gradient(to bottom, transparent 35%, rgb(0 0 0 / 0.7) 100%);
}
.hm-survol {
  --rad: var(--r-pilule);
  position: absolute; left: 50%; bottom: -1.2rem; z-index: 4; translate: -50% 0; padding: 0.3rem 0.85rem; border-radius: var(--rad);
  background: var(--encre); color: var(--nacre); font-size: var(--t-xs); white-space: nowrap; opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.hm-survol.est-visible { opacity: 1; }

/* L'article, le champ, les voisines */
.hm-article { margin: clamp(2.2rem, 4svh, 2.8rem) auto 0; display: grid; justify-items: center; gap: 0.3rem; max-width: 34rem; min-height: 3.4rem; }
.hm-article__dans { font-size: var(--t-xs); color: var(--gris); }
.hm-article__vide { font-family: var(--f-titre); font-style: italic; font-weight: 300; font-size: var(--t-ms); color: var(--gris); }
.hm-question { width: min(34rem, calc(100% - 2 * var(--gout))); margin-top: clamp(1.2rem, 2.6svh, 1.8rem); }
.hm-question input { font-family: var(--f-titre); font-size: var(--t-ms); font-variant-numeric: tabular-nums; }
.hm-erreur { min-height: 1.4em; margin-top: 0.4rem; font-size: var(--t-s); color: var(--rose-f); }
.hm-voisines { margin-top: 0.6rem; display: flex; justify-content: center; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); }
.hm-voisines__axe { width: 1px; height: 2.4rem; background: linear-gradient(to bottom, transparent, var(--argent-f), transparent); }
.hm-voisine { --rad: var(--r-pilule); display: inline-flex; align-items: center; gap: 0.6rem; min-height: 2.9rem; padding: 0.4rem 0.9rem; border-radius: var(--rad); font-size: var(--t-s); transition: background-color 0.3s; }
.hm-voisine b { font-family: var(--f-titre); font-weight: 400; font-size: var(--t-ms); font-variant-numeric: tabular-nums; }
.hm-voisine__dit { color: var(--gris); }
@media (hover: hover) { .hm-voisine:hover { background: var(--nacre); } .hm-voisine:hover .fleche { translate: 0.2rem 0; } [data-f-prec]:hover .fleche { translate: -0.2rem 0; } }
.hm-prochaine { margin-top: 0.4rem; font-size: var(--t-s); color: var(--gris); }
.hm-prochaine[hidden] { display: none; }
.hm-prochaine button { font-weight: 500; color: var(--encre); background: linear-gradient(var(--rose-f) 0 0) left bottom / 100% 1px no-repeat; padding-block: 0.3rem; }

/* ---------- Les 50 heures : trois familles sur l'axe ---------- */
.hm-familles { padding: var(--sec) var(--gout); background: var(--nacre); border-block: 1px solid var(--filet); }
.hm-familles__grille { margin: clamp(2.5rem, 4.5vw, 3.5rem) auto 0; max-width: 74rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1fr); column-gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.hm-famille-bloc { display: grid; justify-items: center; text-align: center; gap: 0.5rem; }
.hm-famille-bloc--inversee { order: 1; padding-top: clamp(2rem, 5vw, 4rem); }
.hm-famille-bloc--doublee { order: 2; }
.hm-famille-bloc--triple { order: 3; padding-top: clamp(2rem, 5vw, 4rem); }
.hm-famille-bloc__t { font-family: var(--f-titre); font-weight: 300; font-size: var(--t-l); line-height: 1.1; }
.hm-famille-bloc__n { font-family: var(--f-texte); font-size: var(--t-s); color: var(--gris); vertical-align: 0.4em; }
.hm-famille-bloc__sous { max-width: 22em; color: var(--gris); font-size: var(--t-s); }
.hm-pastilles { margin-top: 1rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.hm-pastille {
  --rad: var(--r-pilule);
  position: relative; min-width: 4.6rem; min-height: 2.75rem; padding: 0.4rem 0.8rem; border-radius: var(--rad);
  font-family: var(--f-titre); font-size: var(--t-ms); font-variant-numeric: tabular-nums; line-height: 1;
  background: radial-gradient(circle at 34% 28%, var(--blanc), var(--nacre) 60%, var(--tablette));
  box-shadow: inset 0 0 0 1px var(--argent);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.hm-pastille--article::after { --rad: var(--r-rond); content: ''; position: absolute; left: 50%; bottom: 0.3rem; width: 0.32rem; height: 0.32rem; translate: -50% 0; border-radius: var(--rad); background: var(--rose-f); }
.hm-pastille[aria-pressed="true"] { background: var(--encre); color: var(--nacre); box-shadow: none; }
.hm-pastille[aria-pressed="true"]::after { background: var(--rose); }
@media (hover: hover) { .hm-pastille:hover { box-shadow: inset 0 0 0 1px var(--encre); } }

/* ---------- Les heures qui ont leur article ---------- */
.hm-articles { padding: var(--sec) var(--gout); }
.hm-groupe { margin: clamp(2.8rem, 5vw, 4rem) auto 0; max-width: 72rem; }
.hm-groupe__t { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 1.2rem; font-family: var(--f-titre); font-style: italic; font-weight: 300; font-size: var(--t-m); text-align: center; }
.hm-groupe__t::before, .hm-groupe__t::after { content: ''; height: 1px; }
.hm-groupe__t::before { background: linear-gradient(to left, var(--argent), transparent); }
.hm-groupe__t::after { background: linear-gradient(to right, var(--argent), transparent); }
.hm-groupe__sous { margin: 0.6rem auto 0; max-width: 34em; text-align: center; color: var(--gris); font-size: var(--t-s); }
.hm-groupe__liste { margin-top: clamp(1.6rem, 3vw, 2.2rem); display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.8rem, 3vw, 2.6rem) clamp(1rem, 2.5vw, 2rem); }
.hm-entree { width: clamp(9.5rem, 15vw, 12.5rem); }
.hm-entree__lien { display: grid; justify-items: center; text-align: center; gap: 0.35rem; }
.hm-entree__m { width: auto; min-width: 0; height: 6.6rem; margin-bottom: 0.5rem; transition: translate 0.7s var(--ease); }
.hm-entree__h { font-family: var(--f-titre); font-weight: 300; font-size: var(--t-l); line-height: 1; font-variant-numeric: tabular-nums; }
.hm-entree__t { font-size: var(--t-s); color: var(--gris); line-height: 1.4; background: linear-gradient(var(--rose-f) 0 0) center bottom / 0 1px no-repeat; transition: background-size 0.45s var(--ease); }
@media (hover: hover) { .hm-entree__lien:hover .hm-entree__m { translate: 0 -0.35rem; } .hm-entree__lien:hover .hm-entree__t { color: var(--encre); background-size: 100% 1px; } }
.hm-entree__lien:focus-visible .hm-entree__t { color: var(--encre); background-size: 100% 1px; }

/* ---------- Comment le cadran lit une heure ---------- */
.hm-lire { padding: var(--sec) var(--gout); background: var(--nacre); border-top: 1px solid var(--filet); }
.hm-lire__grille { margin: clamp(2.5rem, 4.5vw, 3.5rem) auto 0; max-width: 64rem; display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); column-gap: clamp(1.5rem, 4vw, 3.5rem); }
.hm-lire__axe { background: linear-gradient(to bottom, transparent, var(--argent) 10%, var(--argent) 90%, transparent); }
.hm-lire__col { display: grid; gap: clamp(2rem, 3.5vw, 3rem); align-content: start; }
.hm-lire__col--d { align-content: center; }
.hm-regle { display: grid; justify-items: center; text-align: center; gap: 0.8rem; }
.hm-regle__t { font-family: var(--f-titre); font-style: italic; font-weight: 300; font-size: var(--t-m); line-height: 1.2; }
.hm-regle p { max-width: 30em; color: var(--gris); font-size: var(--t-s); line-height: 1.6; }
.hm-regle p:has(.lien) { color: var(--encre); }

/* ---------- L'encart honnête : une arche ---------- */
.hm-honnete { padding: var(--sec) var(--gout); }
.hm-honnete__cadre {
  --rad: var(--r-arche);
  margin-inline: auto; width: min(44rem, 100%); padding: clamp(5rem, 9vw, 7rem) clamp(1.6rem, 5vw, 4rem) clamp(2.4rem, 4vw, 3.2rem);
  display: grid; justify-items: center; gap: 1rem; text-align: center;
  border: 1px solid var(--argent); border-radius: var(--rad); background: radial-gradient(70% 60% at 50% 20%, var(--blanc), var(--nacre));
  box-shadow: 0 0 0 8px var(--perle), 0 0 0 9px var(--argent), var(--ombre-l);
}
.hm-honnete__t { font-family: var(--f-titre); font-weight: 300; font-size: var(--t-l); line-height: 1.1; }
.hm-honnete__chiffre { font-family: var(--f-titre); font-style: italic; font-weight: 300; font-size: var(--t-m); line-height: 1.3; }
.hm-honnete__chiffre b { font-style: normal; font-weight: 400; color: var(--rose-f); }
.hm-honnete__cadre p:not([class]) { max-width: 34em; color: var(--gris); font-size: var(--t-s); line-height: 1.65; }

/* ---------- Sources ---------- */
.hm-sources { padding: 0 var(--gout) var(--sec); text-align: center; }
.hm-sources__t { font-size: var(--t-xs); color: var(--gris); font-weight: 400; }
.hm-sources__liste { margin: 0.9rem auto 0; max-width: 46rem; display: grid; gap: 0.55rem; font-size: var(--t-s); }
.hm-sources__date { margin-top: 0.9rem; font-size: var(--t-xs); color: var(--gris); }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 899px) {
  .hm-ouv.outil { display: block; }
  .hm-scene { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.2rem; row-gap: 2.2rem; }
  .hm-miroir { grid-column: 1 / -1; grid-row: 1; justify-self: center; --d: min(76vw, 46svh, 26rem); }
  .hm-aile { grid-row: 2; max-width: none; align-self: start; }
  .hm-aile--g { justify-self: end; }
  .hm-aile--d { justify-self: start; }
  .hm-valeur { font-size: var(--t-l); }
  .hm-detail { font-size: var(--t-xs); }
  .hm-survol { display: none; }
  .hm-familles__grille { grid-template-columns: 1fr; row-gap: 3rem; }
  .hm-famille-bloc--doublee { order: 1; }
  .hm-famille-bloc--inversee { order: 2; padding-top: 0; }
  .hm-famille-bloc--triple { order: 3; padding-top: 0; }
  .hm-lire__grille { grid-template-columns: 1fr; row-gap: 2.4rem; }
  .hm-lire__axe { display: none; }
  .hm-entree { width: calc(50% - 0.6rem); max-width: 12rem; }
  .hm-groupe__liste { column-gap: 1.2rem; }
}
@media (max-width: 599px) {
  .hm-question { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.1rem; padding-top: 0.6rem; }
  .hm-question .question__label { grid-column: 1 / -1; font-size: var(--t-corps); }
  .hm-question input { grid-column: 1; }
  .hm-voisines { gap: 0.4rem; }
  .hm-voisine { padding-inline: 0.5rem; flex-direction: column; gap: 0.1rem; text-align: center; }
  .hm-voisine > span:not(.fleche) { display: grid; }
  .hm-voisine .fleche { display: none; }
  .hm-voisine__dit { font-size: var(--t-xs); }
  .hm-pastille { min-width: 4.2rem; font-size: var(--t-corps); }
}

@media (prefers-reduced-motion: reduce) {
  .hm-cadran__point, .hm-entree__m, .hm-entree__t, .hm-pastille, .hm-voisine, .hm-survol, .hm-cadran__fantome { transition: none; }
}
.hm-cadran__now[hidden] { display: none; }
