:root {
  --bg: #000;
  --fg: #f2f2f2;
  --dim: #8a8a8a;
  --line: #222;
  --panel: #0b0b0b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 21px;
  line-height: 1.24;
}

.wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 48px 36px 48px 64px;
  max-width: 1500px;
}

/* photo: square, slightly washed out + grain like the mockup */
.photo {
  position: relative;
  flex: 0 0 auto;
  width: min(576px, 40vw);
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  background: #111;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.8) contrast(.95) brightness(.97);
}
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.photo.empty img { display: none; }
.photo.empty::before {
  content: "drop me.jpg here";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 16px;
}

.info { padding-top: 18px; min-width: 0; }

ul { list-style: none; margin: 0; padding: 0; }

.fetch li { overflow-wrap: anywhere; }

.configs {
  margin-top: 78px;
  padding-left: 49px;
}

/* music player */
.music {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(460px, 100%);
  margin: 40px 0 0 49px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.music .art {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #333;
  animation: spin 8s linear infinite paused;
}
.music.playing .art { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

.track { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.track .label {
  font-size: 12px;
  color: var(--dim);
  text-transform: lowercase;
  letter-spacing: .04em;
}
.track .title {
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.play {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  cursor: pointer;
  transition: transform .15s;
}
.play:hover:not(:disabled) { transform: scale(1.08); }
.play:disabled { opacity: .4; cursor: default; }
.play svg { width: 14px; height: 14px; fill: currentColor; }
.play .i-pause, .music.playing .play .i-play { display: none; }
.music.playing .play .i-pause { display: block; }

.bar {
  flex: 1;
  height: 4px;
  background: #2a2a2a;
  cursor: pointer;
  position: relative;
}
.bar::before { content: ""; position: absolute; inset: -8px 0; }
.fill { height: 100%; width: 0; background: var(--fg); }
.time {
  flex: 0 0 auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--dim);
}

/* the YouTube player plays the audio; the card above is the UI */
.yt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* config viewer */
dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
}
dialog::backdrop { background: rgba(0, 0, 0, .75); }
dialog[open] { display: flex; flex-direction: column; }
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
dialog .actions { display: flex; gap: 14px; align-items: center; }
dialog button, dialog .actions a {
  font: inherit;
  color: var(--dim);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
dialog button:hover, dialog .actions a:hover { color: var(--fg); }
#viewer-close { font-size: 22px; line-height: 1; }
dialog pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  tab-size: 4;
}

@media (max-width: 860px) {
  html, body { font-size: 16px; }
  .wrap {
    flex-direction: column;
    padding: 16px;
    gap: 20px;
  }
  .photo { width: 100%; }
  .info { padding-top: 0; }
  .configs { margin-top: 32px; padding-left: 0; }
  .configs li + li { margin-top: 4px; }
  .music { margin: 28px 0 0; }
  .music .art { width: 60px; height: 60px; }
}
