/* ============ CROSSYHOOD v2 ============
   Light pixel-arcade look over a live animated
   crossy world (canvas #bg, fixed behind all).
   cream #FBF8EF · ink #3d3d2e · lime #a7d817
   deep lime #7fb108 · orange #d97b28 · gold #f2b31b
======================================== */

:root {
  --cream: #fbf8ef;
  --cream-2: #f4efe0;
  --ink: #3d3d2e;
  --ink-soft: #6b6b55;
  --lime: #a7d817;
  --lime-bright: #c6e82e;
  --lime-deep: #7fb108;
  --orange: #d97b28;
  --gold: #f2b31b;
  --panel: #fffdf6;
  --border: #3d3d2e;
  --display: 'Press Start 2P', monospace;
  --body: 'VT323', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.hood { color: var(--gold); }
.lime-ink { color: var(--lime-deep); }
.orange-ink { color: var(--orange); }
.gold-ink { color: var(--orange); font-weight: bold; }

/* ---------- animated world background ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  image-rendering: pixelated;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.4rem;
  background: var(--cream);
  border-bottom: 3px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }

.brand-name {
  font-family: var(--display);
  font-size: 0.8rem;
  color: var(--lime-deep);
  letter-spacing: 1px;
}

.topnav { display: flex; align-items: center; gap: 1.3rem; }

.navlink {
  font-family: var(--display);
  font-size: 0.58rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.4rem 0.1rem;
}
.navlink:hover { color: var(--orange); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--display);
  font-size: 0.68rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.95rem 1.35rem;
  text-decoration: none;
  border: 3px solid var(--border);
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.05s steps(1), box-shadow 0.05s steps(1);
  user-select: none;
}

.btn-lime {
  background: var(--lime-bright);
  box-shadow: 4px 4px 0 var(--border);
}
.btn-lime:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--border); }
.btn-lime:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--border); }

.btn-outline {
  background: var(--panel);
  box-shadow: 4px 4px 0 rgba(61, 61, 46, 0.25);
}
.btn-outline:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(61, 61, 46, 0.25); }

.btn-small { font-size: 0.55rem; padding: 0.55rem 0.8rem; }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 4.5rem 1.25rem 2.5rem;
  max-width: 880px;
  margin: 0 auto;
}

.hero-chicken {
  width: clamp(64px, 9vw, 96px);
  margin: 0 auto 1.1rem;
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 rgba(61, 61, 46, 0.18));
  animation: bob 1.6s steps(2) infinite;
}

.wordmark {
  font-family: var(--display);
  font-size: clamp(1.9rem, 6.5vw, 3.6rem);
  color: var(--lime);
  letter-spacing: 2px;
  text-shadow:
    3px 3px 0 var(--lime-deep),
    6px 6px 0 rgba(61, 61, 46, 0.18);
  -webkit-text-stroke: 1px rgba(61,61,46,0.25);
}

.hero-eyebrow {
  font-family: var(--display);
  font-size: clamp(0.6rem, 1.8vw, 0.85rem);
  color: var(--orange);
  margin-top: 1.4rem;
  letter-spacing: 3px;
}

.hero-copy {
  font-size: clamp(1.3rem, 2.6vw, 1.55rem);
  line-height: 1.5;
  max-width: 620px;
  margin: 1.3rem auto 0;
  color: var(--ink);
}
.hero-copy strong { color: var(--ink); }

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2.1rem;
}
.steps i { color: var(--ink-soft); font-style: normal; }

.step {
  font-family: var(--display);
  font-size: 0.55rem;
  border: 2px solid var(--border);
  background: var(--panel);
  padding: 0.5rem 0.7rem;
  letter-spacing: 1px;
  box-shadow: 3px 3px 0 rgba(61,61,46,0.15);
}
.step b { color: var(--orange); margin-right: 0.35rem; }

.hero-hint {
  display: inline-block;
  font-size: 1.1rem;
  color: var(--lime-deep);
  margin-top: 2.2rem;
  padding: 0.2rem 0.8rem;
  background: var(--cream);
  border: 2px solid rgba(61, 61, 46, 0.25);
  animation: bob 1.6s steps(2) infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* window where the animated world shows through */
.world-window { height: 34vh; min-height: 220px; }

/* ---------- ticker ---------- */
.ticker {
  background: var(--lime-bright);
  border-top: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.ticker-track {
  display: inline-flex;
  gap: 3rem;
  padding: 0.7rem 0;
  animation: ticker 28s linear infinite;
  will-change: transform;
}

.ticker-track span {
  font-family: var(--display);
  font-size: 0.6rem;
  color: var(--ink);
  letter-spacing: 1px;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- stat bar ---------- */
.statbar {
  background: var(--panel);
  border-bottom: 3px solid var(--border);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 6vw, 5rem);
  padding: 1.6rem 1rem;
  position: relative;
  z-index: 2;
}

.stat { text-align: center; }

.stat-big {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  margin-bottom: 0.55rem;
}

.stat-label {
  font-family: var(--display);
  font-size: 0.5rem;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

/* ---------- sections & panels ---------- */
.section {
  padding: 4rem 1.25rem;
  display: flex;
  justify-content: center;
}

.panel {
  width: 100%;
  max-width: 980px;
  background: var(--panel);
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0 rgba(61, 61, 46, 0.22);
  padding: clamp(1.6rem, 4vw, 3rem);
  text-align: center;
}

.eyebrow {
  font-family: var(--display);
  font-size: 0.6rem;
  letter-spacing: 3px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.15rem, 3.4vw, 1.9rem);
  margin-top: 1rem;
  color: var(--ink);
}

.section-copy {
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 1rem auto 0;
}

/* ---------- game ---------- */
.game-shell {
  max-width: 520px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-hud {
  display: flex;
  gap: 0.7rem;
  width: 100%;
  margin-bottom: 0.9rem;
}

.hud-block {
  flex: 1;
  background: var(--cream-2);
  border: 3px solid var(--border);
  padding: 0.6rem 0.4rem;
  text-align: center;
}

.hud-label {
  display: block;
  font-family: var(--display);
  font-size: 0.5rem;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.hud-value {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--ink);
}
.hud-gold { color: var(--orange); }

.game-frame {
  position: relative;
  width: 100%;
  border: 4px solid var(--border);
  box-shadow: 8px 8px 0 rgba(61, 61, 46, 0.22);
  background: #000;
}

#game {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  touch-action: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 248, 239, 0.88);
}
.game-overlay.hidden { display: none; }

.overlay-card { text-align: center; padding: 1.5rem; }

.overlay-title {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--lime-deep);
  margin-bottom: 1rem;
}

.overlay-sub {
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 1.3rem;
}

.controls-hint {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* touch pad — coarse pointers only */
.touch-pad {
  display: none;
  grid-template-areas: ". up ." "left down right";
  gap: 0.5rem;
  margin-top: 1rem;
}
.tp {
  font-family: var(--display);
  font-size: 1rem;
  width: 64px;
  height: 56px;
  background: var(--cream-2);
  color: var(--ink);
  border: 3px solid var(--border);
  box-shadow: 3px 3px 0 rgba(61,61,46,0.25);
  cursor: pointer;
}
.tp:active { transform: translate(3px, 3px); box-shadow: 0 0 0; background: var(--lime-bright); }
.tp-up { grid-area: up; }
.tp-left { grid-area: left; }
.tp-down { grid-area: down; }
.tp-right { grid-area: right; }

@media (pointer: coarse) {
  .touch-pad { display: grid; }
}

/* ---------- about cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 2.2rem;
  text-align: left;
}

.card {
  background: var(--cream);
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 rgba(61,61,46,0.18);
  padding: 1.4rem 1.2rem;
}

.card-icon { font-size: 1.8rem; margin-bottom: 0.8rem; }

.card-title {
  font-family: var(--display);
  font-size: 0.7rem;
  margin-bottom: 0.8rem;
  color: var(--lime-deep);
  letter-spacing: 1px;
}

.card-body {
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--ink);
}
.card-body a { color: var(--orange); }

/* ---------- footer ---------- */
.footer-section { padding-bottom: 5rem; }

.footer-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.footer-banner {
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 rgba(61,61,46,0.18);
}

.footer-word {
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--lime-deep);
  letter-spacing: 2px;
  margin-top: 0.4rem;
}

.footer-fine {
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .navlink { display: none; }
  .world-window { height: 26vh; }
}

/* ---------- a11y ---------- */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .tp { transition: none; }
  .ticker-track { animation: none; }
  .hero-hint { animation: none; }
  .hero-chicken { animation: none; }
}
