/* toadallyfrog.com: day pond in light mode, night pond in dark mode. Pixel art is scaled by whole numbers, never
   smoothed. Until the Aseprite UI kit lands, panels and buttons are drawn in CSS in the game's wood-and-cream style. */

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

:root {
  --bg: #f3ead6;
  --bg-deep: #e7dcc0;
  --ink: #2f2a20;
  --ink-soft: #5e5443;
  --panel: #fffaf0;
  --edge: #6b4a2b;
  --edge-dark: #4a321c;
  --accent: #4f8f3c;
  --accent-ink: #fffaf0;
  --link: #2f6f74;
  --soon: #b9a77f;
  --water: linear-gradient(180deg, #e9dfc7 0%, #cfe3d6 100%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b2235;
    --bg-deep: #141a2a;
    --ink: #f0e7d0;
    --ink-soft: #b9b2a0;
    --panel: #252e47;
    --edge: #0f1424;
    --edge-dark: #0a0e19;
    --accent: #8fd19e;
    --accent-ink: #13281a;
    --link: #9fd8e0;
    --soon: #5b6380;
    --water: linear-gradient(180deg, #1b2235 0%, #1f2b48 100%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 "Fredoka", ui-rounded, "Nunito", system-ui, sans-serif;
  padding: env(safe-area-inset-top, 0) max(16px, env(safe-area-inset-right, 0)) env(safe-area-inset-bottom, 0) max(16px, env(safe-area-inset-left, 0));
}
img { max-width: 100%; height: auto; }
.pix, .shots img, .brand img, .foot-frog, .lost img { image-rendering: pixelated; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.7rem); }
h3 { font-size: 1.15rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
.small { font-size: .9rem; color: var(--ink-soft); }
.lead { font-size: 1.25rem; color: var(--ink-soft); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--panel); padding: 8px 12px; z-index: 9; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }

/* header and footer */
.top {
  max-width: 1080px; margin: 0 auto; padding-block: 14px;
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--link); }
.foot { max-width: 760px; margin: 64px auto 0; padding-block: 32px 40px; text-align: center; border-top: 3px dotted var(--edge); }
.foot-frog { width: 92px; }

/* layout */
.wrap { max-width: 1080px; margin: 0 auto; padding-block: 24px; }
.narrow { max-width: 760px; }
.panel {
  background: var(--panel);
  border: 3px solid var(--edge);
  border-radius: 10px;
  box-shadow: 0 5px 0 var(--edge-dark);
  padding: 20px 22px;
  margin: 0 0 24px;
}
.panel > :last-child { margin-bottom: 0; }
.wrap.panel { margin: 24px auto; }

/* buttons */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px;
  border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge-dark);
  background: var(--panel); color: var(--ink); font-weight: 600; text-decoration: none;
}
.btn:hover { transform: translateY(1px); box-shadow: 0 3px 0 var(--edge-dark); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge-dark); }
.btn-go { background: var(--accent); color: var(--accent-ink); }
.btn-soon { background: var(--soon); color: var(--ink); cursor: default; }
.btn-soon:hover, .btn-soon:active { transform: none; box-shadow: 0 4px 0 var(--edge-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 8px; }

/* studio home */
.studio-hero { text-align: center; padding-block: 28px 20px; background: var(--water); border-radius: 16px; max-width: 1080px; margin: 0 auto; }
.hero-frog {
  width: 276px; height: 312px; margin: 0 auto 8px;
  background: url("/img/frog_sheet.png") 0 0 / 4416px 312px no-repeat;
  image-rendering: pixelated;
  animation: bubbles 2.4s steps(16) infinite;
}
@keyframes bubbles { to { background-position: -4416px 0; } }
@media (max-width: 420px) {
  .hero-frog { width: 184px; height: 208px; background-size: 2944px 208px; animation-name: bubbles-sm; }
  @keyframes bubbles-sm { to { background-position: -2944px 0; } }
}
@media (prefers-reduced-motion: reduce) { .hero-frog { animation: none; } }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.game-card {
  display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 3px solid var(--edge); border-radius: 12px; box-shadow: 0 5px 0 var(--edge-dark); padding: 14px;
}
a.game-card:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--edge-dark); }
.game-card img { width: 96px; height: 96px; border-radius: 22%; flex: none; }
.card-text { display: flex; flex-direction: column; gap: 2px; }
.card-text strong { font-size: 1.25rem; }
.tag { margin-top: 6px; font-size: .85rem; color: var(--ink-soft); }
.game-card.soon { border-style: dashed; box-shadow: none; opacity: .8; min-height: 128px; }

/* game page */
.game-hero {
  max-width: 1080px; margin: 0 auto 8px; display: grid; gap: 28px; align-items: center;
  grid-template-columns: minmax(0, 320px) 1fr;
}
.game-hero .pond { width: 100%; max-width: 320px; border-radius: 14px; border: 3px solid var(--edge); box-shadow: 0 5px 0 var(--edge-dark); display: block; }
.game-icon { width: 96px; height: 96px; border-radius: 22%; }
@media (max-width: 720px) {
  .game-hero { grid-template-columns: 1fr; }
  .game-hero picture { order: 2; justify-self: center; }
}
.subnav { max-width: 1080px; margin: 16px auto 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.subnav a { padding: 6px 12px; border-radius: 999px; border: 2px solid var(--edge); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.subnav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.how { font-size: 1.15rem; max-width: 760px; }
.shots { list-style: none; padding: 4px 4px 16px; margin: 0 0 24px; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; }
.shots li { flex: 0 0 auto; scroll-snap-align: start; }
.shots img { width: 195px; height: auto; border-radius: 12px; border: 3px solid var(--edge); display: block; }
.facts ul, .panel ul { padding-left: 1.2em; }
.facts li { margin-bottom: .4em; }

/* support */
.faq { margin: 16px 0 24px; }
.qa { background: var(--panel); border: 3px solid var(--edge); border-radius: 10px; margin-bottom: 12px; box-shadow: 0 4px 0 var(--edge-dark); }
.qa summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style-position: inside; }
.qa p { padding: 0 18px 4px; }

/* prose (privacy) */
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

/* press */
.facts-table { border-collapse: collapse; width: 100%; }
.facts-table th, .facts-table td { text-align: left; padding: 8px 10px; border-bottom: 2px dotted var(--edge); vertical-align: top; }
.facts-table th { width: 30%; font-weight: 600; }
.downloads { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.downloads a { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.downloads .logo-text { width: 288px; }

/* 404 */
.lost { text-align: center; padding-block: 48px; }

/* about */
.quote { margin: 8px 0 20px; padding: 4px 0 4px 18px; border-left: 4px solid var(--accent); }
.quote blockquote { margin: 0; font-size: 1.15rem; font-style: italic; }
.quote blockquote p { margin: 0 0 4px; }
.quote figcaption { color: var(--ink-soft); }
.quote figcaption::before { content: "― "; }
.signoff { font-weight: 600; }
.nw { white-space: nowrap; }

/* the photo viewer */
.view { display: block; cursor: zoom-in; border-radius: 12px; }
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(10, 13, 22, .94); color: #f0e7d0;
}
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer::backdrop { background: rgba(10, 13, 22, .94); }
.viewer figure {
  margin: 0; height: 100%; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 64px calc(64px + env(safe-area-inset-bottom, 0px));
}
.viewer img { max-height: 100%; max-width: 100%; width: auto; height: auto; min-height: 0; border-radius: 14px; image-rendering: pixelated; }
.viewer figcaption { margin-top: 10px; text-align: center; max-width: 36em; font-size: .95rem; color: #cfc6b0; }
.viewer button {
  position: absolute; z-index: 2; border: 3px solid #0f1424; border-radius: 12px; background: #f0e7d0; color: #2f2a20;
  font: 600 1.6rem/1 "Fredoka", system-ui, sans-serif; width: 48px; height: 48px; cursor: pointer; box-shadow: 0 4px 0 #0a0e19;
}
.viewer button:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a0e19; }
.v-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; font-size: 1.2rem; }
.v-prev { left: 8px; top: 50%; translate: 0 -50%; }
.v-next { right: 8px; top: 50%; translate: 0 -50%; }
.v-count { position: absolute; top: calc(22px + env(safe-area-inset-top, 0px)); left: 0; right: 0; text-align: center; margin: 0; font-size: .9rem; color: #cfc6b0; pointer-events: none; }
@media (max-width: 520px) {
  .viewer figure { padding-inline: 8px; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .v-prev, .v-next { top: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); translate: none; }
  .v-prev { left: calc(50% - 60px); }
  .v-next { right: calc(50% - 60px); }
}
