:root {
  color-scheme: light;
  --ink: #1d252d;
  --muted: #68727d;
  --line: rgba(29, 37, 45, 0.12);
  --panel: rgba(255, 255, 255, 0.74);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --accent: #2e77b8;
  --accent-dark: #155887;
  --soft-blue: #dceaf4;
  --warm: #f7f4ee;
  --champagne: #efe7d9;
  --shadow: 0 22px 70px rgba(31, 41, 52, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(247, 244, 238, 0.64)),
    radial-gradient(circle at 14% 18%, rgba(220, 234, 244, 0.74), transparent 31%),
    radial-gradient(circle at 86% 82%, rgba(239, 231, 217, 0.82), transparent 34%),
    var(--warm);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background-image: url("./assets/manera-cover.png");
  background-position: 58% 48%;
  background-size: min(1320px, 132vw);
  background-repeat: no-repeat;
  opacity: 0.24;
  filter: blur(8px) saturate(0.9);
  transform: scale(1.04);
}

body::after {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(247, 244, 238, 0.64), rgba(255, 255, 255, 0.24), rgba(247, 244, 238, 0.62)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.14) 46%, rgba(239, 231, 217, 0.48));
}

button,
input {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.hero {
  position: relative;
  width: min(1120px, 100%);
  min-height: min(760px, calc(100vh - 64px));
  display: grid;
  align-content: center;
  gap: 28px;
  padding: clamp(24px, 4vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24)),
    linear-gradient(90deg, rgba(220, 234, 244, 0.28), rgba(239, 231, 217, 0.2));
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: auto;
  pointer-events: none;
}

.hero::before {
  width: 880px;
  height: 310px;
  left: -210px;
  bottom: -26px;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(255, 255, 255, 0.34), rgba(239, 231, 217, 0.42), transparent 84%),
    linear-gradient(180deg, transparent, rgba(46, 119, 184, 0.08), transparent);
  border-radius: 50%;
  transform: rotate(-8deg);
  filter: blur(5px);
  animation: drift 12s ease-in-out infinite alternate;
}

.hero::after {
  width: 620px;
  height: 620px;
  right: -260px;
  top: -220px;
  border: 1px solid rgba(198, 164, 102, 0.18);
  border-radius: 50%;
  animation: slowSpin 26s linear infinite;
}

.ambient {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.45;
}

.ambient-one {
  width: 260px;
  height: 260px;
  left: 7%;
  top: 10%;
  background: rgba(220, 234, 244, 0.9);
  animation: floatOne 12s ease-in-out infinite;
}

.ambient-two {
  width: 310px;
  height: 310px;
  right: 10%;
  bottom: 7%;
  background: rgba(239, 231, 217, 0.92);
  animation: floatTwo 14s ease-in-out infinite;
}

.wave-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.wave-field span {
  position: absolute;
  width: 150%;
  height: 1px;
  left: -25%;
  background: linear-gradient(90deg, transparent, rgba(21, 88, 135, 0.08), rgba(198, 164, 102, 0.09), transparent);
  transform: rotate(-12deg);
  animation: waveSlide 8s ease-in-out infinite;
}

.wave-field span:nth-child(1) {
  top: 28%;
}

.wave-field span:nth-child(2) {
  top: 50%;
  animation-delay: -2s;
}

.wave-field span:nth-child(3) {
  top: 72%;
  animation-delay: -4s;
}

.brand,
.player-card,
.info-grid {
  position: relative;
  z-index: 1;
}

.brand {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(3.4rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.subtitle {
  max-width: 520px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
}

.player-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(22px, 5vw, 46px);
  align-items: center;
  width: min(860px, 100%);
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 56px rgba(31, 41, 52, 0.12);
  backdrop-filter: blur(18px);
}

[hidden] {
  display: none !important;
}

.art-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.album-art,
.art-fallback {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(31, 41, 52, 0.22);
}

.album-art {
  object-fit: cover;
}

.art-fallback {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(239, 231, 217, 0.16)),
    url("./assets/manera-cover.png") center / cover no-repeat;
}

.art-fallback span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.pulse-ring {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(46, 119, 184, 0.25);
  border-radius: 12px;
  opacity: 0;
}

body.is-playing .pulse-ring {
  animation: pulse 2.8s ease-out infinite;
}

.player-main {
  min-width: 0;
}

.status-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38a169;
  box-shadow: 0 0 0 4px rgba(56, 161, 105, 0.13);
}

.label {
  margin: 24px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.artist {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.visualizer {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 44px;
  margin: 26px 0;
}

.visualizer i {
  display: block;
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), rgba(46, 119, 184, 0.32));
  transform-origin: bottom;
  animation: equalize 1.1s ease-in-out infinite;
  animation-play-state: paused;
}

body.is-playing .visualizer i {
  animation-play-state: running;
}

.visualizer i:nth-child(2) { animation-delay: -0.2s; }
.visualizer i:nth-child(3) { animation-delay: -0.45s; }
.visualizer i:nth-child(4) { animation-delay: -0.15s; }
.visualizer i:nth-child(5) { animation-delay: -0.65s; }
.visualizer i:nth-child(6) { animation-delay: -0.35s; }
.visualizer i:nth-child(7) { animation-delay: -0.5s; }
.visualizer i:nth-child(8) { animation-delay: -0.1s; }

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

.play-button {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  box-shadow: 0 16px 38px rgba(31, 41, 52, 0.22);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.play-button:hover {
  transform: translateY(-2px);
  background: var(--accent-dark);
}

.play-button:active {
  transform: translateY(0);
}

.play-button:focus-visible {
  outline: 3px solid rgba(46, 119, 184, 0.32);
  outline-offset: 4px;
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid currentColor;
}

body.is-playing .play-icon {
  width: 18px;
  height: 24px;
  margin-left: 0;
  border: 0;
  background:
    linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65% 100%);
}

.listen-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.listen-copy strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.listen-copy span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(860px, 100%);
}

.info-grid article {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(14px);
}

.info-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-grid strong {
  font-size: 1rem;
}

@keyframes floatOne {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(30px, 18px, 0); }
}

@keyframes floatTwo {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-24px, -20px, 0); }
}

@keyframes drift {
  from { transform: translateX(-20px) rotate(-9deg); }
  to { transform: translateX(70px) rotate(-7deg); }
}

@keyframes slowSpin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

@keyframes waveSlide {
  0%, 100% { transform: translateX(-4%) rotate(-12deg); opacity: 0.3; }
  50% { transform: translateX(4%) rotate(-12deg); opacity: 0.8; }
}

@keyframes pulse {
  0% { transform: scale(0.96); opacity: 0.7; }
  100% { transform: scale(1.12); opacity: 0; }
}

@keyframes equalize {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1.5); }
}

/* Wide, short viewports are common in TV browsers with visible browser chrome. */
@media (min-width: 900px) and (max-height: 900px) and (min-aspect-ratio: 16/10) {
  .shell {
    min-height: 0;
    height: 100vh;
    height: 100svh;
    padding: clamp(14px, 2.5vh, 24px) clamp(20px, 2.2vw, 40px);
  }

  .hero {
    width: min(1500px, 100%);
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.6fr);
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: stretch;
    align-items: center;
    column-gap: clamp(30px, 4vw, 72px);
    row-gap: clamp(12px, 2vh, 20px);
    padding: clamp(24px, 4vh, 42px) clamp(28px, 3.5vw, 58px);
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    max-width: 430px;
  }

  h1 {
    font-size: clamp(3.6rem, 5.3vw, 6.3rem);
  }

  .subtitle {
    max-width: 390px;
    margin-top: 16px;
    font-size: clamp(0.95rem, 1.3vw, 1.12rem);
  }

  .player-card {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-height: 100%;
    grid-template-columns: clamp(165px, 17vw, 220px) minmax(0, 1fr);
    gap: clamp(22px, 3vw, 42px);
    padding: clamp(20px, 3vh, 30px);
  }

  .label {
    margin-top: clamp(15px, 2.5vh, 22px);
  }

  h2 {
    font-size: clamp(1.7rem, 3vw, 2.8rem);
  }

  .visualizer {
    height: 34px;
    margin: clamp(14px, 2.5vh, 22px) 0;
  }

  .play-button {
    width: 62px;
    height: 62px;
  }

  .info-grid {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .info-grid article {
    padding: 13px 18px;
  }

  .info-grid span {
    margin-bottom: 5px;
  }
}

@media (min-width: 900px) and (max-height: 680px) and (min-aspect-ratio: 16/10) {
  .shell {
    padding: 10px 18px;
  }

  .hero {
    column-gap: 28px;
    row-gap: 10px;
    padding: 18px 26px;
  }

  .eyebrow {
    margin-bottom: 6px;
  }

  h1 {
    font-size: clamp(3.2rem, 5vw, 5.5rem);
  }

  .subtitle {
    margin-top: 10px;
    font-size: 0.94rem;
    line-height: 1.4;
  }

  .player-card {
    grid-template-columns: clamp(145px, 16vw, 180px) minmax(0, 1fr);
    gap: 20px;
    padding: 16px 20px;
  }

  .status-row {
    min-height: 26px;
    padding-block: 4px;
  }

  .label {
    margin: 11px 0 5px;
  }

  .artist {
    margin-top: 7px;
  }

  .visualizer {
    height: 24px;
    margin: 10px 0;
  }

  .play-button {
    width: 54px;
    height: 54px;
  }

  .info-grid article {
    padding: 9px 14px;
  }

  .info-grid span {
    margin-bottom: 3px;
    font-size: 0.7rem;
  }

  .info-grid strong {
    font-size: 0.92rem;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(160deg, rgba(255, 255, 255, 0.76), rgba(246, 242, 235, 0.76)),
      radial-gradient(circle at 20% 12%, rgba(220, 234, 244, 0.68), transparent 30%),
      radial-gradient(circle at 80% 90%, rgba(239, 231, 217, 0.9), transparent 34%),
      var(--warm);
  }

  body::before {
    background-position: 50% 22%;
    background-size: 820px;
    opacity: 0.2;
    filter: blur(9px) saturate(0.86);
  }

  .shell {
    min-height: 100dvh;
    padding: 0;
    place-items: stretch;
  }

  .hero {
    min-height: 100dvh;
    align-content: start;
    justify-items: center;
    gap: 18px;
    padding: max(18px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
    backdrop-filter: none;
  }

  .hero::before {
    width: 420px;
    height: 120px;
    left: -120px;
    bottom: 22%;
  }

  .hero::after {
    width: 320px;
    height: 320px;
    right: -170px;
    top: -120px;
  }

  .ambient-one {
    width: 190px;
    height: 190px;
    left: -40px;
    top: 40px;
  }

  .ambient-two {
    width: 210px;
    height: 210px;
    right: -64px;
    bottom: 120px;
  }

  .brand {
    width: min(420px, 100%);
    text-align: center;
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  h1 {
    font-size: clamp(2.45rem, 13vw, 3.7rem);
    line-height: 0.94;
  }

  .subtitle {
    max-width: 320px;
    margin: 12px auto 0;
    font-size: 0.95rem;
    line-height: 1.38;
  }

  .player-card {
    grid-template-columns: 1fr;
    width: min(420px, 100%);
    gap: 17px;
    padding: 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 18px 48px rgba(31, 41, 52, 0.12);
  }

  .art-wrap {
    width: min(142px, 45vw);
    justify-self: center;
  }

  .art-fallback span {
    font-size: 2.25rem;
  }

  .status-row {
    min-height: 28px;
    margin-inline: auto;
    font-size: 0.78rem;
  }

  .label {
    margin: 16px 0 7px;
    font-size: 0.7rem;
  }

  h2 {
    font-size: clamp(1.45rem, 7vw, 2.15rem);
    line-height: 1.08;
  }

  .artist {
    margin-top: 8px;
    font-size: 0.95rem;
  }

  .visualizer {
    justify-content: center;
    height: 30px;
    margin: 18px 0;
  }

  .controls {
    flex-direction: column;
    justify-content: center;
    gap: 16px;
  }

  .play-button {
    width: 78px;
    height: 78px;
  }

  .listen-copy {
    text-align: center;
  }

  .listen-copy span {
    font-size: 0.76rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
    width: min(420px, 100%);
    gap: 8px;
  }

  .info-grid article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    text-align: left;
  }

  .info-grid span {
    margin: 0;
    font-size: 0.68rem;
  }

  .info-grid strong {
    font-size: 0.9rem;
    text-align: right;
  }
}

@media (max-width: 380px) {
  .hero {
    gap: 14px;
    padding-inline: 12px;
  }

  .subtitle {
    display: none;
  }

  .player-card {
    padding: 15px;
  }

  .art-wrap {
    width: 118px;
  }

  .visualizer {
    margin: 14px 0;
  }
}

@media (max-height: 720px) and (max-width: 760px) {
  .hero {
    gap: 13px;
  }

  .eyebrow {
    margin-bottom: 5px;
  }

  h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .subtitle {
    display: none;
  }

  .player-card {
    gap: 13px;
  }

  .art-wrap {
    width: min(116px, 38vw);
  }

  .label {
    margin-top: 12px;
  }

  .visualizer {
    height: 24px;
    margin: 12px 0;
  }

  .play-button {
    width: 70px;
    height: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
