/* ============================================================
   PURE PASTRY — woodland intro (v5.1, 2026-08-19)
   The commissioned forest art, brought to life while the site
   loads: the fox and woodpecker hold the log, the fawn watches
   from the leaves, butterflies cross the canvas, and a ladybug
   walks the loading line. Art ships in loading/art.css as the
   original illustrations, untouched. The site's global
   prefers-reduced-motion rule stills every animation here, and
   the composition is designed to read complete when frozen.
   ============================================================ */

html.pp-intro body { visibility: hidden; }

#ppIntro {
  visibility: visible;
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: linear-gradient(180deg, #ffffff 0%, #fdfaf4 58%, #fbf6ef 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --pp-progress: 0;
}
#ppIntro.pp-done {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
  transition: opacity 0.68s ease, transform 0.68s ease;
}

/* soft morning rays, barely-there sage */
#ppIntro::before,
#ppIntro::after {
  content: "";
  position: absolute;
  inset: -30%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(138, 154, 110, 0.05) 50%, transparent 58%);
  animation: ppRay 9s ease-in-out infinite alternate;
}
#ppIntro::after {
  background: linear-gradient(65deg, transparent 44%, rgba(176, 138, 62, 0.045) 51%, transparent 58%);
  animation-duration: 12s;
  animation-delay: -4s;
}
@keyframes ppRay {
  from { transform: translateX(-4%); }
  to   { transform: translateX(4%); }
}

.pp-i-stage {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3.2vh, 30px);
  width: 100%;
  padding: 0 6vw;
}

/* every art sprite renders through its pp-art-* background class */
.pp-i-art {
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

/* the fawn watches from a soft window of leaves, top left */
.pp-i-fawn {
  position: absolute;
  z-index: 1;
  top: calc(-3vh);
  left: max(-40px, -3vw);
  width: clamp(180px, 30vw, 360px);
  aspect-ratio: 900 / 1165;
  opacity: 0;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, #000 46%, transparent 74%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 46%, #000 46%, transparent 74%);
  animation: ppFawnIn 1.6s ease 0.5s forwards, ppFloat 8s ease-in-out 2.1s infinite alternate;
}
@keyframes ppFawnIn { to { opacity: 0.92; } }
@keyframes ppFloat { from { transform: translateY(0); } to { transform: translateY(7px); } }

/* the warbler keeps the opposite corner */
.pp-i-warbler {
  position: absolute;
  z-index: 1;
  top: max(-14px, -1.5vh);
  right: clamp(8px, 4vw, 60px);
  width: clamp(64px, 8vw, 104px);
  aspect-ratio: 400 / 555;
  opacity: 0;
  animation: ppFawnIn 1.4s ease 1s forwards, ppFloat 6s ease-in-out 2.4s infinite alternate;
}

/* hero: fox + woodpecker on the log (the robin settles beside them) */
.pp-i-fox {
  position: relative;
  width: min(72vw, 660px);
  aspect-ratio: 1400 / 757;
  opacity: 0;
  animation: ppHeroIn 0.95s ease-out 0.18s forwards, ppBreathe 6.5s ease-in-out 1.4s infinite alternate;
}
@keyframes ppHeroIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ppBreathe { from { transform: scale(1); } to { transform: scale(1.014); } }

.pp-i-robin {
  position: absolute;
  right: -7%;
  bottom: -4%;
  width: 15%;
  aspect-ratio: 420 / 492;
  opacity: 0;
  animation: ppRobinLand 1.15s ease-out 1.1s forwards;
}
@keyframes ppRobinLand {
  0%   { opacity: 0; transform: translate(-36px, -22vh) rotate(-9deg); }
  70%  { opacity: 1; transform: translate(0, 2px) rotate(2deg); }
  100% { opacity: 1; transform: translate(0, 0) rotate(0); }
}

/* butterflies cross the whole canvas on their own paths;
   the inner sprite flutters, the outer element travels */
.pp-i-fly {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
.pp-i-fly > i {
  display: block;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  animation: ppFlutter 0.34s ease-in-out infinite alternate;
}
@keyframes ppFlutter {
  from { transform: scaleX(1) rotate(-3deg); }
  to   { transform: scaleX(0.74) rotate(4deg); }
}
.pp-i-monarch {
  top: 26vh;
  left: -12vw;
  width: clamp(60px, 8vw, 110px);
  aspect-ratio: 360 / 254;
  animation: ppCrossR 13s linear -2s infinite;
}
.pp-i-swallowtail {
  top: 64vh;
  right: -12vw;
  width: clamp(54px, 7vw, 96px);
  aspect-ratio: 360 / 210;
  animation: ppCrossL 16s linear -7s infinite;
}
.pp-i-comma {
  top: 12vh;
  left: -8vw;
  width: clamp(40px, 5vw, 66px);
  aspect-ratio: 320 / 223;
  animation: ppCrossR 18s linear -11s infinite;
}
@keyframes ppCrossR {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(30vw, -4vh, 0); }
  50%  { transform: translate3d(60vw, 2vh, 0); }
  75%  { transform: translate3d(90vw, -5vh, 0); }
  100% { transform: translate3d(124vw, -1vh, 0); }
}
@keyframes ppCrossL {
  0%   { transform: translate3d(0, 0, 0) scaleX(-1); }
  25%  { transform: translate3d(-30vw, -5vh, 0) scaleX(-1); }
  50%  { transform: translate3d(-62vw, 1vh, 0) scaleX(-1); }
  75%  { transform: translate3d(-92vw, -4vh, 0) scaleX(-1); }
  100% { transform: translate3d(-124vw, -2vh, 0) scaleX(-1); }
}

/* fireflies — gold motes drifting up through the scene */
.pp-i-mote {
  position: absolute;
  z-index: 2;
  bottom: -2vh;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(176, 138, 62, 0.55);
  box-shadow: 0 0 8px 2px rgba(176, 138, 62, 0.28);
  opacity: 0;
  animation: ppMote var(--d, 9s) linear var(--dl, 0s) infinite;
  left: var(--x, 50%);
  pointer-events: none;
}
@keyframes ppMote {
  0%   { opacity: 0; transform: translateY(0); }
  12%  { opacity: 0.7; }
  60%  { opacity: 0.35; }
  100% { opacity: 0; transform: translateY(-88vh) translateX(3vw); }
}

/* wordmark */
.pp-i-word {
  margin: 0;
  font-size: clamp(2.3rem, 5.6vw, 3.7rem);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1;
  color: #2b211c;
  text-transform: lowercase;
  opacity: 0;
  animation: ppHeroIn 0.9s ease-out 0.55s forwards;
}

/* the loading line: a sage twig the ladybug walks */
.pp-i-trackwrap {
  position: relative;
  width: min(64vw, 380px);
  height: 40px;
  opacity: 0;
  animation: ppFawnIn 0.8s ease 0.9s forwards;
}
.pp-i-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  height: 2px;
  border-radius: 2px;
  background: rgba(43, 33, 28, 0.12);
}
.pp-i-fill {
  position: absolute;
  left: 0;
  top: 26px;
  height: 2px;
  border-radius: 2px;
  width: 100%;
  background: #8a9a6e;
  transform-origin: left center;
  transform: scaleX(var(--pp-progress));
  transition: transform 0.3s ease;
}
.pp-i-ladybug {
  position: absolute;
  top: 4px;
  left: calc(var(--pp-progress) * (100% - 30px));
  width: 30px;
  aspect-ratio: 260 / 110;
  transition: left 0.3s ease;
  animation: ppWaddle 0.5s ease-in-out infinite alternate;
}
@keyframes ppWaddle {
  from { transform: rotate(-3deg) translateY(0); }
  to   { transform: rotate(3deg) translateY(-1px); }
}

.pp-i-sr {
  position: absolute;
  left: -9999px;
}

@media (max-width: 640px) {
  .pp-i-fox { width: 88vw; }
  .pp-i-fawn { width: 44vw; top: -2vh; }
  .pp-i-comma { display: none; }
}
