/* Hallmark · macrostructure: single-screen poster (saloon.wtf DNA) · theme: studied-brand (Frame Chicago) · one image, one mark, one line */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  overflow-x: clip;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-paper);
  color: var(--color-ink);
  min-height: 100dvh;
  overflow: clip;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ======= the scene ======= */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
}

/* legibility without killing the room: darker at center-mass and bottom */
.scrim {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(oklch(0% 0 0 / 0.42), oklch(0% 0 0 / 0.18) 30%, oklch(0% 0 0 / 0.24) 62%, oklch(0% 0 0 / 0.62)),
    radial-gradient(ellipse 60% 46% at 50% 44%, oklch(0% 0 0 / 0.38), transparent 70%);
}

/* ======= corner chrome ======= */
.chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  z-index: 4;
}

.clock,
.rotation {
  font-family: var(--font-mono);
  font-size: var(--text-ui-s);
  letter-spacing: 0.08em;
  color: var(--color-ink);
  text-shadow: 0 1px 8px oklch(0% 0 0 / 0.6);
}

.rotation {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--color-live);
}

.playing .live-dot {
  animation: breathe 2.4s var(--ease-in-out) infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.outlink {
  font-size: var(--text-ui-s);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink);
  text-decoration: none;
  background: oklch(0% 0 0 / 0.45);
  border: 1px solid var(--color-hairline);
  padding: var(--space-sm) var(--space-md);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.outlink:hover { border-color: var(--color-ink); background: oklch(0% 0 0 / 0.65); }
.outlink:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.outlink:active { transform: translateY(1px); }

/* ======= the mark ======= */
.poster {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  z-index: 2;
  padding: var(--space-lg);
  pointer-events: none;
  text-align: center;
}

.logo {
  width: clamp(170px, 22vw, 260px);
  height: auto;
  filter: drop-shadow(0 10px 40px oklch(0% 0 0 / 0.65));
}

.playlist-line {
  margin-top: var(--space-md);
  font-size: var(--text-label);
  font-weight: 300;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  text-transform: uppercase;
  color: var(--color-ink);
  text-shadow: 0 1px 10px oklch(0% 0 0 / 0.7);
}

.quote {
  margin-top: var(--space-sm);
  font-size: var(--text-ui-s);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--color-ink-dim);
  text-shadow: 0 1px 10px oklch(0% 0 0 / 0.7);
}

/* ======= player ======= */
.player {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 4.5vh, 44px);
  transform: translateX(-50%);
  z-index: 5;
  width: min(540px, calc(100vw - 2 * var(--space-lg)));
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: oklch(0% 0 0 / 0.6);
  border: 1px solid var(--color-hairline);
  padding: var(--space-sm) var(--space-md);
  backdrop-filter: blur(14px);
}

.player-art {
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: var(--color-paper-2);
  flex: none;
}

.player-meta { flex: 1; min-width: 0; }

.player-title {
  font-size: var(--text-ui);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--color-ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.player-seek {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.player-time {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--color-ink-dim);
  flex: none;
  font-variant-numeric: tabular-nums;
}

.seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 2px;
  background:
    linear-gradient(var(--color-ink), var(--color-ink)) 0 / var(--fill, 0%) 100% no-repeat,
    oklch(100% 0 0 / 0.25);
  cursor: pointer;
}

.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  background: var(--color-ink);
  border: none;
  transition: transform var(--dur-fast) var(--ease-out);
}

.seek::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 0;
  background: var(--color-ink);
  border: none;
}

.seek:hover::-webkit-slider-thumb { transform: scale(1.3); }
.seek:focus-visible { outline: 1px solid var(--color-focus); outline-offset: 4px; }
.seek:disabled { opacity: 0.4; cursor: default; }

.player-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: none;
}

.ctrl {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-hairline);
  background: transparent;
  color: var(--color-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

.ctrl svg { width: 15px; height: 15px; fill: currentColor; }

.ctrl:hover { border-color: var(--color-ink); background: oklch(100% 0 0 / 0.08); }
.ctrl:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.ctrl:active { transform: scale(0.94); }
.ctrl:disabled { opacity: 0.3; cursor: default; }
.ctrl:disabled:hover { border-color: var(--color-hairline); background: transparent; }

.ctrl-play {
  width: 44px;
  height: 44px;
  background: var(--color-ink);
  color: oklch(0% 0 0);
  border: none;
}

.ctrl-play:hover { background: oklch(88% 0 0); }
.ctrl-play svg { width: 18px; height: 18px; }

.ic-pause, .ic-wait { display: none; }
.playing .ic-play { display: none; }
.playing .ic-pause { display: block; }
.loading .ic-play, .loading .ic-pause { display: none; }
.loading .ic-wait { display: block; animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.player.error .player-title { color: oklch(70% 0.16 25); }

/* hidden engine — kept in-DOM and sized so playback is allowed */
.yt-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 220px;
  height: 124px;
  opacity: 0.0001;
  pointer-events: none;
  z-index: 0;
}

/* ======= responsive ======= */
@media (max-width: 640px) {
  .chrome { padding: var(--space-md) var(--space-lg); }
  .player { gap: var(--space-sm); }
  .player-art { width: 42px; height: 42px; }
  .ctrl { width: 32px; height: 32px; }
  .ctrl-play { width: 40px; height: 40px; }
}

@media (max-width: 380px) {
  .player-time { display: none; }
}

/* ======= reduced motion ======= */
@media (prefers-reduced-motion: reduce) {
  .playing .live-dot { animation: none; }
  .loading .ic-wait { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
