/*
  Cortijo Guadiana — landing de vídeo por QR.
  Paleta cálida (limewash / terracota / hierro) en vez de un dark-mode
  genérico azul-sobre-negro: barro cocido, cal, hierro forjado.
  Sin fuentes externas: se usa la pila serif del sistema para que no
  haya peticiones adicionales (importante en cobertura móvil rural).
*/

:root {
  --ink: #1b140f;         /* hierro en sombra / fondo base */
  --iron: #4a3f35cc;      /* madera y hierro envejecido, semitransparente */
  --clay: #c1622e;        /* barro cocido — acento activo */
  --clay-dark: #9c4c22;
  --linen: #f3e7d3;       /* cal — texto sobre fondo oscuro */
  --gold: #c79a56;        /* latón apagado — filetes y foco */
  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--ink);
  overscroll-behavior: none;
}

body {
  font-family: var(--font-display);
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* Atardecer sobre el olivar: se ve mientras el vídeo carga, evita el flash blanco. */
  background: linear-gradient(180deg, #2b1c14 0%, #6b3a22 55%, #1b140f 100%);
}

.stage__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

/* Cartel con id inexistente o vídeo aún no subido: mensaje sobrio, sin enlaces ni acciones. */
.stage--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.empty {
  margin: 0;
  color: var(--linen);
  opacity: 0.85;
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-align: center;
}

/* Mensaje de bienvenida en la raíz del dominio: mismo tono que .empty pero más
   grande y con un respiro suave, para que se note como punto de entrada y no
   como un error. */
.empty--home {
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  line-height: 1.4;
  opacity: 1;
  animation: welcome-breathe 3.2s ease-in-out infinite;
}

@keyframes welcome-breathe {
  0%,
  100% {
    opacity: 0.82;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.045);
  }
}

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

/* Aviso de "toca para sonido" — misma familia visual que el selector de idioma. */
.hint {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--iron);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--linen);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  animation: hint-in 0.3s ease-out;
}

.hint__icon {
  font-size: 1.1rem;
}

@keyframes hint-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Selector de idioma: silueta de vano de cortijo — arco arriba, base recta. */
.langswitch {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--gold);
  border-radius: 28px 28px 14px 14px;
  background: var(--iron);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.langswitch__btn {
  appearance: none;
  border: none;
  min-width: 56px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px 22px 10px 10px;
  background: transparent;
  color: var(--linen);
  opacity: 0.65;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: background-color 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.langswitch__btn[aria-pressed="true"] {
  background: var(--clay);
  color: var(--linen);
  opacity: 1;
}

.langswitch__btn:active {
  background: var(--clay-dark);
}

.langswitch__btn:focus-visible,
.hint:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

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