/* DJ side. Layout from barbianaliu.com, flipped to "lights off". */
.dj {
  --dj-bg: #0a0a0a;
  --dj-ink: #f2f2f2;
  --dj-dim: #8c8c8c;
  --dj-ascii: #bdbdbd;
  --dj-panel: #121212;
  --dj-line: #2a2a2a;
  --font-grotesk: "Inter Tight", "Helvetica Neue", Arial, sans-serif;

  background: var(--dj-bg);
  color: var(--dj-ink);
  font-family: var(--font-grotesk);
  overflow: hidden;
}

.dj ::selection {
  background: var(--red);
  color: #fff;
}

.stage {
  position: relative;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
}

/* Lights coming on: everything flickers in like a fluorescent tube. */
.stage > * {
  opacity: 0;
  animation: flicker 0.9s steps(1) forwards;
  animation-delay: var(--in, 0.15s);
}
@keyframes flicker {
  0% { opacity: 0; }
  12% { opacity: 1; }
  18% { opacity: 0.1; }
  30% { opacity: 1; }
  38% { opacity: 0.3; }
  46%, 100% { opacity: 1; }
}

/* ---------- Name ---------- */

.dj-name {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  margin: 0;
  font-weight: 500;
  font-size: 16vw; /* refined by fitName() in dj.js */
  line-height: 0.78;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 0.12em;
  --in: 0.1s;
}

/* ---------- Intro ---------- */

.intro {
  position: absolute;
  left: 24px;
  top: calc(var(--name-h, 17vw) + 14px);
  width: min(360px, calc(100vw - 48px));
  z-index: 3;
  --in: 0.3s;
}

.socials {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.socials a {
  font-size: 22px;
  line-height: 26px;
  font-weight: 500;
  letter-spacing: -0.8px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  transition: color 0.2s;
}
.socials a:hover {
  color: var(--red);
}

.bio {
  font-size: 15px;
  line-height: 22px;
  font-weight: 500;
  letter-spacing: -0.4px;
  color: var(--dj-ink);
}

/* ---------- ASCII art ---------- */

.ascii {
  position: absolute;
  margin: 0;
  font-family: var(--font-mono);
  color: var(--dj-ascii);
  white-space: pre;
  user-select: none;
  pointer-events: none;
}

.ascii--vinyl {
  left: 50%;
  bottom: 62px;
  translate: -50% 0;
  font-size: var(--vinyl-fs, 9px);
  line-height: var(--vinyl-fs, 9px);
  color: var(--dj-ink);
  z-index: 1;
  --in: 0.45s;
}

.ascii--eq {
  left: 3%;
  bottom: 44px;
  font-size: 10px;
  line-height: 10px;
  --in: 0.6s;
}

.ascii--wave {
  right: 2%;
  top: calc(var(--name-h, 17vw) + 12px);
  font-size: 10px;
  line-height: 10px;
  --in: 0.7s;
}

/* ---------- Bracket tags ---------- */

.tags {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  --in: 0.9s;
}

.tag {
  position: absolute;
  left: var(--x);
  top: var(--y);
  pointer-events: auto;
  padding: 3px 14px;
  background: var(--dj-ink);
  color: #000;
  font-family: var(--font-grotesk);
  font-weight: 600;
  font-size: 17px;
  line-height: 23px;
  letter-spacing: -0.8px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.25s var(--ease-back);
}
.tag:hover,
.tag:focus-visible {
  background: var(--red);
  color: #fff;
  transform: translateY(-3px) rotate(-2deg);
}

/* ---------- Bottom bar ---------- */

.bottom {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 5;
  font-size: 17px;
  line-height: 23px;
  font-weight: 500;
  letter-spacing: -0.8px;
  --in: 1s;
}
.bottom-mail:hover {
  color: var(--red);
}
.bottom-clock {
  font-variant-numeric: tabular-nums;
}

/* Dark version of the light switch: starts "off" (rocker down). */
.lights--dark {
  margin: 0;
  opacity: 1;
  animation: none;
  color: var(--red);
}
.lights--dark:hover {
  background: rgba(255, 255, 255, 0.06);
}
.lights--dark .switch {
  --plate: #1b1b1b;
  --rocker: #111;
  --screw: #3a3a3a;
  box-shadow: 0 0 0 1px #2c2c2c, 0 6px 16px -6px rgba(0, 0, 0, 0.9);
}
.lights--dark .switch-rocker {
  background: linear-gradient(to bottom, var(--rocker) 0 50%, #2a2a2a 50%);
  box-shadow: inset 0 0 0 1px #333, 0 2px 3px -1px rgba(0, 0, 0, 0.6);
  transform: perspective(40px) rotateX(-18deg);
}
.lights--dark:hover .switch-rocker {
  transform: perspective(40px) rotateX(-8deg);
}
.lights--dark.is-flipped .switch-rocker,
.lights--dark.is-flipped:hover .switch-rocker {
  background: linear-gradient(to bottom, #2a2a2a 0 50%, var(--rocker) 50%);
  transform: perspective(40px) rotateX(18deg);
}

/* ---------- Panels ---------- */

.panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 12px 12px 56px;
  background: rgba(10, 10, 10, 0.5);
}
.panel[hidden] {
  display: none;
}
.panel-box {
  position: relative;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  background: var(--dj-panel);
  border: 1px solid var(--dj-line);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
  animation: panel-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
  }
}
.panel-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  padding: 3px 14px;
  background: var(--dj-ink);
  color: #000;
  font-family: var(--font-grotesk);
  font-weight: 600;
  font-size: 17px;
  line-height: 23px;
  letter-spacing: -0.8px;
  text-transform: uppercase;
}
.panel-close:hover {
  background: var(--red);
  color: #fff;
}

.panel-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding: 36px 32px 48px;
  min-height: 100%;
}

.facts {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.fact-label {
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  text-transform: uppercase;
  color: var(--dj-dim);
}
.fact-list {
  list-style: none;
  font-size: 19px;
  line-height: 25px;
  font-weight: 500;
  letter-spacing: -0.8px;
}
.fact-list a {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.fact-list a:hover {
  color: var(--red);
}

.collage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 32px;
  align-content: start;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tile:nth-child(3n + 2) {
  margin-top: 90px;
}
.tile:nth-child(3n) {
  margin-top: 30px;
}
.tile-art {
  position: relative;
  aspect-ratio: 1;
  background: #050505;
  border: 1px solid var(--dj-line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tile-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.1) brightness(0.85);
  transition: filter 0.3s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
a.tile:hover .tile-art img {
  filter: none;
  transform: scale(1.04);
}
.tile-play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.3s var(--ease-back);
}
.tile-play::before {
  content: "";
  margin-left: 4px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
}
a.tile:hover .tile-play,
a.tile:focus-visible .tile-play {
  opacity: 1;
  transform: none;
}
.tile-art pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 5px;
  line-height: 5px;
  color: var(--dj-ascii);
}
a.tile:hover .tile-art {
  border-color: var(--red);
}
.tile-cap {
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
  text-transform: uppercase;
}
.tile-cap span {
  display: block;
  text-transform: none;
  color: var(--dj-dim);
}

.prose {
  max-width: 560px;
  font-size: 22px;
  line-height: 30px;
  font-weight: 500;
  letter-spacing: -0.8px;
}
.prose--wide {
  max-width: none;
}
.prose p + p {
  margin-top: 18px;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.prose a:hover {
  color: var(--red);
}
.big-mail {
  display: inline-block;
  font-size: clamp(32px, 6vw, 88px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.big-mail:hover {
  color: var(--red);
}

/* ---------- Player dock ---------- */

.dock {
  position: fixed;
  right: 12px;
  bottom: 60px;
  z-index: 1100;
  width: min(380px, calc(100vw - 24px));
  background: var(--dj-panel);
  border: 1px solid var(--dj-line);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.9);
  animation: panel-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.dock[hidden] {
  display: none;
}
.dock-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
  text-transform: uppercase;
}
.dock-label {
  color: var(--red);
  white-space: nowrap;
}
.dock-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dock-close {
  padding: 2px 10px;
  background: var(--dj-ink);
  color: #000;
  font-family: var(--font-grotesk);
  font-weight: 600;
  font-size: 13px;
  line-height: 18px;
  text-transform: uppercase;
  white-space: nowrap;
}
.dock-close:hover {
  background: var(--red);
  color: #fff;
}
.dock iframe {
  display: block;
  width: 100%;
  height: 120px;
  border: 0;
}

/* ---------- Phone ---------- */

@media (max-width: 767px) {
  .dj {
    overflow: auto;
  }
  .stage {
    height: auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    padding-bottom: 76px;
  }
  .dj-name,
  .intro,
  .ascii--vinyl,
  .tags {
    position: relative;
    inset: auto;
    translate: none;
  }
  .dj-name {
    left: 0;
    right: 0;
    padding: 0.12em 14px 0;
  }
  .intro {
    width: auto;
    margin: 14px 16px 0;
  }
  .socials a {
    font-size: 19px;
  }
  .ascii--vinyl {
    align-self: center;
    margin-top: 20px;
  }
  .ascii--eq,
  .ascii--wave {
    display: none;
  }
  .tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 20px 16px 0;
    pointer-events: auto;
  }
  .tag {
    position: static;
  }
  .bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 14px;
  }
  .bottom-clock {
    display: none;
  }
  .lights-label {
    font-size: 11px;
  }

  .panel {
    padding: 8px 8px 64px;
  }
  .panel-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 20px 16px 32px;
  }
  .collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }
  .tile:nth-child(n) {
    margin-top: 0;
  }
  .tile:nth-child(2n) {
    margin-top: 40px;
  }
  .prose {
    font-size: 18px;
    line-height: 25px;
  }
  .dock {
    bottom: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage > * {
    animation: none;
    opacity: 1;
  }
}
