/* DuckTune — the game's palette, flat colours, square corners. */
:root {
  --sky: #3C7CE8;
  --sky-light: #6CA4F4;
  --cloud: #F8F8F0;
  --cloud-shade: #B4CCF4;
  --forest-far: #2C6878;
  --forest-near: #1C5C2C;
  --grass: #3CA430;
  --grass-light: #84D048;
  --grass-dark: #1E6E1E;
  --ink: #101018;
  --white: #F8F8F0;
  --gray: #8890A8;
  --dark-gray: #3A3E50;
  --red: #E0402C;
  --orange: #F08028;
  --yellow: #F8C830;
  --green: #5CD85C;

  /* One art pixel, in CSS pixels. Whole numbers only. */
  --k: 3px;
  --logo: 10px;
  --h1: 4px;
  --h2: 3px;
  --h3: 2px;
  color-scheme: dark;
}
@media (min-width: 720px) {
  :root { --k: 4px; --logo: 14px; --h1: 6px; --h2: 4px; --h3: 3px; }
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
img.art, .art img { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--yellow); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Pixel-font text (rendered by site.js) ---------- */
.px { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2; margin: 0; }
.px-on > .px-text { display: flex; flex-wrap: wrap; column-gap: calc(var(--s) * 4); row-gap: calc(var(--s) * 3); }
.px-on.center > .px-text { justify-content: center; }
.px-text svg { display: block; width: calc(var(--w) * var(--s)); height: calc(8 * var(--s)); shape-rendering: crispEdges; }
.px.s1 { --s: var(--h1); } .px.s2 { --s: var(--h2); } .px.s3 { --s: var(--h3); }
.yellow { color: var(--yellow); } .green { color: var(--green); } .red { color: var(--red); }
.orange { color: var(--orange); } .gray { color: var(--gray); } .white { color: var(--white); }
.center { text-align: center; }

/* ---------- Hero: sky, flight zone, treeline, grass ---------- */
.sky {
  position: relative;
  overflow: hidden;
  background: var(--sky);
  min-height: min(100svh, 980px);
  display: flex;
  flex-direction: column;
}
.clouds { position: absolute; inset: 0; pointer-events: none; }
.cloud { position: absolute; left: 0; top: 0; will-change: transform; }
.cloud-1 { width: calc(24 * var(--k)); }
.cloud-2 { width: calc(32 * var(--k)); }
.cloud-3 { width: calc(40 * var(--k)); }

.title {
  position: relative;
  z-index: 2;
  padding: calc(18 * var(--k)) 16px 0;
  text-align: center;
}
.title h1 { margin: 0; }
.title h1:not(.px) { line-height: 0; }
.logo { display: block; margin: 0 auto; width: calc(24 * var(--logo)); height: calc(8 * var(--logo)); }
.logo + .logo { margin-top: calc(var(--logo) * 2); }
.tagline { display: block; margin: calc(6 * var(--k)) auto 0; width: calc(120 * var(--h2)); height: calc(8 * var(--h2)); max-width: 100%; }
@media (max-width: 400px) { .tagline { width: calc(120 * 2px); height: calc(8 * 2px); } }

.flight {
  position: relative;
  flex: 1;
  min-height: calc(90 * var(--k));
  z-index: 0; /* a shot duck falls behind the treeline */
}
.crosshair {
  position: absolute; left: 50%; top: 50%;
  width: calc(41 * var(--k)); height: calc(41 * var(--k));
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}
.duck {
  position: absolute; left: 0; top: 0;
  width: calc(26 * var(--k)); height: calc(18 * var(--k));
  z-index: 2;
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.burst {
  position: absolute; left: 0; top: 0;
  width: calc(17 * var(--k)); height: calc(17 * var(--k));
  z-index: 4; pointer-events: none; display: none;
}
.hint {
  position: absolute; left: 0; right: 0; bottom: calc(4 * var(--k));
  margin: 0; text-align: center; color: var(--cloud); font-size: 14px; opacity: .85;
  z-index: 2;
}

.treeline {
  position: relative;
  height: calc(36 * var(--k));
  /* The far trees over the pale horizon band (a flat band, not a fade). */
  background:
    url(assets/art/forest-strip.png) repeat-x left bottom / calc(160 * var(--k)) 100%,
    linear-gradient(var(--sky-light), var(--sky-light)) left bottom / 100% calc(20 * var(--k)) no-repeat;
  image-rendering: pixelated;
  z-index: 1;
}
.ground {
  height: calc(26 * var(--k));
  background: var(--forest-near) url(assets/art/ground-strip.png) repeat-x left top / calc(160 * var(--k)) 100%;
  image-rendering: pixelated;
}

/* ---------- The ink bottom panel ---------- */
.panel-top { height: 3px; background: var(--dark-gray); }
main { background: var(--ink); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
section { padding: 56px 0; border-bottom: 3px solid var(--dark-gray); }
section:last-of-type { border-bottom: 0; }
.lead { font-size: 19px; max-width: 38em; margin: 20px 0 0; }
.center .lead, .lead.center { margin-left: auto; margin-right: auto; }
p { margin: 14px 0 0; }
.muted { color: var(--gray); }

.box {
  background: var(--ink);
  border: 3px solid var(--dark-gray);
  padding: 20px;
}
.box.bright { border-color: var(--white); }

.pitch { text-align: center; }
.pitch .lead { margin: 22px auto 0; }
.soon {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 20px 12px;
  border: 3px solid var(--yellow);
  background: var(--ink);
}
.soon .px-on > .px-text { justify-content: center; }

/* Tuner diagram: sharp / in tune / flat */
.states { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; }
.state { text-align: center; padding: 16px 8px 14px; }
.state .scope {
  position: relative; margin: 0 auto;
  width: calc(41 * var(--h2)); height: calc(60 * var(--h2));
}
.state .scope .ch { position: absolute; left: 0; top: calc(9.5 * var(--h2)); width: calc(41 * var(--h2)); }
.state .scope .dk { position: absolute; left: calc(7.5 * var(--h2)); width: calc(26 * var(--h2)); }
.state.sharp .dk { top: 0; }
.state.tune .dk { top: calc(21 * var(--h2)); }
.state.flat .dk { top: calc(42 * var(--h2)); }
.state .px { margin-top: 12px; }
.state p { font-size: 14px; margin-top: 6px; color: var(--gray); }
@media (max-width: 480px) {
  .states { gap: 8px; }
  .state { padding: 12px 4px; }
  .state .scope { width: calc(41 * 2px); height: calc(60 * 2px); }
  .state .scope .ch { top: calc(9.5 * 2px); width: calc(41 * 2px); }
  .state .scope .dk { left: calc(7.5 * 2px); width: calc(26 * 2px); }
  .state.tune .dk { top: calc(21 * 2px); }
  .state.flat .dk { top: calc(42 * 2px); }
}

/* Screens */
.shots {
  display: flex; gap: 16px; margin-top: 32px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.shot { flex: 0 0 auto; width: min(66vw, 240px); margin: 0; scroll-snap-align: center; }
.shot img {
  display: block; width: 100%; height: auto; aspect-ratio: 1320 / 2868;
  border: 3px solid var(--white); background: var(--sky);
}
.shot figcaption { font-size: 14px; color: var(--gray); margin-top: 8px; }
@media (min-width: 820px) { .shots { justify-content: center; overflow: visible; } }

/* Modes */
.modes { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 820px) { .modes { grid-template-columns: repeat(3, 1fr); } }
.mode { display: flex; flex-direction: column; }
.mode .shot { width: 100%; max-width: 260px; margin: auto auto 0; padding-top: 18px; } /* screens line up at the bottom */
.mode p { margin-top: 12px; }
.mode .note { font-size: 14px; color: var(--gray); }
.free-tag { color: var(--green); font-size: 14px; margin-top: 10px; }

/* Worlds */
.worlds-grid { display: grid; gap: 24px; margin-top: 32px; align-items: start; }
@media (min-width: 820px) { .worlds-grid { grid-template-columns: 1fr 260px; } }
.worlds { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; counter-reset: w; }
@media (min-width: 560px) { .worlds { grid-template-columns: repeat(5, 1fr); } }
.worlds li {
  border: 3px solid var(--dark-gray); padding: 8px 10px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; line-height: 1.25; min-height: 52px;
}
.worlds li::before { counter-increment: w; content: counter(w); color: var(--yellow); font-variant-numeric: tabular-nums; font-weight: 800; }
.flocks { display: grid; gap: 8px; margin-top: 18px; }
.flocks { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.flock { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flock .levels { font-weight: 700; white-space: nowrap; }
.flock .birds { display: flex; gap: 6px; }
.flock .birds img { width: calc(26 * 2px); height: calc(18 * 2px); }
.rules { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; }
.rules .ic { flex: 0 0 34px; height: 28px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.rules .ic img { height: calc(7 * 3px); width: auto; }
.rules .ic .mult { font-weight: 800; color: var(--green); font-size: 14px; }

/* Price */
.checks { list-style: none; padding: 0; margin: 28px auto 0; max-width: 560px; display: grid; gap: 10px; text-align: left; }
.checks li { display: flex; gap: 14px; align-items: baseline; font-size: 19px; }
.checks li::before { content: "✓"; color: var(--green); font-weight: 800; }
.privacy { max-width: 560px; margin: 28px auto 0; text-align: left; }
.privacy p:first-child { margin-top: 0; }

/* Final call */
.final { text-align: center; padding: 72px 0; }
.final .soon { margin-top: 24px; }
.platform { margin-top: 14px; font-weight: 600; }
.final .icon { width: 96px; height: 96px; display: block; margin: 0 auto 24px; border: 3px solid var(--white); }

footer { border-top: 3px solid var(--dark-gray); padding: 28px 0 40px; font-size: 15px; color: var(--gray); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; }
footer a { color: var(--white); }
footer p { text-align: center; margin-top: 14px; }

/* ---------- 404 ---------- */
.lost .flight { min-height: calc(70 * var(--k)); }
.lost .back { text-align: center; padding: 40px 16px 56px; }
.lost .back a { display: inline-block; padding: 14px 20px 12px; border: 3px solid var(--yellow); text-decoration: none; }
