/* Matt Docherty — DJ / Producer
   Rebuilt from the Claude Design prototype as a static site. */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #0a0a0a;
  overflow-x: hidden; /* allow vertical scroll as a fallback; never scroll sideways */
}

@keyframes kb   { from { transform: scale(1.03); } to { transform: scale(1.13); } }
@keyframes kbm  { from { transform: scale(1.20); } to { transform: scale(1.32); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.stage {
  position: relative;
  width: 100%;
  min-height: 100svh; /* fallback */
  min-height: var(--app-vh, 100svh); /* real visible height, set by JS */
  background: #0a0a0a;
  font-family: 'Space Mono', monospace;
  color: #fff;
}

/* --- Background portraits ---
   Fixed so they stay a full-screen backdrop while content scrolls. */
.photos { position: fixed; inset: 0; overflow: hidden; }

.photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 56%;
  opacity: 0;
  transition: opacity 1.6s ease;
  animation: kb 24s ease-in-out infinite alternate;
  will-change: opacity, transform;
}
.photo.is-active { opacity: 1; }

/* --- Atmospheric overlays (fixed backdrop, like .photos) --- */
.scrim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.9; /* "scrim" prop = 90% */
  background: linear-gradient(180deg,
    rgba(8,8,8,.58) 0%,
    rgba(8,8,8,.04) 26%,
    rgba(8,8,8,.10) 54%,
    rgba(8,8,8,.88) 100%);
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(125% 85% at 50% 38%, transparent 52%, rgba(8,8,8,.55) 100%);
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Inner frame (fixed to viewport edges) --- */
.frame {
  position: fixed;
  inset: clamp(14px, 2.3vw, 26px);
  border: 1px solid rgba(255,255,255,.24);
  pointer-events: none;
  z-index: 3;
}

/* --- Content layout ---
   In normal flow so its height is respected and the page can scroll when
   needed. min-height keeps it filling the screen when there's room.
   Padding adds the iOS safe-area insets so nothing hides under the notch
   or home indicator (env() resolves to 0 where unsupported). */
.content {
  position: relative;
  z-index: 4;
  min-height: 100svh; /* fallback */
  min-height: var(--app-vh, 100svh); /* real visible height, set by JS */
  display: flex;
  flex-direction: column;
  padding:
    calc(clamp(30px, 4.6vw, 64px) + env(safe-area-inset-top))
    calc(clamp(30px, 4.6vw, 64px) + env(safe-area-inset-right))
    calc(clamp(30px, 4.6vw, 64px) + env(safe-area-inset-bottom))
    calc(clamp(30px, 4.6vw, 64px) + env(safe-area-inset-left));
}

.spacer { min-height: 0; }
.spacer-top { flex: 1 1 0; } /* desktop: push title down */
.spacer-mid { flex: 0 1 0; }

.title-block {
  animation: rise 1s ease .12s both;
  max-width: 1100px;
  text-align: left;
}
.title-block h1 {
  margin: 0;
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  line-height: .86;
  letter-spacing: -.018em;
  font-size: clamp(3.1rem, 13vw, 10.5rem);
  text-shadow: 0 2px 50px rgba(0,0,0,.4);
}
.role {
  margin: clamp(22px, 2.7vw, 36px) 0 0;
  font-size: 12px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(255,255,255,.78);
}

/* --- Controls --- */
.controls {
  animation: rise 1s ease .26s both;
  max-width: 1100px;
  margin-top: 18px;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
  justify-content: flex-start;
}

.play-btn {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.play-btn:hover { transform: scale(1.07); }
.play-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Show play OR pause, never both. Class-based so it works in Safari,
   where the `hidden` attribute is unreliable on inline SVG. */
.play-btn .icon-pause { display: none; }
.play-btn.is-playing .icon-play { display: none; }
.play-btn.is-playing .icon-pause { display: block; }

.track-meta { min-width: 0; }
.now-label {
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 3px;
}
/* .track-title is the clip box; .track-title-text is the (truncated) label.
   On mobile, JS briefly adds .marquee-run to let the full title slide across. */
.track-title {
  overflow: hidden;
  max-width: min(66vw, 340px);
}
.track-title-text {
  display: inline-block;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.track-title-text.marquee-run {
  display: inline-flex;
  gap: 48px; /* spacing between the two copies, like a real ticker */
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  will-change: transform;
}
.track-title-text.marquee-run > span { white-space: nowrap; }

.social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.social-link {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: all .25s ease;
}
.social-link:hover {
  background: #fff;
  color: #0a0a0a;
  border-color: #fff;
  transform: translateY(-3px);
}
.social-link:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* --- Hidden audio iframe --- */
#scPlayer {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: none;
}

/* --- Mobile: title at top, controls centred at bottom --- */
@media (max-width: 600px) {
  .spacer-top { flex: 0 1 0; }
  .spacer-mid { flex: 1 1 0; }
  .title-block { text-align: center; }
  .now-playing { justify-content: center; }
  .social { justify-content: center; }
  .photo { animation-name: kbm; object-position: 60% 56%; }
}

@media (prefers-reduced-motion: reduce) {
  .photo { animation: none; }
  .title-block, .controls { animation: none; }
}
