/* gungunao — a record that never stops.
   Reference is a 1970s record sleeve, not a streaming app: heavy display type,
   amber on near-black, generous space, one moving thing at a time. */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,800&family=Outfit:wght@300;400;600&display=swap");

:root {
  --bg: #14100d;
  --ink: #f5ead7;
  --muted: #a2917b;
  --amber: #f0a93c;
  --amber-soft: rgba(240, 169, 60, 0.16);
  --edge: rgba(245, 234, 215, 0.12);
  --panel: rgba(255, 255, 255, 0.035);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
  font-weight: 300;
  display: flex;
  justify-content: center;
  padding: clamp(20px, 5vw, 56px) 18px 56px;
  -webkit-font-smoothing: antialiased;
}

.room {
  width: min(600px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vw, 32px);
}

/* ── masthead ── */

.masthead {
  text-align: center;
}

.wordmark {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--ink);
}

.dot {
  color: var(--amber);
}

.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 3.4vw, 1rem);
}

/* ── the record ──
   The hero is OUR record: CSS only, nothing borrowed, so a listener sees a
   turntable rather than a video. The actual player still lives on the page,
   small and visible, under the now-playing strip — that visibility is the
   condition of the embed licence the music plays under. */

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.disc {
  position: relative;
  width: min(330px, 74vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.05) 0px,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px,
      transparent 4px
    ),
    conic-gradient(
      from 0deg,
      #1a1512 0deg,
      #241d17 60deg,
      #14100d 120deg,
      #241d17 200deg,
      #14100d 280deg,
      #1a1512 360deg
    );
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.65),
    inset 0 0 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(245, 234, 215, 0.07);
  display: grid;
  place-items: center;
  animation: spin 14s linear infinite;
  animation-play-state: paused;
}

body.playing .disc {
  animation-play-state: running;
}

/* The paper label. Amber, printed, with the station in its own script. */
.disc-label {
  width: 42%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f5b44f, #d98f28 70%, #b9761d);
  display: grid;
  place-content: center;
  gap: 2px;
  text-align: center;
  color: #2a1a08;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.disc-word {
  font-family: Fraunces, Georgia, serif;
  font-weight: 800;
  font-size: clamp(0.75rem, 3vw, 0.95rem);
  letter-spacing: -0.02em;
}

.disc-lang {
  font-size: clamp(0.65rem, 2.6vw, 0.8rem);
  opacity: 0.8;
}

/* Spindle hole. */
.disc-label::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
}

/* The tonearm, resting in when paused and swung over when playing. */
.arm {
  position: absolute;
  top: 6%;
  right: -4%;
  width: 46%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(245, 234, 215, 0.55), rgba(245, 234, 215, 0.15));
  transform-origin: right center;
  transform: rotate(-32deg);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

body.playing .arm {
  transform: rotate(6deg);
}

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

@media (prefers-reduced-motion: reduce) {
  .disc {
    animation: none;
  }
}

/* ── the player, kept small ── */

/* Small, but shown whole. Cropping a 16:9 upload into a square used to slice
   the middle out of compilation artwork, which read as a broken thumbnail
   rather than a sleeve. Left at its own ratio it looks like a screen on the
   set. The player is fully on the page and unobscured — nothing is layered
   over it. */
.screen-frame {
  position: relative;
  width: min(200px, 52vw);
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  opacity: 0.72;
  border: 1px solid var(--edge);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

/* Self-hosted stations have no embed, so there is no frame to draw. The disc
   becomes the whole picture. This removes an empty box; it is not the player
   being concealed — on these stations YouTube is never contacted. */
body[data-engine="owned"] .screen-frame {
  display: none;
}

.screen-frame:hover {
  opacity: 1;
  transform: scale(1.04);
}

#player,
iframe#player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── now playing ── */

.marquee {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--edge);
  font-size: 0.98rem;
  min-height: 54px;
}

/* A live equaliser rather than a static dot: the one moving thing that says
   "playing" without needing another label. */
.marquee::before {
  content: "";
  flex: none;
  width: 18px;
  height: 16px;
  background:
    linear-gradient(var(--amber), var(--amber)) 0 100% / 3px 40% no-repeat,
    linear-gradient(var(--amber), var(--amber)) 7px 100% / 3px 70% no-repeat,
    linear-gradient(var(--amber), var(--amber)) 14px 100% / 3px 55% no-repeat;
  opacity: 0.5;
}

body.playing .marquee::before {
  animation: eq 1.1s ease-in-out infinite;
  opacity: 1;
}

@keyframes eq {
  0%,
  100% {
    background-size:
      3px 30%,
      3px 80%,
      3px 45%;
  }
  50% {
    background-size:
      3px 85%,
      3px 35%,
      3px 90%;
  }
}

/* ── controls ── */

.controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.1s ease;
}

.knob:hover {
  color: var(--ink);
  border-color: rgba(245, 234, 215, 0.3);
}

.knob:active {
  transform: scale(0.94);
}

.knob-main {
  width: 74px;
  height: 74px;
  font-size: 1.35rem;
  color: var(--bg);
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 10px 30px rgba(240, 169, 60, 0.28);
}

.knob-main:hover {
  filter: brightness(1.08);
}

/* ── station dial ── */

.dial {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  width: 100%;
}

.station {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 16px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1.25;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.station .native {
  font-size: 0.95rem;
}

.station .roman {
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  /* 0.65 put this 10px text at 3.3:1 against the page. --muted is already a
     secondary colour; it does not need dimming on top. */
  opacity: 0.85;
}

.station:hover {
  color: var(--ink);
  border-color: rgba(245, 234, 215, 0.28);
  background: rgba(255, 255, 255, 0.03);
}

.station.on {
  color: var(--amber);
  border-color: rgba(240, 169, 60, 0.55);
  background: var(--amber-soft);
}

/* Dashed rather than faded: at 0.42 the label fell to about 2:1, and opacity
   alone tells a screen reader nothing (the accessible name says it instead). */
.station.empty {
  border-style: dashed;
  opacity: 0.72;
}

/* ── extras ── */

.extras {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.sleep {
  display: flex;
  align-items: center;
  gap: 8px;
}

select {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: 9px;
  padding: 7px 9px;
  font: inherit;
  font-size: 0.85rem;
  /* The open dropdown is drawn by the OS, not by us. Without this it renders
     as the light-theme popup — pale background under our pale text, which is
     unreadable. This is the one property that reaches inside it. */
  color-scheme: dark;
}

/* Belt and braces for the browsers that still paint options from the page
   rather than from color-scheme. */
select option {
  background: #1c1713;
  color: var(--ink);
}

.link-btn {
  background: none;
  border: 0;
  color: var(--amber);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 0;
}

.empty-note {
  margin: 0;
  width: 100%;
  padding: 13px;
  border: 1px dashed var(--edge);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

code {
  color: var(--amber);
}

/* ── footer ── */

.footer {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.65;
  text-align: center;
  /* Was 0.75, which put 12px text at 4.05:1 — under AA. This footer carries the
     licensing notice, so it is the last thing that should be hard to read. */
  max-width: 46ch;
}

.footer a {
  color: var(--muted);
}

/* ── the front door ── */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 12, 10, 0.9);
  backdrop-filter: blur(10px);
  transition: opacity 0.45s ease;
  padding: 24px;
}

.curtain.gone {
  opacity: 0;
  pointer-events: none;
}

.curtain-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 52px;
  border-radius: 26px;
  border: 1px solid rgba(240, 169, 60, 0.4);
  background: linear-gradient(180deg, rgba(240, 169, 60, 0.1), rgba(20, 16, 13, 0.6));
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.curtain-btn:hover {
  transform: translateY(-3px);
  border-color: var(--amber);
  box-shadow: 0 20px 50px rgba(240, 169, 60, 0.16);
}

.curtain-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--bg);
  font-size: 1.6rem;
  padding-left: 5px;
}

.curtain-text {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.curtain-sub {
  font-size: 0.88rem;
  color: var(--muted);
}

@media (max-width: 400px) {
  .extras {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
  }
  .controls {
    gap: 14px;
  }
}

/* ── reactions ── */

.reactions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.react {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.1s ease;
}

.react:hover {
  color: var(--amber);
  border-color: rgba(240, 169, 60, 0.5);
}

.react:active {
  transform: scale(0.92);
}

/* Lifted out of the flow so the two buttons stay centred under the transport
   whether or not there is a note to show. */
/* Below the buttons rather than beside them. Sitting at left:100% the nowrap
   text ran off the right edge at 360px and gave the whole page a horizontal
   scrollbar — on the one interaction mobile users hit most. */
.react-note {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── suggestion box ── */

.suggest {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--panel);
}

.suggest input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 0;
  /* Only for pointer focus. Killing the ring outright left the field — and so
     the whole form — unusable by keyboard. */
  outline: none;
}

.suggest input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.suggest input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.suggest .link-btn {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--amber-soft);
}

/* ── share row ──
   Each network gets its own button: the native share sheet only exists on
   mobile, and on desktop a lone "Share" that copies silently reads as broken. */

.share-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.share-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.share-ico {
  flex: none;
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ── focus ──
   The page had no focus styles at all, and the UA default outline is nearly
   invisible against #14100d on transparent-backed buttons. Keyboard-only use
   was effectively impossible. */

:where(button, a, select, input):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ── touch ──
   Everything tappable clears 44px, the smallest target a thumb hits reliably.
   The share row and the sleep menu were around 30. */

.share-btn,
.link-btn {
  min-height: 44px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
}

select {
  min-height: 44px;
}

/* A hint of each network's colour on hover — enough to recognise, not enough
   to turn the footer into a sticker sheet. */
.share-btn.wa:hover {
  border-color: #25d366;
  color: #25d366;
}

.share-btn.fb:hover {
  border-color: #4c6ef5;
  color: #7b93ff;
}

.share-btn.x:hover {
  border-color: #f5ead7;
  color: #f5ead7;
}

.share-btn.tg:hover {
  border-color: #2aabee;
  color: #2aabee;
}

.share-btn.copy:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* ── ambience ──
   Things to watch while listening. All CSS: no images, no libraries, nothing
   to license, and it recolours per station for free. Every one of these stops
   under prefers-reduced-motion. */

/* Dust in the projector beam — slow, warm, barely there. */
.motes {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.mote {
  position: absolute;
  bottom: -12px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0;
  filter: blur(0.4px);
  animation: rise linear infinite;
}

body.playing .mote {
  animation-play-state: running;
}

.motes .mote {
  animation-play-state: paused;
}

@keyframes rise {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  12% {
    opacity: 0.5;
  }
  88% {
    opacity: 0.35;
  }
  100% {
    transform: translateY(-104vh) translateX(28px);
    opacity: 0;
  }
}

/* A slow warm pulse behind the record, timed like a breath rather than a beat
   — a strobing background is unbearable for an hour. */
.screen::before {
  content: "";
  position: absolute;
  width: min(420px, 88vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--amber-soft), transparent 62%);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

body.playing .screen::before {
  opacity: 1;
  animation: breathe 7s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.94);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.9;
  }
}

/* The sheen that crosses a record as it turns under a light. */
.disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    115deg,
    transparent 34%,
    rgba(255, 255, 255, 0.07) 46%,
    rgba(255, 255, 255, 0.13) 50%,
    rgba(255, 255, 255, 0.07) 54%,
    transparent 66%
  );
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .mote,
  body.playing .screen::before,
  /* The equaliser is the fastest thing on the page at 1.1s and was the one
     animation still running for people who asked for stillness. */
  body.playing .marquee::before,
  .disc {
    animation: none;
  }

  /* The tonearm swing and the player-tile zoom are transitions, not
     animations, so they escaped the rule above. */
  .arm,
  .screen-frame {
    transition: none;
  }
}
