/* Cube Ant Cat voxel site — tokens from Reef (#136 palette, #137 voxel spec) */
:root {
  --K: #2f130b; --B: #703723; --D: #ab522a; --O: #d97f52; --o: #f3b179;
  --W: #fcf6ee; --w: #f4ded1; --s: #dfb7b1; --P: #ec846d; --p: #e87469; --M: #b3504b;
  --G: #2b1518; --g: #3f2d2c; --h: #64595a; --e: #a48f88; --L: #9f4a24; --H: #ffca9d;
  --Y: #fadabe; --y: #fbcda6; --S: #e0916b; --r: #c48a66;
  --A: #3b4658; --C: #5e6d84; --c: #8496ad; --v: #b4c2d2;
  --display: "Press Start 2P", ui-monospace, monospace;
  --body: "Silkscreen", ui-monospace, monospace;
  --gutter: 32px;
  --fw: 96px;
}
@media (max-width: 640px) { :root { --gutter: 16px; --fw: 72px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--Y); }
body { margin: 0; background: var(--Y); color: var(--K); font: 16px/1.6 var(--body); overflow-x: hidden; }
body.over-cat { cursor: pointer; }
@media (max-width: 640px) { body { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
h1, h2, h3, .btn, .chip, .num, nav, .brand, .caption, dt { font-family: var(--display); -webkit-font-smoothing: none; font-weight: 400; }
h1 { font-size: 32px; line-height: 1.5; margin: 0 0 16px; }
h2 { font-size: 22px; line-height: 1.5; margin: 0 0 20px; }
h3 { font-size: 12px; line-height: 1.5; margin: 0 0 6px; }
@media (max-width: 640px) { h1 { font-size: 22px; } h2 { font-size: 16px; } }
p { margin: 0 0 14px; }
a { color: var(--K); }
code { font-family: var(--body); background: var(--w); padding: 0 4px; word-break: break-all; }
:focus-visible { outline: 4px solid var(--K); outline-offset: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--W); padding: 8px; }

/* live 3D canvas sits behind the page */
#gl { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; display: block; }
html:not(.gl) #gl { display: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 2; }

/* pixel panels + buttons (stepped corners, 4px ink, 4px drop) — same as #136 */
.panel {
  background: var(--W); margin: 4px;
  box-shadow: 0 -4px 0 var(--K), 0 4px 0 var(--K), -4px 0 0 var(--K), 4px 0 0 var(--K), 0 8px 0 var(--D), 4px 4px 0 var(--D), -4px 4px 0 var(--D);
}
.panel.dark { background: var(--g); color: var(--W); box-shadow: 0 -4px 0 var(--K), 0 4px 0 var(--K), -4px 0 0 var(--K), 4px 0 0 var(--K), 0 8px 0 var(--G), 4px 4px 0 var(--G), -4px 4px 0 var(--G); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 20px; margin: 4px 4px 12px;
  background: var(--O); color: var(--W); border: 0; cursor: pointer; text-decoration: none; font-size: 14px; line-height: 1;
  box-shadow: 0 -4px 0 var(--K), 0 4px 0 var(--K), -4px 0 0 var(--K), 4px 0 0 var(--K), 0 8px 0 var(--D), 4px 4px 0 var(--D), -4px 4px 0 var(--D);
  transition: transform 80ms steps(2), background-color 80ms steps(2);
}
.btn:hover { background: var(--p); }
.btn:active { transform: translateY(4px); }
.btn-light { background: var(--W); color: var(--K); }
.btn-light:hover { background: var(--o); }
@media (max-width: 640px) { .btn { font-size: 11px; padding: 12px 12px; } }

/* top bar */
.topbar { position: relative; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 8px var(--gutter); background: var(--W); box-shadow: 0 4px 0 var(--K); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 12px; text-decoration: none; white-space: nowrap; }
.brand img { image-rendering: pixelated; }
.topbar nav { display: flex; gap: 20px; margin-left: auto; font-size: 10px; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { color: var(--D); }
@media (max-width: 760px) { .topbar nav { display: none; } }

/* sections: transparent so the voxel world shows through */
.sec { position: relative; padding: 72px 0 0; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: center; }
.split.rev { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.copy { padding: 28px 28px 16px; position: relative; z-index: 3; }
.stage { position: relative; height: 460px; min-width: 0; pointer-events: none; }
.stage-hero { height: min(74vh, 660px); min-height: 440px; }
.stage-foot { height: 400px; }
.still { display: none; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
html.static .still { display: block; }
html.static .stage { background: var(--Y); }
@media (max-width: 760px) {
  .sec { padding-top: 40px; }
  .split, .split.rev { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .split > .stage { order: -1; height: 300px; }
  .stage-hero { height: 360px; min-height: 0; }
  .copy { padding: 20px 16px 8px; }
}
.hero { padding-top: 40px; }
.chip { display: inline-block; font-size: 12px; background: var(--G); color: var(--H); padding: 8px 12px; margin: 0 0 16px; box-shadow: 0 -4px 0 var(--K), 0 4px 0 var(--K), -4px 0 0 var(--K), 4px 0 0 var(--K); }
.hook { font-size: 18px; max-width: 30ch; }
.chain { color: var(--B); }
.tip { font-size: 12px; color: var(--h); margin-top: 4px; }
html.static .tip { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.caption { font-size: 10px; margin-top: 8px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.steps p { margin-bottom: 4px; }
.num { display: inline-grid; place-items: center; width: 32px; height: 32px; background: var(--G); color: var(--H); font-size: 12px; }

.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
.item { padding: 14px; text-align: center; background: var(--w); box-shadow: 0 0 0 4px var(--K); margin: 4px; }
.item dt { font-size: 10px; margin: 0 0 8px; }
.item dd { margin: 0; font-size: 20px; word-break: break-all; }

.footer { padding-bottom: 24px; }
.disclaimer { max-width: 60ch; font-size: 14px; }
.small { font-size: 12px; color: var(--s); }

/* crowds: pre-rendered voxel sprites standing on a roof-tile ledge */
.crowd { position: relative; z-index: 2; display: flex; justify-content: space-around; align-items: flex-end; margin: 32px auto 0; padding: 0 var(--gutter) 40px; min-height: calc(var(--fw) + 40px); }
.crowd::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: url(assets/ground.png) 0 0 / 96px 48px repeat-x; image-rendering: pixelated; z-index: -1; }
.vx-slot { position: relative; display: block; width: var(--fw); height: var(--fw); margin-bottom: 30px; cursor: pointer; }
.vx { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-size: calc(var(--fw) * 12) var(--fw); background-position: 0 0; }
.vx-cat { background-image: url(assets/crowd-cat.png); }
.vx-shiba { background-image: url(assets/crowd-shiba.png); }
.vx.flip { transform: scaleX(-1); }
.a-idle .vx { animation: vx-idle 3.2s step-end infinite; }
.a-glow .vx { animation: vx-glow 1.6s step-end infinite; }
.a-sleep .vx { background-position: calc(var(--fw) * -11) 0; }
.a-run { animation: lane 8s linear infinite alternate; }
.a-run .vx { animation: vx-run .5s steps(6) infinite; }
@keyframes vx-idle { 0% { background-position: 0 0; } 40% { background-position: calc(var(--fw) * -1) 0; } 55% { background-position: 0 0; } 70% { background-position: calc(var(--fw) * -2) 0; } 84% { background-position: calc(var(--fw) * -3) 0; } }
@keyframes vx-glow { 0% { background-position: 0 0; } 50% { background-position: calc(var(--fw) * -2) 0; } }
@keyframes vx-run { from { background-position: calc(var(--fw) * -4) 0; } to { background-position: calc(var(--fw) * -10) 0; } }
@keyframes lane { from { transform: translateX(-40px); } to { transform: translateX(40px); } }
.vx-slot.hop .vx { animation: none; background-position: calc(var(--fw) * -10) 0; }
.vx-slot.hop { animation: hop .5s steps(6); }
@keyframes hop { 0%, 100% { translate: 0 0; } 40% { translate: 0 -28px; } 60% { translate: 0 -28px; } }
.zz { position: absolute; left: 62%; top: 0; font: 10px var(--display); color: var(--D); animation: zz 1.6s steps(4) infinite; }
@keyframes zz { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-20px); opacity: 0; } }
.crowd.paused .vx, .crowd.paused .vx-slot, .crowd.paused .zz { animation-play-state: paused; }
html.static .vx, html.static .vx-slot, html.static .zz { animation: none !important; }
html.static .a-glow .vx { background-position: calc(var(--fw) * -2) 0; }
@media (prefers-reduced-motion: reduce) { .vx, .vx-slot, .zz { animation: none !important; } }

/* fx + toast */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.cube { position: absolute; left: 0; top: 0; box-shadow: inset -2px -2px 0 rgba(47, 19, 11, .35); }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 40; background: var(--G); color: var(--H); font: 12px/1.5 var(--display); padding: 12px 16px; box-shadow: 0 0 0 4px var(--K); visibility: hidden; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { visibility: visible; }
