/* ===================================================== */
/* 1️⃣  Global reset & base styling                     */
/* ===================================================== */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;                /* keep the page from scrolling */
  background: #87cefa;             /* fallback sky colour */
  font-family: system-ui, sans-serif;
}

/* ===================================================== */
/* 2️⃣  Prairie background – moving sky→prairie        */
/* ===================================================== */
.prairie {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(
    #1e90ff 0%,
    #1e90ff 60%,
    #f4e27c 60%,
    #f4e27c 100%
  );
  background-size: 200% 100%;
  animation: scrollBg 8s linear infinite;
}

/* 2a. Horizon line (fixed at 60 % height) */
.prairie::before {
  content: "";
  position: absolute;
  top: 60%;
  left: 0; right: 0;
  height: 2px;
  background: #333;
}

/* 2b. Test stripe – travels with the gradient */
.prairie::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 19px,
    rgba(255,255,0,0.5) 20px
  );
  background-size: 20px 100%;
  opacity: .6;
  pointer-events: none;
  animation: scrollBg 8s linear infinite;
  z-index: 0;
}

/* ===================================================== */
/* 3️⃣  8‑bit clouds (static & moving)                  */
/* ===================================================== */
.cloud {
  width: 80px;
  height: 50px;
  background: #fff;
  border-radius: 10%;
  box-shadow:
    0 0 0 4px #fff,
    0 0 0 8px #fff,
    0 0 0 12px #fff;
  position: absolute;
  bottom: 65%;
  will-change: transform;
  /* default animation – overridden on .moving */
  animation: cloudMove 8s linear infinite;
}
.cloud.moving {
  /* moving clouds inherit the same animation as static ones */
  animation: cloudMove 8s linear infinite;
}

/* ===================================================== */
/* 4️⃣  8‑bit plants                                     */
/* ===================================================== */
.plant {
  width: 18px;
  height: 120px;
  background: #228b22;
  position: absolute;
  bottom: 30%;
  will-change: transform;
  animation: plantMove 8s linear infinite;
}

/* ===================================================== */
/* 5️⃣  Keyframes                                      */
/* ===================================================== */
@keyframes scrollBg {
  0%   { background-position: 0 0; }
  100% { background-position: -100% 0; }
}
@keyframes cloudMove {
  0%   { transform: translateX(100vw); }     /* start off‑right */
  100% { transform: translateX(-100px); }   /* move left off‑screen */
}
@keyframes plantMove {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100px); }
}

/* ===================================================== */
/* 6️⃣  Train – always above everything else          */
/* ===================================================== */
.train {
  position: absolute;          /* taken out of normal flow */
  transform: scaleX(-1);       /* flip horizontally */
  bottom: 40%;                 /* 10 % above the viewport bottom */
  left: 60%;                   /* centered horizontally (then shift) */
  width: 250px;
  max-width: 90%;
  z-index: 10;                 /* above prairie and its children */
  pointer-events: auto;        /* allow clicks / drag */
}

/* ===================================================== */
/* 7️⃣  Popup overlay – invisible until activated     */
/* ===================================================== */
.popup {
  position: absolute;           /* full‑screen catch‑all */
  inset: 0;
  display: none;                /* hidden by default */
  align-items: flex-end;        /* pull the cloud up from the train */
  justify-content: center;
  pointer-events: none;        /* clicks pass through unless .active */
}
.popup.active {                /* show the overlay */
  display: flex;
  pointer-events: auto;         /* allow the content to receive clicks */
}

/* ===================================================== */
/* 8️⃣  Popup content – the “zoom‑in” modal             */
/* ===================================================== */
.popup-content {
  position: relative;
  max-width: 90vw;          /* responsive – can grow to 90 % of the viewport */
  max-height: 90vh;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 10px 20px rgba(0,0,0,.2);
  padding: 10px;           /* breathing room for the video */
  transform: scale(.9);
  opacity: 0;
  transition: transform .35s ease-out, opacity .35s ease-out;
}
.popup.active .popup-content {
  transform: scale(1);
  opacity: 1;
  translate: 0; /* ensure it stays in place after transition */
}

