/* ---------- Wish Upon A Llama ---------- */

@font-face {
  font-family: "Orange Kid";
  src: url("../assets/fonts/orange-kid.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --sky: #5ec8f8;
  --sky-deep: #3ab0ef;
  --cream: #fff8f0;
  --paper: #fffdf9;
  --pink: #fbd3de;
  --pink-deep: #f06d9d;
  --lav: #d7c9f2;
  --lav-deep: #8f78c9;
  --mint: #c4ecd1;
  --mint-deep: #4aa675;
  --blue-chip: #cde9fb;
  --blue-deep: #2f8fc9;
  --ink: #58453c;
  --ink-soft: #7d6a5f;
  --shadow: 0 10px 30px rgba(88, 69, 60, .12);
  --radius: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Orange Kid", system-ui, sans-serif;
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
}

h2 {
  font-size: clamp(2.2rem, 4.5vw, 3.1rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: .5em;
}

.kicker {
  text-align: center;
  color: var(--pink-deep);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .95rem;
  margin-bottom: .8em;
}

section { padding: 88px 24px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-weight: 600;
  font-size: 1.15rem;
  padding: .8em 1.7em;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn-primary {
  background: var(--pink-deep);
  color: #fff;
  box-shadow: 0 6px 0 #cc4f7f, 0 14px 26px rgba(240, 109, 157, .35);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #cc4f7f, 0 20px 32px rgba(240, 109, 157, .4);
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 3px 0 #cc4f7f; }

.btn-epic {
  background: #2f2f38;
  color: #fff;
  box-shadow: 0 6px 0 #17171d, 0 14px 26px rgba(23, 23, 29, .35);
}
.btn-epic:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #17171d, 0 20px 32px rgba(23, 23, 29, .4);
}
.btn-epic:active { transform: translateY(2px); box-shadow: 0 3px 0 #17171d; }

.btn-ghost {
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { transform: translateY(-3px); background: #fff; }

.btn-big { font-size: 1.2rem; padding: 1em 2.4em; }

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 16px;
  background: rgba(255, 253, 249, .8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav-llama {
  width: 36px; height: 36px;
  border-radius: 50%;
  image-rendering: pixelated;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.nav-brand:hover .nav-llama { animation: wiggle .5s ease-in-out; }

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-links > a:not(.btn) {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  padding: .45em .85em;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.nav-links > a:not(.btn):hover { background: var(--pink); color: var(--ink); }

.btn-nav {
  background: var(--pink-deep);
  color: #fff;
  font-size: 1rem;
  padding: .55em 1.2em;
  box-shadow: 0 3px 0 #cc4f7f;
}
.btn-nav:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #cc4f7f; }

.btn-nav-epic {
  background: #2f2f38;
  box-shadow: 0 3px 0 #17171d;
}
.btn-nav-epic:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #17171d; }

@media (max-width: 1120px) {
  .btn-nav-long { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  /* a little taller than the viewport: extra sky so the logo and buttons
     keep clear of the train scene at the bottom */
  min-height: calc(100svh + 90px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* solid sky plus scattered pixel star-specks matching the scene art */
  background-color: #1d82ed;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="220" height="220"><g fill="%23ffffff"><rect x="24" y="18" width="2" height="2" opacity=".9"/><rect x="130" y="42" width="2" height="2" opacity=".65"/><rect x="196" y="12" width="2" height="2" opacity=".8"/><rect x="66" y="74" width="2" height="2" opacity=".7"/><rect x="178" y="96" width="2" height="2" opacity=".9"/><rect x="12" y="126" width="2" height="2" opacity=".6"/><rect x="104" y="140" width="2" height="2" opacity=".85"/><rect x="210" y="168" width="2" height="2" opacity=".7"/><rect x="48" y="188" width="2" height="2" opacity=".8"/><rect x="150" y="204" width="2" height="2" opacity=".6"/><rect x="88" y="10" width="2" height="2" opacity=".5"/><rect x="160" y="130" width="2" height="2" opacity=".55"/></g></svg>');
  background-size: 220px 220px;
  overflow: hidden;
}

/* falling petals: a fixed field over the whole page, populated by main.js */
.petal-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

.petal {
  position: absolute;
  top: -30px;
  width: 12px; height: 12px;
  background: #f7bfd4;
  border-radius: 60% 40% 60% 40%;
  opacity: .8;
  animation: fall linear infinite;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(540deg); }
}

/* petals shed by the cursor */
.trail-petal {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  border-radius: 60% 40% 60% 40%;
  animation: trailFall 1.1s ease-out forwards;
}

@keyframes trailFall {
  0%   { opacity: .9; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0;  transform: translate(var(--driftx, 10px), 70px) rotate(var(--spin, 200deg)); }
}

/* a second, sparser set of specks that blink like twinkling stars */
.sky-twinkle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="220" height="220"><g fill="%23ffffff"><rect x="58" y="34" width="2" height="2"/><rect x="170" y="70" width="2" height="2"/><rect x="30" y="150" width="3" height="3"/><rect x="118" y="104" width="2" height="2"/><rect x="188" y="190" width="2" height="2"/><rect x="86" y="196" width="2" height="2"/></g></svg>');
  background-size: 220px 220px;
  animation: skyFlicker 2.8s steps(1) infinite;
}

@keyframes skyFlicker {
  0%, 100% { opacity: .9; }
  30% { opacity: .2; }
  55% { opacity: .75; }
  80% { opacity: .35; }
}

/* an occasional pixel shooting star, spawned by main.js */
.shooting-star {
  position: absolute;
  width: 3px; height: 3px;
  background: #fff;
  z-index: 1;
  pointer-events: none;
  box-shadow:
    6px -3px 0 rgba(255, 255, 255, .8),
    12px -6px 0 rgba(255, 255, 255, .6),
    18px -9px 0 rgba(255, 255, 255, .4),
    24px -12px 0 rgba(255, 255, 255, .22);
  animation: shoot 1.2s ease-out forwards;
}

@keyframes shoot {
  0%   { opacity: 0; transform: translate(0, 0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-200px, 100px); }
}

.hero-inner {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 120px 24px 0;
  max-width: 760px;
  margin: 0 auto;
}

.hero-logo {
  width: min(480px, 84vw);
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 24px rgba(30, 90, 140, .35));
  animation: bob 5s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-tag {
  margin-top: 18px;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(20, 70, 130, .55);
}

.hero-cta {
  margin-top: 26px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-platforms {
  margin-top: 24px;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .85);
  text-shadow: 0 2px 4px rgba(20, 70, 130, .5);
}

/* ---------- Parallax train scene ----------
   Pixel-art layers lifted straight from the game's train loading screen.
   --s is the integer-ish pixel scale; layer speeds are set in main.js. */

.parallax {
  --s: 2;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.layer {
  position: absolute;
  left: 0;
  width: 100%;
  image-rendering: pixelated;
  background-repeat: repeat-x;
}

.layer-scene {
  bottom: 0;
  height: calc(382px * var(--s));
  background-image: url("../assets/parallax/scene-tall.png");
  background-size: calc(960px * var(--s)) calc(382px * var(--s));
  background-position: bottom left;
}

.train {
  position: absolute;
  bottom: calc(48px * var(--s));
  left: 50%;
  transform: translateX(-50%);
  width: calc(253px * var(--s));
  height: auto;
  image-rendering: pixelated;
  animation: chug 1.1s steps(2) infinite;
}

@keyframes chug {
  0%, 100% { margin-bottom: 0; }
  50% { margin-bottom: calc(1px * var(--s)); }
}

/* tree line on the lakeshore, behind the passing train */
.layer-backtrees {
  bottom: calc(62px * var(--s));
  height: calc(108px * var(--s));
  background-image: url("../assets/parallax/trees.png");
  background-size: calc(1920px * var(--s)) calc(108px * var(--s));
  filter: brightness(.95) saturate(.9);
}

/* the near bank: grass + rails as one piece, rushing past under the train */
.layer-track {
  bottom: 0;
  height: calc(102px * var(--s));
  background-image: url("../assets/parallax/track.png");
  background-size: calc(960px * var(--s)) calc(102px * var(--s));
}

.layer-ground {
  bottom: calc(-38px * var(--s));
  height: calc(88px * var(--s));
  background-image: url("../assets/parallax/ground.png");
  background-size: calc(1920px * var(--s)) calc(88px * var(--s));
}

/* trees that sweep past in the near foreground */
.layer-trees {
  bottom: calc(2px * var(--s));
  height: calc(108px * var(--s));
  background-image: url("../assets/parallax/trees.png");
  background-size: calc(1920px * var(--s)) calc(108px * var(--s));
}

.scene-fade {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: calc(60px * var(--s));
  background: linear-gradient(180deg, #1d82ed 0%, rgba(29, 130, 237, 0) 100%);
  pointer-events: none;
}

/* on shorter viewports, shrink the scene so the sky stays clear behind the logo */
@media (max-height: 1020px) {
  .parallax { --s: 1.5; }
}
@media (max-width: 900px) {
  .parallax { --s: 1.5; }
}
@media (max-width: 520px), (max-height: 700px) {
  .parallax { --s: 1.25; }
}

.scallop {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 44px;
  z-index: 3;
}

/* ---------- About ---------- */

.about { text-align: center; }

.about-lede {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.3rem;
  color: var(--ink-soft);
}

.stats {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 44px;
}

.stats li {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 36px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform .2s ease;
}
.stats li:hover { transform: translateY(-5px) rotate(-1deg); }
.stats li:nth-child(2):hover { transform: translateY(-5px) rotate(1deg); }

.stat-num {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--pink-deep);
  line-height: 1.1;
}
.stats li:nth-child(2) .stat-num { color: var(--lav-deep); }
.stats li:nth-child(3) .stat-num { color: var(--mint-deep); }

.stat-label { font-weight: 700; color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- Features ---------- */

.features {
  max-width: 1060px;
  margin: 0 auto;
}

.feature {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  margin-top: 72px;
}

.feature:nth-child(odd) .feature-img { order: 2; }

.feature-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 6px solid #fff;
  transition: transform .25s ease, box-shadow .25s ease;
}
.feature-img:hover {
  transform: translateY(-6px) rotate(-.6deg);
  box-shadow: 0 22px 44px rgba(88, 69, 60, .2);
}
.feature-img img { width: 100%; display: block; }

.feature-chip {
  display: inline-block;
  font-weight: 800;
  font-size: 1rem;
  padding: .35em 1em;
  border-radius: 999px;
  margin-bottom: 14px;
}
.chip-pink { background: var(--pink); color: #b4356b; }
.chip-mint { background: var(--mint); color: #2e7a52; }
.chip-lav  { background: var(--lav);  color: #6a4fae; }
.chip-blue { background: var(--blue-chip); color: #1f74a8; }

.feature-text h3 {
  font-size: clamp(1.7rem, 3vw, 2.1rem);
  font-weight: 600;
  margin-bottom: .4em;
}

.feature-text p { color: var(--ink-soft); }

/* ---------- Gallery ---------- */

.gallery { max-width: 1100px; margin: 0 auto; }

.gallery-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.shot {
  border: 5px solid #fff;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  cursor: zoom-in;
  background: none;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  line-height: 0;
}
.shot:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 18px 36px rgba(88, 69, 60, .22);
}
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

/* stagger the gallery reveal so shots cascade in */
.gallery-grid .shot:nth-child(2) { transition-delay: .07s; }
.gallery-grid .shot:nth-child(3) { transition-delay: .14s; }
.gallery-grid .shot:nth-child(4) { transition-delay: .21s; }
.gallery-grid .shot:nth-child(5) { transition-delay: .07s; }
.gallery-grid .shot:nth-child(6) { transition-delay: .14s; }
.gallery-grid .shot:nth-child(7) { transition-delay: .21s; }
.gallery-grid .shot:nth-child(8) { transition-delay: .28s; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  background: none;
  padding: 0;
  width: min(1200px, 92vw);
  height: fit-content;
  max-height: 92vh;
  overflow: visible;
  outline: none;
}
.lightbox::backdrop { background: rgba(40, 28, 24, .82); backdrop-filter: blur(4px); }
.lightbox img {
  width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  display: block;
}
.lightbox-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  z-index: 1;
}

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center;
  background:
    radial-gradient(ellipse at 20% 120%, rgba(247, 191, 212, .5), transparent 55%),
    radial-gradient(ellipse at 80% 120%, rgba(215, 201, 242, .5), transparent 55%),
    linear-gradient(180deg, var(--cream), #fff1f6);
  padding: 110px 24px;
}

.cta-llama {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: var(--shadow);
  image-rendering: pixelated;
  animation: bob 4s ease-in-out infinite;
}

.cta-band h2 { margin-top: 18px; }
.cta-band p { color: var(--ink-soft); font-weight: 700; margin-bottom: 28px; }
.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cta-band .btn-big { animation: heartbeat 2.6s ease-in-out infinite; }
.cta-band .btn-epic.btn-big { animation-delay: .4s; }

@keyframes heartbeat {
  0%, 40%, 100% { transform: scale(1); }
  20% { transform: scale(1.05); }
  30% { transform: scale(1.02); }
}
.cta-band .btn-big:hover { animation: none; transform: translateY(-3px); }

.store-badges {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.store-badge {
  display: inline-block;
  padding: .45em 1.1em;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(88, 69, 60, .12);
  transition: transform .15s ease;
}
a.store-badge:hover { transform: translateY(-2px); color: var(--pink-deep); }
.store-badge.soon { opacity: .68; }

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 44px 24px 56px;
  background: #4a3a33;
  color: #e9ddd6;
  font-size: 1.1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.footer-links a {
  color: #ffd7e6;
  font-weight: 800;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-links span { opacity: .4; }

.footer-fine { margin-top: 8px; opacity: .55; font-size: .95rem; }

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }

.preview .hero { min-height: auto; padding-top: 40px; }
.preview .reveal { opacity: 1; transform: none; transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .petal, .hero-logo, .cta-llama, .train, .sky-twinkle, .shooting-star,
  .cta-band .btn-big, .nav-brand:hover .nav-llama { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .nav-links > a:not(.btn) { display: none; }

  .feature,
  .feature:nth-child(odd) {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .feature:nth-child(odd) .feature-img { order: 0; }

  section { padding: 64px 20px; }
}
