/* Lawn War landing page: the page is a slice through the backyard, sky to soil. */

@font-face {
  font-family: "Lilita One";
  src: url("assets/fonts/LilitaOne-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("assets/fonts/Fredoka.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --sky-top: #4fa3f0;
  --sky-low: #bfe5ff;
  --lawn: #58b245;
  --lawn-mown: #4ca33a;
  --hedge: #2f7a2a;
  --hedge-lit: #3f9036;
  --soil: #6b4226;
  --board: #fff8e6;
  --ink: #1e2a16;
  --leaf: #5cb84a;
  --leaf-dark: #2e6b22;
  --wood: #a8743f;
  --sun: #ffd84a;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Fredoka", ui-rounded, system-ui, sans-serif;
  /* white text with an ink outline, like the in-game labels */
  --outline: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 6px 0 var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--lawn-mown);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible, .btn:focus-visible { outline: 4px solid var(--sun); outline-offset: 4px; border-radius: 12px; }
p { margin: 0 0 1rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- buttons: the game's chunky toy buttons ---------- */
.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.1;
  text-decoration: none;
  padding: 0.7em 1.2em 0.75em;
  border: 3px solid var(--ink);
  border-bottom-width: 8px;
  border-radius: 16px;
  transition: transform 0.08s ease-out;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); border-bottom-width: 5px; }
.btn[hidden] { display: none; }
.btn-go {
  background: var(--leaf);
  color: #fff;
  text-shadow: 2px 0 0 var(--leaf-dark), -2px 0 0 var(--leaf-dark), 0 2px 0 var(--leaf-dark), 0 -2px 0 var(--leaf-dark), 0 3px 0 var(--leaf-dark);
}
.btn-go:hover { background: #6cc858; }
.btn-paper { background: var(--board); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.size { font-family: var(--body); font-weight: 600; font-size: 0.8em; text-shadow: none; opacity: 0.9; }

/* ---------- sky ---------- */
.sky {
  position: relative;
  overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-low) 78%);
  padding: 2.5rem 1.25rem 0;
  text-align: center;
}
.sky-inner { position: relative; z-index: 2; max-width: 52rem; margin: 0 auto; padding-bottom: 12.5rem; }
h1 { margin: 0; }
.logo { width: min(660px, 94vw); margin: 0 auto -1rem; filter: drop-shadow(0 10px 0 rgba(30, 42, 22, 0.16)); }
.lede { font-size: 1.3rem; line-height: 1.5; max-width: 33em; margin: 0 auto 1.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }
.aside { margin: 1.1rem 0 0; font-size: 1rem; }
.cloud { position: absolute; z-index: 1; opacity: 0.95; pointer-events: none; }
.c1 { width: 210px; top: 5%; left: 3%; }
.c2 { width: 290px; top: 14%; right: 4%; }
.c3 { width: 150px; top: 46%; left: 10%; opacity: 0.8; }

/* the horizon: hedge, a strip of lawn, and the one moving thing on the page */
.horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 11rem; z-index: 1; }
.horizon::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 4.75rem;
  background: repeating-linear-gradient(90deg, var(--lawn) 0 120px, var(--lawn-mown) 120px 240px);
  border-top: 4px solid var(--hedge);
}
.hedge {
  position: absolute; left: 0; right: 0; bottom: 4.6rem; height: 84px;
  background:
    radial-gradient(circle at 50% 42px, var(--hedge-lit) 0 30px, transparent 31px) 0 0 / 64px 84px repeat-x,
    radial-gradient(circle at 50% 56px, var(--hedge) 0 32px, transparent 33px) 32px 0 / 64px 84px repeat-x,
    linear-gradient(var(--hedge), var(--hedge)) 0 56px / 100% 28px no-repeat;
}
.parade { position: absolute; left: 0; right: 0; bottom: 1.1rem; height: 120px; overflow: hidden; z-index: 2; }
.walker { position: absolute; bottom: 0; left: 0; width: 92px; animation: march 26s linear infinite; }
.walker img { width: 100%; transform-origin: 50% 100%; }
.squirrel { animation-delay: -15s; }
.squirrel.late { animation-delay: -18.5s; }
.mole { width: 100px; animation-delay: -11s; }
.mower { width: 132px; animation-delay: -6.5s; }
.gnome { width: 88px; animation-delay: -2s; }
.squirrel img { animation: hop 0.42s ease-in-out infinite alternate; }
.mole img { animation: waddle 0.55s ease-in-out infinite alternate; }
.mower img { animation: rattle 0.14s steps(2) infinite; }
.gnome img { animation: hop 0.3s ease-in-out infinite alternate; }
.jet {
  position: absolute; left: 72%; top: 50%; width: 110px; height: 7px; border-radius: 4px;
  background: linear-gradient(90deg, #c9f1ff, #6fd3f0 60%, transparent);
  transform-origin: 0 50%;
  animation: squirt 0.6s ease-out infinite;
}
@keyframes march { from { transform: translateX(-180px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes hop { from { transform: translateY(0) scaleY(0.92); } to { transform: translateY(-16px) scaleY(1.02); } }
@keyframes waddle { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes rattle { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes squirt { from { transform: scaleX(0.2); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }

/* ---------- lawn ---------- */
.lawn {
  background: repeating-linear-gradient(90deg, var(--lawn) 0 160px, var(--lawn-mown) 160px 320px);
  padding: 1rem 1.25rem 3rem;
}
.lawn > section { max-width: 70rem; margin: 0 auto; padding: 3.5rem 0; }
h2, .cast h3 {
  font-family: var(--display);
  font-weight: 400;
  color: #fff;
  text-shadow: var(--outline);
  margin: 0 0 2.5rem;
}
h2 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; text-align: center; }

/* screenshots as photos laid on the grass */
.yard { position: relative; }
.photo {
  margin: 0;
  border: 6px solid var(--ink);
  border-radius: 22px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 12px 0 rgba(30, 42, 22, 0.35);
}
.photo-main { transform: rotate(-1.2deg); }
.photo-side {
  position: relative; z-index: 2;
  width: min(44%, 30rem);
  margin: -16% 2% 0 auto;
  transform: rotate(2.4deg);
}
.caption {
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.25;
  color: #fff;
  text-shadow: var(--outline);
  max-width: 19em;
  margin: -9% 0 0 1%;
  position: relative; z-index: 3;
}

/* signboards */
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 3rem 2.25rem; }
.board {
  position: relative;
  background: var(--board);
  border: 4px solid var(--ink);
  border-radius: 26px;
  padding: 1.75rem 1.75rem 1.9rem;
  box-shadow: 0 10px 0 rgba(30, 42, 22, 0.3);
}
.board h3 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.1; margin: 0 0 0.6rem; }
.board p { max-width: 36em; }
.board-icon { position: absolute; width: 104px; top: -56px; right: 14px; }
.board-shot { border: 3px solid var(--ink); border-radius: 14px; margin-top: 1.4rem; }

/* towers and creeps: signs on stakes, planted in the lawn */
.cast h3 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin: 0 0 4.5rem; text-align: center; }
.stakes { list-style: none; padding: 0; margin: 0 0 3.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.stake {
  position: relative;
  background: var(--board);
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 0 1.25rem 1.2rem;
  margin-bottom: 70px;
  text-align: center;
  box-shadow: 0 8px 0 rgba(30, 42, 22, 0.28);
}
.stake::after {
  content: "";
  position: absolute; left: 50%; bottom: -74px;
  width: 22px; height: 70px; transform: translateX(-50%);
  background: var(--wood);
  border: 4px solid var(--ink); border-top: 0;
  border-radius: 0 0 8px 8px;
  z-index: -1;
}
.stake:nth-child(1) { transform: rotate(-2deg); }
.stake:nth-child(2) { transform: rotate(1.4deg); }
.stake:nth-child(3) { transform: rotate(-0.6deg); }
.stake img { width: 132px; margin: -70px auto 0; }
.stake h4 { font-family: var(--display); font-weight: 400; font-size: 1.55rem; margin: 0.2rem 0 0; }
.stake .price { font-weight: 600; color: #8a5a12; margin: 0 0 0.5rem; }
.stake p:last-child { margin: 0; }

/* play together */
.board.wide { max-width: 46rem; margin: 0 auto; }
dl { margin: 0; }
dt { font-family: var(--display); font-size: 1.45rem; }
dd { margin: 0 0 1.2rem; }
dd:last-child { margin-bottom: 0; }

/* downloads as seed packets */
.packets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.25rem; align-items: stretch; }
.packet {
  display: flex; flex-direction: column;
  background: #fffdf5;
  border: 4px solid var(--ink);
  border-radius: 8px 8px 20px 20px;
  padding: 0 1.5rem 1.6rem;
  box-shadow: 0 10px 0 rgba(30, 42, 22, 0.3);
}
.packet[data-os="web"] { --packet: var(--sun); }
.packet[data-os="windows"] { --packet: #8ec5ff; }
.packet[data-os="mac"] { --packet: #ffa9c2; }
.packet-art {
  position: relative;
  display: grid; place-items: center;
  height: 180px;
  margin: 0 -1.5rem 1.25rem;
  background: radial-gradient(circle at 50% 115%, rgba(255, 255, 255, 0.6), transparent 62%), var(--packet);
  border-bottom: 4px solid var(--ink);
  border-radius: 4px 4px 0 0;
}
.packet-art::before { /* the crimped seal at the top of a seed packet */
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 18px;
  background: repeating-linear-gradient(90deg, rgba(30, 42, 22, 0.3) 0 3px, transparent 3px 10px);
  border-bottom: 3px solid var(--ink);
}
.packet-art img { width: 136px; margin-top: 16px; }
.packet h3 { font-family: var(--display); font-weight: 400; font-size: 1.75rem; margin: 0 0 0.5rem; }
.packet p { flex: 1; }
.packet .btn { align-self: flex-start; font-size: 1.15rem; }
.packet.mine { outline: 6px solid var(--sun); outline-offset: 6px; }

/* controls */
.controls table { border-collapse: collapse; width: 100%; }
.controls td { padding: 0.35rem 0.5rem 0.35rem 0; vertical-align: middle; }
.controls td:first-child { white-space: nowrap; width: 1%; padding-right: 1.25rem; }
kbd {
  display: inline-block;
  font-family: var(--display);
  font-size: 0.95rem;
  min-width: 2.1em;
  text-align: center;
  padding: 0.12em 0.5em 0.22em;
  margin: 0.15em 0.15em 0.15em 0;
  background: #fff;
  border: 3px solid var(--ink);
  border-bottom-width: 5px;
  border-radius: 9px;
}

/* ---------- soil ---------- */
.soil {
  position: relative;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.07) 0 6px, transparent 7px) 0 0 / 90px 70px,
    radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.12) 0 9px, transparent 10px) 0 0 / 130px 90px,
    var(--soil);
  color: #f6e8d2;
  padding: 3rem 1.25rem 2.5rem;
  text-align: center;
  font-size: 1rem;
  border-top: 10px solid var(--hedge);
}
.soil p { max-width: 42em; margin: 0 auto 0.75rem; }
.version { opacity: 0.7; font-size: 0.9rem; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .stakes, .packets { grid-template-columns: 1fr; max-width: 26rem; margin-left: auto; margin-right: auto; }
  .stakes { gap: 4.5rem; }
  .photo-side { width: 80%; margin: -8% 0 0 auto; }
  .caption { margin: 1.5rem 0 0; }
  .c3 { display: none; }
  .c1 { width: 110px; top: 2%; left: -2%; }
  .c2 { width: 130px; top: 26%; right: -4%; opacity: 0.7; }
  .lede { font-size: 1.15rem; }
  .sky-inner { padding-bottom: 11rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .walker, .walker img, .jet { animation: none; }
  .squirrel { left: 74%; } .squirrel.late { left: 86%; } .mole { left: 58%; } .mower { left: 38%; } .gnome { left: 22%; }
  .btn, .btn:hover, .btn:active { transition: none; transform: none; }
}
