/* Landing page in the look of the game: cream paper, ink outlines, gold title, sky gradient. */
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --cream: #FFF4E0;
  --paper: #FFFDF6;
  --ink: #3B2A3F;
  --gold: #FFC94A;
  --leaf: #5DBB63;
  --leaf-dark: #2E8B57;
  --sky: #7FD8F5;
  --teal: #3FC1C9;
  --pink: #FF7BAC;
  --shadow: rgba(59, 42, 63, 0.35);
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  font-family: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

.small { font-size: 0.9rem; }

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

/* Language switch in the top corner (the page of the other language). */
.lang-switch {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  padding: 6px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--ink);
}
.lang-switch:hover { transform: translateY(-1px); }
.lang-switch:focus-visible { outline: 4px solid var(--pink); outline-offset: 3px; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(32px, 6vw, 80px) clamp(16px, 5vw, 72px) clamp(40px, 7vw, 96px);
  background: radial-gradient(circle at 30% 20%, var(--sky) 0%, var(--teal) 48%, var(--leaf-dark) 100%);
  border-bottom: 5px solid var(--ink);
}

.hero-text { color: var(--cream); }

h1 {
  margin: 0;
  font-size: clamp(56px, 10vw, 118px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--gold);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 8px 0 var(--shadow);
}

.tagline {
  margin: 12px 0 18px;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 600;
  text-shadow: 0 2px 0 var(--ink);
}

.intro {
  max-width: 34em;
  margin: 0 0 26px;
  font-size: 1.1rem;
  text-shadow: 0 1px 0 rgba(59, 42, 63, 0.6);
}

.play {
  display: inline-block;
  padding: 14px 40px 16px;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--gold);
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 7px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}

.play:hover { transform: translateY(-2px); box-shadow: 0 9px 0 var(--ink); }
.play:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.play:focus-visible, .shop:focus-visible { outline: 4px solid var(--pink); outline-offset: 4px; }

.note { margin: 18px 0 0; font-weight: 600; text-shadow: 0 1px 0 var(--ink); }
.note.small { margin-top: 6px; font-weight: 500; opacity: 0.95; }

.hero-shot {
  margin: 0;
  border: 5px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 10px 0 var(--shadow);
  transform: rotate(1deg);
}

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

main { padding: clamp(32px, 6vw, 72px) clamp(16px, 5vw, 72px); }

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 32px);
  max-width: 1280px;
  margin: 0 auto;
}

.card {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 7px 0 var(--shadow);
}

.card img { border-bottom: 4px solid var(--ink); }
.card h2 { margin: 16px 20px 4px; font-size: 1.45rem; }
.card p { margin: 0 20px 22px; }

/* --- Shops -------------------------------------------------------------------------------- */

.shops {
  max-width: 900px;
  margin: clamp(40px, 7vw, 88px) auto 0;
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 7px 0 var(--shadow);
}

.shops h2 { margin: 0 0 8px; font-size: clamp(26px, 3.4vw, 36px); color: var(--leaf-dark); }
.shops p { margin: 0 auto 20px; max-width: 36em; }

.shop-buttons { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

.shop {
  padding: 12px 28px 14px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  text-shadow: 0 2px 0 var(--ink);
  background: var(--leaf);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink);
}

.shop[data-shop="ebay"] { background: var(--teal); }
.shop:hover { transform: translateY(-2px); }
.shop-soon { font-weight: 600; opacity: 0.8; }

/* --- Headings of the longer sections ------------------------------------------------------ */

.section-head { max-width: 900px; margin: clamp(56px, 9vw, 112px) auto clamp(28px, 4vw, 44px); text-align: center; }
.section-head h2, .showcase h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.15;
  color: var(--leaf-dark);
}
.section-head p { margin: 0 auto; max-width: 40em; font-size: 1.08rem; }

.kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding: 3px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--gold);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
}

/* --- How it works: four numbered steps ---------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(22px, 2.6vw, 30px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 40px 20px 22px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 7px 0 var(--shadow);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -24px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gold);
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 4px 0 var(--ink);
}

.step h3 { margin: 0 0 6px; font-size: 1.3rem; }
.step p { margin: 0; }

/* --- A video next to its text ------------------------------------------------------------- */

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
  max-width: 1280px;
  margin: clamp(56px, 9vw, 112px) auto 0;
}

.showcase.flip .media { order: 2; }
.showcase p { margin: 0 0 12px; font-size: 1.06rem; }

.media {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper);
  border: 5px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 10px 0 var(--shadow);
}

.media video, .media img { width: 100%; height: 100%; object-fit: cover; }
.hero-shot video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.facts li {
  padding: 5px 14px;
  font-weight: 600;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--shadow);
}
.facts strong { color: var(--leaf-dark); font-size: 1.15em; }

/* --- Plant gallery ------------------------------------------------------------------------ */

.plants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: clamp(14px, 2vw, 24px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.plant {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--shadow);
}

.plant img { aspect-ratio: 1; object-fit: contain; border-bottom: 3px dashed rgba(59, 42, 63, 0.25); }
.plant-body { padding: 12px 14px 16px; }
.plant h3 { margin: 0; font-size: 1.12rem; line-height: 1.2; }
.latin { margin: 2px 0 8px; font-size: 0.9rem; font-style: italic; opacity: 0.75; }

.rarity {
  display: inline-block;
  padding: 1px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cream);
  text-shadow: 0 1px 0 var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
/* The rarity colours of the game (Palette.RARITY_COLORS). */
.rarity-0 { background: #9DB59A; }
.rarity-1 { background: #4CC26A; }
.rarity-2 { background: #3F8FE0; }
.rarity-3 { background: #8E6CEF; }
.rarity-4 { background: #FFC94A; color: var(--ink); text-shadow: none; }
.rarity-5 { background: #FF7BAC; }

/* Long origins and facts stay short on the card (the game shows them in full). */
.origin, .fact { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.origin { margin: 8px 0 4px; font-size: 0.92rem; font-weight: 600; -webkit-line-clamp: 2; line-clamp: 2; }
.fact { margin: 0; font-size: 0.92rem; -webkit-line-clamp: 5; line-clamp: 5; }

/* --- Mutations ---------------------------------------------------------------------------- */

.mutation-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  max-width: 1280px;
  margin: 28px auto 0;
  padding: 0;
  list-style: none;
}
.mutation-list li { padding: 9px 14px; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; }
.mutation-list b { display: block; color: var(--leaf-dark); }
.mutation-list .magic b { color: #8E6CEF; }

/* --- Seasons ------------------------------------------------------------------------------ */

.seasons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 1280px; margin: 28px auto 0; }
.seasons figure {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--shadow);
}
.seasons figcaption { padding: 6px 10px; font-weight: 700; text-align: center; }

/* --- Questions ---------------------------------------------------------------------------- */

.faq { max-width: 900px; margin: 0 auto; }
.faq details {
  margin: 0 0 12px;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--shadow);
}
.faq summary { padding: 14px 20px; font-size: 1.1rem; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq summary:focus-visible { outline: 4px solid var(--pink); outline-offset: 3px; border-radius: 12px; }
.faq details p { margin: 0; padding: 0 20px 16px; }

.cta { margin: clamp(48px, 8vw, 96px) auto 0; text-align: center; }
.cta h2 { margin: 0 0 20px; font-size: clamp(26px, 3.4vw, 38px); color: var(--leaf-dark); }
.cta .note { text-shadow: none; }

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

footer {
  margin-top: clamp(40px, 7vw, 88px);
  padding: 28px 16px 36px;
  text-align: center;
  color: var(--cream);
  background: var(--ink);
}

footer p { margin: 4px 0; }

/* --- Small screens ------------------------------------------------------------------------ */

@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .intro { margin-left: auto; margin-right: auto; }
  .hero-shot { transform: none; }
  .features { grid-template-columns: 1fr; max-width: 560px; }
  .showcase { grid-template-columns: 1fr; }
  .showcase.flip .media { order: 0; }
  .seasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .plants { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .plant-body { padding: 10px 10px 12px; }
  .fact { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .play, .shop { transition: none; }
}

/* On narrow screens the title starts below the switch. */
@media (max-width: 700px) {
  .hero { padding-top: 72px; }
}

/* --- Hype: moving title, claim, floating plants, sparkles --------------------------------- */

.hero { overflow: hidden; }
.hero-text, .hero-shot { position: relative; z-index: 1; }

h1 span { display: inline-block; animation: bob 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * 0.13s); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(-2deg); } }

.claim {
  margin: 6px 0 14px;
  font-size: clamp(30px, 4.3vw, 54px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--cream);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
}
.claim em { font-style: normal; color: var(--gold); }

.play.big { padding: 16px 44px 18px; font-size: clamp(24px, 3vw, 32px); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 7px 0 var(--ink), 0 0 0 0 rgba(255, 201, 74, 0.75); }
  50% { box-shadow: 0 7px 0 var(--ink), 0 0 0 16px rgba(255, 201, 74, 0); }
}

.float {
  position: absolute;
  z-index: 0;
  width: clamp(70px, 8.5vw, 128px);
  pointer-events: none;
  filter: drop-shadow(0 8px 0 rgba(59, 42, 63, 0.25));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-16px) rotate(calc(var(--r, 0deg) * -1)); } }

.sparkle {
  position: absolute;
  z-index: 0;
  width: 16px;
  height: 16px;
  pointer-events: none;
  background: radial-gradient(circle, #FFFDF6 0 25%, rgba(255, 253, 246, 0) 70%);
  border-radius: 50%;
  animation: twinkle 2.6s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.3); } 50% { opacity: 1; transform: scale(1.1); } }

/* --- Numbers and the band of plants ------------------------------------------------------- */

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 34px;
  margin: 0;
  padding: 18px 16px;
  list-style: none;
  color: var(--cream);
  background: var(--ink);
}
.stats li { font-size: 1.05rem; font-weight: 600; }
.stats strong { margin-right: 6px; font-size: 1.9rem; color: var(--gold); }

.band { overflow: hidden; padding: 16px 0; background: var(--leaf-dark); border-bottom: 5px solid var(--ink); }
.band-track { display: flex; gap: 36px; width: max-content; animation: band 45s linear infinite; }
.band img { width: auto; height: 100px; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.25)); }
@keyframes band { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- The four clips in phone frames ------------------------------------------------------- */

.phones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2.6vw, 34px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 0 20px;
  list-style: none;
}
.phone { position: relative; margin: 0; padding: 9px; background: var(--ink); border-radius: 34px; box-shadow: 0 10px 0 var(--shadow); }
.phone:nth-child(odd) { transform: rotate(-2deg); }
.phone:nth-child(even) { transform: rotate(2deg) translateY(18px); }
.phone video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; background: var(--ink); border-radius: 26px; }
.phone figcaption {
  position: absolute;
  bottom: -16px;
  left: 50%;
  padding: 4px 16px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--gold);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  transform: translateX(-50%);
}

/* --- Rarity ladder ------------------------------------------------------------------------ */

.ladder {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.ladder li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 16px;
  text-align: center;
  background: var(--paper);
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--shadow);
}
.ladder img { width: 100%; max-width: 130px; aspect-ratio: 1; object-fit: contain; }
.ladder small { font-weight: 600; line-height: 1.2; }
.ladder li:last-child { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow {
  0%, 100% { box-shadow: 0 6px 0 var(--shadow), 0 0 16px 2px rgba(255, 123, 172, 0.45); }
  50% { box-shadow: 0 6px 0 var(--shadow), 0 0 34px 10px rgba(255, 123, 172, 0.8); }
}

/* Magical mutations shimmer. */
.mutation-list .magic {
  background: linear-gradient(120deg, var(--paper) 30%, #EFE6FF 50%, var(--paper) 70%);
  background-size: 250% 100%;
  animation: shimmer 3.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.plant { transition: transform 0.18s; }
.plant:hover { transform: translateY(-5px) rotate(-1deg); }

/* Sections slide in while scrolling (only with scripts, so nothing stays hidden without). */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.6s, transform 0.6s; }
.js .reveal.shown { opacity: 1; transform: none; }

/* The final call: the sky of the hero again, with sparkles. */
.cta {
  position: relative;
  max-width: 1180px;
  padding: clamp(36px, 6vw, 70px) 16px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 25%, var(--sky) 0%, var(--teal) 55%, var(--leaf-dark) 100%);
  border: 5px solid var(--ink);
  border-radius: 28px;
  box-shadow: 0 10px 0 var(--shadow);
}
.cta h2 { position: relative; color: var(--cream); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.cta .play, .cta .note { position: relative; }
.cta .note { color: var(--cream); text-shadow: 0 1px 0 var(--ink); }

/* Phones: a play button that stays at the bottom once the big one has scrolled away. */
.sticky-play { position: fixed; right: 12px; bottom: 12px; left: 12px; z-index: 5; display: none; }
.sticky-play .play { display: block; padding: 12px 20px 14px; text-align: center; }

@media (max-width: 900px) {
  .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 44px; }
  .ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .float { display: none; }
}

@media (max-width: 700px) {
  .sticky-play.on { display: block; }
  footer { padding-bottom: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  h1 span, .play.big, .float, .sparkle, .band-track, .ladder li:last-child, .mutation-list .magic { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* --- Legal pages (privacy) ---------------------------------------------------------------- */

.legal-top { padding: 18px clamp(16px, 5vw, 72px); background: var(--teal); border-bottom: 5px solid var(--ink); }
.legal-top a { font-size: 1.6rem; font-weight: 700; color: var(--gold); text-decoration: none; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.legal { max-width: 820px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) 16px; }
.legal h1 { font-size: clamp(34px, 5vw, 48px); -webkit-text-stroke: 3px var(--ink); }
.legal h2 { margin: 30px 0 8px; font-size: 1.35rem; color: var(--leaf-dark); }
.legal p, .legal li { font-size: 1.02rem; }
.legal ul { padding-left: 1.2em; }
.legal .box { padding: 16px 20px; background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 var(--shadow); }
footer a { color: var(--gold); }
