/* Grove background + welcome animation (js/intro.js). Content stays hidden only while html.intro-play is set. */
.intro-play body { overflow: hidden; }
.intro-play .site-header,
.intro-play main,
.intro-play .site-footer { opacity: 0; }
.intro-reveal .site-header,
.intro-reveal main,
.intro-reveal .site-footer { transition: opacity 1s ease .15s; }
.intro-reveal .hero > * { animation: ag-rise .9s cubic-bezier(.2,.7,.2,1) both; }
.intro-reveal .hero > :nth-child(1) { animation-delay: .2s; }
.intro-reveal .hero > :nth-child(2) { animation-delay: .32s; }
.intro-reveal .hero > :nth-child(3) { animation-delay: .46s; }
.intro-reveal .hero > :nth-child(4) { animation-delay: .58s; }

main, .site-footer { position: relative; z-index: 1; }

.grove-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% 100%, #2a1650 0%, transparent 60%),
    linear-gradient(#05040a, #0e0a18 55%, #1a1030);
}
.grove-sky, .grove-forest, .intro-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.grove-forest {
  transform: translate(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -6px));
  transition: transform .6s ease-out;
}
.grove-bg.settled .ag-layer { animation: none; }

.intro { position: fixed; inset: 0; z-index: 100; overflow: hidden; cursor: pointer; }
.intro-tree {
  position: absolute; left: 0; top: 2vh; width: 100%; height: 76vh; overflow: visible;
  transform: translate(calc(var(--px, 0) * 6px), calc(var(--py, 0) * 3px));
  transition: transform .6s ease-out;
}
.intro-fx { pointer-events: none; }

.ag-layer { animation: ag-layer-rise 1.6s cubic-bezier(.2,.7,.2,1) both; }
.ag-layer-1 { animation-delay: .15s; }

.ag-sigil {
  opacity: .55;
  transform-origin: 500px 470px;
  animation: ag-spin 90s linear infinite;
}
.ag-quote {
  font-family: var(--font-display); font-weight: 700;
  stroke: #0b0a10; stroke-width: 4px; stroke-linejoin: round; paint-order: stroke;
}
.ag-quote-rest { font-weight: 400; stroke-width: 3px; }
.ag-sym { fill: #e9d5ff; font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols", serif; }
.ag-ring-spin {
  transform-origin: 500px 470px;
  animation: ag-spin 160s linear infinite;
}
.ag-sprout { transform-box: fill-box; transform-origin: 50% 100%; }
.ag-leaf, .ag-pulse { transform-box: fill-box; transform-origin: center; }
.ag-leaf .core { animation: ag-twinkle 2.4s ease-in-out infinite alternate; }

.grove-mist {
  position: absolute; left: -20%; right: -20%; bottom: -6%; height: 45%;
  pointer-events: none; filter: blur(10px);
  background:
    radial-gradient(ellipse 40% 50% at 30% 70%, rgba(139, 92, 246, .2), transparent 70%),
    radial-gradient(ellipse 35% 45% at 75% 60%, rgba(201, 195, 214, .1), transparent 70%);
  animation: ag-drift 14s ease-in-out infinite alternate;
}
.grove-mist.m2 {
  height: 28%; bottom: -8%; opacity: .85;
  animation-duration: 19s; animation-direction: alternate-reverse;
}

.intro-title {
  position: absolute; left: 0; right: 0; bottom: 6vh;
  text-align: center; pointer-events: none; padding: 0 1rem;
}
.intro-name {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 7vw, 5rem); letter-spacing: .06em; line-height: 1.1;
  color: var(--bone); text-shadow: 0 0 24px rgba(139, 92, 246, .6);
}
.intro-name .word { display: inline-block; white-space: nowrap; }
.intro-name .word + .word { margin-left: .3em; }
.intro-name .ch {
  display: inline-block; opacity: 0;
  animation: ag-letter .8s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--t0, 2000ms) + var(--i) * 40ms);
}
.intro-name .accent .ch {
  color: var(--amethyst);
  text-shadow: 0 0 18px rgba(183, 148, 246, .9), 0 0 42px rgba(139, 92, 246, .6);
}
.intro-sub {
  margin: .9rem 0 0; opacity: 0; color: var(--bone);
  text-shadow: 0 0 12px rgba(139, 92, 246, .8);
  font-size: clamp(.7rem, 1.6vw, .85rem); letter-spacing: .35em; text-transform: uppercase;
  animation: ag-fade 1s ease forwards;
  animation-delay: calc(var(--t0, 2000ms) + 700ms);
}
.intro-skip {
  position: absolute; top: 1.25rem; right: 1.25rem; z-index: 1;
  font: inherit; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; cursor: pointer;
  padding: .5rem 1rem; border-radius: 999px;
  color: var(--mist); background: rgba(11, 10, 16, .5); border: 1px solid var(--slate);
  opacity: 0; animation: ag-fade .6s ease .4s forwards;
}
.intro-skip:hover { color: var(--bone); border-color: var(--violet); }

@media (prefers-reduced-motion: reduce) {
  .grove-mist, .ag-layer, .ag-sigil, .ag-ring-spin, .ag-leaf .core { animation: none !important; }
  .intro-name .ch { opacity: 1 !important; animation: none !important; }
  .intro-sub, .intro-skip { opacity: 1 !important; animation: none !important; }
  .ag-quote { opacity: 1 !important; }
}

@keyframes ag-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ag-layer-rise { from { opacity: 0; transform: translateY(70px); } to { opacity: 1; transform: none; } }
@keyframes ag-spin { to { transform: rotate(360deg); } }
@keyframes ag-twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes ag-drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes ag-fade { to { opacity: 1; } }
@keyframes ag-letter {
  from { opacity: 0; filter: blur(10px); transform: translateY(.35em) scale(1.25); }
  60% { opacity: 1; }
  to { opacity: 1; filter: blur(0); transform: none; }
}
