/* ════════════════════════════════════════
   PROTISTA — histoire.css
   De l'animalcule au génome : frise verticale par époque,
   oculaire qui fait la mise au point au fil du défilement.
   S'appuie sur les variables de style.css (Protista).
════════════════════════════════════════ */

/* ── en-tête ── */
.hs-top { max-width: 1180px; margin: 0 auto; padding: clamp(2rem, 5vw, 3.6rem) clamp(1rem, 4vw, 3rem) 1.6rem; }
.hs-top h1 { font-family: var(--fd); font-weight: 300; font-size: clamp(2.2rem, 5.4vw, 4rem); letter-spacing: -.02em; line-height: 1.08; }
.hs-top h1 em { font-style: normal; color: var(--accent); }
.hs-top .lead { max-width: 58ch; }
.hs-chiffres { display: flex; flex-wrap: wrap; gap: 1rem 2.6rem; margin-top: 1.8rem; font-size: .82rem; letter-spacing: .06em; color: var(--ink-muted); }
.hs-chiffres b { display: block; font-family: var(--fd); font-weight: 300; font-size: 1.7rem; color: var(--accent); letter-spacing: 0; }
.hs-vide { text-align: center; font-style: italic; color: var(--ink-muted); padding: 3rem 1rem 5rem; }

/* ── filtres ── */
.hs-filtres { max-width: 1180px; margin: 0 auto; padding: .4rem clamp(1rem, 4vw, 3rem) 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.hs-filtre {
  display: inline-flex; align-items: center; gap: .45rem;
  font: inherit; font-size: .92rem; cursor: pointer;
  padding: .35rem 1rem; border-radius: 999px;
  background: var(--card); color: var(--ink-light); border: 1px solid var(--border);
  transition: border-color .2s, background .2s, color .2s;
}
.hs-filtre i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.hs-filtre:hover { border-color: var(--c, var(--accent)); }
.hs-filtre[aria-pressed="true"] { background: color-mix(in srgb, var(--c, var(--accent)) 18%, var(--card)); border-color: var(--c, var(--accent)); color: var(--ink); }
.hs-filtre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── mise en page : frise + oculaire collant ── */
.hs-wrap {
  max-width: 1180px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem) 3rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start;
}

/* ══════════ LA FRISE ══════════ */
.hs-epoque + .hs-epoque { margin-top: 3.4rem; }
.hs-epoque-tete { display: flex; gap: 1.2rem; align-items: flex-start; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.hs-epoque-num { font-family: var(--fd); font-weight: 300; font-size: 3rem; line-height: .9; color: transparent; -webkit-text-stroke: 1px rgba(53, 230, 211, .6); }
.hs-epoque-dates { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.hs-epoque-tete h2 { font-family: var(--fd); font-weight: 300; font-size: clamp(1.5rem, 3.2vw, 2.1rem); line-height: 1.15; margin: .25rem 0 .35rem; }
.hs-epoque-instr { color: var(--ink-light); }
.hs-epoque-instr b { font-family: var(--fd); font-weight: 500; font-size: .85rem; color: var(--on); background: var(--accent); padding: .1rem .5rem; border-radius: 4px; margin-right: .3rem; }
.hs-epoque-txt { margin-top: .5rem; color: var(--ink-muted); font-style: italic; max-width: 60ch; }

.hs-evts { list-style: none; position: relative; margin: 1.6rem 0 0; padding-left: 0; }
/* le fil de la frise */
.hs-evts::before { content: ""; position: absolute; left: 92px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, rgba(120, 200, 230, .5), rgba(120, 200, 230, .15)); }

.hs-evt { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0 34px; }
.hs-evt + .hs-evt { margin-top: 1.4rem; }
.hs-evt[hidden] { display: none; }
.hs-point { position: absolute; left: 87px; top: 13px; width: 11px; height: 11px; border-radius: 50%; background: var(--parch); border: 2px solid var(--c); box-shadow: 0 0 10px var(--c); }
.hs-annee { font-family: var(--fd); font-weight: 300; font-size: 1.35rem; color: var(--c); text-align: right; padding-top: .3rem; line-height: 1.1; }
.hs-annee small { display: block; font-size: .7rem; color: var(--ink-muted); }

.hs-carte {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .01)), var(--card);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 1.1rem 1.3rem 1.2rem;
  transition: border-color .25s, transform .25s;
}
.hs-carte::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.hs-evt:hover .hs-carte { border-color: color-mix(in srgb, var(--c) 60%, transparent); transform: translateX(3px); }
.hs-cat { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--c); }
.hs-carte h3 { font-family: var(--fd); font-weight: 300; font-size: 1.18rem; line-height: 1.25; margin: .3rem 0 .15rem; }
.hs-qui { font-style: italic; color: var(--ink-muted); }
.hs-resume { margin-top: .55rem; color: var(--ink-light); line-height: 1.6; }
.hs-suite { margin-top: .6rem; }
.hs-suite summary { cursor: pointer; color: var(--accent); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; list-style: none; }
.hs-suite summary::-webkit-details-marker { display: none; }
.hs-suite summary::after { content: " +"; }
.hs-suite[open] summary::after { content: " −"; }
.hs-suite p { margin-top: .7rem; color: var(--ink-light); line-height: 1.65; }
.hs-liens { margin-top: .8rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: baseline; }
.hs-liens a { color: var(--accent); text-decoration: none; font-size: .92rem; border-bottom: 1px solid rgba(53, 230, 211, .35); }
.hs-liens .hs-source { font-size: .8rem; color: var(--ink-muted); border-bottom-color: var(--border); }
.hs-aucun { font-style: italic; color: var(--ink-muted); padding: 2rem 0; }

/* ══════════ L'OCULAIRE ══════════ */
.hs-oculaire { position: sticky; top: 96px; text-align: center; }
.hs-champ {
  width: 260px; height: 260px; margin: 0 auto; border-radius: 50%;
  box-shadow: 0 0 0 10px #091b2d, 0 0 0 11px #24566f, 0 0 0 22px #0b2036, 0 0 0 23px rgba(120, 200, 230, .22), 0 0 70px rgba(53, 230, 211, .25);
  --flou: 5px; --zoom: .55;
}
.hs-champ svg { width: 100%; height: 100%; display: block; }
.hs-org { transform-box: view-box; transform-origin: 100px 100px; transform: scale(var(--zoom)); filter: blur(var(--flou)); transition: transform .9s cubic-bezier(.3, .7, .2, 1), filter .9s; }
.hs-corps { fill: rgba(53, 230, 211, .22); stroke: rgba(127, 245, 232, .7); stroke-width: 1.4; }
.hs-champ .n2, .hs-champ .n3, .hs-champ .n4, .hs-champ .n5 { opacity: 0; transition: opacity .8s; }
/* chaque époque ajoute des détails et affine l'image */
.hs-champ[data-niveau="2"] { --flou: 2.2px; --zoom: .75; }
.hs-champ[data-niveau="3"] { --flou: .6px; --zoom: .9; }
.hs-champ[data-niveau="4"] { --flou: 0px; --zoom: 1.22; }
.hs-champ[data-niveau="5"] { --flou: 0px; --zoom: 1.22; }
.hs-champ:is([data-niveau="2"], [data-niveau="3"], [data-niveau="4"], [data-niveau="5"]) .n2 { opacity: 1; }
.hs-champ:is([data-niveau="3"], [data-niveau="4"], [data-niveau="5"]) .n3 { opacity: 1; }
.hs-champ:is([data-niveau="4"], [data-niveau="5"]) .n4 { opacity: 1; }
.hs-champ[data-niveau="5"] .hs-org { opacity: .45; }
.hs-champ[data-niveau="5"] .n5 { opacity: 1; }
.hs-champ .n5 > path { stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 1.6s ease; }
.hs-champ[data-niveau="5"] .n5 > path { stroke-dashoffset: 0; }

.hs-zoom { margin-top: 2.2rem; font-family: var(--fd); font-weight: 500; font-size: 2rem; color: var(--accent); letter-spacing: -.01em; transition: opacity .3s; }
.hs-instr { color: var(--ink-light); font-style: italic; min-height: 1.6em; }
.hs-molette { position: relative; height: 4px; margin: 1.2rem auto 0; width: 200px; border-radius: 4px; background: rgba(120, 200, 230, .15); overflow: hidden; }
.hs-molette span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 4px; }
.hs-epoques-mini { list-style: none; margin: 1.2rem auto 0; padding: 0; width: 220px; text-align: left; font-size: .9rem; }
.hs-epoques-mini li { padding: .25rem 0 .25rem 1rem; position: relative; color: var(--ink-muted); transition: color .3s; }
.hs-epoques-mini li::before { content: ""; position: absolute; left: 0; top: .72rem; width: 6px; height: 6px; border-radius: 50%; background: rgba(120, 200, 230, .3); transition: background .3s, box-shadow .3s; }
.hs-epoques-mini li.on { color: var(--ink); }
.hs-epoques-mini li.on::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.hs-fin { max-width: 70ch; margin: 1rem auto 0; padding: 0 1.4rem 4.5rem; text-align: center; font-style: italic; color: var(--ink-muted); }
.hs-fin a { color: var(--accent); }

/* ══════════ ÉCRANS ══════════ */
@media (min-width: 1500px) {
  .hs-wrap, .hs-top, .hs-filtres { max-width: 1320px; }
  .hs-wrap { grid-template-columns: minmax(0, 1fr) 360px; }
  .hs-champ { width: 310px; height: 310px; }
}
/* tablette et téléphone : l'oculaire devient un petit bandeau collé sous la nav */
@media (max-width: 900px) {
  .hs-wrap { grid-template-columns: 1fr; gap: 0; }
  .hs-oculaire {
    order: -1; top: 64px; z-index: 50;
    display: flex; align-items: center; gap: .9rem; text-align: left;
    margin: 0 calc(-1 * clamp(1rem, 4vw, 3rem)) 1.4rem; padding: .6rem clamp(1rem, 4vw, 3rem);
    background: rgba(6, 16, 29, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border);
  }
  .hs-champ { width: 54px; height: 54px; margin: 0; flex: 0 0 auto; box-shadow: 0 0 0 3px #091b2d, 0 0 0 4px #24566f, 0 0 18px rgba(53, 230, 211, .25); }
  .hs-zoom { margin: 0; font-size: 1.15rem; }
  .hs-instr { font-size: .92rem; min-height: 0; }
  .hs-molette { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 2px; margin: 0; border-radius: 0; }
  .hs-epoques-mini { display: none; }
}
@media (max-width: 600px) {
  .hs-evts::before { left: 9px; }
  .hs-evt { grid-template-columns: 1fr; gap: .3rem; padding-left: 30px; }
  .hs-point { left: 4px; top: 6px; }
  .hs-annee { text-align: left; padding-top: 0; font-size: 1.1rem; }
  .hs-annee small { display: inline; margin-left: .2rem; }
  .hs-epoque-num { font-size: 2.2rem; }
}
