/* ════════════════════════════════════════
   FUNGI — style.css
   Le réseau : mycélium animé + cartes en chapeau
════════════════════════════════════════ */

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

:root {
  --parch: #1d140d;
  --parch-dark: #2e2015;
  --ink: #efe1c6;
  --ink-light: #d3c1a0;
  --ink-muted: #a4906f;
  --accent: #d76d2e;
  --accent-dark: #e8834a;
  --accent-light: #3b2a1a;
  --danger: #c0432f;
  --danger-light: #f0d0c8;
  --gold: #c9963a;
  --gold-light: #4a3820;
  --border: rgba(239, 225, 198, 0.18);
  --card: #26190f;
  --on: #1d140d;
  --fd: 'Young Serif', Georgia, serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'EB Garamond', Georgia, serif; background: 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(29,20,13,.92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 200;
}
.nav-logo { font-family: var(--fd); font-size: 1.45rem; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.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); }

/* RECHERCHE */
.search-wrap { max-width: 580px; margin: 0 auto 1.5rem; 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); }
.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.14rem; font-style: italic; color: var(--ink-muted); line-height: 1.6; margin: 1.2rem 0 1.8rem; }

/* HERO — mycélium qui pousse */
.fg-hero {
  position: relative; overflow: hidden; display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); align-items: end; gap: 2rem;
  min-height: min(84vh, 700px); padding: clamp(2rem,5vw,4rem) clamp(1rem,5vw,4rem) 0;
  background: linear-gradient(#140c07 0, #22160d 72%, #1d140d);
}
.fg-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.fg-hero .txt { position: relative; z-index: 2; align-self: center; padding-bottom: clamp(2rem,5vw,4rem); }
.fg-hero h1 { font-family: var(--fd); font-weight: 400; font-size: clamp(3rem,8.4vw,6.6rem); line-height: .96; }
.fg-hero h1 em { color: var(--accent); font-style: normal; }
.fg-hero .shroom { position: relative; z-index: 2; width: min(100%,400px); height: auto; justify-self: center; display: block; margin-bottom: -4px; }

/* RÉSEAU — le mycélium relie les groupes */
.fg-wrap { padding: clamp(3rem,6vw,5rem) 0 4rem; }
.fg-head { max-width: 640px; margin: 0 auto 3rem; padding: 0 1.2rem; text-align: center; }
.fg-head h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.9rem,4vw,2.8rem); }
.fg-head p { color: var(--ink-muted); font-style: italic; margin-top: .6rem; }
.fg-path { position: relative; max-width: 1040px; margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem); }
.hy { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.nodes { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2.4rem; }
.node { display: flex; }
.node.l { justify-content: flex-start; }
.node.r { justify-content: flex-end; margin-top: 1rem; }
.fcard { width: calc(50% - 46px); background: var(--card); border: 1px solid var(--border); border-radius: 0 0 22px 22px; overflow: hidden; text-decoration: none; color: inherit; display: block; }
.fcap { display: block; height: 44px; border-radius: 44px 44px 0 0; background: radial-gradient(circle at 24% 62%, rgba(255,255,255,.3) 0 4px, transparent 5px), radial-gradient(circle at 66% 40%, rgba(255,255,255,.28) 0 3px, transparent 4px), repeating-linear-gradient(90deg, transparent 0 6px, rgba(0,0,0,.14) 6px 8px), var(--c); }
.fcard > div, .fcard > h3, .fcard > .lat, .fcard > p { margin-left: 1.3rem; margin-right: 1.3rem; }
.fcard h3 { font-family: var(--fd); font-weight: 400; font-size: 1.4rem; margin-top: 1rem; line-height: 1.2; }
.fcard .lat { display: block; font-style: italic; font-size: .9rem; color: var(--gold); }
.fcard p { color: var(--ink-muted); margin-top: .5rem; font-size: 1rem; padding-bottom: .2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .9rem 1.3rem 1.3rem; }
.chips span { font-size: .84rem; color: var(--ink-light); border: 1px solid var(--border); border-radius: 999px; padding: .15rem .8rem; }
.node.danger .fcard { border-color: #8f2f22; background: #1f0f0c; }
.node.danger .lat { color: #e0743a; }
.fg-end { text-align: center; margin-top: 3rem; position: relative; z-index: 1; }
.fg-end a { display: inline-block; color: var(--accent); text-decoration: none; font-size: .86rem; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid rgba(215,109,46,.4); padding-bottom: .15rem; }

/* CALENDRIER DES SAISONS */
.fg-season { max-width: 1040px; margin: 1rem auto 0; padding: 0 clamp(1rem,4vw,2rem) 4.5rem; }
.fg-season h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.7rem,3.6vw,2.4rem); text-align: center; }
.fg-season > p { text-align: center; color: var(--ink-muted); font-style: italic; margin: .5rem 0 2.4rem; }
.seasons { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 1.4rem; }
.season { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 1.3rem 1.4rem 1.5rem; }
.season .sn { display: inline-flex; align-items: center; gap: .5rem; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--c); }
.season .sn i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.season h3 { font-family: var(--fd); font-weight: 400; font-size: 1.3rem; margin: .5rem 0 .8rem; }
.season ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.season li a { color: var(--ink-light); text-decoration: none; font-size: .94rem; border-bottom: 1px dotted var(--border); display: block; padding: .15rem 0; }
.season li a:hover { color: var(--accent); }
.season.printemps { --c: #7fae5a; } .season.ete { --c: #d76d2e; } .season.automne { --c: #c9963a; } .season.hiver { --c: #5a86ae; }

/* GLOSSAIRE DU MYCOLOGUE */
.fg-gloss { max-width: 760px; margin: 4rem auto 0; padding: 0 clamp(1rem,4vw,2rem) 4.5rem; }
.fg-gloss h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.5rem,3.2vw,2rem); text-align: center; margin-bottom: 1.8rem; }
.gloss { border-top: 1px solid var(--border); }
.gloss div { display: grid; grid-template-columns: 180px 1fr; gap: 1.4rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.gloss dt { font-family: var(--fd); font-style: italic; color: var(--accent); }
.gloss dd { margin: 0; color: var(--ink-light); font-size: .96rem; }
@media (max-width: 600px) { .gloss div { grid-template-columns: 1fr; } }

/* SOUS L'ÉCORCE — schéma de symbiose */
.fg-symb { max-width: 1040px; margin: 4.5rem auto 0; padding: 0 clamp(1rem,4vw,2rem); text-align: center; }
.fg-symb h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.7rem,3.6vw,2.4rem); }
.fg-symb > p { color: var(--ink-muted); font-style: italic; margin: .5rem auto 2rem; max-width: 60ch; }
.symb-svg { width: 100%; max-width: 760px; height: auto; margin: 0 auto; display: block; }

/* LÉGENDES DU SOUS-BOIS */
.fg-legend { max-width: 1040px; margin: 4rem auto 0; padding: 0 clamp(1rem,4vw,2rem) 4.5rem; }
.fg-legend h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.5rem,3.2vw,2rem); text-align: center; margin-bottom: 2rem; }
.legs { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 1.2rem; }
.leg { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.3rem 1.4rem; }
.leg span { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.leg p { margin-top: .5rem; font-style: italic; color: var(--ink-light); font-size: .98rem; line-height: 1.5; }

/* 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); 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: 760px) {
  .fg-hero { grid-template-columns: 1fr; min-height: 0; }
  .fg-hero .shroom { width: 220px; }
  .fcard { width: calc(100% - 42px); }
  .node.l, .node.r { justify-content: flex-end; }
}
@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(29,20,13,.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); }
  .search-wrap { max-width: 100%; margin: 0 0 1.5rem; }
  .plant-grid .plant-card { min-width: 100%; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
