/* ============================================================
   lucymusic — dark & cinematic single-page player
   ============================================================ */

:root {
  --bg: #07070a;
  --ink: #f3f1ea;
  --ink-dim: rgba(243, 241, 234, 0.62);
  --ink-faint: rgba(243, 241, 234, 0.38);
  --accent: #d8b06a;          /* warm gold focal accent */
  --accent-soft: rgba(216, 176, 106, 0.18);
  --panel: rgba(16, 16, 22, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --fade: 1s ease;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { user-select: none; -webkit-user-drag: none; }

/* ---------- Rotating background ---------- */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 35% 35%;       /* focal point biased upper-left */
  opacity: 0;
  transition: opacity var(--fade);
  will-change: opacity;
  transform: scale(1.15);             /* 15% larger than the window */
  transform-origin: 35% 35%;          /* zoom anchored toward upper-left */
  filter: brightness(1.12);           /* lighten — it was a touch too dark */
}

.bg-slide.is-visible { opacity: 1; }

.bg-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 35%, rgba(0,0,0,0.25), rgba(0,0,0,0.78) 75%),
    linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.85));
}

/* ---------- Password gate ---------- */
#gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 7, 0.55);
  backdrop-filter: blur(3px);
}

#gate-form {
  width: min(360px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#gate-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 4rem);
  letter-spacing: 0.04em;
  margin: 0;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}

.gate-sub {
  margin: 0 0 8px;
  color: var(--ink-dim);
  font-weight: 300;
  letter-spacing: 0.02em;
}

#gate-input,
#gate-submit {
  font-family: var(--sans);
  font-size: 1rem;
  border-radius: 999px;
  padding: 14px 20px;
  border: 1px solid var(--panel-border);
}

#gate-input {
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.08em;
}
#gate-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#gate-submit {
  background: var(--accent);
  color: #1a1206;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
#gate-submit:hover { filter: brightness(1.08); }
#gate-submit:active { transform: translateY(1px); }

.gate-error {
  margin: 4px 0 0;
  color: #e9a3a3;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.gate-shake { animation: shake 0.4s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50% { transform: translateX(-6px); }
}

/* ---------- Stage / hero ---------- */
/* The `hidden` attribute must win over the display rule below, or the stage
   stays in the layout before unlock. */
#stage[hidden] { display: none; }

#stage {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 6vh 24px 5vh;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#stage.is-revealed { opacity: 1; }

.hero {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(280px, 380px);
  gap: clamp(20px, 4vw, 48px);
  align-items: stretch;
  width: 100%;
  max-width: 820px;
}

/* The UI sits above the signature watermark below */
.hero,
.triggers { position: relative; z-index: 1; }

/* ---------- Signature watermark ---------- */
/* A large cursive "full name" anchored to the darker bottom-right of the
   background, trailing off the right edge. Decorative only (aria-hidden);
   fades in slowly on unlock. */
#nameplate {
  position: absolute;
  right: -1.5%;
  bottom: 6%;
  z-index: 0;
  margin: 0;
  white-space: nowrap;
  pointer-events: none;
  font-family: "Sacramento", var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--accent);
  filter: blur(3px);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 2.4s ease 0.6s;   /* slow fade-in, after the stage reveal */
}
#nameplate:empty { display: none; }
#stage.is-revealed #nameplate { opacity: 0.22; }

/* Album cover — the glowing focal point */
.cover-wrap {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(216, 176, 106, 0.12);
}
.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #15151c;
}

/* Player column */
.player {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 18px;
  backdrop-filter: blur(8px);
  min-height: 0;
}

.player-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  margin: 0 0 10px;
  color: var(--ink);
}
.player-head h2:empty { display: none; }

/* Track list */
.tracklist {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  max-height: 240px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft) transparent;
}

.track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-dim);
  transition: background 0.15s ease, color 0.15s ease;
}
.track:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }

.track .track-index {
  width: 1.4em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.track .track-title { flex: 1; letter-spacing: 0.01em; }
.track .track-eq { width: 1em; color: var(--accent); opacity: 0; }

.track.is-active {
  background: var(--accent-soft);
  color: var(--ink);
}
.track.is-active .track-index { color: var(--accent); }
.track.is-active .track-eq { opacity: 1; }
.track.is-playing .track-eq { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Transport */
.transport { margin-top: auto; }

.seek {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.time {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  min-width: 2.6em;
  text-align: center;
}

.seek-bar {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}
.seek-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 4px;
  background: var(--accent);
}
.seek-handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.seek-bar:hover .seek-handle,
.seek-bar:focus-visible .seek-handle { opacity: 1; }
.seek-bar:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 4px; }

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctrl {
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ctrl:hover { background: rgba(255, 255, 255, 0.08); }
.ctrl:active { transform: scale(0.92); }
.ctrl-play {
  font-size: 1.3rem;
  width: 46px;
  height: 46px;
  background: var(--accent);
  color: #1a1206;
}
.ctrl-play:hover { background: var(--accent); filter: brightness(1.08); }

.volume {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.vol-icon {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
#volume {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Bio / contact triggers ---------- */
.triggers {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--serif);
}
.trigger {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 4px 8px;
  position: relative;
  transition: color 0.2s ease;
}
.trigger::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: 2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.trigger:hover { color: var(--ink); }
.trigger:hover::after { transform: scaleX(1); }
.trigger-sep { color: var(--ink-faint); }

/* ---------- Modals ---------- */
/* Without this, `.modal { display: grid }` overrides the `hidden` attribute,
   leaving both modals as invisible full-viewport overlays that swallow every
   click on the stage beneath them. */
.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.modal.is-open { opacity: 1; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 6, 0.7);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 32px 30px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(10px);
  transition: transform 0.35s ease;
}
.modal.is-open .modal-panel { transform: translateY(0); }

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--ink); }

.modal-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.8rem;
  letter-spacing: 0.03em;
  margin: 0 0 14px;
}
.modal-body {
  color: var(--ink-dim);
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.01em;
}
.modal-body p { margin: 0 0 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .hero {
    grid-template-columns: 1fr;
    max-width: 380px;
  }
  .cover-wrap { max-width: 320px; margin: 0 auto; }
  .tracklist { max-height: 200px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  .bg-slide,
  #stage,
  .modal,
  .modal-panel {
    transition-duration: 0.001s !important;
    animation: none !important;
  }
  .bg-slide { transform: scale(1.15); }   /* keep static framing, no motion */
}
