/* Hello Universe: website styles */
@font-face { font-family: 'VT323'; src: url('fonts/VT323-Regular.ttf') format('truetype'); font-display: swap; }

:root {
  --space: #070a1a;
  --space-2: #0d1230;
  --ink: #eef0ff;
  --dim: #a3abd0;
  --faint: #6b7299;
  --line: rgba(160, 175, 255, .16);
  --glass: rgba(14, 18, 44, .62);
  --gold: #ffcf6b;
  --ember: #ff8a3d;
  --sky: #7fe3ff;
  --tie: #7fd38a;
  --nebula: #c86bff;
  --pixel: 'Pixelify Sans', 'VT323', ui-monospace, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--space); color: var(--ink); font: 400 17px/1.65 var(--sans); overflow-x: hidden; }
body.intro-running { overflow: hidden; }
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.08; margin: 0 0 .5em; letter-spacing: .01em; }
h2 { font-size: clamp(30px, 4vw, 50px); }
h2.big { font-size: clamp(40px, 7.4vw, 96px); }
h3 { font-size: 22px; }
p { margin: 0 0 1em; color: var(--dim); }
em { color: var(--ink); font-style: normal; }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 2; }
.center { text-align: center; }
.narrow { max-width: 720px; }
.center .narrow { margin-left: auto; margin-right: auto; }
.small { font-size: 13px; color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--sky); margin-bottom: 18px; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: #c9cfee; }
.grad { background: linear-gradient(90deg, var(--gold), var(--ember) 40%, var(--nebula) 75%, var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: shimmer 8s linear infinite; }
@keyframes shimmer { to { background-position: 200% 0; } }
kbd { font: 500 12px var(--sans); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; opacity: .7; }
section { position: relative; padding: clamp(90px, 14vh, 160px) 0; }

/* ---------- the sky behind everything ---------- */
#cosmos { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#grain { position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }
main { position: relative; z-index: 2; }

/* ---------- cursor ---------- */
#cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; display: none; }
#cursor i, #cursor b { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
#cursor i { width: 6px; height: 6px; background: #fff; box-shadow: 0 0 10px 2px rgba(127, 227, 255, .9), 0 0 24px 6px rgba(127, 227, 255, .35); }
#cursor b { width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .45); transition: width .25s var(--ease), height .25s var(--ease), border-color .25s, background .25s; }
#cursor.hover b { width: 58px; height: 58px; border-color: var(--gold); background: rgba(255, 207, 107, .08); }
#cursor.down b { width: 22px; height: 22px; }
#cursor.game b { width: 26px; height: 26px; border-color: rgba(255, 255, 255, .8); border-radius: 0; }
@media (hover: hover) and (pointer: fine) { #cursor { display: block; } body, a, button, input { cursor: none; } }
#progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; transform-origin: 0 0; transform: scaleX(0); z-index: 60;
  background: linear-gradient(90deg, var(--gold), var(--nebula), var(--sky)); }

/* ---------- nav ---------- */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 24px;
  padding: 16px var(--gutter); transition: background .4s, padding .4s, transform .5s var(--ease-out), opacity .5s; }
#nav.solid { background: rgba(7, 10, 26, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
body.intro-running #nav { transform: translateY(-100%); opacity: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 18px var(--pixel); letter-spacing: .08em; text-decoration: none; }
.brand-star { width: 10px; height: 10px; background: #fff; box-shadow: 0 0 12px 3px var(--sky); transform: rotate(45deg); animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 18px 6px var(--gold); } }
#nav nav { display: flex; gap: 4px; margin-left: auto; }
#nav nav a { text-decoration: none; color: var(--dim); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 99px; transition: color .2s, background .2s; }
#nav nav a:hover, #nav nav a.on { color: var(--ink); background: rgba(255, 255, 255, .07); }
@media (max-width: 860px) { #nav nav { display: none; } #nav .btn-small { margin-left: auto; } }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 15px 26px; border-radius: 999px; border: 0;
  font: 600 16px var(--sans); color: #1a1205; text-decoration: none; cursor: pointer; isolation: isolate; overflow: hidden;
  background: linear-gradient(135deg, #ffe39a, var(--gold) 45%, var(--ember)); box-shadow: 0 10px 40px -10px rgba(255, 160, 60, .7), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: box-shadow .3s var(--ease), filter .3s; will-change: transform; }
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease-out); z-index: -1; }
.btn:hover::after { transform: translateX(120%); }
.btn:hover { box-shadow: 0 14px 50px -8px rgba(255, 160, 60, .9), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn span, .btn kbd { pointer-events: none; }
.btn kbd { border-color: rgba(26, 18, 5, .5); }
.btn-ghost { color: var(--ink); background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--sky), 0 0 30px -6px rgba(127, 227, 255, .6); }
.btn-small { padding: 9px 18px; font-size: 14px; }
.btn-steam { color: var(--dim); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.btn-steam::after { display: none; }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------- reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
.dots-nav { }
#dots { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 12px; transition: opacity .6s; }
body.intro-running #dots { opacity: 0; }
#dots a { position: relative; display: block; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .25); transition: background .3s, transform .3s; }
#dots a.on { background: var(--gold); transform: scale(1.5); box-shadow: 0 0 10px var(--gold); }
#dots a span { position: absolute; right: 18px; top: 50%; transform: translate(6px, -50%); white-space: nowrap; font-size: 12px; color: var(--ink); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
#dots a:hover span { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 860px) { #dots { display: none; } }

/* ---------- 1. hello ---------- */
#hello { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 120px 0 90px; overflow: hidden; }
.hello-layers { position: absolute; inset: 0; pointer-events: none; }
.hello-glow { position: absolute; left: 50%; top: 50%; width: 120vmax; height: 120vmax; transform: translate(-50%, -50%); opacity: 0;
  background: radial-gradient(circle, rgba(255, 220, 160, .22), rgba(200, 107, 255, .1) 25%, transparent 55%); transition: opacity 3s; }
body.banged .hello-glow { opacity: 1; }
#bubble { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 5; min-width: 92px; padding: 16px 22px;
  border-radius: 22px 22px 22px 6px; background: #1d2240; color: #eef0ff; font: 30px/1.1 'VT323', monospace; letter-spacing: .04em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 20px 60px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .8s, transform 1s var(--ease); }
#bubble.show { opacity: 1; }
#bubble .dots { display: flex; gap: 6px; padding: 6px 2px; }
#bubble .dots i { width: 9px; height: 9px; border-radius: 50%; background: #8d95c4; animation: typing 1.2s infinite; }
#bubble .dots i:nth-child(2) { animation-delay: .15s; } #bubble .dots i:nth-child(3) { animation-delay: .3s; }
#bubble.paused .dots i { animation-play-state: paused; opacity: .35; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
#bubble .msg { display: none; white-space: nowrap; }
#bubble .msg span { display: inline-block; animation: glyph .5s var(--ease-out) both; }
@keyframes glyph { from { opacity: 0; filter: blur(6px); transform: translateY(6px) scale(1.4); text-shadow: 0 0 16px #fff; } }
#bubble .delivered { position: absolute; right: 6px; bottom: -24px; font: 500 12px var(--sans); color: #8d95c4; opacity: 0; transition: opacity .5s; }
#bubble.sent .delivered { opacity: 1; }
#bubble.collapse { transform: translate(-50%, -50%) scale(0); opacity: 0; transition: transform .9s cubic-bezier(.7, 0, .84, 0), opacity .2s .75s; }
#flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; background: radial-gradient(circle at 50% 46%, #fff, #ffe7b8 30%, rgba(255, 180, 90, .3) 60%, transparent 80%); opacity: 0; }
#flash.go { animation: flash 2.2s var(--ease-out) forwards; }
@keyframes flash { 0% { opacity: 0; } 6% { opacity: 1; } 100% { opacity: 0; } }
.hello-copy { position: relative; z-index: 3; text-align: center; padding: 0 var(--gutter); max-width: 980px; }
.title { font-size: clamp(54px, 13vw, 176px); font-weight: 700; line-height: .9; letter-spacing: .02em; margin: 0 0 28px;
  text-shadow: 0 0 40px rgba(127, 227, 255, .35), 0 0 120px rgba(200, 107, 255, .35); }
.title .split { display: inline-block; white-space: nowrap; }
.title .ch { display: inline-block; opacity: 0; transform: translateY(.5em) scale(.6) rotate(-8deg); filter: blur(10px); }
body.banged .title .ch { animation: ch 1.2s var(--ease-out) forwards; animation-delay: calc(.35s + var(--i) * .06s); }
@keyframes ch { to { opacity: 1; transform: none; filter: blur(0); } }
.title .split:last-child .ch { background: linear-gradient(180deg, #fff 20%, #ffd78a 70%, #ff9a4a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reveal-intro { opacity: 0; transform: translateY(18px); transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out); }
body.banged .reveal-intro { opacity: 1; transform: none; }
body.banged .hello-copy .eyebrow { transition-delay: .2s; } body.banged .hello-copy .lede { transition-delay: 1.1s; }
body.banged .hello-copy .cta { transition-delay: 1.4s; justify-content: center; } body.banged .hello-copy .hint { transition-delay: 2.2s; }
.hello-copy .lede { max-width: 640px; margin: 0 auto; }
.hello-copy .cta { justify-content: center; }
.hint { margin-top: 26px; font-size: 13px; color: var(--faint); letter-spacing: .04em; }
#skip { position: fixed; right: 22px; bottom: 22px; z-index: 80; background: none; border: 1px solid var(--line); color: var(--faint); border-radius: 99px; padding: 6px 14px; font: 13px var(--sans); cursor: pointer; transition: opacity .5s, color .2s; }
#skip:hover { color: var(--ink); }
body:not(.intro-running) #skip { opacity: 0; pointer-events: none; }
.year { position: absolute; left: var(--gutter); bottom: 28px; z-index: 3; font: 600 22px var(--pixel); color: #d9dcf5; opacity: 0; transition: opacity 1s; }
.year small { display: block; font: 500 11px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
body.banged .year { opacity: 1; }
.star-pop { position: fixed; z-index: 90; pointer-events: none; font: 500 12px var(--sans); color: var(--gold); transform: translate(-50%, -150%); animation: pop 1.6s var(--ease-out) forwards; white-space: nowrap; }
@keyframes pop { from { opacity: 1; } to { opacity: 0; transform: translate(-50%, -320%); } }

/* ---------- 2. the First at dawn ---------- */
#first { min-height: 110vh; display: flex; align-items: center; overflow: hidden; padding-top: 18vh; }
.dawn { position: absolute; inset: 0; pointer-events: none; }
.dawn .layer { position: absolute; left: -6%; right: -6%; top: -6%; bottom: -6%; will-change: transform; }
.dawn .sky { background: url('img/sky_sunset.webp') center 70% / cover no-repeat; }
.dawn .clouds { background-repeat: repeat-x; image-rendering: pixelated; opacity: .9; }
.dawn .c1 { background-image: url('art/sky/clouds_2.png'), url('art/sky/clouds_5.png'); background-size: 384px auto, 384px auto; background-position: 10% 18%, 70% 30%; animation: drift 120s linear infinite; opacity: .55; }
.dawn .c2 { background-image: url('art/sky/clouds_0.png'), url('art/sky/clouds_3.png'); background-size: 576px auto, 576px auto; background-position: 30% 40%, 90% 52%; animation: drift 80s linear infinite; opacity: .75; }
.dawn .c3 { background-image: url('art/sky/clouds_1.png'), url('art/sky/clouds_4.png'); background-size: 768px auto, 768px auto; background-position: 0% 58%, 60% 70%; animation: drift 55s linear infinite; }
@keyframes drift { to { background-position-x: calc(10% + 2400px), calc(70% + 2400px); } }
.dawn .meadow { top: auto; height: 46%; bottom: -2%; width: 112%; image-rendering: pixelated; }
.dawn-fade { position: absolute; inset: 0; background: linear-gradient(180deg, var(--space) 0%, rgba(7, 10, 26, 0) 22%, rgba(7, 10, 26, 0) 70%, var(--space) 100%); }
.first-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.first-copy { padding: 28px; border-radius: 20px; background: rgba(7, 10, 26, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); }
.first-copy p { color: #d5d9f2; }
.first-copy h2 { font-size: clamp(26px, 2.8vw, 36px); }
.talk { background: rgba(12, 14, 20, .9); border: 3px solid #3d4a3f; box-shadow: 0 0 0 3px #0b0d10, 0 24px 60px rgba(0, 0, 0, .5); padding: 18px 22px 20px; font-family: 'VT323', monospace; image-rendering: pixelated; }
.talk .who { color: var(--tie); font-size: 20px; letter-spacing: 3px; }
.talk .say { font-size: 30px; line-height: 1.15; min-height: 70px; color: #f2f0e6; }
.talk .choices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.talk button { font: 24px 'VT323', monospace; text-align: left; background: #1a1f1b; color: #e8e6df; border: 2px solid #3d4a3f; padding: 6px 14px; cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
.talk button::before { content: '› '; color: var(--tie); opacity: 0; transition: opacity .15s; }
.talk button:hover, .talk button:focus-visible { border-color: var(--tie); color: #fff; transform: translateX(6px); background: #212820; outline: none; }
.talk button:hover::before { opacity: 1; }
.talk input { font: 24px 'VT323', monospace; background: #0b0d10; color: #fff; border: 2px solid #3d4a3f; padding: 6px 12px; width: 100%; }
.note { position: absolute; z-index: 4; right: 8%; bottom: 14%; background: #f3ead2; color: #3b3326; padding: 14px 20px; font: 22px/1.25 'VT323', monospace;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); max-width: 340px; transform: rotate(-2deg) translateY(30px); opacity: 0; transition: opacity .6s, transform .8s var(--ease-out); }
.note.show { opacity: 1; transform: rotate(-2deg); }
.note b { color: #6b4f1d; font-weight: normal; display: block; }
@media (max-width: 860px) { .first-grid { grid-template-columns: 1fr; } .note { position: relative; right: auto; bottom: auto; margin: 24px auto 0; } }

/* ---------- 3. pitch ---------- */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 56px; perspective: 1000px; }
.card { position: relative; padding: 24px 22px; border-radius: 18px; background: linear-gradient(160deg, rgba(30, 36, 80, .7), rgba(12, 15, 38, .75));
  border: 1px solid var(--line); transform-style: preserve-3d; transition: transform .25s var(--ease), border-color .3s, box-shadow .3s; overflow: hidden; }
.card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 220, 160, .16), transparent 40%); }
.card:hover { border-color: rgba(255, 207, 107, .45); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); }
.card:hover::before { opacity: 1; }
.card h3 { transform: translateZ(30px); }
.card p { font-size: 15px; margin: 0; transform: translateZ(20px); }
.card .icons { display: flex; gap: 8px; margin-bottom: 18px; transform: translateZ(50px); }
.card .icons img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; padding: 4px; border-radius: 8px; background: rgba(255, 255, 255, .06); transition: transform .3s var(--ease); }
.card .icons.people img { height: 44px; width: 28px; padding: 2px; }
.card:hover .icons img { transform: translateY(-4px); }
.card:hover .icons img:nth-child(2) { transition-delay: .04s; } .card:hover .icons img:nth-child(3) { transition-delay: .08s; } .card:hover .icons img:nth-child(4) { transition-delay: .12s; }
.marquee { margin-top: 90px; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee .track { display: flex; gap: 48px; width: max-content; animation: marquee 70s linear infinite; font: 26px 'VT323', monospace; color: #d6d2c2; }
.marquee .track span { white-space: nowrap; } .marquee .track span::before { content: '✦'; color: var(--gold); margin-right: 48px; font-size: 14px; vertical-align: middle; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 4. the demo ---------- */
.play-head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; margin-bottom: 28px; }
@media (max-width: 860px) { .play-head { grid-template-columns: 1fr; } }
.goals { list-style: none; margin: 0; padding: 18px 20px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); font-size: 14px; }
.goals li { display: flex; gap: 10px; align-items: center; padding: 4px 0; color: var(--dim); transition: color .3s; }
.goals li::before { content: ''; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--faint); flex: none; transition: all .3s var(--ease); }
.goals li.now { color: var(--ink); } .goals li.now::before { border-color: var(--gold); box-shadow: 0 0 10px rgba(255, 207, 107, .6); }
.goals li.done { color: var(--faint); text-decoration: line-through; }
.goals li.done::before { background: var(--tie); border-color: var(--tie); box-shadow: inset 0 0 0 3px #13301a; }
.demo-frame { position: relative; border-radius: 20px; overflow: hidden; background: #1b2a1a; aspect-ratio: 16 / 9; max-height: 82vh; margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 40px 120px -30px rgba(0, 0, 0, .9), 0 0 120px -40px rgba(127, 211, 138, .45); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.demo-frame:fullscreen { border-radius: 0; max-height: none; aspect-ratio: auto; width: 100vw; height: 100vh; }
#demo { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.hud { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; gap: 12px; align-items: flex-start; pointer-events: none; font: 20px 'VT323', monospace; }
.needs { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: rgba(10, 12, 20, .7); border: 2px solid rgba(255, 255, 255, .1); border-radius: 8px; }
.need { display: flex; align-items: center; gap: 8px; }
.need img { width: 20px; height: 20px; image-rendering: pixelated; }
.need span { width: 90px; height: 8px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
.need i { display: block; height: 100%; width: 100%; transition: width .4s; }
#needFood i { background: #ff7a6b; } #needWarm i { background: var(--gold); } #needJoy i { background: #8fe3a0; }
.need.low span { animation: blink .7s steps(2) infinite; }
@keyframes blink { 50% { background: rgba(255, 90, 90, .6); } }
.inv { display: flex; gap: 6px; flex-wrap: wrap; }
.inv div { display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: rgba(10, 12, 20, .7); border: 2px solid rgba(255, 255, 255, .1); border-radius: 8px; color: #fff; }
.inv div.bump { animation: bump .35s var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.25); border-color: var(--gold); } }
.inv img { width: 18px; height: 18px; image-rendering: pixelated; object-fit: contain; }
.clock { margin-left: auto; padding: 4px 12px; background: rgba(10, 12, 20, .7); border: 2px solid rgba(255, 255, 255, .1); border-radius: 8px; color: #f2e6c8; }
.speech { position: absolute; left: 50%; bottom: 96px; transform: translate(-50%, 10px); max-width: min(520px, 80%); padding: 10px 16px; text-align: center;
  background: rgba(12, 14, 20, .9); border: 2px solid #3d4a3f; color: #f2f0e6; font: 24px/1.15 'VT323', monospace; opacity: 0; transition: opacity .3s, transform .3s var(--ease-out); pointer-events: none; }
.speech.show { opacity: 1; transform: translate(-50%, 0); }
.build { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; }
.build button { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; background: rgba(10, 12, 20, .82); color: #fff; border: 2px solid rgba(255, 255, 255, .14); border-radius: 10px; font: 20px 'VT323', monospace; cursor: pointer; transition: transform .2s var(--ease), border-color .2s, opacity .2s; }
.build button img { width: 32px; height: 32px; object-fit: cover; object-position: left top; image-rendering: pixelated; }
.build button small { display: block; font-size: 15px; color: var(--dim); }
.build button span { text-align: left; line-height: 1; }
.build button:disabled { opacity: .45; cursor: not-allowed; }
.build button:not(:disabled) { border-color: var(--gold); animation: ready 1.6s ease-in-out infinite; }
.build button:not(:disabled):hover { transform: translateY(-3px); }
.build button.placing { background: var(--gold); color: #1a1205; }
@keyframes ready { 50% { box-shadow: 0 0 22px rgba(255, 207, 107, .55); } }
.demo-tip { position: absolute; left: 14px; bottom: 14px; padding: 6px 12px; border-radius: 8px; background: rgba(10, 12, 20, .7); color: #f2e6c8; font: 19px 'VT323', monospace; pointer-events: none; transition: opacity .3s; }
.demo-start { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; background: radial-gradient(circle, rgba(7, 10, 26, .35), rgba(7, 10, 26, .8)); transition: opacity .6s; z-index: 3; }
.demo-start p { color: #e5e8ff; font-size: 14px; }
.demo-start.gone { opacity: 0; pointer-events: none; }
.demo-tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; z-index: 2; }
.demo-tools button { width: 34px; height: 34px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .14); background: rgba(10, 12, 20, .7); color: #fff; font-size: 16px; cursor: pointer; }
.demo-tools button:hover { border-color: var(--sky); }
.hud .clock { margin-right: 84px; }
@media (max-width: 700px) {
  .demo-frame { aspect-ratio: 3 / 4; max-height: 78vh; }
  .need span { width: 54px; } .hud { font-size: 17px; } .hud .clock { display: none; }
  .build { left: 10px; right: 10px; bottom: 10px; } .build button { flex: 1; } .demo-tip { bottom: 70px; }
  .speech { bottom: 120px; font-size: 20px; }
}

/* ---------- 5. village ---------- */
.diorama { position: relative; margin: 50px 0 40px; height: clamp(360px, 62vh, 640px); overflow: hidden;
  mask-image: linear-gradient(180deg, transparent, #000 10%, #000 88%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 10%, #000 88%, transparent); }
#diorama { position: absolute; left: 0; top: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.dio-ui { position: absolute; left: var(--gutter); top: 48px; display: flex; align-items: center; gap: 12px; z-index: 2; }
.toggle { position: relative; width: 66px; height: 34px; border-radius: 99px; border: 1px solid var(--line); background: rgba(10, 12, 30, .7); color: #fff; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 0 9px; font-size: 14px; }
.toggle::after { content: ''; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); transition: transform .4s var(--ease-out), background .4s, box-shadow .4s; }
.toggle[aria-pressed="true"]::after { transform: translateX(32px); background: #cfd8ff; box-shadow: 0 0 14px #9fb2ff; }
.person-card { position: absolute; z-index: 3; width: 260px; padding: 14px 16px; border-radius: 14px; background: rgba(10, 12, 26, .92); border: 1px solid rgba(255, 207, 107, .4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6); pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 10px)) scale(.94); transition: opacity .2s, transform .25s var(--ease-out); }
.person-card.show { opacity: 1; transform: translate(-50%, calc(-100% - 18px)); }
.person-card b { font: 600 18px var(--pixel); display: block; } .person-card i { font-style: normal; color: var(--gold); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.person-card p { font-size: 14px; margin: 6px 0 0; color: #d5d9f2; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.person { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.person:hover { transform: translateY(-4px); border-color: rgba(255, 207, 107, .4); }
.person canvas { width: 44px; height: 80px; image-rendering: pixelated; flex: none; }
.person b { display: block; font: 600 17px var(--pixel); } .person small { color: var(--gold); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.person p { font-size: 13px; margin: 4px 0 0; line-height: 1.45; }

/* ---------- 6. the wild ---------- */
.split2 { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.split2.top { align-items: start; }
@media (max-width: 920px) { .split2 { grid-template-columns: 1fr; } }
.beasts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 600px) { .beasts { grid-template-columns: repeat(2, 1fr); } }
.beast:first-child { grid-column: span 1; }
.beast { position: relative; border-radius: 16px; padding: 10px 10px 12px; background: radial-gradient(circle at 50% 70%, rgba(127, 211, 138, .12), transparent 60%), var(--glass); border: 1px solid var(--line); cursor: pointer; transition: border-color .3s, transform .3s var(--ease); }
.beast:hover, .beast.angry { border-color: rgba(255, 110, 80, .6); transform: translateY(-3px); }
.beast canvas { width: 100%; aspect-ratio: 4 / 3; image-rendering: pixelated; display: block; }
.beast b { font: 600 16px var(--pixel); } .beast small { display: block; color: var(--faint); font-size: 12px; }
.lv { position: absolute; right: 10px; top: 10px; font: 600 12px var(--pixel); padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: var(--gold); }
.beast.fantasy .lv { color: var(--nebula); }

/* ---------- 7. grow (sticky, scroll-driven) ---------- */
#grow { padding: 0; }
.grow-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.grow-spacer { height: 340vh; }
.grow-stage { position: absolute; inset: 0; }
.era { position: absolute; inset: 0; margin: 0; opacity: 0; will-change: opacity, transform; }
.era img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transform: scale(var(--s, 1.12)) translate(var(--x, 0), var(--y, 0)); will-change: transform; }
.era[data-era="0"] { opacity: 1; }
.grow-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 10, 26, .92) 0%, rgba(7, 10, 26, .55) 38%, rgba(7, 10, 26, 0) 65%), linear-gradient(180deg, var(--space), transparent 18%, transparent 82%, var(--space)); }
.grow-clouds i { position: absolute; width: 60vw; height: 36vh; background: url('art/sky/clouds_1.png') center / contain no-repeat; image-rendering: pixelated; opacity: 0; will-change: transform, opacity; }
.grow-clouds i:nth-child(2) { background-image: url('art/sky/clouds_4.png'); } .grow-clouds i:nth-child(3) { background-image: url('art/sky/clouds_0.png'); }
.grow-copy { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(480px, calc(100% - 2 * var(--gutter))); z-index: 3; }
.era-text { position: relative; min-height: 250px; }
.era-text article { position: absolute; inset: 0; opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .8s var(--ease-out); pointer-events: none; }
.era-text article.on { opacity: 1; transform: none; pointer-events: auto; }
.era-text h2 { font-size: clamp(32px, 4.4vw, 54px); }
.era-text p { color: #dfe3fb; }
.era-steps { list-style: none; padding: 0; margin: 20px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.era-steps li { font: 600 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--faint); background: rgba(7, 10, 26, .5); transition: all .4s var(--ease); }
.era-steps li.on { color: #1a1205; background: var(--gold); border-color: var(--gold); }
.era-steps li.past { color: var(--ink); border-color: rgba(255, 207, 107, .5); }
@media (max-width: 700px) { .grow-copy { top: auto; bottom: 8vh; transform: none; } .grow-shade { background: linear-gradient(0deg, rgba(7, 10, 26, .95) 0%, rgba(7, 10, 26, .6) 45%, transparent 75%), linear-gradient(180deg, var(--space), transparent 15%); } .era-text { min-height: 230px; } }

/* ---------- 8. elements ---------- */
.ptable { display: grid; grid-template-columns: repeat(18, 1fr); gap: 3px; }
.ptable .el { position: relative; aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); transition: transform .2s var(--ease), background .2s, border-color .2s, z-index 0s; }
.ptable .el img { width: 82%; height: 82%; image-rendering: pixelated; transition: transform .25s var(--ease); }
.ptable .el:hover, .ptable .el.near { z-index: 2; }
.ptable .el:hover { background: rgba(255, 207, 107, .18); border-color: var(--gold); transform: scale(1.9); }
.ptable .el.near { transform: scale(1.3); }
.ptable .gap { aspect-ratio: 1; }
.ptable .row-label { grid-column: 1 / 4; font-size: 11px; color: var(--faint); display: flex; align-items: center; }
.ptable .el.dim { opacity: .25; }
.el-info { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 16px 18px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); min-height: 92px; }
.el-info .sym { font: 700 42px var(--pixel); width: 64px; text-align: center; color: var(--gold); }
.el-info b { font: 600 20px var(--pixel); display: block; } .el-info small { color: var(--dim); font-size: 13px; display: block; }
.eras-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.eras-filter button { font: 600 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); background: none; cursor: pointer; transition: all .2s; }
.eras-filter button.on, .eras-filter button:hover { color: #1a1205; background: var(--gold); border-color: var(--gold); }

/* ---------- 9. universe ---------- */
#universe { min-height: 110vh; display: flex; align-items: center; overflow: hidden; }
#orrery { position: absolute; inset: 0; width: 100%; height: 100%; }
.uni-copy { pointer-events: none; } .uni-copy * { pointer-events: auto; }
.stats { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 40px; }
.stats b { display: block; font: 700 clamp(40px, 5vw, 64px)/1 var(--pixel); background: linear-gradient(180deg, #fff, var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats small { color: var(--dim); font-size: 13px; max-width: 160px; display: block; margin-top: 6px; }
.planet-tag { position: absolute; z-index: 3; pointer-events: none; padding: 6px 12px; border-radius: 10px; background: rgba(10, 12, 26, .9); border: 1px solid var(--line); font-size: 13px; transform: translate(-50%, -140%); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.planet-tag.show { opacity: 1; } .planet-tag b { font-family: var(--pixel); }

/* ---------- 10. the question ---------- */
#question { min-height: 90vh; display: flex; align-items: center; overflow: hidden; }
.floaters { position: absolute; inset: 0; pointer-events: none; }
.floaters span { position: absolute; font: 22px 'VT323', monospace; color: rgba(230, 226, 210, .5); white-space: nowrap; will-change: transform; }
.ask { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.ask input { width: min(420px, 100%); padding: 15px 20px; border-radius: 99px; border: 1px solid var(--line); background: rgba(10, 12, 30, .7); color: var(--ink); font: 17px var(--sans); }
.ask input::placeholder { color: var(--faint); }
.ask input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 4px rgba(255, 207, 107, .15); }
.notebook { margin: 30px auto 0; max-width: 420px; background: #f3ead2; color: #3b3326; padding: 16px 22px; font: 24px/1.2 'VT323', monospace; text-align: left; transform: rotate(-1.5deg); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: noteIn .8s var(--ease-out); }
.notebook b { display: block; color: #6b4f1d; font-weight: normal; }
@keyframes noteIn { from { opacity: 0; transform: rotate(-6deg) translateY(30px) scale(.9); } }

/* ---------- 11. join ---------- */
.road { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .road { grid-template-columns: 1fr; } }
.road-col { padding: 22px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.road-col h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.road-col ul { margin: 0; padding-left: 18px; color: var(--dim); font-size: 15px; } .road-col li { margin: 6px 0; }
.pip { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.pip.on { background: var(--tie); box-shadow: 0 0 12px var(--tie); animation: pulse2 2s infinite; }
@keyframes pulse2 { 50% { box-shadow: 0 0 2px var(--tie); } }
footer { width: min(1180px, 100%); margin: 120px auto 0; padding: 30px var(--gutter) 10px; border-top: 1px solid var(--line); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
footer p { margin: 0; font-size: 13px; color: var(--faint); flex: 1; min-width: 240px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
.demo-end { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 24px; text-align: center; background: radial-gradient(circle, rgba(7, 10, 26, .55), rgba(7, 10, 26, .9)); opacity: 0; pointer-events: none; transition: opacity 1s; }
.demo-end.show { opacity: 1; pointer-events: auto; }
.demo-end > div { max-width: 520px; }
.demo-end h3 { font-size: clamp(26px, 3.4vw, 40px); }
.demo-end p { color: #d5d9f2; }
.demo-end .cta { justify-content: center; }
@media (max-width: 900px) { #orrery { opacity: .4; } }

/* ---------- mailing list (off until Tom switches it on) ---------- */
.signup { margin-top: 26px; max-width: 480px; }
body[data-signup="off"] .signup { display: none !important; }
.signup-label { display: block; font-weight: 600; margin-bottom: 10px; }
.signup-row { display: flex; gap: 8px; flex-wrap: wrap; }
.signup-row input { flex: 1 1 220px; min-width: 0; padding: 13px 18px; border-radius: 99px; border: 1px solid var(--line); background: rgba(10, 12, 30, .7); color: var(--ink); font: 16px var(--sans); }
.signup-row input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 4px rgba(255, 207, 107, .15); }
.signup-row .btn { padding: 13px 22px; }
.signup-note { font-size: 12px; color: var(--faint); margin: 10px 0 0; }
.signup-done { margin: 10px 0 0; color: var(--tie); font-weight: 600; min-height: 1em; }
.signup-done.err { color: #ff9a8a; }
.signup.sent .signup-row { opacity: .5; pointer-events: none; }

/* ---------- the HD set (ART_SPEC.md 2): smooth, full colour; ?art=x1 for the old look ---------- */
.hd img[src^="arthd/"], .hd img[src^="art2x/"] { image-rendering: auto; }
.hd .dawn .clouds, .hd .grow-clouds i { image-rendering: auto; }
.hd .dawn .c1 { background-image: url('arthd/sky/clouds_2.webp'), url('arthd/sky/clouds_5.webp'); }
.hd .dawn .c2 { background-image: url('arthd/sky/clouds_0.webp'), url('arthd/sky/clouds_3.webp'); }
.hd .dawn .c3 { background-image: url('arthd/sky/clouds_1.webp'), url('arthd/sky/clouds_4.webp'); }
.hd .grow-clouds i { background-image: url('arthd/sky/clouds_1.webp'); }
.hd .grow-clouds i:nth-child(2) { background-image: url('arthd/sky/clouds_4.webp'); }
.hd .grow-clouds i:nth-child(3) { background-image: url('arthd/sky/clouds_0.webp'); }
