:root {
  color-scheme: light;
  --paper: #f6f3e9;
  --paper-deep: #eee9d9;
  --ink: #20251d;
  --muted: #7d8072;
  --green: #d8fa54;
  --orange: #ff7448;
  --line: #dedbce;
  --white: #fffef9;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh; margin: 0; color: var(--ink); background: var(--paper);
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: radial-gradient(#b9b5a4 0.55px, transparent 0.55px);
  background-size: 15px 15px; background-position: 7px 7px;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header {
  min-height: 74px; padding: 12px clamp(20px, 5vw, 76px); display: flex; align-items: center;
  justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(32,37,29,.14);
  background: rgba(246,243,233,.92); position: relative; z-index: 2; flex-wrap: wrap;
}
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 950; letter-spacing: -.065em; font-size: 19px; }
.wordmark-egg { font-size: 24px; filter: saturate(.82); }
.wordmark-dot { color: var(--orange); }
.header-note, .eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: .11em;
}
.header-note { display: flex; align-items: center; gap: 8px; color: #727568; }
.live-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #89aa3c; box-shadow: 0 0 0 3px rgba(137,170,60,.16); }
.back-link { font-size: 12px; font-weight: 750; text-decoration: none; color: var(--ink); }
.back-link:hover { color: var(--orange); }

.shell { width: min(1080px, calc(100% - 48px)); margin: 30px auto 0; }

.reel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; color: #66734e; }
.eyebrow-mark { color: var(--orange); font-size: 16px; vertical-align: -1px; margin-right: 4px; }
.reel-head h1 { margin: 0; font-size: clamp(30px, 5vw, 50px); line-height: .95; letter-spacing: -.055em; font-weight: 950; }
.reel-head h1 em { font-style: normal; color: var(--orange); }
.reel-note { margin: 0; text-align: right; font-size: 13px; line-height: 1.5; color: var(--muted); font-weight: 600; }

.stage {
  position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden;
  border: 1px solid rgba(32,37,29,.18); border-radius: 8px;
  background: linear-gradient(#a9cfe8 0%, #c6e0f1 55%, #dcecf6 100%);
  box-shadow: 0 24px 46px -32px rgba(32,37,29,.7);
}
.scene { position: absolute; inset: 0; will-change: transform; transform-origin: 50% 50%; }
.scene canvas, .scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#puff-layer { z-index: 1; }
#hom-svg { z-index: 2; }
#fire-layer { z-index: 3; }

#hom.is-charred #body { filter: grayscale(.86) brightness(.5) contrast(1.32); }

#flash {
  position: absolute; inset: -2%; z-index: 4; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 44% 60%, #fffbe0 0%, #ffd166 34%, #ff8a2b 58%, rgba(255,120,40,0) 76%);
}

.hud {
  position: absolute; z-index: 5; top: 14px; left: 16px; display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 999px; background: rgba(246,243,233,.86);
  border: 1px solid rgba(32,37,29,.16); backdrop-filter: blur(4px);
  font-size: 10px; font-weight: 800; letter-spacing: .1em; max-width: calc(100% - 32px);
}
.hud-key { color: var(--orange); }
.hud-label { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-dots { display: inline-flex; gap: 5px; margin-left: 4px; }
.hud-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(32,37,29,.22); transition: background .2s, transform .2s; }
.hud-dots i.on { background: var(--orange); transform: scale(1.3); }

.stage-badge {
  position: absolute; z-index: 5; right: 16px; bottom: 14px; font-size: 9px; font-weight: 800;
  letter-spacing: .14em; color: rgba(32,37,29,.55);
}

.controls { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn {
  border: 1px solid rgba(32,37,29,.2); background: var(--white); color: var(--ink);
  font-size: 13px; font-weight: 800; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 16px -12px rgba(32,37,29,.8); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--green); border-color: rgba(32,37,29,.28); }
.btn-primary:hover { background: #cdf23f; }
.controls-note { margin: 0 0 0 auto; font-size: 11.5px; color: var(--muted); font-weight: 600; }
kbd {
  font: inherit; font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--paper-deep); color: var(--ink);
}

.reel-caption {
  margin: 22px 0 0; max-width: 720px; font-size: 14.5px; line-height: 1.6; color: var(--muted); font-weight: 600;
}

.site-footer {
  width: min(1080px, calc(100% - 48px)); margin: 44px auto 0; min-height: 63px;
  border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  gap: 15px; color: var(--muted); font-size: 10px; padding-bottom: 30px; flex-wrap: wrap;
}
.footer-brand { color: var(--ink); font-size: 12px; font-weight: 950; letter-spacing: -.04em; }
.footer-disclaimer { text-align: center; }

@media (max-width: 780px) {
  .shell { width: calc(100% - 26px); margin-top: 20px; }
  .site-footer { width: calc(100% - 26px); }
  .reel-note { text-align: left; }
  .hud-label { display: none; }
  .controls-note { order: 3; width: 100%; margin: 0; }
  .stage-badge { font-size: 8px; right: 10px; bottom: 9px; }
  .site-header { gap: 10px; }
  .header-note { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .hud-dots i { transition: none; }
}
