:root {
  --ink: #fff3e3;
  --ink-soft: #f1dcc4;
  --espresso: #24150f;
  --ember: #f7b28c;
  --wa: #1f8f4e;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--espresso);
  color: var(--ink);
  font: 400 1.05rem/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#world, .scrim, .art { position: fixed; inset: 0; width: 100%; height: 100lvh; }
#world { display: none; }
.scrim {
  display: none; pointer-events: none;
  background: linear-gradient(to top, rgba(26,14,10,.94) 0%, rgba(26,14,10,.82) 30%, rgba(26,14,10,0) 58%);
}
.art svg { width: 100%; height: 100%; display: block; }

.tag {
  position: fixed; z-index: 5; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  margin: 0; padding: .3rem .8rem; border-radius: 99px;
  background: rgba(26,14,10,.9); color: var(--ink);
  font: 600 .72rem/1.2 var(--text); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}

main { position: relative; z-index: 2; }
.beat { position: relative; }
.panel {
  padding: 0 16px 14vh; max-width: 34rem;
}
.kicker {
  margin: 0 0 .6rem; color: var(--ember);
  font: 700 .8rem/1.2 var(--text); letter-spacing: .14em; text-transform: uppercase;
}
h1, h2 {
  margin: 0; font-family: var(--display); font-weight: 800;
  font-size: clamp(2.7rem, 12.5vw, 5.4rem); line-height: .95; letter-spacing: -.02em;
  font-variation-settings: "opsz" 144; text-wrap: balance;
}
.sub { margin: 1rem 0 0; max-width: 24rem; color: var(--ink-soft); font-size: 1.08rem; }
.hint { margin: 2rem 0 0; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.hint::after { content: " ↓"; }

.wa {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.6rem;
  padding: .95rem 1.4rem; border-radius: 99px;
  background: var(--wa); color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.wa svg { width: 1.4rem; height: 1.4rem; }
.wa:focus-visible, .back:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.back {
  display: table; margin-top: 2.2rem; padding: .35rem .8rem; border-radius: 99px;
  background: rgba(26,14,10,.78); color: var(--ink); font-size: .9rem; text-decoration: none;
}
.back:hover { text-decoration: underline; }

/* Static fallback (default until 3D starts; also reduced motion / no WebGL) */
html:not(.three) .beat { min-height: 70vh; display: flex; align-items: flex-end; }
html:not(.three) .beat:first-child { min-height: 100svh; background: linear-gradient(to top, rgba(26,14,10,.94) 0%, rgba(26,14,10,.9) 42%, rgba(26,14,10,0) 50%); }
html:not(.three) .art { height: 64svh; }
html:not(.three) .beat + .beat .panel { background: rgba(26,14,10,.86); border-radius: 18px; margin: 0 12px; padding: 1.6rem 1.2rem; }
html:not(.three) main { padding-bottom: 6vh; }

/* 3D mode */
html.three #world, html.three .scrim { display: block; }
html.three .art { display: none; }
html.three .beat { height: 160vh; }
html.three .beat:last-child { height: 100lvh; }
html.three .panel {
  position: sticky; top: 0; height: 100lvh; display: flex; flex-direction: column; justify-content: flex-end;
  will-change: opacity, transform;
}
html.three .beat:last-child .panel { padding-bottom: 8vh; }

@media (min-width: 900px) {
  .panel { padding-left: 7vw; max-width: 44rem; }
  .scrim { background: linear-gradient(to right, rgba(26,14,10,.94) 0%, rgba(26,14,10,.88) 42%, rgba(26,14,10,0) 72%); }
  html.three .panel { justify-content: center; padding-bottom: 0; }
  html.three .beat:last-child .panel { padding-bottom: 0; }
}
