/* ════════════════════════════════════════
   PROTISTA — style.css
   Le microscope interactif
════════════════════════════════════════ */

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

:root {
  --parch: #06101d;
  --parch-dark: #0e2035;
  --ink: #d9ebf3;
  --ink-light: #b3cfdc;
  --ink-muted: #86a4b8;
  --accent: #35e6d3;
  --accent-dark: #7ff5e8;
  --accent-light: #0f3a44;
  --danger: #d3327a;
  --danger-light: #ffd3e6;
  --gold: #ff4d9d;
  --gold-light: #4a1a36;
  --border: rgba(120, 200, 230, 0.22);
  --card: #081a2c;
  --on: #04121a;
  --fd: 'Unbounded', system-ui, sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'EB Garamond', Georgia, serif;
  background: radial-gradient(800px 500px at 82% 12%, #0a2a44 0, transparent 70%), radial-gradient(600px 400px at 0 75%, #1a0c2e 0, transparent 70%), var(--parch);
  color: var(--ink);
}

/* NAVIGATION */
nav {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem 1.6rem;
  padding: 1.1rem 3rem; border-bottom: 1px solid var(--border);
  background: rgba(6,16,29,.85); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 200;
}
.nav-logo { font-family: var(--fd); font-weight: 300; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.nav-logo em { color: var(--accent); font-style: normal; }
.nav-links { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; list-style: none; }
.nav-links a { font-size: .92rem; color: var(--ink-light); text-decoration: none; letter-spacing: .05em; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--accent); }
.hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s ease, opacity .3s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* HAUT DE PAGE + RECHERCHE */
.pr-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.4rem 2.4rem; padding: clamp(1.6rem,4vw,3rem) clamp(1rem,4vw,3rem) 1.6rem; }
.pr-top h1 { font-family: var(--fd); font-weight: 300; font-size: clamp(2.2rem,5vw,3.8rem); letter-spacing: -.02em; line-height: 1.1; }
.pr-top .lead { margin: .8rem 0 0; }
.hero-tag { display: inline-block; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-light); padding: .3rem 1rem; margin-bottom: 1.6rem; }
.lead { max-width: 44ch; font-size: 1.05rem; font-style: italic; color: var(--ink-muted); line-height: 1.6; margin: 1.2rem 0 0; }
.search-wrap { flex: 1 1 320px; max-width: 480px; display: flex; border: 1px solid var(--border); background: var(--card); box-shadow: 0 2px 16px rgba(0,0,0,.3); }
.search-wrap input { flex: 1; min-width: 0; border: none; background: transparent; padding: .95rem 1.1rem; font-family: 'EB Garamond', serif; font-size: 1.05rem; color: var(--ink); outline: none; }
.search-wrap input::placeholder { color: var(--ink-muted); font-style: italic; }
.search-wrap button { background: var(--accent); border: none; color: var(--on); padding: 0 1.6rem; font-family: 'EB Garamond', serif; font-size: .88rem; letter-spacing: .1em; cursor: pointer; transition: background .2s; }
.search-wrap button:hover { background: var(--accent-dark); }

/* LABORATOIRE — plateau de lames + microscope + panneau */
.pr-lab { display: grid; grid-template-columns: 250px minmax(0,1fr) 330px; gap: 2rem; align-items: start; padding: 1rem clamp(1rem,4vw,3rem) 3rem; }
.tray { display: flex; flex-direction: column; gap: .7rem; }
.slide {
  display: flex; align-items: stretch; text-align: left; color: var(--ink); width: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  border: 1px solid rgba(160,220,240,.28); border-radius: 4px; padding: 0; cursor: pointer; overflow: hidden;
  transition: transform .2s, border-color .2s, background .2s; font: inherit;
}
.slide:hover { border-color: var(--c); }
.slide .lab { width: 16px; flex-shrink: 0; background: var(--c); }
.slide .t { padding: .6rem .9rem; }
.slide b { display: block; font-family: var(--fd); font-weight: 300; font-size: .9rem; line-height: 1.25; }
.slide em { font-size: .82rem; color: var(--ink-muted); }
.slide[aria-pressed="true"] { transform: translateX(8px); border-color: var(--c); background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.03)); }

.scope-lg { position: relative; width: min(100%,540px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #0e405a 0, #07233a 55%, #030f1c 100%);
  box-shadow: 0 0 0 10px #091b2d, 0 0 0 11px #24566f, 0 0 80px rgba(53,230,211,.28); }
.scope-lg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
#orgG { transform-box: fill-box; transform-origin: center; }
#orgG.pop { animation: pop .55s cubic-bezier(.2,.9,.3,1); }
@keyframes pop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }

.mag { display: flex; align-items: center; gap: 1rem; max-width: 540px; margin: 1.6rem auto 0; color: var(--ink-muted); font-size: .98rem; }
.mag input { flex: 1; accent-color: var(--accent); min-width: 0; }
.mag output { min-width: 3.6rem; text-align: right; color: var(--accent); font-family: var(--fd); font-size: .9rem; }

.panel { border: 1px solid var(--border); background: var(--card); border-radius: 22px; padding: 1.6rem; }
.panel .tg { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--c); }
.panel h2 { font-family: var(--fd); font-weight: 300; font-size: 1.5rem; line-height: 1.2; margin: .5rem 0 .2rem; }
.panel .lat { font-style: italic; color: var(--ink-muted); font-size: .95rem; }
.panel p { margin-top: 1rem; color: var(--ink-light); }
.panel .ex { margin: 1.1rem 0 0; list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; }
.panel .ex li { font-size: .86rem; font-style: italic; padding: .18rem .8rem; border: 1px solid var(--c); border-radius: 999px; color: var(--ink); }
.panel .pn { margin-top: 1.4rem; font-size: .84rem; letter-spacing: .06em; color: var(--ink-muted); }
.panel .pn b { font-family: var(--fd); font-weight: 300; font-size: 1.6rem; color: var(--c); margin-right: .4rem; letter-spacing: 0; }
.panel .warn { margin-top: 1.1rem; padding: .7rem .9rem; border-left: 3px solid #ff4d9d; background: rgba(255,77,157,.08); font-size: .95rem; color: #ffc4de; }
.panel a { display: inline-block; margin-top: 1.3rem; color: var(--accent); text-decoration: none; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid rgba(53,230,211,.4); padding-bottom: .15rem; }

/* HISTOIRE DE LA MICROSCOPIE */
.pr-hist { max-width: 1080px; margin: 0 auto; padding: 4.5rem clamp(1rem,4vw,2rem) 0; }
.pr-hist h2 { font-family: var(--fd); font-weight: 300; font-size: clamp(1.7rem,3.6vw,2.4rem); text-align: center; }
.pr-hist > p { text-align: center; color: var(--ink-muted); margin: .6rem 0 3rem; }
.tl { position: relative; display: grid; grid-template-columns: repeat(5,1fr); gap: .8rem; }
.tl::before { content: ""; position: absolute; top: 9px; left: 4%; right: 4%; height: 1px; background: linear-gradient(90deg,transparent,rgba(120,200,230,.5) 8%,rgba(120,200,230,.5) 92%,transparent); }
.tl > div { position: relative; text-align: center; padding-top: 1.6rem; }
.tl > div::before { content: ""; position: absolute; top: 0; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tl b { display: block; font-family: var(--fd); font-weight: 300; color: var(--accent); font-size: 1.15rem; }
.tl span { display: block; margin-top: .35rem; font-size: .86rem; color: var(--ink-muted); line-height: 1.35; }
@media (max-width: 700px) { .tl { grid-template-columns: repeat(2,1fr); row-gap: 1.6rem; } .tl::before { display: none; } }

/* COMPARATEUR DE TAILLES */
.pr-compare { max-width: 900px; margin: 4rem auto 0; padding: 0 clamp(1rem,4vw,2rem) 4.5rem; }
.pr-compare h2 { font-family: var(--fd); font-weight: 300; font-size: clamp(1.5rem,3.2vw,2rem); text-align: center; margin-bottom: 2rem; }
.cmp { display: flex; align-items: flex-end; justify-content: center; gap: clamp(1.5rem,6vw,4rem); flex-wrap: wrap; }
.cmp > div { text-align: center; }
.cmp .ring { display: flex; align-items: center; justify-content: center; border-radius: 50%; margin: 0 auto; background: radial-gradient(circle at 32% 30%, color-mix(in srgb, var(--gc) 30%, transparent), transparent 62%), var(--card); border: 1px solid var(--gc); }
.cmp .lbl { margin-top: .9rem; font-size: .94rem; }
.cmp .lbl b { display: block; font-family: var(--fd); font-weight: 300; color: var(--gc); }
.cmp .lbl span { color: var(--ink-muted); font-size: .82rem; }

/* OÙ LES TROUVE-T-ON */
.pr-hab { max-width: 1080px; margin: 4.5rem auto 0; padding: 0 clamp(1rem,4vw,2rem); }
.pr-hab h2 { font-family: var(--fd); font-weight: 300; font-size: clamp(1.7rem,3.6vw,2.4rem); text-align: center; }
.pr-hab > p { text-align: center; color: var(--ink-muted); margin: .5rem 0 2.4rem; }
.habs { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 1rem; }
.hab { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; text-align: center; }
.hab .ic { font-size: 1.8rem; }
.hab b { display: block; font-family: var(--fd); font-weight: 300; margin-top: .5rem; font-size: 1rem; }
.hab span { display: block; margin-top: .3rem; font-size: .82rem; color: var(--ink-muted); }

/* LE SAVIEZ-VOUS */
.pr-facts { max-width: 1080px; margin: 4rem auto 0; padding: 0 clamp(1rem,4vw,2rem) 4.5rem; }
.pr-facts h2 { font-family: var(--fd); font-weight: 300; font-size: clamp(1.5rem,3.2vw,2rem); text-align: center; margin-bottom: 2rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 1.2rem; }
.fact { padding: 1.3rem 1.4rem; border-radius: 20px; background: radial-gradient(circle at 26% 22%, color-mix(in srgb, var(--gc) 20%, transparent), transparent 60%), var(--card); border: 1px solid color-mix(in srgb, var(--gc) 45%, transparent); }
.fact b { display: block; font-family: var(--fd); font-weight: 300; color: var(--gc); margin-bottom: .4rem; }
.fact p { color: var(--ink-light); font-size: .94rem; margin: 0; }

/* FOOTER */
footer { border-top: 1px solid var(--border); text-align: center; padding: 2.5rem 2rem; font-size: .85rem; color: var(--ink-muted); font-style: italic; background: var(--parch); }
footer strong { font-family: var(--fd); font-weight: 300; color: var(--ink-light); font-style: normal; }
footer ul { list-style: none; margin: .9rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; font-style: normal; }
footer a { color: var(--ink-light); text-decoration: none; }
footer a:hover { color: var(--accent); }
footer [aria-current] { color: var(--accent); border-bottom: 1px solid var(--accent); }

@media (max-width: 1000px) {
  .pr-lab { grid-template-columns: 1fr; }
  .pr-mid { order: -1; }
  .tray { flex-direction: row; overflow-x: auto; padding-bottom: .6rem; }
  .slide { min-width: 180px; }
  .slide[aria-pressed="true"] { transform: translateY(-4px); }
}
@media (max-width: 768px) {
  nav { padding: 1rem 1.4rem; }
  .nav-logo { flex: 1; }
  .hamburger { display: flex !important; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; width: 100%; background: rgba(6,16,29,.98); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .5rem 0 1rem; max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-10px); transition: max-height .4s ease, opacity .35s ease, transform .35s ease; display: flex; z-index: 199; }
  .nav-links.open { max-height: 500px; opacity: 1; transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: .75rem 1.4rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .plant-grid .plant-card { min-width: 100%; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
