/* nomad.radio archive — white globe canvas */
@font-face { font-family: "Archivo Black"; src: url("../fonts/archivo-black.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; font-weight: 400; src: url("../fonts/archivo-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; font-weight: 600; src: url("../fonts/archivo-600.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Plex Mono"; font-weight: 400; src: url("../fonts/plexmono-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Plex Mono"; font-weight: 500; src: url("../fonts/plexmono-500.woff2") format("woff2"); font-display: swap; }

:root {
  --ink: #000000;
  --dim: #000000;
  --paper: #ffffff;
  --signal: #ff4d00;
  --line: #e8e4da;
  --display: "Archivo Black", sans-serif;
  --body: "Archivo", sans-serif;
  --mono: "Plex Mono", monospace;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: #ffffff;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.mono { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; }
.dim { color: var(--dim); }

/* ============ masthead (bare floating line) ============ */
.masthead {
  position: fixed; inset: 0 0 auto 0; z-index: 75;
  display: flex; justify-content: flex-end;
  padding: 20px 26px; pointer-events: none;
}
.onair { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--dim); }

/* ============ focus veil (blur the globe, keep it visible) ============ */
#veil {
  position: absolute; inset: 0; z-index: 3000; pointer-events: none;
  backdrop-filter: blur(0px) saturate(1);
  -webkit-backdrop-filter: blur(0px) saturate(1);
  background: rgba(255, 255, 255, 0);
  transition: backdrop-filter 0.9s cubic-bezier(0.4, 0, 0.2, 1), background 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
#veil.on {
  backdrop-filter: blur(11px) saturate(1.35);
  -webkit-backdrop-filter: blur(11px) saturate(1.35);
  background: rgba(255, 255, 255, 0.30);
}

/* ============ liquid-glass artist card ============ */
#focusCard {
  /* lives inside #world so it can sit ABOVE the veil but BEHIND the focal
     tile — it slides out from underneath the image (transform-only) */
  position: absolute; z-index: 4000;
  display: flex; flex-direction: column;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.30) 100%);
  backdrop-filter: blur(20px) saturate(1.8) brightness(1.04);
  -webkit-backdrop-filter: blur(20px) saturate(1.8) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--tile-r, 28px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(255, 255, 255, 0.35),
    0 24px 70px rgba(19, 18, 17, 0.16),
    0 6px 18px rgba(19, 18, 17, 0.08);
  padding: clamp(24px, 3vw, 52px);
  overflow: auto;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
#focusCard::before {
  /* specular top-edge highlight — the "wet glass" line */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 42%;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.42), transparent);
  pointer-events: none;
}
#focusCard > * {
  position: relative;
  /* content fades in during the second half of the card's growth */
  opacity: clamp(0, calc((var(--k, 1) - 0.5) * 2.2), 1);
}
#focusCard.on { pointer-events: auto; }
.fc-name {
  font-family: var(--display); font-size: clamp(1.8rem, 3.4vw, 3.6rem);
  line-height: 0.95; text-transform: uppercase; letter-spacing: -0.01em;
  margin: 14px 0 18px;
}
.fc-bio { color: #4c483f; max-width: 52ch; font-size: clamp(0.9rem, 1.05vw, 1.05rem); }
.fc-meta { margin-top: auto; padding-top: 24px; }

/* ============ the globe ============ */
#world {
  position: fixed; inset: 0;
  overflow: hidden;
  perspective: 900px; /* closer camera = stronger fisheye magnification at centre */
  perspective-origin: 50% 50%;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#world.dragging { cursor: grabbing; }
#world.focused { touch-action: pan-y; } /* let the episode band scroll on touch */
.wtile {
  position: absolute; top: 0; left: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
  contain: layout style; /* no paint containment — hover growth must escape the box */
}
.wtile-art {
  width: 100%; height: 100%;
  overflow: hidden; background: #f1eee6;
  border-radius: var(--tile-r, 28px); /* same absolute rounding at every tile size */
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.35s ease;
}
/* hover: uniform scale from centre + deepening shadow = "toward the screen",
   on the inner art so it composes cleanly with the sphere transform */
.wtile:not(.special):not(.focal):hover .wtile-art {
  transform: scale(1.075);
  box-shadow: 0 14px 36px rgba(19, 18, 17, 0.20), 0 3px 10px rgba(19, 18, 17, 0.10);
}
.wtile-art img {
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none; -webkit-user-drag: none;
  filter: saturate(0.96);
}
.wtile.special { pointer-events: none; }
.wtile.intro { display: flex; align-items: center; justify-content: center; }
.intro-text {
  font-family: var(--mono); font-size: clamp(0.68rem, 0.95vw, 0.85rem);
  letter-spacing: 0.14em; line-height: 2; color: #000;
  text-align: center;
  padding: clamp(16px, 2.2vw, 40px);
}
.intro-credit { display: inline-block; margin-top: 14px; }
.intro-text a { pointer-events: auto; color: #000; text-decoration: none; }
.intro-text a:hover { color: var(--signal); }
.wtile.focal .wtile-art {
  box-shadow: 0 30px 90px rgba(19, 18, 17, 0.28), 0 8px 24px rgba(19, 18, 17, 0.14);
  transition: box-shadow 0.4s ease;
}
.wtile .noart {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 1.6rem; color: #d9d4c6;
  background: #f4f1ea; border: 1px solid var(--line);
}

/* CRT edge: one compositor layer doing diffusion + chromatic fringe at the
   screen borders, instead of per-tile filters (which murder the frame rate) */
#crt { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
/* blur only the edge strips (~40% of pixels) instead of a full-screen
   backdrop-filter — the centre never pays for the blur */
.crt-s { position: absolute; }
.crt-s.l { left: 0; top: 0; bottom: 0; width: 12%; }
.crt-s.r { right: 0; top: 0; bottom: 0; width: 12%; }
.crt-s.t { top: 0; left: 0; right: 0; height: 15%; }
.crt-s.b { bottom: 0; left: 0; right: 0; height: 15%; }
.crt-s { backdrop-filter: blur(5px) saturate(1.25); -webkit-backdrop-filter: blur(5px) saturate(1.25); }
.crt-s.l { mask-image: linear-gradient(to right, black 30%, transparent); -webkit-mask-image: linear-gradient(to right, black 30%, transparent); }
.crt-s.r { mask-image: linear-gradient(to left, black 30%, transparent); -webkit-mask-image: linear-gradient(to left, black 30%, transparent); }
.crt-s.t { mask-image: linear-gradient(to bottom, black 30%, transparent); -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent); }
.crt-s.b { mask-image: linear-gradient(to top, black 30%, transparent); -webkit-mask-image: linear-gradient(to top, black 30%, transparent); }
@media (prefers-reduced-motion: reduce) { #crt { display: none; } }

/* ============ floating glass name bubble ============ */
.tip {
  position: fixed; left: 0; top: 0; z-index: 85;
  pointer-events: none;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.42) 100%);
  backdrop-filter: blur(14px) saturate(1.7);
  -webkit-backdrop-filter: blur(14px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 8px 24px rgba(19, 18, 17, 0.16);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em;
  white-space: nowrap; color: var(--ink);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.45s ease, width 0.3s cubic-bezier(0.3, 1.15, 0.45, 1);
  will-change: transform;
}
.tip.on { opacity: 1; }
.tip-label { display: inline-block; white-space: nowrap; }

.hint {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 40; pointer-events: none;
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.16em;
  color: var(--dim);
  transition: opacity 0.8s ease;
}
.hint.gone { opacity: 0; }

/* ============ zoom clone ============ */
.zoom-clone {
  position: fixed; z-index: 90; object-fit: cover;
  border-radius: 20px; overflow: hidden;
  pointer-events: none;
}
.zoom-clone.noart {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); color: #d9d4c6; background: #f4f1ea;
}

/* ============ panel (expanded artist / episode) ============ */
#panel {
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper);
  overflow-y: auto;
  padding: 0 clamp(20px, 5vw, 72px) 140px;
}
#panel[hidden] { display: none; }
#panel { transition: background-color 0.45s ease 0.15s; }
#panel.entering { background-color: transparent; pointer-events: none; }
#panel.entering .pwrap { opacity: 0; }
.pwrap { transition: opacity 0.45s ease 0.25s; }

.panel-close {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em;
  color: var(--dim); padding: 26px 0 18px;
  display: inline-block;
}
.panel-close:hover { color: var(--signal); }

.ph { display: grid; grid-template-columns: minmax(220px, 380px) 1fr; gap: clamp(24px, 4vw, 56px); align-items: end; margin-bottom: 44px; }
.ph-art { aspect-ratio: 1; overflow: hidden; border-radius: 2px; background: #f1eee6; }
.ph-art img { width: 100%; height: 100%; object-fit: cover; }
.ph-art .noart { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 4rem; color: #d9d4c6; }
.ph-meta h1 {
  font-family: var(--display); font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 0.95; letter-spacing: -0.01em; text-transform: uppercase;
  margin: 10px 0 16px;
}
.res-bio { max-width: 56ch; color: #4c483f; }

.pgrid {
  display: grid; gap: 22px 18px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.ptile { text-decoration: none; display: block; }
.ptile-art { aspect-ratio: 1; overflow: hidden; border-radius: 2px; background: #f1eee6; }
.ptile-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.ptile:hover .ptile-art img { transform: scale(1.045); }
.ptile:hover .ptile-name { color: var(--signal); }
.ptile-art .noart { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em; color: #c9c4b5; }
.ptile-name { display: block; margin-top: 8px; font-weight: 600; font-size: 0.82rem; line-height: 1.3; }
.ptile-date { display: block; margin-top: 2px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; color: var(--dim); }

/* episode detail */
.ep { display: grid; grid-template-columns: minmax(240px, 460px) 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.ep-art-wrap { aspect-ratio: 1; overflow: hidden; border-radius: 2px; background: #f1eee6; }
.ep-art-wrap img { width: 100%; height: 100%; object-fit: cover; }
.ep-stamp { color: var(--dim); }
.pick { color: var(--signal); }
.ep-title { font-family: var(--display); font-size: clamp(1.6rem, 4vw, 3.1rem); line-height: 1; text-transform: uppercase; margin: 12px 0 10px; }
.ep-show { color: var(--dim); margin-bottom: 4px; }
.ep-res a { color: var(--ink); text-decoration-color: var(--signal); }
.ep-res a:hover { color: var(--signal); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag {
  padding: 4px 10px; border: 1px solid var(--tagc, var(--signal));
  color: var(--tagc, var(--signal)); border-radius: 99px;
  font-size: 0.62rem; text-transform: uppercase;
}
.bigplay {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--paper);
  padding: 14px 26px; border-radius: 99px;
  letter-spacing: 0.14em; font-size: 0.7rem;
  margin: 14px 0;
}
.bigplay:hover { background: var(--signal); }
.ep-links { display: flex; gap: 18px; margin-top: 10px; }
.ep-links a { color: var(--dim); text-decoration: none; }
.ep-links a:hover { color: var(--signal); }

.tracklist { margin-top: 48px; max-width: 860px; }
.section-label { color: var(--dim); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 6px; }
.tl { list-style: none; padding: 0; }
.tl li { display: flex; gap: 16px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.tl-time { color: var(--dim); min-width: 52px; }
.tl-track { flex: 1; }
.tl-label { color: var(--dim); }
.tl-sp { color: var(--dim); text-decoration: none; }
.tl-sp:hover { color: var(--signal); }

/* ============ episode cards under the resident card ============ */
#epsScroll {
  position: absolute; inset: 0; z-index: 3500; /* above veil, below the card */
  overflow-y: auto;
  opacity: 0; pointer-events: none;
}
.fep-wrap {
  margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-bottom: 160px;
}
@media (max-width: 900px) { .fep-wrap { grid-template-columns: 1fr; } }
.fep {
  display: flex; align-items: center; gap: 16px;
  text-align: left; padding: 16px 18px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.60) 0%, rgba(255, 255, 255, 0.32) 100%);
  backdrop-filter: blur(16px) saturate(1.7);
  -webkit-backdrop-filter: blur(16px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 10px 30px rgba(19, 18, 17, 0.10);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.fep:hover { transform: translateY(-2px); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 16px 40px rgba(19, 18, 17, 0.16); }
.fep.noaudio { opacity: 0.55; cursor: default; }
.fep.noaudio:hover { transform: none; }
.fep-art { width: 86px; height: 86px; border-radius: 20px; overflow: hidden; flex: none; background: #eee; }
.fep-art img, .fep-art .art { width: 100%; height: 100%; object-fit: cover; }
.fep-art .noart { width: 100%; height: 100%; }
.fep-meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fep-title {
  font-weight: 600; font-size: 0.92rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fep-sub { font-size: 0.62rem; letter-spacing: 0.1em; color: #444; }

/* ============ floating glass player (drops from the top) ============ */
.player {
  position: fixed; top: 16px; left: 50%; z-index: 80;
  width: min(680px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.68) 0%, rgba(255, 255, 255, 0.40) 100%);
  backdrop-filter: blur(22px) saturate(1.8);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 18px 50px rgba(19, 18, 17, 0.18);
  color: var(--ink);
  transform: translate(-50%, -140%);
  transition: transform 0.65s cubic-bezier(0.32, 1.2, 0.45, 1);
}
.player.up { transform: translate(-50%, 0); }
.pl-art { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; flex: none; }
.pl-btn {
  color: #fff; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.pl-btn:hover { background: var(--signal); }
.pl-meta { flex: 1; min-width: 0; }
.pl-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 0.82rem; }
.pl-timerow { display: flex; align-items: center; gap: 10px; font-size: 0.6rem; color: #444; margin-top: 4px; }
.pl-timerow input[type="range"] { flex: 1; accent-color: var(--signal); height: 3px; }
.pl-eplink { color: #444; text-decoration: none; flex: none; }
.pl-eplink:hover { color: var(--signal); }

/* ============ responsive / motion ============ */
@media (max-width: 720px) {
  .ph, .ep { grid-template-columns: 1fr; align-items: start; }
  .ph-art { max-width: 300px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .crt-s { display: none; } /* edge blur strips fight the veil on small screens */
}

/* liquid glass refraction (Chromium only — html.lg set by JS) */
html.lg #focusCard {
  backdrop-filter: url(#lgCard) blur(14px) saturate(1.8) brightness(1.04);
  -webkit-backdrop-filter: url(#lgCard) blur(14px) saturate(1.8) brightness(1.04);
}
html.lg .player {
  backdrop-filter: url(#lgPlayer) blur(16px) saturate(1.8);
  -webkit-backdrop-filter: url(#lgPlayer) blur(16px) saturate(1.8);
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
