/* TuneGrab pages — landing, and search / My Pod. */

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color-scheme: dark;
  overflow-x: clip;
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

button:disabled,
.tab.is-disabled {
  cursor: not-allowed;
}

a { color: inherit; }

img { max-width: 100%; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px 14px;
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(7, 9, 11, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  line-height: 0;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand img {
  height: auto;
  width: min(420px, 62vw);
  display: block;
}

.actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.pill {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #3a4a52;
  background: #10171b;
  color: var(--tg-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--tg-font-ui);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pill svg { display: block; }

.pill:disabled { opacity: 1; }

.signin {
  background: #fff;
  color: #1a1a1a;
  border-color: #fff;
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 13px;
  font-weight: 600;
}

.pod-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1c2428;
  color: var(--tg-muted);
  font-size: 11px;
  letter-spacing: 0;
}

.pod-count.has {
  background: var(--tg-red);
  color: #fff;
}

body[data-page="landing"] {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(7, 9, 11, 0.45) 0%, rgba(7, 9, 11, 0.62) 38%, #07090b 76%),
    url("../hero/tunegrab-hero-head-front-1920x820.webp") center 18% / cover no-repeat,
    var(--tg-void);
}

.landing {
  min-height: calc(100vh - 69px);
  display: flex;
  flex-direction: column;
}

.landing-copy {
  width: min(860px, calc(100% - 40px));
  margin: auto;
  text-align: center;
  padding: 7vh 0 4vh;
}

.landing-copy .tg-display { margin: 0; }

.landing-copy .tg-sub { margin: 18px 0 0; }

.tabs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 28px;
  margin: 36px 0 18px;
  flex-wrap: wrap;
}

.app .tabs { justify-content: center; margin-top: 18px; }

.banner {
  position: relative;
  width: 100vw;
  height: auto;
  aspect-ratio: 2880 / 560;
  margin: 0 0 0 calc(50% - 50vw);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px 4%;
  background:
    linear-gradient(180deg, rgba(7, 9, 11, 0.05) 30%, rgba(7, 9, 11, 0.78) 100%),
    url("../banners/tunegrab-banner-head-front-desktop-2880x560.webp") center / cover no-repeat;
}
.banner-logo {
  position: absolute;
  top: 14px;
  left: 20px;
  line-height: 0;
  z-index: 1;
}
.banner-logo img {
  width: min(720px, calc(100vw - 360px), 44vw);
  height: auto;
  display: block;
}
body:has(#search-view:not([hidden])) .app { padding-top: 0; }
body:has(#search-view:not([hidden])) .top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  justify-content: flex-end;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}
body:has(#search-view:not([hidden])) .top .brand { display: none; }
.banner .tg-display {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}
.banner .tg-sub { margin: 10px 0 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }

.work {
  width: min(860px, 100%);
  margin: 0 auto;
}
.work.is-open {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.empty { text-align: center; }

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 0 8px;
  color: var(--tg-dim);
  font-family: var(--tg-font-ui);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.tab.is-on {
  color: var(--tg-text);
  border-bottom-color: var(--tg-red);
}

.tab.is-disabled { opacity: 0.4; }

.finder {
  display: flex;
  align-items: stretch;
  text-align: left;
  background: #10171b;
  border: 1px solid #243036;
  border-radius: 18px;
  overflow: hidden;
}

.finder label {
  flex: 1;
  min-width: 0;
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.finder label + label { border-left: 1px solid #243036; }

.finder span {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tg-dim);
}

.finder input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  font-family: var(--tg-font-ui);
  font-weight: 500;
  font-size: 16px;
}

.finder input::placeholder { color: #6d8086; }

.find {
  margin: 8px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--tg-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--tg-font-ui);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 0 22px rgba(255, 59, 47, 0.45);
  white-space: nowrap;
}

.find svg { display: block; }

.reassure,
.site-foot,
.fine {
  color: var(--tg-dim);
  font-size: 13px;
  line-height: 1.5;
}

.reassure { margin: 18px 0 0; }

body[data-page="landing"] .landing {
  flex: 1;
  min-height: 0;
}

.site-footer {
  margin-top: 2.4rem;
  padding: 1.35rem 1.25rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.site-footer .mark {
  height: 3.6rem;
  width: auto;
  margin: 0 auto 0.75rem;
  display: block;
}
.site-footer p {
  max-width: 38rem;
  margin: 0 auto;
  color: var(--tg-dim);
  font-size: 0.78rem;
  line-height: 1.55;
}
.site-footer p + p { margin-top: 0.45rem; }
.site-footer a { color: var(--tg-teal); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.app {
  width: min(1140px, calc(100% - 48px));
  margin: 0 auto;
  padding: 16px 0 72px;
}

.app-grid,
.pod-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #243036;
  background: #10171b;
  font-size: 13px;
}

.toast svg { color: var(--tg-teal); }

.toast a {
  color: var(--tg-red);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  text-decoration: none;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 8px;
  min-height: 28px;
}

.results-head p { margin: 0; color: var(--tg-muted); font-size: 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.filters button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--tg-dim);
  padding: 6px 10px;
  font-family: var(--tg-font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filters button[aria-pressed="true"] {
  color: var(--tg-teal);
  border-color: rgba(63, 208, 201, 0.45);
}

.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.genres button {
  background: #10171b;
  border: 1px solid #243036;
  color: var(--tg-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--tg-font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.genres button.is-on {
  border-color: var(--tg-red);
  color: var(--tg-red);
  box-shadow: 0 0 16px rgba(255, 59, 47, 0.25);
}

.track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px 52px 36px 36px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.track.is-on {
  background: #10171b;
  border-color: #2a3a42;
}

.track-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-family: var(--tg-font-ui);
}

.track-main img,
.pod-row img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.who { min-width: 0; }
.who strong,
.pod-name {
  display: block;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who span,
.meta-quiet {
  display: block;
  color: var(--tg-muted);
  font-size: 13px;
}
.who .compact { display: none; }

.lic, .dur {
  color: var(--tg-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dur { font-variant-numeric: tabular-nums; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #2a3840;
  background: transparent;
  color: var(--tg-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-btn svg { display: block; }

.icon-btn.is-playing {
  color: var(--tg-teal);
  border-color: var(--tg-teal);
}

.icon-btn.is-saved {
  background: var(--tg-red);
  border-color: transparent;
  color: #1a0706;
}

.icon-btn:disabled { opacity: 0.4; }

.empty {
  margin: 28px 0;
  color: var(--tg-muted);
  font-size: 15px;
}

.fine { margin: 14px 0 0; }

.inspector {
  position: sticky;
  top: 86px;
  background: #0c1216;
  border: 1px solid #1c282e;
  border-radius: 20px;
  padding: 16px 18px 22px;
}

.inspector-top { display: flex; justify-content: flex-end; }

.disc {
  width: 210px;
  height: 210px;
  margin: 6px auto 22px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 50% 50%, #140c10 0 28px, transparent 29px),
    repeating-radial-gradient(circle at 50% 50%, rgba(63, 208, 201, 0.55) 0 1px, rgba(12, 22, 26, 0.2) 2px 7px),
    radial-gradient(circle at 50% 45%, #3a1420, #071416 70%);
  box-shadow: 0 0 36px rgba(63, 208, 201, 0.18), inset 0 0 24px rgba(255, 59, 47, 0.28);
}

.disc span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 18px 0 18px 30px;
  border-color: transparent transparent transparent var(--tg-red);
  filter: drop-shadow(0 0 10px rgba(255, 59, 47, 0.8));
}

.inspector h2 {
  margin: 0;
  font-family: var(--tg-font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.01em;
}

.by { margin: 6px 0 0; color: var(--tg-muted); font-size: 14px; }

.wave-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.wave { display: flex; align-items: center; gap: 3px; height: 36px; flex: 1; }

.wave i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--tg-teal);
}

.wave-time {
  color: var(--tg-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.licence {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #243036;
  border-radius: 14px;
}

.licence p { margin: 0; }

.licence-k {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tg-muted);
  margin-bottom: 6px;
}

.licence .copy { color: var(--tg-text); font-size: 14px; line-height: 1.45; }

.inspector-actions { display: flex; align-items: center; gap: 10px; }

.pod-state {
  flex: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 59, 47, 0.75);
  background: transparent;
  color: var(--tg-red);
  padding: 13px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--tg-font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pod-state svg { display: block; }
.pod-state:disabled { opacity: 1; cursor: default; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tg-teal);
  font-family: var(--tg-font-ui);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.back svg { display: block; }

.pod-title {
  margin: 8px 0 6px;
  font-family: var(--tg-font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.pod-summary { margin: 0 0 16px; color: var(--tg-muted); }

.pod-list {
  border: 1px solid #243036;
  border-radius: 16px;
  background: #0c1216;
  overflow: hidden;
}

.pod-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 72px 52px minmax(120px, auto) 32px;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
}

.pod-row + .pod-row { border-top: 1px solid #1c282e; }

.pod-id { display: flex; gap: 12px; align-items: center; min-width: 0; }

.file-name {
  display: block;
  color: var(--tg-dim);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pod-status { color: var(--tg-teal); font-size: 13px; font-weight: 600; }

.side-card {
  border: 1px solid #243036;
  border-radius: 16px;
  background: #0c1216;
  padding: 16px;
  margin-bottom: 14px;
}

.side-k {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tg-dim);
  font-weight: 600;
}

.side-card .tg-btn { width: 100%; justify-content: center; margin-bottom: 10px; }

.side-card .tg-btn:disabled { opacity: 0.4; box-shadow: none; }

.credit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tg-muted);
  font-size: 13px;
}

.signin-note { margin: 0 0 14px; color: var(--tg-muted); font-size: 14px; line-height: 1.45; }

.pod-foot { margin: 12px 4px 0; }

:focus-visible {
  outline: 2px solid var(--tg-teal);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .top { padding: 12px 16px 14px; flex-wrap: wrap; row-gap: 8px; }
  .brand { flex: 1 0 100%; }
  .brand img { width: min(420px, 86vw); }
  .actions { width: 100%; justify-content: flex-end; }
  .pill.install { display: none; }
  .tabs { flex-wrap: nowrap; gap: 12px; overflow-x: auto; justify-content: flex-start; }
  .app .tabs { justify-content: center; }
  .landing .tabs { justify-content: flex-start; }
  .landing-copy .tg-display { font-size: 28px; letter-spacing: 0.06em; }
  .tab { flex-shrink: 0; font-size: 11px; letter-spacing: 0.1em; }
  .app { width: min(1140px, calc(100% - 28px)); }
  .app-grid, .pod-grid, .work.is-open { grid-template-columns: 1fr; }
  body:has(#search-view:not([hidden])) .top {
    top: 0;
    padding: 12px 12px;
    flex-wrap: nowrap;
  }
  body:has(#search-view:not([hidden])) .actions { width: auto; }
  .banner {
    aspect-ratio: 1600 / 840;
    padding: 0 16px 18px;
    background:
      linear-gradient(180deg, rgba(7, 9, 11, 0.28) 0%, rgba(7, 9, 11, 0.04) 34%, rgba(7, 9, 11, 0.84) 100%),
      url("../banners/tunegrab-banner-head-front-mobile-1600x840.webp") center / cover no-repeat;
  }
  .banner-logo { top: 12px; left: 14px; }
  .banner-logo img { width: min(520px, calc(100vw - 220px)); }
  .banner .tg-display { font-size: clamp(20px, 5.4vw, 28px); }
  .banner .tg-sub { margin-top: 4px; font-size: 12px; }
  .finder { flex-direction: column; }
  .finder label + label { border-left: 0; border-top: 1px solid #243036; }
  .find { margin: 8px; min-height: 46px; justify-content: center; }
  .results-head { flex-direction: column; align-items: flex-start; }
  .filters { justify-content: flex-start; }
  .track { grid-template-columns: minmax(0, 1fr) 36px 36px; }
  .lic, .dur { display: none; }
  .who .compact { display: block; }
  .who .meta-quiet { display: none; }
  .inspector { position: static; }
  .pod-row { grid-template-columns: minmax(0, 1fr) 32px; }
  .pod-row .lic, .pod-row .dur, .pod-status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
