@font-face {
  font-family: "Feguropic";
  src: url("../fonts/Feguropic.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* =========================================
   1. Base: viewport completo, sin scroll
   ========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  color: #fff;
  background: #111;

  --cycle: 24s;
  --accent: #a7f3d0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.landing {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100vh;
  /* Ajusta la altura cuando aparecen las barras del navegador móvil. */
  height: 100dvh;
  overflow: hidden;
  background: #111;
}

/* =========================================
   2. Carrusel: solo se animan los slides
   ========================================= */

.carousel,
.slide,
.overlay,
.interface {
  --interface-padding: clamp(1rem, 4vw, 3rem);
  position: absolute;
  inset: 0;
}

.carousel {
  z-index: 0;
  pointer-events: none;
}

.slide {
  margin: 0;
  opacity: 0;
  animation: slide-fade var(--cycle) linear infinite;
}

/*
  Cuatro slides en orden 1 → 2 → 3 → 4 → 1.
  Ciclo total: 24 s; nuevo slide cada 6 s; fade de 1,5 s.

  Tiempo local de cada slide:
    0–1,5 s: entrada (0–6,25 %).
    1,5–6 s: visible (6,25–25 %).
    6–7,5 s: salida (25–31,25 %).
    7,5–24 s: invisible (31,25–100 %).

  Retrasos separados por 6 s. El primero empieza en -1,5 s
  para estar visible desde el inicio.
  Transiciones globales:
    4,5–6 s: 1 → 2; 10,5–12 s: 2 → 3;
    16,5–18 s: 3 → 4; 22,5–24 s: 4 → 1.
  Solo se anima la opacidad; la interfaz permanece estática.
*/

.slide:nth-child(1) {
  animation-delay: -1.5s;
}

.slide:nth-child(2) {
  animation-delay: 4.5s;
}

.slide:nth-child(3) {
  animation-delay: 10.5s;
}

.slide:nth-child(4) {
  animation-delay: 16.5s;
}

@keyframes slide-fade {
  0% {
    opacity: 0;
    animation-timing-function: ease-in-out;
  }

  6.25% {
    opacity: 1;
  }

  25% {
    opacity: 1;
    animation-timing-function: ease-in-out;
  }

  31.25%,
  100% {
    opacity: 0;
  }
}

.slide picture,
.slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.slide img {
  object-fit: cover;
  object-position: center;
}

/* =========================================
   3. Overlay independiente y estático
   ========================================= */

.overlay {
  z-index: 1;
  background: rgb(0 0 0 / 50%);
  pointer-events: none;
}

/* =========================================
   4. Interfaz estática sobre el fondo
   ========================================= */

.interface {
  z-index: 2;
  display: grid;
  place-items: center;
  padding: max(var(--interface-padding), env(safe-area-inset-top))
    max(var(--interface-padding), env(safe-area-inset-right))
    max(var(--interface-padding), env(safe-area-inset-bottom))
    max(var(--interface-padding), env(safe-area-inset-left));
  align-items: end;
}

.content {
  width: min(100%, 40rem);
  text-align: center;
}

.eyebrow {
  font-family: "Feguropic", system-ui, sans-serif;
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 5rem);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.description {
  max-width: 34rem;
  margin: 1.25rem auto 0;
  color: #e3e5e8;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.player {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 1.5rem;
  background: rgb(12 18 24 / 90%);
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 25%);
  text-align: left;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.station-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.station-description {
  margin: 0.35rem 0 0;
  color: #bdc6cf;
  font-size: 0.875rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(167 243 208 / 30%);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Indicador estático: sin animación. */
.live-badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

audio {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

audio:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
  border-radius: 0.5rem;
}

.player-note {
  margin: 0.85rem 0 0;
  color: #bdc6cf;
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Ajustes para pantallas de poca altura. */
@media (max-height: 540px) {
  .interface {
    --interface-padding: 0.75rem;
  }

  .eyebrow {
    margin-bottom: 0.5rem;
  }

  h1 {
    font-size: clamp(1.75rem, 6vh, 2.5rem);
  }

  .description {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .player {
    margin-top: 0.75rem;
    padding: 0.875rem;
  }

  .player-header {
    margin-bottom: 0.75rem;
  }

  .player-note {
    margin-top: 0.5rem;
  }
}

/* Accesibilidad: respeta la preferencia de reducir movimiento. */
@media (prefers-reduced-motion: reduce) {
  .slide {
    animation: none;
    opacity: 0;
  }

  .slide:first-child {
    opacity: 1;
  }
}
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-width: 0;
}

.player-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1c2b59;
  cursor: pointer;
}

.play-button {
  width: 4.5rem;
  height: 4.5rem;
  border: 4px solid currentColor;
  border-radius: 50%;
}

.mute-button { width: 2.75rem; height: 2.75rem; }
.player-button svg { width: 2rem; height: 2rem; fill: currentColor; }
.player-button:hover { color: #8d1721; }
.player-button:focus-visible, .volume:focus-visible { outline: 3px solid #8d1721; outline-offset: 5px; }
.volume { width: clamp(5rem, 12vw, 14rem); min-width: 0; height: 2.75rem; margin: 0; accent-color: #1c2b59; cursor: pointer; }
.player-status { margin: 0.75rem 0 0; color: #fff; font-size: 0.875rem; line-height: 1.4; }
.player-status:empty { display: none; }
[hidden] { display: none !important; }


/* Controles adaptados dentro de la tarjeta de la primera versión. */
.player-controls {
  padding: 0.75rem;
  gap: clamp(0.5rem, 3vw, 1.25rem);
  border-radius: 0.75rem;
  background: #fff;
  color-scheme: light;
}
.station-logo {
  display: block;
  flex-shrink: 0;
  margin-right: auto;
  width: 7rem;
  height: auto;
  padding: 0.25rem;
  border-radius: 0.375rem;
  background: #fff;
}
.volume { flex: 1; max-width: 14rem; }
.play-button { width: 3.5rem; height: 3.5rem; border-width: 3px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 380px), (max-height: 540px) {
  .station-logo { width: 5rem; }
  .station-name { font-size: 1rem; }
  .station-description { font-size: 0.75rem; }
  .live-badge { padding: 0.375rem; font-size: 0.625rem; }
}
.player-header > div { flex: 1; min-width: 0; }
.now-playing { overflow-wrap: anywhere; line-height: 1.5; }

/* Redes ancladas a la interfaz; no alteran la posición inferior del contenido. */
.social-links {
  position: absolute;
  top: max(clamp(1rem, 4vw, 3rem), env(safe-area-inset-top));
  right: max(clamp(1rem, 4vw, 3rem), env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.social-link {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  color: #fff;
  background: rgb(0 0 0 / 35%);
  text-decoration: none;
}
.social-link svg { display: block; width: 1.75rem; height: 1.75rem; }
.social-link[href]:hover { background: rgb(0 0 0 / 60%); }
.social-link:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
