/* =====================================================================
   HOME screen — logo, hosts, Win-a-feature ticket, vibe chips, beat tiles
   and the home dock. Loaded after style.css.
   Motion: the logo's layered entrance + equalizer bars, short fades. No
   glows, no shine, no rotating/animated gradients. style.css's
   prefers-reduced-motion block stops it all; resting states are final.
   ===================================================================== */

#home { position: relative; overflow-x: clip; --t0: 1.2s; /* when the logo's equalizer kicks in */
  padding-bottom: calc(130px + env(safe-area-inset-bottom)); }

/* ---------- hero + animated logo ---------- */
.hero { text-align: center; margin: 10px 0 22px; }
.logo-anim { position: relative; display: block; width: min(100%, 440px); margin: 14px auto 0; }
.logo-anim .logo { display: block; width: 100%; height: auto; visibility: hidden; }
.logo-anim .lyr { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
/* seams traced on the art (700×220): mic | peach | lime | orange | wordmark | ? over the credit line.
   Neighbours overlap ~.2% so anti-aliased seams never show a hairline. */
.l-mic    { clip-path: polygon(0 0, 6.67% 0, 6.67% 74%, 0 74%); }
.l-b1     { clip-path: polygon(6.47% 0, 12.96% 0, 11.98% 74%, 6.47% 74%); }
.l-b2     { clip-path: polygon(12.76% 0, 19.67% 0, 17.79% 74%, 11.78% 74%); }
.l-b3     { clip-path: polygon(19.47% 0, 26.1% 0, 26.1% 74%, 17.59% 74%); }
.l-word   { clip-path: polygon(25.9% 0, 83.81% 0, 83.81% 74%, 25.9% 74%); }
.l-q      { clip-path: polygon(83.61% 0, 100% 0, 100% 74%, 83.61% 74%); }
.l-credit { clip-path: polygon(0 73.8%, 100% 73.8%, 100% 100%, 0 100%); }

/* entrance (transform), then a subtle equalizer on the three bars (individual `scale` so it stacks) */
.l-mic { transform-origin: 3.3% 71%; animation: fade-up .4s var(--ease) both; }
.l-b1, .l-b2, .l-b3 { animation: bar-in .45s var(--ease) both, eq1 calc(var(--beat) * 4) var(--t0) infinite; }
.l-b1 { transform-origin: 9.3% 71%; animation-delay: .08s, var(--t0); }
.l-b2 { transform-origin: 15.2% 71%; animation-delay: .16s, var(--t0); animation-name: bar-in, eq2; }
.l-b3 { transform-origin: 22.5% 71%; animation-delay: .24s, var(--t0); animation-name: bar-in, eq3; }
.l-word { transform-origin: 55% 45%; animation: word-in .5s var(--ease) .3s both; }
.l-q { transform-origin: 91% 70%; animation: q-in .5s var(--ease) .5s both; }
.l-credit { animation: fade-up .45s var(--ease) .65s both; }

@keyframes fade-up { from { transform: translateY(10%); opacity: 0; } }
@keyframes bar-in { from { transform: scaleY(0); } to { transform: none; } }
@keyframes word-in { from { transform: scale(1.06); opacity: 0; } to { transform: none; } }
@keyframes q-in { from { transform: translateY(-14%) rotate(-18deg); opacity: 0; } to { transform: none; } }

/* equalizer: each bar dips and returns on the beat, a little differently per bar */
@keyframes eq1 {
  0% { scale: 1 1.03; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 21% { scale: 1 .9; animation-timing-function: ease-in; }
  25% { scale: 1 .98; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 46% { scale: 1 .89; animation-timing-function: ease-in; }
  50% { scale: 1 1.04; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 71% { scale: 1 .91; animation-timing-function: ease-in; }
  75% { scale: 1 .97; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 96% { scale: 1 .89; animation-timing-function: ease-in; }
  100% { scale: 1 1.03; } }
@keyframes eq2 {
  0% { scale: 1 1.01; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 21% { scale: 1 .9; animation-timing-function: ease-in; }
  25% { scale: 1 1.04; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 46% { scale: 1 .91; animation-timing-function: ease-in; }
  50% { scale: 1 .98; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 71% { scale: 1 .89; animation-timing-function: ease-in; }
  75% { scale: 1 1.03; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 96% { scale: 1 .9; animation-timing-function: ease-in; }
  100% { scale: 1 1.01; } }
@keyframes eq3 {
  0% { scale: 1 1.035; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 21% { scale: 1 .92; animation-timing-function: ease-in; }
  25% { scale: 1 1; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 46% { scale: 1 .89; animation-timing-function: ease-in; }
  50% { scale: 1 1.02; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 71% { scale: 1 .91; animation-timing-function: ease-in; }
  75% { scale: 1 .99; animation-timing-function: cubic-bezier(.2, .6, .3, 1); } 96% { scale: 1 .88; animation-timing-function: ease-in; }
  100% { scale: 1 1.035; } }

/* tagline */
.tag { margin: 14px 0 0; font-size: 14.5px; font-weight: 500; color: var(--muted); letter-spacing: .1px; animation: rise .3s var(--ease) .8s both; }
.tag b { color: var(--text); font-weight: 700; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- hosts card ---------- */
a.hosts { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; margin: 0 auto 22px; padding: 6px 8px 6px 6px;
  border-radius: 99px; color: var(--text); text-decoration: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .2s var(--ease), border-color .2s;
  animation: rise .3s var(--ease) .9s backwards; }
.faces { display: flex; flex: 0 0 auto; }
.faces img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; background: var(--panel2); border: 2px solid var(--panel); }
.faces img + img { margin-left: -12px; }
.hosts-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; text-align: left; }
.hosts-txt small { font-size: 9.5px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.hosts-txt b { font-family: var(--display); font-weight: 400; font-size: 17px; margin: 2px 0 1px; white-space: nowrap; }
.hosts-txt b i { font-style: normal; color: var(--orange); }
.hosts-txt > span { font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hosts-txt > span em { font-style: normal; font-weight: 700; color: var(--text); }
.hosts-mic { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 16px; margin-left: 2px;
  background: var(--panel2); border: 1px solid var(--line); }
@media (hover: hover) { a.hosts:hover { transform: translateY(-1px); border-color: var(--line2); } }
a.hosts:active { transform: scale(.98); }

/* ---------- Win a feature: a clean dark ticket ---------- */
.feature { position: relative; display: block; margin: 8px 0 20px; padding: 18px 16px 14px; border-radius: 18px;
  color: var(--text); text-decoration: none; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .2s var(--ease), border-color .2s; }
@media (hover: hover) { .feature:hover { transform: translateY(-1px); border-color: var(--line2); } }
.feature:active { transform: scale(.99); }

.ft-sticker { position: absolute; top: 18px; right: 16px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.ft-sticker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }

.ft-top { display: flex; align-items: center; gap: 13px; }
.ft-trophy { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; font-size: 22px; border-radius: 50%;
  background: var(--panel2); border: 1px solid var(--line); }
.ft-top > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ft-top small { font-size: 10px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; color: var(--orange); }
.ft-top b { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.05; color: var(--text); margin-top: 3px; white-space: nowrap; }

.ft-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 16px 0 0; counter-reset: step; }
.ft-steps > span { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 11px; border-radius: 12px; text-align: center;
  background: var(--bg); border: 1px solid var(--line); font-size: 11.5px; font-weight: 600; line-height: 1.3; color: var(--text); }
.ft-steps > span::before { counter-increment: step; content: counter(step); position: absolute; top: 7px; left: 8px;
  font-family: var(--display); font-size: 10px; color: var(--orange); }
.ft-steps i { font-style: normal; font-size: 17px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel2); border: 1px solid var(--line); }

/* tear line + punched side notches on the stub's top edge */
.ft-tags { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin: 16px -16px 0; padding: 14px 16px 0; border-top: 1px dashed var(--line2); }
.ft-tags::before, .ft-tags::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.ft-tags::before { left: -11px; clip-path: inset(0 0 0 50%); }
.ft-tags::after { right: -11px; clip-path: inset(0 50% 0 0); }
.ft-tags em { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 99px; color: var(--text);
  background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.ft-tags em:nth-child(n + 3) { color: var(--muted); }
.ft-rules { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--orange);
  text-decoration: underline; text-decoration-color: rgba(252, 114, 8, .45); text-underline-offset: 3px; }

/* compact card on the results screen */
.feature.sm { margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; }
.feature.sm .ft-top { gap: 10px; }
.feature.sm .ft-top b { font-size: 16px; }
.feature.sm .ft-trophy { width: 34px; height: 34px; font-size: 16px; }
.feature.sm .ft-tags { margin: 10px 0 0; padding: 0; border: 0; gap: 5px; }
.feature.sm .ft-tags::before, .feature.sm .ft-tags::after { display: none; }
.feature.sm .ft-tags em { font-size: 11px; padding: 3px 8px; }
.feature.sm .ft-rules { display: block; margin-top: 8px; font-size: 12px; }

/* ---------- Pick a beat header ---------- */
#home .label { align-items: flex-end; flex-wrap: wrap; gap: 8px 10px; margin: 32px 2px 4px; }
#home .label h3 { font-size: 22px; }
.fresh { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.fresh i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.crate-hint { margin: 2px 2px 12px; }

/* ---------- vibe chips ---------- */
.vibes { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 2px 16px 10px; }
.vibes::-webkit-scrollbar { display: none; }
.vibe { flex: 0 0 auto; padding: 8px 14px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 13px;
  white-space: nowrap; color: var(--muted); transition: background .15s, color .15s, border-color .15s; }
.vibe small { margin-left: 5px; font-size: 11px; font-weight: 700; color: var(--dim); }
@media (hover: hover) { .vibe:not(.on):hover { color: var(--text); border-color: var(--line2); } }
.vibe:active { transform: scale(.98); }
.vibe.on { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.vibe.on small { color: var(--ink); opacity: .65; }

/* ---------- beat crate ---------- */
.crate { display: grid; gap: 8px; }
.beat { --c1: #fc7208; --c2: #6e2c00;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 16px; text-align: left; position: relative; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow);
  transition: transform .18s var(--ease), border-color .18s, background .18s; }
.crate:not(.settled) .beat { animation: tile-in .3s var(--ease) both; animation-delay: min(calc(var(--i, 0) * 25ms), 400ms); }
@keyframes tile-in { from { opacity: 0; transform: translateY(8px); } }
@media (hover: hover) { .beat:hover { transform: translateY(-1px); border-color: var(--line2); } }
.beat:active { transform: scale(.98); }

/* selected: solid orange edge + a faint warm fill (1px border + 1px inset ring = 2px, no layout shift) */
.beat.on, .beat.on:hover { border-color: var(--orange); background: #1a1511; box-shadow: inset 0 0 0 1px var(--orange), var(--shadow); }
/* previewing: orange edge, the cover's bars move, the play button turns orange */
.beat.playing { border-color: var(--orange); }

.cover { width: 56px; height: 56px; border-radius: 12px; flex: 0 0 auto; position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  display: flex; align-items: flex-end; gap: 2px; padding: 10px 8px 9px; }
.cover i { flex: 1; height: calc(var(--v) * 100%); background: rgba(0, 0, 0, .5); border-radius: 2px 2px 1px 1px; transform-origin: bottom; }
.cover .emo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; z-index: 1; }
.beat.playing .cover i { animation: eq .42s ease-in-out infinite alternate; animation-delay: calc(var(--d) * -1s); }
@keyframes eq { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.beat.on .cover::after { content: "✓"; position: absolute; top: 4px; right: 4px; z-index: 2; width: 18px; height: 18px; border-radius: 50%;
  background: var(--orange); color: var(--ink); font-size: 11px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--bg); }

.meta { flex: 1; min-width: 0; }
.meta b { display: block; font-size: 15px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .bpm { display: inline-block; padding: 0 6px; margin-right: 1px; border-radius: 6px; font-size: 11px; font-weight: 700; color: var(--text);
  border: 1px solid var(--line2); line-height: 17px; }

.beat .play { position: relative; width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 12px; padding-left: 2px;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--text); transition: background .15s, color .15s, border-color .15s, transform .15s var(--ease); }
@media (hover: hover) { .beat .play:hover { border-color: var(--orange); } }
.beat .play:active { transform: scale(.94); }
.beat.playing .play { background: var(--orange); border-color: var(--orange); color: var(--ink); padding-left: 0; }

/* random tile */
.beat.rand .cover { background: var(--panel2); border: 1px solid var(--line2); }
.beat.rand .meta b { color: var(--text); }

@media (min-width: 700px) { .crate { grid-template-columns: 1fr 1fr; } }

/* ---------- home dock: selected beat + Next ---------- */
.go.next { font-size: 18px; height: 50px; padding: 0 22px; border-radius: 12px; letter-spacing: .3px; }

/* ---------- Dumblit-style labels: uppercase eyebrows over tight heavy headings ---------- */
#home .chip-live { text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: 1.7px; color: var(--text); }
#home .chip-live::after { content: "· by Dumblit"; color: var(--muted); font-weight: 700; }
#home .label h3::before, #home .about h2::before {
  display: block; margin-bottom: 8px; font: 800 10.5px/1 var(--ui); letter-spacing: 1.8px; text-transform: uppercase; color: var(--orange); }
#home .label h3::before { content: "01 / The crate"; }
#home .about h2::before { content: "02 / How it works"; }
@media (max-width: 459px) { #home .chip-live::after { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .beat:hover, a.hosts:hover, .feature:hover { transform: none; }
}
