/* 2plat website. Palette comes from the Sky Hopper template: daytime sky, grass, coin gold. */
:root {
  --sky: #cdeefa;
  --sky-deep: #a8dcf0;
  --ink: #1a1c2c;
  --grass: #38b764;
  --grass-light: #a7f070;
  --coin: #ffcd75;
  --dirt: #7a4a3a;
  --white: #ffffff;
  --display: 'Pixelify Sans', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --pixel: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

main { flex: 1; }
img { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { background: var(--coin); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 6px var(--coin); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.75rem, 7vw, 4.75rem); text-shadow: 4px 4px 0 var(--white); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); text-shadow: 3px 3px 0 var(--white); }
h3 { font-size: 1.375rem; font-weight: 500; }
p { margin: 0; max-width: 62ch; }

/* header */
.site-head { padding: 20px 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wordmark {
  font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1;
  text-decoration: none; text-shadow: 3px 3px 0 var(--coin); letter-spacing: 0.02em;
}
.wordmark:hover { background: none; }
.site-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--display); font-size: 1.125rem; font-weight: 500;
  text-decoration: none; padding: 6px 14px; border: 3px solid transparent;
}
.site-nav a:hover { background: var(--white); border-color: var(--ink); }
.site-nav a[aria-current='page'] { background: var(--white); border-color: var(--ink); }

/* buttons: chunky, flat, pressed on click */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.2;
  padding: 14px 24px; color: var(--ink); background: var(--grass); text-decoration: none;
  border: 3px solid var(--ink); box-shadow: var(--pixel) var(--pixel) 0 var(--ink);
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2);
}
.btn:hover { background: var(--grass-light); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(var(--pixel), var(--pixel)); box-shadow: 0 0 0 var(--ink); }
.btn.alt { background: var(--white); }
.btn.alt:hover { background: var(--coin); }
.btn-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* hero */
.hero { padding: 24px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.hero-copy .lede { font-size: 1.25rem; }

/* The game is 320x180 and scales in whole-number steps, so the frame is an exact
   multiple of that size: 1x on phones, 2x everywhere else. */
.screen { margin: 0; max-width: 100%; }
.screen .frame {
  box-sizing: content-box; width: 320px; height: 180px; max-width: calc(100vw - 40px);
  background: #000; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); overflow: hidden;
}
.screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.screen figcaption { margin-top: 24px; font-size: 1rem; max-width: 56ch; }
@media (min-width: 760px) { .screen .frame { width: 640px; height: 360px; } }

/* sections */
.section { padding: 64px 0; }
.section > .wrap { display: grid; gap: 32px; }
.section.tinted { background: var(--sky-deep); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 56px; margin: 0; padding: 0; list-style: none; }
.tools li { border-top: 3px solid var(--ink); padding-top: 16px; display: grid; gap: 8px; align-content: start; }
.tools p { font-size: 1.0625rem; }

pre {
  margin: 0; padding: 20px 24px; background: var(--ink); color: var(--white);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; font-size: 1rem; line-height: 1.7;
  border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--white); overflow-x: auto; max-width: 640px;
}
pre .c { color: var(--grass-light); }

.download-panel {
  background: var(--coin); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  padding: 40px; display: grid; gap: 20px; justify-items: start;
}
.download-panel .small { font-size: 1rem; max-width: 72ch; }

/* showcase */
.page-head { padding: 24px 0 40px; }
.page-head .wrap { display: grid; gap: 16px; }
.showcase-frame {
  margin: 0; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: var(--white);
  width: fit-content; max-width: 100%; display: grid;
}
.showcase-frame img { display: block; image-rendering: pixelated; image-rendering: crisp-edges; height: auto; min-width: min(100%, 480px); }
.showcase-frame[data-missing] img { display: none; }
.showcase-frame .missing {
  display: none; padding: 48px 32px; max-width: 520px; text-align: left;
}
.showcase-frame[data-missing] .missing { display: grid; gap: 12px; }
.showcase-frame code { font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; background: var(--coin); padding: 1px 6px; }

/* footer: the ground, tiled like the level editor grid */
.ground { margin-top: 72px; }
.ground .grass { height: 28px; background: linear-gradient(var(--grass-light) 0 8px, var(--grass) 8px); border-top: 3px solid var(--ink); }
.ground .dirt {
  background-color: var(--dirt); color: var(--white); padding: 32px 0 40px; font-size: 1rem;
  background-image: linear-gradient(90deg, rgba(26, 28, 44, 0.28) 2px, transparent 2px), linear-gradient(rgba(26, 28, 44, 0.28) 2px, transparent 2px);
  background-size: 32px 32px;
}
.ground .dirt .wrap { display: flex; gap: 12px 32px; flex-wrap: wrap; justify-content: space-between; }
.ground a { color: var(--white); }
.ground a:hover { background: var(--ink); }
.ground :focus-visible { outline-color: var(--white); box-shadow: 0 0 0 6px var(--ink); }

@media (max-width: 1119px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding-bottom: 48px; }
}
@media (max-width: 900px) {
  .tools { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .section { padding: 48px 0; }
  .download-panel { padding: 28px 24px; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .screen .frame { box-shadow: 5px 5px 0 var(--ink); }
  pre { font-size: 0.875rem; padding: 16px; }
  .btn { width: 100%; text-align: center; }
  .btn-row { width: 100%; }
}
