/* EntomoSphère — thèmes débloquables (récompenses easter eggs).
   Chaque thème transforme réellement le site : fond, textures, cartes,
   bannières, titres — plus une ambiance animée et une transition d'activation. */

/* ============================================================
   TRANSITION D'ACTIVATION — un rideau balaie l'écran
   ============================================================ */
.theme-wipe{
  position:fixed; inset:0; z-index:200; pointer-events:none;
  display:grid; place-items:center;
  clip-path:inset(0 100% 0 0);
  animation:wipeIn .55s cubic-bezier(.7,0,.3,1) forwards,
            wipeOut .5s cubic-bezier(.7,0,.3,1) .75s forwards;
}
@keyframes wipeIn{ from{ clip-path:inset(0 100% 0 0); } to{ clip-path:inset(0 0 0 0); } }
@keyframes wipeOut{ from{ clip-path:inset(0 0 0 0); } to{ clip-path:inset(0 0 0 100%); } }
.theme-wipe__i{
  font-size:clamp(4rem,14vw,9rem); line-height:1;
  filter:drop-shadow(0 8px 24px rgba(0,0,0,.35));
  animation:wipePop .8s cubic-bezier(.25,1.6,.4,1) .12s both;
}
@keyframes wipePop{
  0%{ transform:scale(.2) rotate(-30deg); opacity:0; }
  60%{ transform:scale(1.15) rotate(8deg); opacity:1; }
  100%{ transform:scale(1) rotate(0); opacity:1; }
}
.theme-wipe__n{
  position:absolute; bottom:22%; font-family:var(--font-hand); font-size:clamp(1.8rem,5vw,3rem);
  letter-spacing:.04em; animation:wipePop .8s cubic-bezier(.25,1.6,.4,1) .22s both;
}
.theme-wipe--herbier{ background:linear-gradient(135deg,#f6ecd0,#e6d3a4); color:#6d6330; }
.theme-wipe--sousbois{ background:linear-gradient(135deg,#26402080,#1d3318); background-color:#24401f; color:#dff0d0; }
.theme-wipe--or{ background:linear-gradient(135deg,#3a2f12,#1b1710); color:#e8c964; }
.theme-wipe--reset{ background:linear-gradient(135deg,#fbf3d6,#f0e4bd); color:#4e6636; }

/* ============================================================
   AMBIANCE — particules flottantes propres à chaque thème
   ============================================================ */
.theme-amb{ position:fixed; inset:0; z-index:1; pointer-events:none; overflow:hidden; }
.theme-amb i{
  position:absolute; display:block; will-change:transform;
  animation:ambTombe linear infinite;
}
@keyframes ambTombe{
  0%{ transform:translate3d(0,-12vh,0) rotate(0deg); opacity:0; }
  8%{ opacity:var(--o,.7); }
  92%{ opacity:var(--o,.7); }
  100%{ transform:translate3d(var(--dx,4vw),112vh,0) rotate(var(--rot,360deg)); opacity:0; }
}
@keyframes ambMonte{
  0%{ transform:translate3d(0,110vh,0) scale(.6); opacity:0; }
  12%{ opacity:var(--o,.9); }
  88%{ opacity:var(--o,.9); }
  100%{ transform:translate3d(var(--dx,3vw),-10vh,0) scale(1.1); opacity:0; }
}
body.theme-or .theme-amb i{ animation-name:ambMonte; }
@media (prefers-reduced-motion: reduce){
  .theme-amb{ display:none; }
  .theme-wipe{ animation-duration:.01s, .01s; }
  .theme-wipe__i, .theme-wipe__n{ animation:none; }
}

/* ============================================================
   🎨 HERBIER — planche de collection ancienne
   ============================================================ */
body.theme-herbier{
  --paper:#fdf6e3; --paper-2:#fffcf0; --paper-3:#f3e7c8; --paper-edge:#e0cfa0;
  --ink:#3a3524; --ink-soft:#63593c; --ink-faint:#948968;
  --olive:#9a8f4a; --olive-2:#867c3c; --olive-deep:#6d6330; --olive-ink:#413b1a;
  --sage:#ded2ab; --sage-2:#c9bb8c; --terra:#a9702f; --terra-2:#8a5722; --gold:#b8912f;
  background-color:#f6ecd0;
  /* papier vieilli : piqûres de rousseur + grain */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(160,120,50,.09) 0 3px, transparent 4px),
    radial-gradient(circle at 78% 32%, rgba(160,120,50,.07) 0 4px, transparent 5px),
    radial-gradient(circle at 34% 71%, rgba(160,120,50,.08) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 84%, rgba(160,120,50,.06) 0 5px, transparent 6px),
    radial-gradient(circle at 55% 45%, rgba(160,120,50,.05) 0 3px, transparent 4px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><g fill='none' stroke='%23a08a52' stroke-opacity='.13' stroke-width='1'><path d='M10 60 Q30 40 50 60 T90 60'/><path d='M60 10 Q40 30 60 50 T60 90'/></g></svg>");
  background-size:auto, auto, auto, auto, auto, 240px 240px;
}
body.theme-herbier .site-header{
  background:rgba(255,252,240,.93);
  border-bottom:1px solid rgba(160,120,50,.28);
}
/* les cartes deviennent des spécimens épinglés, légèrement de travers */
body.theme-herbier .card,
body.theme-herbier .cat{
  position:relative;
  transform:rotate(-.5deg);
  box-shadow:0 8px 22px rgba(120,90,30,.16), inset 0 0 0 1px rgba(160,120,50,.3);
}
body.theme-herbier .card:nth-child(even),
body.theme-herbier .cat:nth-child(even){ transform:rotate(.7deg); }
body.theme-herbier .card:hover,
body.theme-herbier .cat:hover{ transform:rotate(0) translateY(-4px); }
body.theme-herbier .card::before{
  content:""; position:absolute; top:7px; left:50%; transform:translateX(-50%);
  width:9px; height:9px; border-radius:50%; z-index:4;
  background:radial-gradient(circle at 35% 30%, #e8dcc0, #8a7a52);
  box-shadow:0 2px 4px rgba(80,60,20,.45);
}
body.theme-herbier .card__media img,
body.theme-herbier .hero__specimen img{ filter:sepia(.35) saturate(.9) contrast(1.04); }
body.theme-herbier .banner{ filter:sepia(.5) saturate(.7) brightness(1.05); }
body.theme-herbier .kicker{ font-style:italic; }
body.theme-herbier h1, body.theme-herbier h2{ letter-spacing:.015em; }

/* ============================================================
   🌲 SOUS-BOIS — sol forestier, lumière filtrée
   ============================================================ */
body.theme-sousbois{
  --paper:#e8efe0; --paper-2:#f2f7ec; --paper-3:#d8e4cc; --paper-edge:#bcd0ab;
  --ink:#22301c; --ink-soft:#42553a; --ink-faint:#6f8265;
  --olive:#4d7a3a; --olive-2:#3d6630; --olive-deep:#2f5626; --olive-ink:#1c3818;
  --sage:#b6cba6; --sage-2:#9ab488; --terra:#8a6a30; --terra-2:#6d5324; --gold:#8f9b3c;
  background-color:#dfe9d5;
  /* taches de lumière à travers la canopée */
  background-image:
    radial-gradient(ellipse 40vw 30vh at 15% 8%, rgba(255,252,210,.55), transparent 70%),
    radial-gradient(ellipse 34vw 26vh at 82% 24%, rgba(255,250,200,.42), transparent 72%),
    radial-gradient(ellipse 30vw 24vh at 46% 62%, rgba(250,255,225,.38), transparent 74%),
    radial-gradient(ellipse 26vw 22vh at 8% 88%, rgba(255,252,215,.32), transparent 75%);
  background-attachment:fixed;
}
/* vignette organique sur les bords */
body.theme-sousbois::after{
  content:""; position:fixed; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(ellipse 120% 100% at 50% 40%, transparent 52%, rgba(30,55,25,.22) 100%);
}
body.theme-sousbois .site-header{
  background:rgba(242,247,236,.93);
  border-bottom:1px solid rgba(60,100,45,.22);
}
body.theme-sousbois .card,
body.theme-sousbois .cat,
body.theme-sousbois .info-card,
body.theme-sousbois .compte-card{
  box-shadow:0 10px 26px rgba(25,50,20,.14), inset 0 0 0 1px rgba(60,100,45,.2);
}
body.theme-sousbois .card{ border-left:3px solid rgba(77,122,58,.5); }
body.theme-sousbois .card__media img{ filter:saturate(1.12) contrast(1.03); }
body.theme-sousbois .banner{ filter:hue-rotate(-8deg) saturate(1.15); }
body.theme-sousbois .site-footer{ background:#1f3a1a; }

/* ============================================================
   👑 OR — la récompense des complétistes
   ============================================================ */
body.theme-or{
  --paper:#241f14; --paper-2:#2e281a; --paper-3:#1b1710; --paper-edge:#4a3f26;
  --ink:#f3e9cd; --ink-soft:#d6c79c; --ink-faint:#a2926a;
  --sage:#4a3f26; --sage-2:#5e5133;
  --olive:#b8912f; --olive-2:#9a7726; --olive-deep:#e0c163; --olive-ink:#f0d98a;
  --terra:#c07a35; --terra-2:#a3632a; --gold:#e8c964;
  --shadow-sm:0 2px 10px rgba(0,0,0,.45); --shadow-md:0 12px 30px rgba(0,0,0,.55);
  --shadow-lg:0 24px 64px rgba(0,0,0,.68);
  color:var(--ink);
  background-color:#15120b;
  background-image:
    radial-gradient(ellipse 70vw 50vh at 50% -8%, rgba(232,201,100,.16), transparent 70%),
    radial-gradient(ellipse 50vw 40vh at 88% 78%, rgba(232,201,100,.08), transparent 72%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><g fill='none' stroke='%23e8c964' stroke-opacity='.07' stroke-width='1'><path d='M0 80 Q40 60 80 80 T160 80'/><path d='M80 0 Q60 40 80 80 T80 160'/></g></svg>");
  background-attachment:fixed, fixed, scroll;
}
body.theme-or .site-header{
  background:rgba(30,25,15,.94);
  border-bottom:1px solid rgba(232,201,100,.3);
  box-shadow:0 2px 24px rgba(232,201,100,.12);
}
body.theme-or .card, body.theme-or .cat,
body.theme-or .info-card, body.theme-or .compte-card, body.theme-or .panel{
  background:linear-gradient(165deg, #322b1c, #262013);
  box-shadow:0 10px 30px rgba(0,0,0,.5), inset 0 0 0 1px rgba(232,201,100,.28);
}
body.theme-or .card:hover, body.theme-or .cat:hover{
  box-shadow:0 16px 40px rgba(0,0,0,.6), inset 0 0 0 1.5px rgba(232,201,100,.55),
             0 0 26px rgba(232,201,100,.18);
}
/* titres à reflet doré qui balaie */
body.theme-or h1, body.theme-or h2, body.theme-or .banner-txt,
body.theme-or .eggcol__t, body.theme-or .elv__t{
  background:linear-gradient(100deg,#b8912f 20%,#f6e9a8 42%,#e8c964 50%,#b8912f 70%);
  background-size:250% 100%;
  -webkit-background-clip:text; background-clip:text; color:transparent;
  animation:orReflet 6s linear infinite;
}
@keyframes orReflet{ from{ background-position:180% 0; } to{ background-position:-80% 0; } }
body.theme-or .banner{ filter:sepia(1) saturate(2.2) hue-rotate(-12deg) brightness(1.05); }
body.theme-or .site-footer{ background:#0f0d08; border-top:1px solid rgba(232,201,100,.2); }
body.theme-or .card__media img, body.theme-or .cat__art img{ filter:brightness(.94) contrast(1.06); }
body.theme-or .btn{ box-shadow:0 4px 16px rgba(232,201,100,.22); }
@media (prefers-reduced-motion: reduce){
  body.theme-or h1, body.theme-or h2, body.theme-or .banner-txt{ animation:none; }
}

/* les séparateurs de sections suivent le thème */
body.theme-herbier .sec-sep{ color:#a08a52; }
body.theme-sousbois .sec-sep{ color:#3d6630; }
body.theme-or .sec-sep{ color:#e8c964; }
