/* === plant-enhance.css — shared ambient + interaction layer for all plant sub-pages === */

:root {
  --pe-accent-primary: #7ab362;
  --pe-accent-secondary: #f4a7b9;
  --pe-accent-warm: #e8c57a;
  --pe-accent-glow: rgba(122,179,98,0.42);
  --pe-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- Ambient gradient field behind everything --- */
body { position: relative; overflow-x: hidden; }
body::before {
  content: "";
  position: fixed;
  inset: -15%;
  background:
    radial-gradient(ellipse at 15% 10%, var(--pe-accent-glow), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(244,167,185,0.14), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(232,197,122,0.08), transparent 55%);
  z-index: -3;
  animation: pe-drift 28s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes pe-drift {
  0%   { transform: translate(-2%, -2%) scale(1); }
  50%  { transform: translate(2%, 1%) scale(1.04); }
  100% { transform: translate(-1%, 3%) scale(1); }
}

/* --- Growing background tree (right edge) --- */
.pe-tree {
  position: fixed;
  right: -28px;
  bottom: 0;
  width: 300px;
  height: 86vh;
  max-height: 900px;
  opacity: 0.22;
  color: #d8cbaa;
  z-index: -2;
  pointer-events: none;
  overflow: visible;
}
.pe-tree .branch {
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: pe-grow 2.4s var(--pe-ease) forwards;
}
.pe-tree .b-0 { animation-delay: 0.05s; }
.pe-tree .b-1 { animation-delay: 0.9s; }
.pe-tree .b-2 { animation-delay: 1.1s; }
.pe-tree .b-3 { animation-delay: 1.4s; }
.pe-tree .b-4 { animation-delay: 1.6s; }
.pe-tree .b-5 { animation-delay: 1.9s; }
.pe-tree .b-6 { animation-delay: 2.1s; }
.pe-tree .b-7 { animation-delay: 2.3s; }
.pe-tree .b-8 { animation-delay: 2.5s; }
.pe-tree .b-9 { animation-delay: 2.7s; }
.pe-tree .b-10 { animation-delay: 2.9s; }
.pe-tree .b-11 { animation-delay: 3.1s; }
@keyframes pe-grow {
  to { stroke-dashoffset: 0; }
}
.pe-tree-bud {
  fill: var(--pe-accent-secondary);
  opacity: 0;
  animation: pe-bud 0.8s var(--pe-ease) forwards;
}
@keyframes pe-bud {
  to { opacity: 0.9; transform: scale(1); }
}

/* --- Falling skeletal leaves --- */
.pe-petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.pe-petal {
  position: absolute;
  top: -40px;
  opacity: 0.72;
  will-change: transform;
  animation: pe-fall linear infinite;
  pointer-events: none;
}
.pe-petal svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}
@keyframes pe-fall {
  0%   { transform: translate3d(0, -12vh, 0) rotate(0deg); }
  20%  { transform: translate3d(calc(var(--drift, 40px) * 0.55), 14vh, 0) rotate(120deg); }
  45%  { transform: translate3d(calc(var(--drift, 40px) * -0.35), 42vh, 0) rotate(320deg); }
  70%  { transform: translate3d(calc(var(--drift, 40px) * 0.75), 72vh, 0) rotate(520deg); }
  100% { transform: translate3d(var(--drift, 40px), 112vh, 0) rotate(740deg); }
}

/* --- Hero polish --- */
main .hero, .hero {
  position: relative;
  overflow: hidden;
}
main .hero::after, .hero.pe-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 10% 0%, var(--pe-accent-glow), transparent 55%);
  opacity: 0.55;
}
main .hero .title, .hero h1.title {
  background: linear-gradient(110deg, #fff 0%, var(--pe-accent-warm) 55%, var(--pe-accent-secondary) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: pe-shine 14s linear infinite;
}
@keyframes pe-shine {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* --- Timeline entry alternating slide-in --- */
.timeline-entry {
  opacity: 0;
  transform: translateX(-40px) translateY(20px);
  transition: opacity 0.9s var(--pe-ease), transform 0.9s var(--pe-ease);
  border-left: 3px solid transparent !important;
  position: relative;
}
.timeline-entry:nth-child(even) {
  transform: translateX(40px) translateY(20px);
}
.timeline-entry.pe-in {
  opacity: 1;
  transform: translateX(0) translateY(0);
  border-left-color: var(--pe-accent-primary) !important;
}
.timeline-entry::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--pe-accent-primary);
  box-shadow: 0 0 12px var(--pe-accent-glow);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.6s var(--pe-ease), transform 0.6s var(--pe-ease);
}
.timeline-entry.pe-in::before { opacity: 1; transform: scale(1); }
.entry-date {
  color: var(--pe-accent-warm) !important;
  font-weight: 600;
  letter-spacing: 0.6px;
}

/* --- Photo hover: 3D tilt, scale, saturation --- */
.photo {
  transition: transform 0.5s var(--pe-ease), box-shadow 0.5s var(--pe-ease), filter 0.5s ease;
  will-change: transform;
  transform-style: preserve-3d;
}
.photo:hover {
  transform: perspective(900px) translateY(-4px) rotateX(var(--pe-rx,0deg)) rotateY(var(--pe-ry,0deg)) scale(1.02);
  box-shadow: 0 28px 60px rgba(0,0,0,0.45);
  filter: saturate(1.1) brightness(1.02);
}

/* --- Panel polish: subtle accent border on hover --- */
.panel, .timeline-entry {
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.panel:hover {
  border-color: rgba(232,197,122,0.35) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
}

/* --- Section header underline accent --- */
.section-title, .entry-title {
  position: relative;
}
.section-title::after, .entry-title::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  border-radius: 3px;
  margin-top: 7px;
  background: linear-gradient(90deg, var(--pe-accent-primary), var(--pe-accent-warm));
  opacity: 0.85;
}

/* Respect but don't cripple: fewer leaves only */
@media (prefers-reduced-motion: reduce) {
  .pe-petal { opacity: 0.4; }
  .timeline-entry { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .pe-tree { width: 200px; opacity: 0.16; }
}
