:root {
  --ink: #17212d;
  --muted: #5c6875;
  --paper: #fffdf4;
  --sky: #74c9ff;
  --blue: #1379d1;
  --yellow: #ffd940;
  --orange: #ff7a32;
  --green: #48a84f;
  --border: #17212d;
  --shadow: 6px 6px 0 var(--border);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.6;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(20px, 5vw, 72px);
  border-bottom: 3px solid var(--border);
  background: rgba(255, 253, 244, .92);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  color: white; background: var(--orange); border: 3px solid var(--border);
  box-shadow: 3px 3px 0 var(--border); transform: rotate(-3deg);
}
nav { display: flex; gap: 28px; font-weight: 700; }
nav a { text-decoration: none; border-bottom: 2px solid transparent; }
nav a:hover, nav a:focus-visible { border-color: var(--ink); }

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  border-bottom: 3px solid var(--border);
  overflow: hidden;
}
.hero-copy { align-self: center; padding: clamp(52px, 8vw, 120px) clamp(24px, 6vw, 92px); }
.eyebrow { margin: 0 0 14px; color: var(--blue); font-size: 13px; font-weight: 900; letter-spacing: .16em; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.04em; }
h1 { max-width: 680px; font-size: clamp(48px, 7vw, 102px); }
h1 span { color: var(--orange); text-shadow: 4px 4px 0 var(--ink); -webkit-text-stroke: 2px var(--ink); }
.intro { max-width: 580px; margin: 32px 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); }
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 24px; color: var(--ink); background: var(--yellow);
  border: 3px solid var(--border); box-shadow: var(--shadow); font-weight: 900;
  text-decoration: none; cursor: pointer; transition: .15s ease;
}
.primary-button:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--border); }
.primary-button:active { transform: translate(6px, 6px); box-shadow: none; }

.hero-art { position: relative; min-height: 520px; overflow: hidden; background: var(--sky); border-left: 3px solid var(--border); }
.sun { position: absolute; top: 12%; right: 14%; width: 92px; height: 92px; border: 4px solid var(--border); border-radius: 50%; background: var(--yellow); box-shadow: 8px 8px 0 rgba(23,33,45,.18); }
.cloud { position: absolute; width: 140px; height: 38px; border: 3px solid var(--border); border-radius: 30px; background: white; }
.cloud::before, .cloud::after { content: ""; position: absolute; bottom: -3px; border: 3px solid var(--border); border-bottom: 0; border-radius: 50% 50% 0 0; background: white; }
.cloud::before { left: 28px; width: 48px; height: 54px; }
.cloud::after { right: 24px; width: 40px; height: 40px; }
.cloud-one { top: 18%; left: 10%; }
.cloud-two { top: 39%; right: -20px; transform: scale(.72); }
.hill { position: absolute; bottom: -26%; border: 4px solid var(--border); border-radius: 50% 50% 0 0; }
.hill-back { left: -18%; width: 85%; height: 58%; background: #87ce58; }
.hill-front { right: -24%; width: 92%; height: 66%; background: #44a852; }
.floating-block { position: absolute; display: grid; place-items: center; width: 64px; height: 64px; border: 4px solid var(--border); box-shadow: 6px 6px 0 rgba(23,33,45,.25); font-size: 30px; font-weight: 900; }
.block-one { left: 18%; top: 43%; color: #fff; background: var(--orange); transform: rotate(-7deg); }
.block-two { right: 24%; top: 25%; background: var(--yellow); transform: rotate(5deg); }
.pixel-hero { position: absolute; z-index: 3; bottom: 27%; left: 50%; width: 68px; height: 78px; border: 4px solid var(--border); background: var(--orange); box-shadow: inset 0 -20px #166ab0, 7px 7px 0 rgba(23,33,45,.2); animation: float 2.2s ease-in-out infinite; }
.pixel-hero::before { content: ""; position: absolute; width: 56px; height: 18px; left: 2px; top: -16px; border: 4px solid var(--border); background: var(--yellow); }
.pixel-hero::after { content: "•  •"; position: absolute; top: 11px; left: 11px; white-space: pre; font-size: 22px; font-weight: 900; }
.pixel-hero i { position: absolute; left: 18px; bottom: -14px; width: 24px; height: 16px; border: 4px solid var(--border); background: var(--ink); }
@keyframes float { 50% { transform: translateY(-16px); } }

.game-section { padding: 96px clamp(18px, 6vw, 92px); background: #f3eedf; }
.section-heading { max-width: 1180px; margin: 0 auto 38px; display: flex; justify-content: space-between; align-items: end; gap: 36px; }
.section-heading h2, .about h2 { font-size: clamp(42px, 6vw, 76px); }
.section-heading > p { max-width: 460px; margin: 0; color: var(--muted); }
.game-shell { max-width: 1180px; margin: auto; border: 3px solid var(--border); background: white; box-shadow: 10px 10px 0 var(--border); }
.game-toolbar { min-height: 72px; display: flex; align-items: center; gap: clamp(20px, 5vw, 68px); padding: 10px 22px; border-bottom: 3px solid var(--border); background: var(--yellow); }
.game-toolbar div { display: grid; line-height: 1.1; }
.game-toolbar span { font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.game-toolbar strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 21px; }
.game-toolbar button { margin-left: auto; padding: 8px 14px; border: 2px solid var(--border); background: white; font-weight: 800; cursor: pointer; }
.canvas-wrap { position: relative; overflow: hidden; background: #80d2ff; aspect-ratio: 16 / 9; }
canvas { display: block; width: 100%; height: 100%; outline: none; image-rendering: pixelated; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16, 34, 50, .45); backdrop-filter: blur(4px); }
.game-overlay[hidden] { display: none; }
.overlay-card { width: min(430px, 100%); padding: 30px; text-align: center; border: 3px solid var(--border); background: var(--paper); box-shadow: 8px 8px 0 var(--border); }
.overlay-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border: 3px solid var(--border); border-radius: 50%; background: var(--yellow); font-size: 30px; }
.overlay-card h3 { font-size: clamp(30px, 5vw, 46px); }
.overlay-card > p:not(.eyebrow) { color: var(--muted); }
.game-help { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 20px; border-top: 3px solid var(--border); }
kbd { display: inline-grid; min-width: 30px; height: 30px; place-items: center; padding: 0 7px; border: 2px solid var(--border); border-radius: 3px; background: #fff; box-shadow: 0 3px 0 #aeb5bc; font: 700 13px ui-monospace, monospace; }
.text-button { border: 0; background: transparent; font-weight: 900; cursor: pointer; }
.touch-controls { display: none; gap: 8px; width: 100%; }
.touch-controls button { min-width: 54px; min-height: 48px; border: 2px solid var(--border); background: #fff; box-shadow: 0 3px 0 var(--border); font-weight: 900; touch-action: none; }
.touch-controls .jump-control { margin-left: auto; padding-inline: 20px; background: var(--yellow); }

.about { max-width: 900px; margin: auto; padding: 120px 28px; text-align: center; }
.about > p:not(.eyebrow) { max-width: 650px; margin: 28px auto; color: var(--muted); font-size: 18px; }
.about-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.about-tags span { padding: 9px 16px; border: 2px solid var(--border); border-radius: 999px; background: white; font-weight: 700; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px clamp(20px, 5vw, 72px); color: white; background: var(--ink); font-size: 14px; }
footer p { margin: 0; }
footer a { text-underline-offset: 4px; }

@media (max-width: 800px) {
  nav { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-top: 72px; padding-bottom: 72px; }
  .hero-art { min-height: 440px; border-top: 3px solid var(--border); border-left: 0; }
  .section-heading { align-items: start; flex-direction: column; }
  .game-section { padding-block: 72px; }
  .desktop-help { display: none; }
  .touch-controls { display: flex; }
  .game-help { flex-wrap: wrap; }
  .game-help .text-button { width: 100%; padding-top: 8px; }
  footer { align-items: center; flex-direction: column; text-align: center; }
}

@media (max-width: 540px) {
  .site-header { min-height: 62px; }
  .brand-mark { width: 36px; height: 36px; }
  h1 { font-size: 48px; }
  h1 span { text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1.5px var(--ink); }
  .hero-art { min-height: 380px; }
  .game-toolbar { gap: 18px; padding-inline: 12px; }
  .game-toolbar strong { font-size: 16px; }
  .game-toolbar button { padding: 6px 8px; font-size: 12px; }
  .overlay-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
