/* FloppyFrog — floppyfrogs.com
   Palette lifted straight from the character art so the site and the videos read as one
   thing: bg_sky.png's blue, the frog's body green, his cream belly, and the near-black his
   outlines are drawn in. */

:root {
  --sky: #7ec8e3;
  --sky-deep: #5bb4d6;
  --sky-pale: #d4eef8;
  --grass: #8cc63f;
  --grass-deep: #5aa02c;
  --frog: #72a858;
  --cream: #f8f3d8;
  --ink: #16281c;
  --ink-soft: #3d5244;
  --white: #ffffff;

  --radius: 22px;
  --radius-lg: 34px;
  --shadow: 0 6px 0 rgba(22, 40, 28, 0.14);
  --shadow-lift: 0 14px 28px rgba(22, 40, 28, 0.18);
  --page: 1140px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sky-pale);
}

h1, h2, h3, .brandmark {
  font-family: "Baloo 2", "Nunito", system-ui, sans-serif;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }

a { color: var(--grass-deep); }

img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: 20px;
}

/* ---------- header ---------- */

.site-header {
  background: var(--white);
  border-bottom: 4px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
  flex-wrap: wrap;
}

.site-header .logo { height: 58px; width: auto; }

.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  color: var(--ink);
  border: 3px solid transparent;
}

.nav a:hover { background: var(--sky-pale); }

.nav a[aria-current="page"] {
  background: var(--grass);
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  background: url("assets/bg-sky.jpg") center / cover no-repeat;
  border-bottom: 5px solid var(--ink);
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 24px;
  padding-block: 52px 0;
}

.hero-copy { padding-bottom: 52px; }

.hero h1 {
  color: var(--white);
  text-shadow: 0 4px 0 var(--ink), 0 0 22px rgba(22, 40, 28, 0.35);
}

.hero p {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  display: inline-block;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 3px solid var(--ink);
  max-width: 34ch;
}

.hero-frog {
  align-self: end;
  max-height: 380px;
  width: auto;
  margin-inline: auto;
  filter: drop-shadow(0 10px 0 rgba(22, 40, 28, 0.18));
}

/* ---------- hero game ---------- */
/* The stage holds the static frog and, once the game has actually started, a canvas laid
   over him. Until then — and forever, on a browser without WebGL or with reduced motion
   asked for — the picture is all there is, which is how the page looked before. */
.hero-stage {
  position: relative;
  align-self: end;
  display: grid;
  place-items: end center;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}
.hero-stage .hero-frog {
  grid-area: 1 / 1;
  transition: opacity 0.4s ease;
}
.hero-stage.is-playing .hero-frog {
  opacity: 0;
  pointer-events: none;
}
.hero-stage canvas {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: block;
  touch-action: manipulation; /* taps fire immediately instead of waiting on double-tap zoom */
  cursor: pointer;
}
/* Keyboard players need to see where focus is; mouse and touch players do not, and a hard
   ring around the picture on every tap looks like a bug. */
.hero-stage canvas:focus { outline: none; }
.hero-stage canvas:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 4px;
  border-radius: var(--radius);
}
.hero-score,
.hero-hint {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  line-height: 1.1;
  pointer-events: none;
}
.hero-score {
  top: 10px;
  right: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hero-score__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hero-score strong {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.5rem;
}
.hero-hint {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--sky, #7fd4f2);
  animation: hero-hint-bob 1.8s ease-in-out infinite;
}
@keyframes hero-hint-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-hint { animation: none; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 999px;
  border: 4px solid var(--ink);
  background: var(--grass);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { transform: translateY(-3px); box-shadow: 0 9px 0 rgba(22, 40, 28, 0.16); }
.btn:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(22, 40, 28, 0.16); }
.btn--sky { background: var(--sky); }
.btn--cream { background: var(--cream); }

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- sections ---------- */

section { padding-block: 54px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.section-head h2 { margin: 0; }
.lead { font-size: 1.12rem; max-width: 62ch; }

.band-grass {
  background: linear-gradient(180deg, var(--grass) 0%, var(--grass-deep) 100%);
  border-block: 5px solid var(--ink);
}

.band-white { background: var(--white); }

/* ---------- video cards ---------- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}

.video-card {
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.video-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: var(--sky-pale);
  border-bottom: 4px solid var(--ink);
}

.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.video-card .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(22, 40, 28, 0);
  transition: background 0.14s ease;
}

.video-card:hover .play { background: rgba(22, 40, 28, 0.24); }

.video-card .play span {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--white);
  border: 4px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  opacity: 0.92;
}

.video-card .body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.video-card h3 { margin-bottom: 8px; }
.video-card h3 a { color: var(--ink); text-decoration: none; }
.video-card h3 a:hover { text-decoration: underline; }
.video-card .meta { font-size: 0.95rem; color: var(--ink-soft); margin-top: auto; padding-top: 10px; }

/* Embedded player, used once a card is opened */
.player { aspect-ratio: 16 / 9; max-width: 100%; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- toy cards ---------- */

.toy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}

.toy-card {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toy-card h3 { margin: 0; }
.toy-card p { margin: 0; }
.toy-card .toy-links { margin-top: auto; padding-top: 12px; display: flex; gap: 12px; flex-wrap: wrap; }

.pill {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--sky);
  border: 3px solid var(--ink);
  align-self: flex-start;
}

/* ---------- disclosure ---------- */

.disclosure {
  background: var(--white);
  border: 4px dashed var(--ink);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 30px;
}

.disclosure p { margin: 0; font-weight: 700; }

.note {
  background: var(--sky-pale);
  border-left: 8px solid var(--sky-deep);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 22px;
  margin: 22px 0;
}

.prose { max-width: 68ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--sky-pale);
  padding-block: 38px;
  border-top: 5px solid var(--grass-deep);
}

.site-footer a { color: var(--sky); }
.site-footer .wrap { display: grid; gap: 18px; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 700; }
.fineprint { font-size: 0.92rem; color: #a9c4b2; max-width: 74ch; }

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 40px 0; text-align: center; }
  .hero-copy { padding-bottom: 20px; }
  .hero p { max-width: none; }
  .btn-row { justify-content: center; }
  .hero-frog { max-height: 260px; }
  .hero-stage { max-width: 320px; }
  .hero-stage canvas { min-height: 280px; }
  .site-header .wrap { justify-content: center; }
}

/* On a wide screen the stage was still capped at 420px, so the frog sat as a small figure in
   a very large band of empty sky — and a small canvas is also literally fewer pixels of frog.
   Give him room to match the header he is sitting in. */
@media (min-width: 1100px) {
  .hero-frog { max-height: 500px; }
  .hero-stage { max-width: 520px; }
  .hero-stage canvas { min-height: 500px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
