@font-face {
  font-family: "FrogSnack";
  src: url("assets/FrogSnack.ttf") format("truetype");
  font-display: swap;
}

:root {
  --sky: #9cd5ea;
  --water: #3d9da2;
  --deep: #1b3a40;
  --deep-2: #22474e;
  --ink: #e9f6f1;
  --ink-soft: #b9d8d2;
  --gold: #ffe066;
  --gold-shadow: #5a3a06;
  --wood: #c98a4b;
  --wood-hi: #e4ad6c;
  --wood-lo: #8a5427;
  --wood-edge: #3b2210;
  --cream: #fff4dc;
  --leaf: #2f7a1f;
  --leaf-hi: #5cb040;
  --leaf-lo: #1f5414;
  --leaf-edge: #173008;
  --s: 2; /* sprite scale, whole numbers only */
}

* { box-sizing: border-box; }

html {
  background: var(--deep);
  scroll-behavior: smooth;
  scrollbar-color: var(--water) var(--deep);
}

body {
  margin: 0;
  font-family: "FrogSnack", ui-rounded, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--deep);
  -webkit-font-smoothing: none;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--gold); color: var(--wood-edge); }

a { color: var(--gold); text-underline-offset: 4px; text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

img, .sprite { image-rendering: pixelated; }

/* ---------- The pond (first screen) ---------- */

.pond {
  --u: calc(var(--s) * 1px); /* one art pixel */
  position: relative;
  min-height: 100svh;
  min-height: max(100svh, 640px);
  overflow: hidden;
  background:
    url("assets/bg_pond_clear.png") repeat-x center bottom calc(40 * var(--u)) / calc(180 * var(--u)) calc(320 * var(--u)),
    linear-gradient(var(--water), var(--water)) center bottom / 100% calc(41 * var(--u)) no-repeat,
    var(--sky);
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sky { position: absolute; inset: 0; pointer-events: none; }

.cloud {
  position: absolute;
  left: 0;
  background: url("assets/cloud_big.png") 0 0 / 100% 100%;
  width: calc(81 * var(--u)); height: calc(30 * var(--u));
  animation: drift 90s linear infinite;
}
.cloud-a { top: 10%; animation-delay: -20s; }
.cloud-b, .cloud-c { width: calc(61 * var(--u)); background-image: url("assets/cloud_small.png"); }
.cloud-b { top: 30%; animation-duration: 120s; animation-delay: -75s; }
.cloud-c { top: 3%; animation-duration: 150s; animation-delay: -40s; }

@keyframes drift {
  from { transform: translateX(-260px); }
  to { transform: translateX(calc(100vw + 20px)); }
}

.title {
  position: relative;
  margin-top: clamp(72px, 14svh, 140px);
  text-align: center;
  padding: 0 16px;
}

.wordmark {
  margin: 0;
  line-height: 0;
  font-size: 0;
}
.wordmark .logo {
  display: block;
  margin: 0 auto;
  width: 246px; height: 177px; /* the logo is 82x59 art pixels: 3x on phones */
  image-rendering: pixelated;
}

.tagline {
  margin: 12px 0 0;
  font-size: 16px;
  color: var(--wood-edge);
}

/* Frog on a lily pad, sitting on the water. Every size is in art pixels (--u). */
.diorama {
  position: absolute;
  left: 50%;
  bottom: calc(38 * var(--u));
  width: calc(100 * var(--u));
  height: calc(115 * var(--u));
  margin-left: calc(-50 * var(--u));
}

.pad {
  position: absolute;
  left: calc(18 * var(--u)); bottom: 0;
  width: calc(64 * var(--u)); height: calc(64 * var(--u));
  background: url("assets/prop_lilypad.png") 0 0 / 100% 100%;
}

.frog {
  position: absolute;
  left: calc(16 * var(--u)); bottom: calc(17 * var(--u));
  width: calc(68 * var(--u)); height: calc(68 * var(--u));
  padding: 0;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: url("assets/frog_classic.png") 0 calc(-204 * var(--u)) / calc(612 * var(--u)) calc(476 * var(--u)) no-repeat;
  animation: idle 1.2s steps(9) infinite;
}
.frog.lick { animation: lick .42s steps(7) 1 forwards; }
.frog.happy { animation: happy .9s steps(9) 1 forwards; }

@keyframes idle  { from { background-position: 0 calc(-204 * var(--u)); } to { background-position: calc(-612 * var(--u)) calc(-204 * var(--u)); } }
@keyframes lick  { from { background-position: 0 calc(-408 * var(--u)); } to { background-position: calc(-476 * var(--u)) calc(-408 * var(--u)); } }
@keyframes happy { from { background-position: 0 calc(-340 * var(--u)); } to { background-position: calc(-612 * var(--u)) calc(-340 * var(--u)); } }

/* The tongue, drawn like the game's: dark outline under pink, round tip.
   It runs from the frog's mouth up to where the fly is held. */
.tongue {
  position: absolute;
  left: calc(48 * var(--u));
  bottom: calc(47 * var(--u));
  width: calc(5 * var(--u));
  height: 0;
  background: #3a0d14;
  border-radius: calc(2 * var(--u)) calc(2 * var(--u)) 0 0;
  pointer-events: none;
}
.tongue::before {
  content: "";
  position: absolute;
  inset: var(--u) var(--u) 0;
  background: #f26d85;
  border-radius: var(--u) var(--u) 0 0;
}
.tongue.out { animation: tongue .36s steps(6) 1; }
@keyframes tongue {
  0%   { height: 0; }
  40%  { height: calc(52 * var(--u)); }
  100% { height: 0; }
}

.fly {
  position: absolute;
  left: calc(34 * var(--u)); top: 0;
  width: calc(32 * var(--u)); height: calc(32 * var(--u));
  background: url("assets/bug_fly.png") 0 calc(-32 * var(--u)) / calc(128 * var(--u)) calc(64 * var(--u)) no-repeat;
  animation: flap .24s steps(4) infinite, buzz 3.2s steps(16) infinite;
}
.fly.held { animation: flap .24s steps(4) infinite; }
.fly.eaten { animation: flap .24s steps(4) infinite, gulp .36s steps(6) 1 forwards; }
.fly.back { animation: flap .24s steps(4) infinite, enter .9s steps(9) 1; }

@keyframes flap { from { background-position-x: 0; } to { background-position-x: calc(-128 * var(--u)); } }
@keyframes buzz {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(calc(17 * var(--u)), calc(-6 * var(--u))); }
  50%  { transform: translate(calc(4 * var(--u)), calc(-11 * var(--u))); }
  75%  { transform: translate(calc(-15 * var(--u)), calc(-4 * var(--u))); }
  100% { transform: translate(0, 0); }
}
/* stays put while the tongue reaches it, then rides the tongue back to the mouth */
@keyframes gulp {
  0%, 40% { transform: translate(0, 0); opacity: 1; }
  99%  { transform: translate(0, calc(52 * var(--u))); opacity: 1; }
  100% { transform: translate(0, calc(52 * var(--u))); opacity: 0; }
}
@keyframes enter { from { transform: translate(calc(90 * var(--u)), calc(-45 * var(--u))); } to { transform: translate(0, 0); } }

.plus {
  position: absolute;
  left: calc(58 * var(--u)); top: calc(14 * var(--u));
  font-size: 32px;
  color: var(--gold);
  text-shadow: 0 3px 0 var(--gold-shadow), 3px 0 0 var(--gold-shadow), -3px 0 0 var(--gold-shadow), 0 -3px 0 var(--gold-shadow);
  opacity: 0;
  pointer-events: none;
}
.plus.pop { animation: pop .9s steps(9) 1; }
@keyframes pop {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(-36px); }
  100% { opacity: 0; transform: translateY(-44px); }
}

.poke-hint {
  position: absolute;
  left: 50%; bottom: -30px;
  width: max-content;
  margin: 0;
  transform: translateX(-50%);
  font-size: 16px;
  color: var(--cream);
  text-shadow: 0 2px 0 var(--deep), 2px 0 0 var(--deep), -2px 0 0 var(--deep), 0 -2px 0 var(--deep);
  transition: opacity .3s;
}
.poked .poke-hint { opacity: 0; }

/* Cattails at the pond's edges and a lotus on the water, from Frog Snack's own props */
.reeds {
  position: absolute;
  bottom: calc(34 * var(--u));
  width: calc(64 * var(--u)); height: calc(64 * var(--u));
  background: url("assets/prop_cattail.png") 0 calc(-64 * var(--u)) / calc(512 * var(--u)) calc(128 * var(--u)) no-repeat;
  animation: sway 1.6s steps(8) infinite;
  pointer-events: none;
}
.reeds-left { left: calc(-10 * var(--u)); }
.reeds-right { right: calc(-10 * var(--u)); transform: scaleX(-1); animation-delay: -.8s; }
@keyframes sway { from { background-position-x: 0; } to { background-position-x: calc(-512 * var(--u)); } }

.lotus {
  display: none;
  position: absolute;
  left: calc(50% + 62 * var(--u));
  bottom: calc(12 * var(--u));
  width: calc(64 * var(--u)); height: calc(64 * var(--u));
  background: url("assets/prop_lotus.png") 0 0 / 100% 100%;
  pointer-events: none;
}

.down {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 44px;
  color: var(--cream);
  text-decoration: none;
  font-size: 16px;
  text-shadow: 0 2px 0 var(--deep);
}
.down svg { animation: nudge 1.6s steps(2) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* ---------- Deep water (content) ---------- */

.deep {
  position: relative;
  background:
    linear-gradient(to bottom,
      var(--water) 0 12px, #2f8187 12px 24px, #286b72 24px 36px, #22565d 36px 48px, var(--deep) 48px) top / 100% 48px no-repeat,
    var(--deep);
  padding: 96px 16px 32px;
}

/* A koi swims through the deep water between the sections */
.deep { overflow: hidden; }
.koi-lane {
  position: relative;
  height: 0;
  margin: 0 -16px; /* full width of the water */
}
.koi {
  position: absolute;
  left: 0;
  top: -128px;
  width: 128px; height: 128px; /* 64 at 2x */
  background: url("assets/deco_koi.png") 0 -128px / 1024px 256px no-repeat;
  image-rendering: pixelated;
  opacity: .7;
  animation: finning .8s steps(8) infinite, swim 32s linear -12s infinite;
  pointer-events: none;
}
@keyframes finning { from { background-position-x: 0; } to { background-position-x: -1024px; } }
@keyframes swim {
  from { transform: translateX(-140px); }
  to { transform: translateX(100vw); }
}

.block {
  max-width: 720px;
  margin: 0 auto 96px;
}

.block h2 {
  margin: 0 0 24px;
  font-size: 32px;
  line-height: 1.1;
  font-weight: normal;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--gold-shadow);
}

.block > p { margin: 0 0 16px; max-width: 60ch; color: var(--ink); }

/* Wooden sign board, the same build as the boxes inside Frog Snack */
.board {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 24px 20px 28px;
  background: var(--wood);
  border: 4px solid var(--wood-edge);
  border-radius: 10px;
  box-shadow: inset 0 4px 0 var(--wood-hi), inset 0 -5px 0 var(--wood-lo), 0 6px 0 rgba(0, 0, 0, .35);
}

.board .board-title { margin: -8px 0 -16px; line-height: 0; font-size: 0; }
.board-logo { display: block; width: 256px; height: 256px; }

.board-text { width: 100%; }


.board p {
  margin: 0 0 12px;
  color: var(--wood-edge);
}
.board .free { color: var(--wood-edge); }

.board-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  text-shadow: 2px 2px 0 var(--leaf-edge);
  background: var(--leaf);
  border: 3px solid var(--leaf-edge);
  border-radius: 8px;
  box-shadow: inset 0 3px 0 var(--leaf-hi), inset 0 -4px 0 var(--leaf-lo), 0 4px 0 rgba(0, 0, 0, .3);
  transition: transform .08s steps(1), box-shadow .08s steps(1), background-color .08s steps(1);
}
.btn:hover { background: #276a19; }
.btn:active { transform: translateY(3px); box-shadow: inset 0 3px 0 var(--leaf-hi), inset 0 -2px 0 var(--leaf-lo), 0 1px 0 rgba(0, 0, 0, .3); }

.small-link { color: var(--wood-edge); }
.small-link:hover { color: #000; }

.mail {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.mail:hover { color: #fff; }

.foot {
  padding: 24px 16px 40px;
  text-align: center;
  color: var(--ink-soft);
  border-top: 4px solid var(--deep-2);
}
.foot p { margin: 0; }

@media (min-width: 720px) {
  .tagline { font-size: 32px; margin-top: 28px; }
  :root { --s: 3; }
  .wordmark .logo { width: 328px; height: 236px; } /* 4x */
  .lotus { display: block; }
  .block h2 { font-size: 48px; }
  .board {
    grid-template-columns: 256px 1fr;
    align-items: center;
    gap: 32px;
    padding: 28px 36px 32px 28px;
  }
  .board .board-title { margin: 0; }
  .mail { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cloud, .fly, .down svg, .reeds, .koi { animation: none !important; }
  .koi { transform: translateX(40px); }
  .tongue.out, .fly.eaten { animation-duration: .01s; }
  .cloud-a { transform: translateX(6vw); }
  .cloud-b { transform: translateX(62vw); }
  .cloud-c { transform: translateX(34vw); }
  .frog { animation: none; }
}

/* The sleepy frog from the game, napping on a pond rock by the footer */
.foot-perch {
  position: relative;
  width: 128px; height: 168px;
  margin: -40px auto 8px;
}
.foot-rock {
  position: absolute;
  left: 0; bottom: 0;
  width: 128px; height: 128px; /* 64 at 2x */
  background: url("assets/prop_rock.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
}
.foot-frog {
  position: absolute;
  left: -4px; top: 0;
  width: 136px; height: 136px; /* 68 at 2x */
  background: url("assets/frog_classic.png") -680px -544px / 1224px 952px no-repeat;
  image-rendering: pixelated;
}

/* ---------- Privacy page ---------- */

.page-top {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 144px;
  background: var(--sky);
}

.home-mark { display: block; line-height: 0; }
.home-mark img { display: block; width: 164px; height: 118px; image-rendering: pixelated; } /* logo at 2x */

.doc { padding-top: 80px; }
.doc .block { margin-bottom: 48px; }

.doc h1 {
  margin: 0 0 12px;
  font-size: 48px;
  line-height: 1.1;
  font-weight: normal;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--gold-shadow);
}

.doc .updated { margin: 0 0 32px; color: var(--ink-soft); }

/* Paper notice pinned in a wooden frame, like Frog Snack's own privacy page */
.paper {
  padding: 28px 24px 12px;
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: auto;
  font-size: 16px;
  line-height: 1.6;
  color: #2a1a0c;
  background: var(--cream);
  border: 4px solid var(--wood-edge);
  border-radius: 10px;
  box-shadow: inset 0 0 0 4px var(--wood), 0 6px 0 rgba(0, 0, 0, .35);
}
.paper ::selection { background: var(--gold); color: var(--wood-edge); }
.paper h2 {
  margin: 32px 0 8px;
  font-family: "FrogSnack", system-ui, sans-serif;
  -webkit-font-smoothing: none;
  font-size: 16px;
  font-weight: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--wood-edge);
  text-shadow: none;
}
.paper p, .paper ul { margin: 0 0 16px; max-width: 68ch; }
.paper ul { padding-left: 20px; }
.paper li + li { margin-top: 10px; }
.paper a { color: var(--leaf); overflow-wrap: anywhere; }
.paper a:hover { color: var(--leaf-lo); }
.paper .in-short {
  margin: 0 0 8px;
  padding: 12px 16px;
  background: #e8f5d8;
  border: 2px solid #8cc46a;
  border-radius: 8px;
}

.back { margin-top: 40px; }

.foot-link { color: var(--ink-soft); }
.foot-link:hover { color: var(--gold); }

@media (min-width: 720px) {
  .paper { padding: 36px 40px 20px; }
}
