/* ============================================================
   VELVET MIC — midnight cabaret
   ink room · champagne spotlight · film grain
   ============================================================ */

:root {
  --ink: #0d0a07;
  --ink-2: #16110b;
  --ink-3: #211a11;
  --gold: #f0c46c;
  --champagne: #ffe9b8;
  --gold-deep: #b8862e;
  --rose: #ff6b7a;
  --smoke: #a89a86;
  --smoke-dim: #5e5546;
  --display: "Fraunces", serif;
  --body: "Hanken Grotesk", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--ink);
  color: var(--champagne);
  font-family: var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: var(--ink); }

/* film grain over everything */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 50;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  animation: grain-shift 1.4s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1.5%); }
  50% { transform: translate(1.5%, -2%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

.view { min-height: 100vh; position: relative; }
[hidden] { display: none !important; }

/* ============================== SEARCH ============================== */

#view-search {
  display: flex; flex-direction: column;
  padding: clamp(20px, 4vw, 56px);
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(240,196,108,.13), transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 110%, rgba(255,107,122,.05), transparent 60%),
    var(--ink);
}

.masthead {
  display: flex; align-items: baseline; gap: 18px;
  border-bottom: 1px solid rgba(240,196,108,.18);
  padding-bottom: 14px;
}
.brand {
  font-family: var(--display);
  font-weight: 700; font-size: 20px; letter-spacing: .22em;
  color: var(--gold);
}
.brand-mark { color: var(--rose); }
.brand-sub {
  font-style: italic; font-family: var(--display);
  color: var(--smoke); font-size: 14px; font-weight: 300;
}

.hero { text-align: center; padding: clamp(40px, 9vh, 110px) 0 30px; }

.hero-title {
  font-family: var(--display);
  font-weight: 350;
  font-size: clamp(44px, 7.5vw, 104px);
  line-height: 1.02;
  letter-spacing: -.015em;
}
.hero-line { display: block; animation: rise .8s cubic-bezier(.2,.9,.25,1) both; }
.hero-line--em {
  font-style: italic; font-weight: 600;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(240,196,108,.35);
  animation-delay: .12s;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

.search-bar {
  margin: clamp(28px, 5vh, 52px) auto 0;
  max-width: 640px;
  display: flex;
  border: 1px solid rgba(240,196,108,.35);
  border-radius: 999px;
  background: rgba(22,17,11,.8);
  backdrop-filter: blur(6px);
  transition: border-color .25s, box-shadow .25s;
  animation: rise .8s .24s cubic-bezier(.2,.9,.25,1) both;
}
.search-bar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 8px 50px rgba(240,196,108,.18);
}
.search-bar input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--champagne);
  font: 500 18px/1 var(--body);
  padding: 20px 28px;
}
.search-bar input::placeholder { color: var(--smoke-dim); font-style: italic; }
.search-bar button {
  border: none; cursor: pointer;
  margin: 6px; padding: 0 30px;
  border-radius: 999px;
  background: var(--gold); color: var(--ink);
  font: 700 14px/1 var(--body);
  letter-spacing: .14em; text-transform: uppercase;
  transition: background .2s, transform .15s;
}
.search-bar button:hover { background: var(--champagne); transform: translateY(-1px); }

.search-status {
  margin-top: 18px; min-height: 20px;
  color: var(--smoke); font-style: italic; font-family: var(--display);
}

/* setlist results */
.setlist {
  list-style: none;
  max-width: 760px; margin: 10px auto 60px; width: 100%;
}
.setlist li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center; gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(240,196,108,.12);
  cursor: pointer;
  animation: rise .5s both;
  transition: background .2s, padding-left .2s;
}
.setlist li:hover { background: rgba(240,196,108,.07); padding-left: 28px; }
.setlist .num {
  font-family: var(--display); font-style: italic;
  color: var(--smoke-dim); font-size: 18px;
}
.setlist li:hover .num { color: var(--rose); }
.setlist .t { font-weight: 700; font-size: 17px; }
.setlist .a { color: var(--smoke); font-size: 14px; margin-top: 2px; }
.setlist .d {
  font-variant-numeric: tabular-nums;
  color: var(--smoke-dim); font-size: 13px;
}

.footnote {
  margin-top: auto; text-align: center;
  color: var(--smoke-dim); font-size: 12px; letter-spacing: .08em;
  padding-top: 30px;
}

/* ============================== STAGE ============================== */

#view-stage {
  display: grid;
  grid-template-columns: clamp(260px, 26vw, 360px) 1fr;
  height: 100vh; overflow: hidden;
  background: var(--ink);
}

.spotlight {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 58% 75% at 62% 38%, rgba(240,196,108,.10), transparent 65%),
    radial-gradient(ellipse 100% 100% at 50% 120%, rgba(0,0,0,.7), transparent 60%);
}

/* left bill */
.bill {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 20px;
  padding: 28px;
  background: linear-gradient(160deg, var(--ink-2), var(--ink));
  border-right: 1px solid rgba(240,196,108,.14);
  overflow-y: auto;
}

.ghost-btn {
  align-self: flex-start;
  background: none; border: none; cursor: pointer;
  color: var(--smoke); font: italic 500 15px var(--display);
  transition: color .2s;
}
.ghost-btn:hover { color: var(--gold); }

.art-frame {
  position: relative;
  border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(240,196,108,.25);
  box-shadow: 0 18px 60px rgba(0,0,0,.65), 0 0 80px rgba(240,196,108,.07);
  aspect-ratio: 1; background: var(--ink-3);
}
.art-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-shine {
  position: absolute; inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,.14), transparent 35%);
}

.bill-meta h2 {
  font-family: var(--display); font-weight: 600;
  font-size: 24px; line-height: 1.15; color: var(--champagne);
}
.bill-meta p { color: var(--smoke); margin-top: 4px; font-size: 15px; }
.source-note {
  font-size: 11px !important; color: var(--smoke-dim) !important;
  margin-top: 10px !important; line-height: 1.5;
}

.controls { display: flex; flex-direction: column; gap: 16px; }

.play-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--gold-deep);
  background: radial-gradient(circle at 35% 30%, #2b2113, var(--ink-2));
  color: var(--gold); cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s, box-shadow .2s, color .2s;
  box-shadow: 0 6px 26px rgba(0,0,0,.5);
}
.play-btn:hover {
  transform: scale(1.06); color: var(--champagne);
  box-shadow: 0 6px 30px rgba(240,196,108,.25);
}
.play-btn:active { transform: scale(.97); }
.play-btn.attn { animation: attn-pulse 1.4s ease-in-out infinite; }
@keyframes attn-pulse {
  0%, 100% { box-shadow: 0 6px 26px rgba(0,0,0,.5); }
  50% { box-shadow: 0 0 36px rgba(240,196,108,.55); }
}

.seek-row { display: flex; align-items: center; gap: 10px; }
.time {
  font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--smoke); min-width: 34px;
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--gold) var(--fill, 0%), #32291b var(--fill, 0%));
  cursor: pointer; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--champagne);
  border: 2px solid var(--gold-deep);
  box-shadow: 0 0 10px rgba(240,196,108,.5);
}

.mix { display: flex; flex-direction: column; gap: 10px; }
.mix-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--smoke);
}
.mix-label {
  width: 44px; letter-spacing: .08em; flex-shrink: 0;
}
.mix-val {
  font-variant-numeric: tabular-nums;
  width: 28px; text-align: right; color: var(--champagne);
}
.stem-btn {
  flex: 1; padding: 10px 6px;
  border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(240,196,108,.3);
  background: none; color: var(--smoke);
  font: 600 12px var(--body); letter-spacing: .06em;
  transition: all .2s;
}
.stem-btn:hover { border-color: var(--gold); color: var(--champagne); }
.stem-btn.is-on {
  background: var(--gold); color: var(--ink); border-color: var(--gold);
}
.stem-btn:disabled { opacity: .45; cursor: default; }
.stem-btn.is-busy {
  color: var(--gold);
  background: linear-gradient(to right, rgba(240,196,108,.18) var(--prog, 0%), transparent var(--prog, 0%));
}

.offset-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--smoke);
}
.offset-label { letter-spacing: .08em; flex: 1; }
.nudge {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid rgba(240,196,108,.3);
  background: none; color: var(--gold);
  font-size: 16px; cursor: pointer; line-height: 1;
  transition: background .15s;
}
.nudge:hover { background: rgba(240,196,108,.15); }
.offset-value {
  font-variant-numeric: tabular-nums;
  min-width: 44px; text-align: center; color: var(--champagne);
}

.keys-hint {
  margin-top: auto; font-size: 11px;
  color: var(--smoke-dim); letter-spacing: .06em; text-align: center;
}

/* the stage itself */
.stage { position: relative; z-index: 1; overflow: hidden; }

.prep-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-content: center; gap: 14px;
  text-align: center;
  background: rgba(13,10,7,.85); backdrop-filter: blur(4px);
}
.prep-mic { font-size: 44px; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-12px) rotate(6deg); }
}
.prep-overlay p {
  font-family: var(--display); font-style: italic;
  color: var(--smoke); font-size: 17px; max-width: 360px;
}

.sync-progress {
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.sync-bar {
  width: 260px; height: 6px; border-radius: 3px;
  background: #32291b; overflow: hidden;
}
#sync-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  border-radius: 3px;
  box-shadow: 0 0 14px rgba(240,196,108,.55);
  transition: width .4s ease;
}
.sync-bar.indeterminate #sync-fill {
  width: 30%;
  animation: sync-scan 1.1s ease-in-out infinite alternate;
}
@keyframes sync-scan {
  from { transform: translateX(-40%); }
  to   { transform: translateX(280%); }
}
#sync-pct {
  font-variant-numeric: tabular-nums;
  color: var(--smoke); font-size: 13px;
  min-width: 38px; text-align: left;
}
.skip-sync { font-size: 14px; align-self: center; }

.lyrics-window {
  position: absolute; inset: 0;
  /* no flex centering — the translateY on .lyrics does ALL vertical
     positioning, so line offsets stay relative to the window top */
  padding: 0 clamp(28px, 5vw, 90px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.lyrics {
  width: 100%;
  /* no CSS transition — the render loop eases translateY itself */
  will-change: transform;
}

.line {
  font-weight: 800;
  font-size: clamp(26px, 3.4vw, 46px);
  line-height: 1.25;
  padding: clamp(8px, 1.4vh, 14px) 0;
  color: var(--smoke-dim);
  opacity: .55;
  transform-origin: left center;
  transition: opacity .4s, transform .4s, color .4s, filter .4s;
  cursor: pointer;
  filter: blur(.4px);
}
.line:hover { opacity: .8; }

.line.past { color: var(--smoke-dim); opacity: .3; }

.line.active {
  opacity: 1;
  transform: scale(1.04);
  filter: none;
}

/* word-wipe: each word fills gold left→right via --p (0..1) */
.line .w {
  display: inline;
  background-image: linear-gradient(
    to right,
    var(--champagne) calc(var(--p, 0) * 100%),
    var(--smoke-dim) calc(var(--p, 0) * 100%)
  );
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.line.active .w[style*="--p: 1"],
.line.active .w.sung {
  text-shadow: 0 0 30px rgba(240,196,108,.0);
}
.line.active {
  text-shadow: 0 0 50px rgba(240,196,108,.18);
}
.line.past .w { background-image: none; color: inherit; }
.line.future .w { background-image: none; color: inherit; }

/* instrumental interlude dots */
.line.interlude {
  display: flex; gap: 14px; align-items: center;
  cursor: default;
}
.line.interlude .dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--smoke-dim);
  transition: background .3s, transform .3s, box-shadow .3s;
}
.line.interlude.active .dot.lit {
  background: var(--gold);
  transform: scale(1.25);
  box-shadow: 0 0 16px rgba(240,196,108,.6);
}

/* ============================== RESPONSIVE ============================== */

@media (max-width: 820px) {
  #view-stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .bill {
    flex-direction: row; flex-wrap: wrap; align-items: center;
    border-right: none; border-bottom: 1px solid rgba(240,196,108,.14);
    gap: 14px; padding: 14px;
  }
  .art-frame { width: 64px; }
  .bill-meta h2 { font-size: 16px; }
  .controls { flex: 1; min-width: 240px; gap: 8px; }
  .play-btn { width: 48px; height: 48px; }
  .keys-hint { display: none; }
  .lyrics-window { padding: 0 20px; }
}
