/* ── hero layout ───────────────────────────────────────────── */
.hero { position: relative; padding: 22px 16px 40px; }
.hero__title {
  margin: 0 auto 20px; text-align: center;
  font-family: var(--font-pixel); font-weight: 700; letter-spacing: .02em;
  font-size: clamp(22px, 2.6vw, 36px); line-height: 1.05;
  text-shadow: 0 3px 0 #000, 0 0 30px rgba(182,224,90,.25);
}
.hero__title .hot { color: var(--ember); text-shadow: 0 3px 0 #000, 0 0 30px rgba(255,122,31,.35); }

.stage-grid {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(340px, 440px) minmax(250px, 300px);
  grid-template-areas: 'demo phone status';
  gap: 36px; justify-content: center; align-items: start;
  max-width: 1200px; margin: 0 auto;
}
.phone { grid-area: phone; }
.panel--demo, .panel--feed { grid-area: demo; }
body.is-live .panel--demo, body.is-live .dock--demo { display: none !important; }
body.is-demo .panel--feed, body.is-demo .dock--live { display: none !important; }

/* burn feed (public) */
.feedlist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.feedlist li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid var(--line); animation: cage-in .4s var(--spring) both; }
.feedlist b { font-family: var(--font-pixel); font-size: 12px; }
.feedlist small { display: block; color: var(--text-faint); font-size: 16px; }
.feedlist a { color: inherit; text-decoration: none; }
.feedlist__empty { margin: 0 0 14px; color: var(--text-faint); font-size: 18px; }
.panel--feed .btn--buy { width: 100%; justify-content: center; text-decoration: none; }
.ca-mini { width: 100%; margin-top: 10px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; background: rgba(0,0,0,.3); border: 1px dashed var(--line-2); color: var(--text-dim); font-size: 16px; }
.ca-mini span { font-family: var(--font-pixel); font-size: 10px; color: var(--text-faint); }
.ca-mini code { flex: 1; text-align: left; color: var(--lime); font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.ca-mini b { font-family: var(--font-pixel); font-size: 10px; color: var(--lime); }
.panel--status { grid-area: status; }

.scroll-cue { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 36px auto 0; width: max-content; font-family: var(--font-pixel); font-size: 11px; color: var(--text-faint); text-decoration: none; letter-spacing: .1em; }
.scroll-cue svg { width: 14px; fill: currentColor; animation: bob 1.4s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* ── panels ────────────────────────────────────────────────── */
.panel {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(28, 40, 22, .92), rgba(16, 23, 13, .94));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.panel::before { /* pixel corner ticks */
  content: ''; position: absolute; inset: 6px; pointer-events: none; border-radius: 10px;
  background:
    linear-gradient(var(--line-2), var(--line-2)) top left / 8px 2px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) top left / 2px 8px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) bottom right / 8px 2px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) bottom right / 2px 8px no-repeat;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel h2 { margin: 0; font-family: var(--font-pixel); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--lime); }
.panel h3 { margin: 0 0 8px; font-family: var(--font-pixel); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.panel__note { margin: 0 0 12px; color: var(--text-dim); font-size: 19px; }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 14px; font-family: var(--font-pixel); font-size: 9px; letter-spacing: .05em; color: var(--text-faint); }
.flow span { padding: 3px 6px; border: 1px dashed var(--line-2); border-radius: 5px; }
.flow i { font-style: normal; color: var(--ember-2); }

.demo-actions { display: grid; gap: 12px; }
.demo-actions--minor { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.demo-hint { min-height: 1.2em; margin: 10px 0 0; font-size: 18px; color: var(--ember-2); }

.pending { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--line); color: var(--text); font-size: 10px; }
.pending__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pending__empty { margin: 0; color: var(--text-faint); font-size: 18px; }
.cage {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left;
  background: rgba(0,0,0,.25); border: 2px dashed var(--line-2);
  animation: cage-in .4s var(--spring) both;
  -webkit-tap-highlight-color: transparent;
}
.cage:hover { border-color: var(--ember-2); }
.cage__art { width: 22px; height: 22px; color: var(--lime); }
.cage__art svg { width: 100%; height: 100%; fill: currentColor; animation: caged 1.2s steps(2, start) infinite; }
@keyframes caged { to { opacity: .35; } }
.cage__amt { font-family: var(--font-pixel); font-size: 12px; }
.cage__id { display: block; color: var(--text-faint); font-size: 16px; }
.cage__go { font-family: var(--font-pixel); font-size: 9px; color: var(--ember); letter-spacing: .06em; }
@keyframes cage-in { from { transform: scale(.85); opacity: 0; } }

/* ── status panel ──────────────────────────────────────────── */
.feed { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-pixel); font-size: 10px; letter-spacing: .06em; color: var(--text-dim); }
.feed i { width: 8px; height: 8px; border-radius: 2px; background: var(--text-faint); }
.feed[data-status='live'] { color: var(--lime); }
.feed[data-status='live'] i { background: var(--lime); box-shadow: 0 0 8px var(--lime); animation: blink 1.4s steps(2, start) infinite; }
.feed[data-status='connecting'] i { background: var(--ember-2); animation: blink .5s steps(2, start) infinite; }
.feed[data-status='offline'] { color: var(--danger); }
.feed[data-status='offline'] i { background: var(--danger); }

.stagecard { display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; padding: 12px; margin: 6px 0 14px; border-radius: 12px; background: var(--lcd-green); color: #1c2812; box-shadow: inset 0 0 0 2px rgba(0,0,0,.3), inset 0 0 18px rgba(0,0,0,.18); transition: transform .3s var(--spring); }
.stagecard.is-pop { animation: card-pop .9s var(--spring); }
@keyframes card-pop { 30% { transform: scale(1.06) rotate(-1deg); background: var(--lime); } }
.stagecard__art { width: 76px; height: 76px; image-rendering: pixelated; background: rgba(0,0,0,.06); border-radius: 8px; }
.stagecard__kicker { margin: 0; font-family: var(--font-pixel); font-size: 10px; letter-spacing: .12em; opacity: .7; }
.stagecard__name { margin: 2px 0; font-family: var(--font-pixel); font-weight: 700; font-size: 18px; line-height: 1; }
.stagecard__blurb { margin: 0; font-size: 18px; line-height: 1.05; }

.meter__label { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-pixel); font-size: 10px; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 6px; }
.meter__label b { color: var(--text); font-size: 12px; }
.segbar { display: grid; grid-template-columns: repeat(33, 1fr); gap: 2px; }
.segbar i { aspect-ratio: 1; background: #233019; border-radius: 1px; transition: background .2s; }
.segbar i.on { background: var(--lime); }
.segbar i.new { animation: seg-new .6s steps(3); }
@keyframes seg-new { 0%, 66% { background: var(--ember-2); } }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.stats div { padding: 10px; border-radius: 10px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.stats dt { font-family: var(--font-pixel); font-size: 9px; letter-spacing: .08em; color: var(--text-dim); text-transform: uppercase; }
.stats dt small { display: block; font-size: 8px; color: var(--text-faint); }
.stats dd { margin: 4px 0 0; font-family: var(--font-pixel); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.stats dd.is-tick { animation: tick .5s steps(2); }
@keyframes tick { 50% { color: var(--ember-2); } }
.stats__unit { margin: 6px 0 14px; font-size: 16px; color: var(--text-faint); }
.stats__unit b { color: var(--ember-2); font-weight: 400; }
.progress { height: 12px; border: 2px solid var(--line-2); border-radius: 4px; padding: 2px; }
.progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--lime) 0 6px, transparent 6px 8px); transition: width .6s var(--ease-out); }
.milestone { margin-bottom: 10px; }
.milestone .meter__label { flex-wrap: wrap; gap: 2px 8px; }
#status-retry { margin-top: 8px; }

.panel.is-offline .stats dd, .panel.is-offline .stagecard { opacity: .55; }

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stage-grid { grid-template-columns: minmax(0, 520px); grid-template-areas: 'phone' 'demo' 'status'; gap: 18px; }
  .hero__title { margin-bottom: 18px; }
}
@media (max-width: 600px) {
  .hero { padding: 12px 12px 28px; }
  .hero__title { font-size: min(12.5px, 2.85vw); margin-bottom: 10px; text-shadow: 0 2px 0 #000; white-space: nowrap; letter-spacing: 0; }
  .hero__title span { display: inline; }
  .stage-grid { gap: 14px; }
  .panel { padding: 14px; }
  .panel--demo .panel__note, .panel--demo .flow, .panel--feed .panel__note, .panel--feed .flow { display: none; }
  .panel--demo .panel__head { margin-bottom: 10px; }
  .panel h2 { font-size: 12px; }
  .demo-actions { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .demo-actions .btn { flex-direction: column; gap: 4px; padding: 8px 4px; min-height: 76px; justify-content: center; text-align: center; }
  .demo-actions .btn__text { align-items: center; }
  .demo-actions .btn__text b { font-size: 11px; }
  .demo-actions .btn__text small { font-size: 14px; }
  .demo-actions--minor { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
  .demo-actions--minor .btn { flex-direction: column; min-height: 52px; font-size: 8.5px; gap: 3px; padding: 6px 2px; text-align: center; justify-content: center; }
}

/* ── demo dock: primary actions always in reach when stacked ─ */
.dock { display: none; }
@media (max-width: 1100px) {
  .panel--demo .demo-actions:not(.demo-actions--minor) { display: none; }
  .panel--demo .demo-actions--minor { margin-top: 0; }
  .dock {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: center;
    padding: 10px max(12px, calc((100vw - 640px) / 2)) calc(10px + env(safe-area-inset-bottom));
    background: rgba(11, 16, 9, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line-2);
  }
  .dock__tag { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--font-pixel); font-size: 9px; letter-spacing: .12em; color: #1a1206; background: var(--ember-2); padding: 6px 3px; border-radius: 4px; }
  .dock .btn { min-width: 0; min-height: 54px; padding: 5px 8px; justify-content: center; gap: 8px; font-family: var(--font-pixel); }
  .dock .btn b { font-size: 12px; letter-spacing: .03em; }
  .dock .btn__icon { width: 22px; height: 22px; }
  .dock--live { grid-template-columns: 2fr 1fr; }
  .dock--live .btn { text-decoration: none; }
  .panel--feed .btn--buy, .panel--feed .ca-mini { display: none; }
  .dock__count { position: absolute; top: -8px; right: -6px; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 11px; background: #1d0d02; color: var(--ember-2); font-size: 11px; border: 2px solid var(--ember); }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .dock .btn { padding: 5px 4px; flex-direction: column; gap: 3px; }
  .dock .btn b { font-size: 10px; }
  .dock .btn__icon { width: 18px; height: 18px; }
}

/* tall desktops: give the snake more screen */
@media (min-width: 1280px) and (min-height: 980px) {
  .stage-grid { grid-template-columns: minmax(250px, 300px) minmax(360px, 500px) minmax(250px, 300px); }
  .phone { width: min(500px, 100%); }
}
