/* ==========================================================================
   DISCIPLINE — /histoire · « La Maison »
   Styles propres à la page. Réutilise les classes de main.css.
   SOMMAIRE
    1. Héros (façade de temple construite pierre à pierre)
    2. Rail de chapitres
    3. Bandeau de devises
    4. En-têtes de chapitre & texte courant
    5. Chapitre I — Disciplina (monnaie)
    6. Chapitre II — Bâtisseurs
    7. Chapitre III — Naissance de la maison
    8. Chapitre IV — Préceptes
    9. Chapitre V — Valeurs
   10. Conclusion
   ========================================================================== */

/* ---------- 1. HÉROS ---------- */
.h-hero {
  --hero-top: calc(var(--announce-h) + var(--header-h));
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-block: calc(var(--hero-top) + clamp(32px, 6vh, 80px)) 0;
  background-color: var(--ink);
}
.h-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.h-hero__temple {
  position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%);
  /* le temple entier tient sous l'en-tête : son fronton n'est plus rogné (hauteur bornée par celle du héros, largeur déduite du rapport du SVG) */
  height: min(calc(min(1560px, 150vw) * 1183 / 1600), calc(100% - var(--hero-top) - 12px)); aspect-ratio: 1600 / 1183; width: auto;
  --decor: var(--decor-soft);              /* « pierre » : aplat opaque sous le titre, texte lisible */
}
.h-hero__temple svg { display: block; width: 100%; height: 100%; }
.h-hero__temple > div { width: 100%; height: 100%; }
.h-hero__veil { display: none; }
.h-hero__inner { position: relative; display: grid; gap: clamp(16px, 2.4vw, 32px); padding-bottom: clamp(48px, 9vh, 112px); }
/* taille : h1.page-title--showcase (main.css) ; l'ancienne surcharge de taille était sans effet (spécificité) et a été retirée */
.h-hero__title { max-width: 17.25em; }
.h-hero__title em { color: var(--gold-light); }
.h-hero__lead { max-width: 40rem; color: rgba(243, 239, 231, 0.86); font-size: clamp(1rem, 0.78rem + 0.55vw, 1.1875rem); }

.h-hero__base { position: relative; background: var(--ink); }   /* socle plein : les chapitres reposent sur un aplat, devant la base du temple */
.h-hero__chapters { position: relative; padding-block: 0 clamp(20px, 3vh, 36px); }
.h-hero__list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.h-hero__list a { display: grid; gap: 6px; min-width: 44px; min-height: 44px; padding: 18px 16px 4px 0; transition: color var(--dur-2) var(--ease); }
.h-hero__num { font: 900 1.375rem/1 var(--font-sans); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: var(--gold-light); transition: transform var(--dur-2) var(--ease); }
.h-hero__name { font: 600 0.7rem/1.4 var(--font-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-dark); transition: color var(--dur-2) var(--ease); }
.h-hero__list a:hover .h-hero__name, .h-hero__list a:focus-visible .h-hero__name { color: var(--marble); }
.h-hero__list a:hover .h-hero__num, .h-hero__list a:focus-visible .h-hero__num { transform: translateX(6px); }
@media (max-width: 760px) {
  .h-hero__list { grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 8px; }
  .h-hero__name { display: none; }
  .h-hero__list a { padding-right: 0; justify-items: center; justify-content: center; }
}

/* ---------- 2. RAIL DE CHAPITRES ----------
   Pastille pleine (socle de pierre), repère d'or unique qui glisse d'un chapitre à l'autre. */
.h-rail { position: fixed; z-index: var(--z-sticky); right: clamp(10px, 1vw, 18px); top: 50%; transform: translate(14px, -50%); opacity: 0; pointer-events: none; visibility: hidden; transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease), visibility 0s linear var(--dur-3); display: none; }
/* masqué = hors de l'ordre de tabulation (visibility), la sortie attend la fin du fondu */
.h-rail.is-visible { opacity: 1; transform: translate(0, -50%); pointer-events: auto; visibility: visible; transition-delay: 0s; }
.h-rail ol { position: relative; list-style: none; padding: 5px; display: grid; gap: 2px; background: var(--ink); border-radius: 999px; box-shadow: 0 0 0 4px var(--decor-soft); --k: 0; }
.h-rail a { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted-dark); transition: color var(--dur-2) var(--ease); }
.h-rail__num { font: 500 0.66rem/1 var(--font-engraved); letter-spacing: 0.04em; }
.h-rail a:hover { color: var(--marble); }
.h-rail a[aria-current='true'] { color: var(--ink); }
.h-rail__mark { position: absolute; left: 5px; top: 5px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); pointer-events: none; opacity: 0; transform: translateY(calc(var(--k) * 32px)); transition: transform 560ms var(--ease-out), opacity var(--dur-2) var(--ease); }
.h-rail ol.has-current .h-rail__mark { opacity: 1; }
@media (min-width: 1280px) { .h-rail { display: block; } }

/* ---------- 3. BANDEAU DE DEVISES ---------- */
.h-motto { background: var(--ink); color: var(--gold-light); box-shadow: inset 0 5px 0 var(--decor-soft), inset 0 -5px 0 var(--decor-soft); padding-block: 22px; --accent-line: var(--gold); }
.h-motto .marquee--caps .marquee__item { font-size: 0.7rem; line-height: 2; }
.h-motto .marquee { --marquee-gap: clamp(28px, 4vw, 56px); }

/* ---------- 4. EN-TÊTES & TEXTE ---------- */
.h-work__year, .h-value__num, .h-hero__num, .h-head__num { font-variant-numeric: tabular-nums; }
.h-head { position: relative; display: grid; gap: var(--space-4); justify-items: start; margin-bottom: clamp(28px, 4vw, 56px); }
/* chiffre géant : aplat plein en teinte pierre (docs/da/GRAMMAIRE.md §8) ; il se compte en chiffres romains à l'apparition */
.h-head__num { display: block; margin-bottom: -0.1em; font-size: clamp(4.25rem, 8.6vw, 7.8125rem); color: color-mix(in srgb, var(--decor) 15%, var(--bg)); opacity: 1; }
.h-head__title { max-width: 18em; }
.h-head__sub { font: 600 clamp(1.0625rem, 0.86rem + 0.78vw, 1.5rem)/1.3 var(--font-sans); color: var(--accent); }
.h-head--wide { margin-bottom: clamp(40px, 6vw, 88px); }

.h-prose { max-width: 36rem; display: grid; gap: 1.25em; font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem); }
.h-prose > p + p { margin-top: 0; }
.h-prose strong { font-weight: 600; }
/* lettrine : celle de main.css (900, 5,9em = trois lignes à l'interligne 1,65 du texte courant) ; les paragraphes sont des éléments de grille, ils contiennent déjà le flottant */
/* Chapitre III : paragraphe de deux lignes sur grand écran, la lettrine en épouse la hauteur ((1 × 1,65 + 0,66) / 0,66 = 3,5em) */
.h-birth__text .dropcap::first-letter { font-size: 3.5em; }


/* ---------- 5. CHAPITRE I — DISCIPLINA ---------- */
.h-chap__grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 1000px) {
  .h-chap__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(48px, 7vw, 112px); }
}
.h-coin { margin: 0; display: grid; justify-items: center; text-align: center; }
/* La monnaie : un vrai disque (deux faces et une tranche de huit anneaux) qui fait UNE révolution lente
   pendant que la section traverse l'écran (rotation liée au défilement, CSS natif) ; statique ailleurs. */
.h-coin__stage { --coin-t: clamp(10px, 2.4vw, 16px); width: min(100%, 520px); aspect-ratio: 1; position: relative; perspective: 1500px; }
.h-coin__body { position: absolute; inset: 0; transform-style: preserve-3d; }
.h-coin__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.h-coin__face svg { display: block; width: 100%; height: 100%; }
.h-coin__face--front { transform: translateZ(calc(var(--coin-t) / 2)); }
.h-coin__face--back { transform: translateZ(calc(var(--coin-t) / -2)) rotateY(180deg); }
.h-coin__edge { position: absolute; inset: 0; border-radius: 50%; border: 9px solid var(--decor); box-sizing: border-box; transform: translateZ(calc(var(--coin-t) * (var(--k) / 7 - 0.5))); pointer-events: none; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes h-coin-turn { from { rotate: 0 1 0 -360deg; } to { rotate: 0 1 0 0deg; } }
    .h-coin__stage { view-timeline: --h-coin block; }
    .h-coin__body { animation: h-coin-turn cubic-bezier(0.45, 0, 0.35, 1) both; animation-timeline: --h-coin; animation-range: cover 14% cover 62%; }
  }
}

/* ---------- 6. CHAPITRE II — BÂTISSEURS ---------- */
.h-chap--build { overflow: clip; }
.h-build__column { position: absolute; right: clamp(-90px, -3vw, -16px); bottom: -4%; height: 92%; width: auto; aspect-ratio: 195 / 982.7; max-width: none; --decor: var(--decor-soft); opacity: 1; pointer-events: none; z-index: 0; }
@media (max-width: 700px) { .h-build__column { height: 44%; right: -36px; } }   /* étroite et basse : elle ne traverse plus les blocs de texte */
.h-build__column svg { display: block; width: 100%; height: 100%; }
.h-chap--build > .container { position: relative; z-index: 1; }
.h-build__head { margin-bottom: clamp(32px, 4vw, 56px); }
.h-works { position: relative; list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule); }
@media (min-width: 640px) { .h-works { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .h-works { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.h-work { display: grid; align-content: start; gap: 10px; padding: clamp(24px, 3vw, 40px) clamp(16px, 2vw, 32px) clamp(24px, 3vw, 40px) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .h-work:nth-child(even) { padding-left: clamp(16px, 2vw, 32px); border-left: 1px solid var(--rule); } }
@media (min-width: 1100px) {
  .h-work { border-bottom: 0; }
  .h-work + .h-work { padding-left: clamp(16px, 2vw, 32px); border-left: 1px solid var(--rule); }
}
.h-work__date { display: grid; gap: 8px; align-content: start; margin-bottom: 8px; }
.h-work__year { font: 900 clamp(3.0625rem, 4.7vw, 4.6875rem)/1 var(--font-sans); letter-spacing: var(--brut-track-xl); font-variant-numeric: tabular-nums; color: var(--gold-light); }
.h-work__era { font: 600 0.7rem/1.4 var(--font-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-dark); }
.h-work__title { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); letter-spacing: 0.14em; }
.h-work__txt { color: rgba(243, 239, 231, 0.84); max-width: 17rem; }

/* Frise : sur grand écran, une poutre pleine se remplit au défilement et chaque date s'allume à son passage (CSS natif ; sans prise en charge, tout est allumé) */
@media (min-width: 1100px) {
  .h-works { border-top: 0; padding-top: 6px; }
  .h-works::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--decor-soft); }
  .h-work::before { content: ''; position: absolute; left: 0; top: -9px; width: 12px; height: 12px; background: var(--gold); transform: rotate(45deg); }
  .h-work + .h-work::before { left: clamp(16px, 2vw, 32px); }
  .h-works::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--decor); transform-origin: left center; }
  .h-work { position: relative; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 1100px) {
    @keyframes h-beam { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    @keyframes h-lit { from { opacity: 0.3; } to { opacity: 1; } }
    @keyframes h-node { from { transform: rotate(45deg) scale(0); } to { transform: rotate(45deg) scale(1); } }
    .h-works { view-timeline: --h-works block; }
    .h-works::after { animation: h-beam linear both; animation-timeline: --h-works; animation-range: cover 10% cover 58%; }
    .h-work { --lit-a: calc(10% + 12% * var(--n, 0)); }
    .h-work:nth-child(2) { --n: 1; } .h-work:nth-child(3) { --n: 2; } .h-work:nth-child(4) { --n: 3; }
    .h-work__date { animation: h-lit linear both; animation-timeline: --h-works; animation-range: cover var(--lit-a) cover calc(var(--lit-a) + 9%); }
    .h-work::before { animation: h-node linear both; animation-timeline: --h-works; animation-range: cover var(--lit-a) cover calc(var(--lit-a) + 7%); }
  }
}

.h-triad { margin-top: clamp(40px, 6vw, 80px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 48px; padding-top: clamp(24px, 3.4vw, 40px); border-top: 1px solid var(--rule); }
.h-triad__list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 20px clamp(20px, 4vw, 56px); }
.h-triad__list li { display: grid; gap: 4px; }
.h-triad__list li + li { padding-left: clamp(20px, 4vw, 56px); border-left: 1px solid var(--rule); }
@media (max-width: 560px) { .h-triad__list li + li { padding-left: 0; border-left: 0; } }
.h-triad__word { font: 600 clamp(0.9rem, 0.8rem + 0.5vw, 1.15rem)/1.2 var(--font-caps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-light); }
.h-triad__fr { font: 600 0.875rem/1.3 var(--font-sans); color: var(--muted-dark); }

/* ---------- 7. CHAPITRE III — NAISSANCE ---------- */
.h-birth__grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 1000px) {
  .h-birth__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(56px, 8vw, 128px); }
}
.h-birth__visual { padding: 12px; width: min(100%, 300px); justify-self: center; }
@media (min-width: 1000px) { .h-birth__visual { width: min(100%, 440px); padding: 14px; } }
.h-birth__arch { background: var(--basalt); }
.h-birth__arch-in { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: clamp(20px, 4vw, 36px); padding: 12%; }
.h-birth__emblem { --logo-w: clamp(150px, 15vw, 230px); color: var(--marble); }
.h-birth__text .h-head { margin-bottom: 28px; }

/* ---------- 8. CHAPITRE IV — PRÉCEPTES ---------- */
.h-chap--precepts { background-color: var(--ink); }
/* Titre du chapitre (.display-1) : un cran sous le h1 de la page, au-dessus des autres titres de chapitre (.display-2) */
.h-chap--precepts .h-head__title { font-size: clamp(2.125rem, 4.4vw, 4.375rem); }
.h-precepts { list-style: none; padding: 0; counter-reset: precept; }
.h-precept {
  display: grid; grid-template-columns: 1fr; gap: 10px 40px; align-items: baseline;
  padding-block: clamp(24px, 3vw, 44px); border-top: 1px solid var(--rule);
  transition: opacity var(--dur-3) var(--ease), border-color var(--dur-2);
}
.h-precept:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .h-precept { grid-template-columns: 70px minmax(0, 1.7fr) minmax(0, 1fr); } }
.h-precept__num { font: 900 clamp(1.125rem, 0.9rem + 0.75vw, 1.625rem)/1 var(--font-sans); letter-spacing: 0.02em; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.h-precept__latin {
  font: 900 clamp(1.5625rem, 0.62rem + 2.6vw, 2.875rem)/1.04 var(--font-sans); letter-spacing: var(--brut-track-l); text-transform: uppercase; color: var(--marble);
  transition: color var(--dur-2) var(--ease), transform var(--dur-3) var(--ease);
  text-wrap: balance;
}
.h-precept__fr { font: 600 clamp(0.875rem, 0.78rem + 0.39vw, 1.0625rem)/1.3 var(--font-sans); letter-spacing: 0; color: var(--muted-dark); }
/* Les préceptes s'allument l'un après l'autre : celui qui traverse le milieu de l'écran est à pleine lumière (CSS natif) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes h-engrave { 0%, 100% { opacity: 0.62; } 36%, 64% { opacity: 1; } }
    @keyframes h-engrave-x { 0%, 100% { translate: 0 0; } 36%, 64% { translate: 14px 0; } }
    .h-precept__latin, .h-precept__num { animation: h-engrave linear both; animation-timeline: view(); animation-range: cover 4% cover 96%; }
    .h-precept__latin { animation-name: h-engrave, h-engrave-x; }
  }
}
@media (hover: hover) and (min-width: 900px) {
  .h-precept:hover .h-precept__latin { color: var(--gold-light); }
}
/* sans lumière liée au défilement : le survol seul allume un précepte (sinon les deux effets se cumuleraient) */
@supports not (animation-timeline: view()) {
  @media (hover: hover) and (min-width: 900px) {
    .h-precepts:hover .h-precept:not(:hover) { opacity: 0.55; }
    .h-precept:hover .h-precept__latin { transform: translateX(14px); }
  }
}

/* ---------- 9. CHAPITRE V — VALEURS ---------- */
.h-values { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }
@media (max-width: 1000px) { .h-values { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .h-values { grid-template-columns: 1fr; } }
.h-value {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: clamp(24px, 2.6vw, 36px);
  background: color-mix(in srgb, var(--ink) 6%, var(--marble)); border-radius: var(--radius-sm);   /* carte en aplat de pierre, sans filet doré */
  transition: background-color var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease), transform var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.h-value::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-3) var(--ease); }
.h-value__num { font: 900 2.625rem/1 var(--font-sans); letter-spacing: var(--brut-track-l); font-variant-numeric: tabular-nums; color: var(--accent-line); transition: color var(--dur-2); }
.h-value__name { margin-top: 6px; font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem); letter-spacing: 0.16em; }
.h-value__gloss { font: 600 1rem/1.3 var(--font-sans); color: var(--accent); transition: color var(--dur-2); }
.h-value__def { margin-top: 6px; color: var(--fg); }
@media (hover: hover) {
  .h-value:hover, .h-value:focus-within {
    background: var(--basalt); border-color: var(--basalt); transform: translateY(-4px); box-shadow: var(--shadow-3);
    --fg: var(--marble); --fg-muted: var(--muted-dark); --accent: var(--gold-light); --rule: rgba(217, 192, 138, 0.28); color: var(--marble);
  }
  .h-value:hover::before, .h-value:focus-within::before { transform: scaleX(1); }
}

/* ---------- 10. CONCLUSION ---------- */
.h-end { padding-bottom: clamp(72px, 9vw, 140px); }
.h-end .divider--laurel { width: min(260px, 60%); margin-inline: auto; margin-bottom: var(--space-7); }

@media (max-width: 560px) {
  .h-end .cluster { flex-direction: column; align-items: stretch; width: min(100%, 360px); margin-inline: auto; }
}
@media (max-width: 700px) {
  .h-hero { justify-content: flex-start; }
  .h-hero__temple { bottom: auto; top: calc(var(--hero-top) + 4px); width: 165vw; height: auto; opacity: 0.7; }
  .h-hero__temple svg, .h-hero__temple > div { height: auto; }
  .h-hero__inner { margin-top: auto; padding-top: clamp(210px, 52vw, 300px); }
  .h-hero__veil { background: linear-gradient(180deg, rgba(15, 14, 12, 0.35), rgba(15, 14, 12, 0) 30%, rgba(15, 14, 12, 0.55) 52%, rgba(15, 14, 12, 0.94) 72%); }
}
