/* ── Rave ────────────────────────────────────────────────── */

:root {
  color-scheme: dark;
  --black: #000000;
  --acid: #39ff14;
  --pink: #ff0090;
  --yellow: #ffff00;
  --text: #e0e0e0;
  --text-dim: #555;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Mono", monospace;
  background: var(--black);
  color: var(--text);
  overflow: hidden;
  cursor: crosshair;
}

/* Acid grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image:
    linear-gradient(var(--acid) 1px, transparent 1px),
    linear-gradient(90deg, var(--acid) 1px, transparent 1px);
  background-size: 40px 40px;
}

button, input { font: inherit; }

.visualizer-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.visualizer-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Title Watermark ────────────────────────────────────── */
.title-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: clamp(6rem, 15vw, 14rem);
  line-height: 0.85;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.04);
  text-align: center;
  white-space: nowrap;
  user-select: none;
  animation: title-breathe 8s ease-in-out infinite;
}

/* ── Corner Mark ────────────────────────────────────────── */
.corner-mark {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 10;
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--acid);
  opacity: 0.6;
}

/* ── Transport Bar ──────────────────────────────────────── */
.transport-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0, 0, 0, 0.85);
  border-top: 2px solid var(--text-dim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 80ms linear;
}

/* Beat-reactive border flash */
.transport-bar.beat {
  border-top-color: var(--acid);
  box-shadow: 0 -2px 20px rgba(57, 255, 20, 0.2);
}

.transport-upload,
.transport-play {
  height: 100%;
  padding: 0 1.6rem;
  border: none;
  border-right: 1px solid #333;
  background: transparent;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: none;
}

.transport-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.transport-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.transport-upload:hover,
.transport-play:hover {
  background: var(--acid);
  color: var(--black);
}

.transport-play:hover {
  background: var(--pink);
  color: #fff;
}

.transport-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.2rem;
  border-right: 1px solid #333;
  height: 100%;
}

.status-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}

.transport-bar.beat .status-dot,
.status-dot.active {
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}

.status-text {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  text-transform: uppercase;
}

.transport-track {
  margin: 0;
  padding: 0 1.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes title-breathe {
  0%, 100% { letter-spacing: 0.04em; }
  50% { letter-spacing: 0.08em; }
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .title-watermark {
    font-size: clamp(3.5rem, 14vw, 7rem);
  }

  .transport-bar {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
  }

  .transport-upload,
  .transport-play {
    flex: 1;
    min-height: 48px;
    padding: 0 1rem;
    border-right: none;
    border-bottom: 1px solid #333;
  }

  .transport-status {
    flex: 1;
    min-height: 36px;
    border-right: none;
  }

  .transport-track {
    width: 100%;
    padding: 0.5rem 1rem;
    border-top: 1px solid #222;
  }

  .corner-mark {
    top: 0.8rem;
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
