/* ==========================================================
   RESET / BASE
   ========================================================== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  position: relative;
  height: 100dvh; /* accounts for Safari's collapsing toolbar */
  overflow: hidden; /* no scrolling */
  font-family: 'Love Light', cursive;
}

/* ==========================================================
   STAGE
   Fills the entire browser window edge-to-edge — no borders,
   no letterboxing. On screens with a different proportion than
   the original 1280:1080 art, the background crops slightly at
   the sides (via object-fit: cover below) rather than shrinking
   with visible bars.
   ========================================================== */
.stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

/* ==========================================================
   BACKGROUND
   Fills the stage only (not the whole viewport anymore) —
   the stage itself is what fills the page, centered.
   ========================================================== */
.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

/* ==========================================================
   WELCOME CARD
   Spans nearly the full height and scrolls internally once its
   content is taller than the box — the rest of the page (and
   the critters) stay fixed in place while you scroll inside it.
   Extra top/bottom padding keeps scrolled text clear of the
   header/footer bars, which float on top of this card.
   ========================================================== */

.card-frame {
  position: absolute;
  top: 0%;
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%);
  width: min(46%, 500px);
  z-index: 2;
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 15em 2.5em;
  background: rgba(230, 226, 217, 0.85);
  text-align: center;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3226 transparent;
}

.card h1 {
  font-family: 'Love Light', cursive;
  font-weight: 700; /* Love Light only ships a Regular weight, so the
                        browser synthetically bolds it — a bit heavier-
                        handed than a true bold face, but distinguishes
                        the heading from the body text below. */
  font-size: 3.4rem;
  margin: 0 0 0.3em;
}

.card p {
  font-size: 1.3rem;
  line-height: 1.6;
  color: #3a3226;
  /* font-family inherits 'Love Light' from body */
}

.vine-frame {
  position: absolute;
  top: 0%;
  bottom: 0%;
  left: 50%;
  transform: translateX(-50%);
  width: min(46%, 500px);
  z-index: 4;
  pointer-events: none;
}

.vine {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45px;
  overflow: hidden;

}

.vine-left  { right: -6%; }
.vine-right { left: -6%; }

.vine::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1800px;
  height: 45px;
  background-image: url('assets/vines.gif');
  background-repeat: repeat-x;
  background-size: auto 45px;
  transform: translate(-50%, -50%) rotate(90deg);
}

.vine-right::before {
  transform: translate(-50%, -50%) rotate(90deg) scaleX(-1);
}

/* ==========================================================
   HEADER AND FOOTER
   Same background/transparency as the card, floating on top of
   it (higher z-index) rather than pushing its content around.
   ========================================================== */
.homepage-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(46%, 500px);
  padding: 0.5em 1.4em;
  text-align: center;
  z-index: 3;
  border-top: 1.5px solid #3a3226;
  border-bottom: 1.5px solid #3a3226;
  border-radius: 0px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  background: rgba(230, 226, 217, 0.85);
}

.homepage-header {
  top: 2%;
  display: flex;
  align-items: center;
  gap: 0.8em;
  font-size: 1.6rem;
}

.player-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  height: 1.4em;
  padding: 0 0.8em;
  border-left: 1px solid rgba(58, 50, 38, 0.3);
  border-right: 1px solid rgba(58, 50, 38, 0.3);
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

.track-scroll {
  display: inline-flex;
  white-space: nowrap;
}

.track-scroll.marquee {
  animation: marquee-roll var(--duration, 10s) linear infinite;
}

.track-text {
  padding-right: 3em; /* gap before the text repeats */
}

@keyframes marquee-roll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.homepage-footer {
  bottom: 2%;
  font-size: 1.6rem;
}

/* ==========================================================
   CRITTERS
   Each animal is now a link (.critter-link) that holds the
   position/size (--x / --y / --w, percentages of .stage), with
   the image and a hover label as its children. Rotation
   (--rot) stays on the image itself, not the link, so the
   hover label doesn't tilt along with the artwork.
   ========================================================== */
.critter-link {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: calc(var(--w) * 1vmin);
  display: block;
  text-decoration: none;
  z-index: 1;
}

.critter-link:hover {
  z-index: 5; /* pop above its neighbors while active */
}

.critter {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(var(--rot, 0deg));
  transform-origin: center bottom;
  cursor: pointer;
  transition: transform 0.2s ease;

  /* Sticker-style outline traced around the PNG's actual shape,
     plus a soft glow that breathes in and out (see @keyframes
     critter-glow below). Both live in the same filter list so
     they apply together; the outline part stays fixed across
     the animation, only the glow's blur/spread changes. */
  --outline-color: #ffea00;
  --outline-width: 1.5px;
  --glow-color: rgba(255, 234, 0, 0.75);

  animation: critter-glow 3s ease-in-out infinite;
}

/* Both keyframe stops repeat the same 8 outline drop-shadows —
   only the final drop-shadow (the glow) changes blur radius,
   which is what creates the pulsing effect. */
@keyframes critter-glow {
  0%, 100% {
    filter:
      drop-shadow(var(--outline-width) 0 0.5px var(--outline-color))
      drop-shadow(calc(var(--outline-width) * -1) 0 0.5px var(--outline-color))
      drop-shadow(0 var(--outline-width) 0.5px var(--outline-color))
      drop-shadow(0 calc(var(--outline-width) * -1) 0.5px var(--outline-color))
      drop-shadow(var(--outline-width) var(--outline-width) 0.5px var(--outline-color))
      drop-shadow(calc(var(--outline-width) * -1) var(--outline-width) 0.5px var(--outline-color))
      drop-shadow(var(--outline-width) calc(var(--outline-width) * -1) 0.5px var(--outline-color))
      drop-shadow(calc(var(--outline-width) * -1) calc(var(--outline-width) * -1) 0.5px var(--outline-color))
      drop-shadow(0 0 4px var(--glow-color));
  }
  50% {
    filter:
      drop-shadow(var(--outline-width) 0 0.5px var(--outline-color))
      drop-shadow(calc(var(--outline-width) * -1) 0 0.5px var(--outline-color))
      drop-shadow(0 var(--outline-width) 0.5px var(--outline-color))
      drop-shadow(0 calc(var(--outline-width) * -1) 0.5px var(--outline-color))
      drop-shadow(var(--outline-width) var(--outline-width) 0.5px var(--outline-color))
      drop-shadow(calc(var(--outline-width) * -1) var(--outline-width) 0.5px var(--outline-color))
      drop-shadow(var(--outline-width) calc(var(--outline-width) * -1) 0.5px var(--outline-color))
      drop-shadow(calc(var(--outline-width) * -1) calc(var(--outline-width) * -1) 0.5px var(--outline-color))
      drop-shadow(0 0 14px var(--glow-color));
  }
}

.critter-link:hover .critter {
  animation: critter-glow 3s ease-in-out infinite, critter-wiggle 0.5s ease-in-out infinite;
}

@keyframes critter-wiggle {
  0%, 100% { transform: rotate(calc(var(--rot, 0deg) - 4deg)) scale(1.08); }
  50%      { transform: rotate(calc(var(--rot, 0deg) + 4deg)) scale(1.08); }
}

/* Name label shown above the critter on hover */
.critter-label {
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(230, 226, 217, 0.9);
  color: #3a3226;
  border: 1px solid #3a3226;
  border-radius: 4px;
  padding: 0.2em 0.6em;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.critter-link:hover .critter-label {
  opacity: 1;
}

/* Respect people who've asked their system to reduce motion */
@media (prefers-reduced-motion: reduce) {
  .critter {
    animation: none;
    filter:
      drop-shadow(var(--outline-width) 0 0.5px var(--outline-color))
      drop-shadow(calc(var(--outline-width) * -1) 0 0.5px var(--outline-color))
      drop-shadow(0 var(--outline-width) 0.5px var(--outline-color))
      drop-shadow(0 calc(var(--outline-width) * -1) 0.5px var(--outline-color))
      drop-shadow(0 0 6px var(--glow-color));
  }
  .critter-link:hover .critter {
    animation: none;
    transform: rotate(var(--rot, 0deg)) scale(1.05);
  }
}

/* ==========================================================
   SMALL SCREENS
   Mobile drops the fixed full-screen "scene" entirely. The page
   scrolls normally, the background art becomes a true CSS
   background instead of a content image, and everything else
   stacks as normal document flow — except the footer, which is
   pinned with position: fixed so it's visible immediately on
   load, without needing to scroll all the way down to reach it.
   ========================================================== */
@media (max-width: 600px) {

  /* Let the whole page scroll normally instead of locking to one screen */
  body {
    height: auto;
    overflow: visible;
    background-image: url('assets/main_background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #2e2a20; /* fallback tone while it loads */
  }

  html {
    scroll-snap-type: y mandatory;
  }

  .mobile-hero {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .mobile-critters {
    scroll-snap-align: start;
    padding-bottom: 4.5em; /* keeps the last critter clear of the fixed footer bar */
  }

  /* Stage becomes a normal stacking container, not a fixed full-bleed scene */
  .stage {
    position: static;
    width: 100%;
    height: auto;
  }

  /* The old banner-style background image is replaced by the
     body background above — hide it here rather than deleting
     it from the HTML, so desktop is unaffected. */
  .scene-bg {
    display: none;
  }

  /* Header sticks to the top as you scroll */
  .homepage-header {
    position: sticky;
    top: 0;
    left: auto;
    transform: none;
    width: 100%;
  }

  /* Footer is pinned to the screen at all times — position: fixed
     (not sticky) is what makes it visible immediately on load,
     since its natural place in the document is far down the page
     after the critters. */
  .homepage-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    z-index: 6; /* above everything, including the sticky header */
  }

  /* Card becomes a normal block — no more absolute full-height +
     internal scroll, since the whole page scrolls now */
  .card {
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    transform: none;
    width: 90%;
    max-width: none;
    margin: 1.5em auto;
    overflow: visible;
    height: auto;
  }

  /* Critter links stack one under another, fixed size regardless
     of screen width — the link (not the image) now carries the
     positioning, so it's the link that gets overridden here. */
  .critter-link {
    position: static;
    display: block;
    width: 160px;
    margin: 1em auto;
  }

}