/* ---------- Tokens ---------- */
:root {
  --bg: #f6ecd6; --fg: #2a1c14; --muted: #6e5640; --card: #fff8e8; --line: #d9c19a;
  --accent: #f08a24; --accent-dark: #b0632a; --navy: #1f2d4d; --on-accent: #2a1c14;
  --frame: #3a2618;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f; --fg: #f2ead9; --muted: #b3a38b; --card: #221d16; --line: #3d3326;
    --accent: #f59a3c; --accent-dark: #c77426; --navy: #9fb4e0; --on-accent: #1a1209;
    --frame: #0c0906;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17140f; --fg: #f2ead9; --muted: #b3a38b; --card: #221d16; --line: #3d3326;
  --accent: #f59a3c; --accent-dark: #c77426; --navy: #9fb4e0; --on-accent: #1a1209;
  --frame: #0c0906;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: 'Pixelify Sans', ui-rounded, system-ui, sans-serif;
  font-size: 17px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: 12px;
  max-width: 1040px; margin: 0 auto; padding: 18px 16px 10px;
}
.logo { width: 48px; height: 42px; }
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.brand-1 { font-weight: 700; font-size: 24px; letter-spacing: .5px; }
.brand-2 { font-size: 15px; color: var(--muted); }
.soon-chip {
  margin-left: auto; padding: 5px 12px; font-size: 14px; font-weight: 600;
  background: var(--accent); color: var(--on-accent);
  border: 3px solid var(--frame); box-shadow: 3px 3px 0 var(--frame);
}

main { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- Stage ---------- */
.stage-wrap { margin-top: 8px; }
.stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border: 4px solid var(--frame); box-shadow: 6px 6px 0 var(--frame);
  background: #6fae47; overflow: hidden;
}
.stage canvas { display: block; width: 100%; height: 100%; }
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; transform: translate(-50%, -100%);
  max-width: 46%; width: max-content;
  padding: 4px 9px 5px; font-size: clamp(12px, 2vw, 18px); line-height: 1.2; text-align: center;
  background: #fff8e8; color: #2a1c14; border: 3px solid #2a1c14;
  box-shadow: 2px 2px 0 rgba(42, 28, 20, .35);
  animation: pop .18s steps(3) both;
  transition: opacity .2s;
}
.bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -4px;
  border: 5px solid transparent; border-top-color: #2a1c14; border-bottom: 0;
}
.bubble.fade { opacity: 0; }
@keyframes pop { from { transform: translate(-50%, -80%) scale(.6); } to { transform: translate(-50%, -100%) scale(1); } }

.endcard {
  position: absolute; inset: 0; display: grid; place-items: end center; padding-bottom: 4%;
  background: linear-gradient(to bottom, transparent 55%, rgba(31, 45, 77, .45));
  animation: fadein .6s ease both;
}
.endcard[hidden] { display: none; }
.endcard-inner {
  background: #fff8e8; color: #2a1c14; text-align: center;
  border: 4px solid #2a1c14; box-shadow: 5px 5px 0 #2a1c14;
  padding: 12px 22px 14px; max-width: 86%;
}
.end-1 { margin: 0; font-size: clamp(22px, 4vw, 40px); font-weight: 700; color: #b0632a; }
.end-2 { margin: 4px 0 14px; font-size: clamp(14px, 2.2vw, 20px); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- HUD ---------- */
.hud { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.meter { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; }
.meter-label { font-weight: 600; }
.meter-track {
  flex: 1; height: 18px; background: var(--card);
  border: 3px solid var(--frame); position: relative; overflow: hidden;
}
.meter-fill {
  height: 100%; width: 0; background: var(--accent);
  background-image: repeating-linear-gradient(90deg, transparent 0 10px, rgba(0,0,0,.12) 10px 12px);
  transition: width .3s steps(4);
}
.meter-pct { font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; font-weight: 600; }
.controls { display: flex; gap: 8px; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
  padding: 9px 18px; min-height: 44px;
  background: var(--accent); color: var(--on-accent);
  border: 3px solid var(--frame); box-shadow: 3px 3px 0 var(--frame);
}
.endcard .btn { background: #f08a24; color: #2a1c14; border-color: #2a1c14; box-shadow: 3px 3px 0 #2a1c14; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--frame); }
.btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.btn-small { padding: 6px 12px; font-size: 15px; background: var(--card); color: var(--fg); }
.hint { color: var(--muted); font-size: 15px; margin: 10px 0 0; }

/* ---------- Pitch ---------- */
.pitch { margin: 44px 0 0; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0 0 8px; }
.lede { font-size: 20px; color: var(--muted); margin: 0 0 22px; }
.services {
  list-style: none; padding: 0; margin: 0 0 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
}
.services li {
  background: var(--card); border: 3px solid var(--frame); padding: 12px 14px;
  color: var(--muted); font-size: 15px;
}
.services b { display: block; color: var(--fg); font-size: 18px; margin-bottom: 2px; }

/* ---------- Crew ---------- */
.crew { margin: 44px 0 0; }
h2 { font-size: 26px; margin: 0 0 14px; }
.crew-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.crew-card {
  background: var(--card); border: 3px solid var(--frame); padding: 14px 10px 12px; text-align: center;
}
.portrait { width: 60px; height: 100px; display: block; margin: 0 auto 6px; }
.crew-name { font-weight: 700; font-size: 19px; }
.crew-role { color: var(--muted); font-size: 14px; }

.foot { max-width: 1040px; margin: 48px auto 0; padding: 20px 16px 32px; color: var(--muted); font-size: 14px; border-top: 3px solid var(--line); }

@media (max-width: 520px) {
  .soon-chip { display: none; }
  .crew-grid { gap: 8px; }
  .portrait { width: 48px; height: 80px; }
  .crew-name { font-size: 16px; }
  .crew-role { font-size: 12px; }
}

[hidden] { display: none !important; }
