/* Santa — videollamada al Polo Norte. Dirección: carta navideña antigua sobre el taller a la luz del fuego. */
@font-face {
  font-family: "Titulo";
  src: local("Hoefler Text"), local("Baskerville"), local("Palatino"), local("Georgia");
}

:root {
  --noche: #140b09;
  --madera: #2a1712;
  --brasa: #e2572b;
  --terciopelo: #a3161c;
  --terciopelo-hondo: #6d0d13;
  --oro: #e9c46a;
  --papel: #f6ecd7;
  --tinta: #33211a;
  --nieve: #fff8ec;
  --pino: #1f4d3a;

  --fuente-titulo: "Titulo", "Hoefler Text", Baskerville, Palatino, Georgia, serif;
  --fuente-texto: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;

  --texto-xl: clamp(2.2rem, 1.2rem + 4.5vw, 4.6rem);
  --texto-l: clamp(1.25rem, 1rem + 1.4vw, 1.9rem);
  --texto-m: clamp(1rem, 0.94rem + 0.4vw, 1.2rem);
  --texto-s: 0.82rem;

  --rapido: 160ms;
  --normal: 420ms;
  --salida: cubic-bezier(0.16, 1, 0.3, 1);
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  --seguro-arriba: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--noche);
  color: var(--nieve);
  font-family: var(--fuente-texto);
  font-size: var(--texto-m);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }

.sello {
  font-size: var(--texto-s);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--oro);
}
h1, h2 { font-family: var(--fuente-titulo); font-weight: 600; line-height: 1.02; letter-spacing: -0.01em; }
h1 { font-size: var(--texto-xl); text-wrap: balance; }

/* ── Escena: Santa a pantalla completa ── */
.escena { position: fixed; inset: 0; background: var(--noche); }
.capa {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 28%;
  opacity: 0; transition: opacity var(--normal) ease;
}
.capa.visible { opacity: 1; }
.vineta {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgb(20 11 9 / 0.72) 0%, transparent 20%, transparent 52%, rgb(20 11 9 / 0.94) 100%),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgb(20 11 9 / 0.6) 100%);
}
.llamada[data-estado="habla"] .vineta { box-shadow: inset 0 0 0 4px rgb(233 196 106 / 0.55), inset 0 0 90px rgb(226 87 43 / 0.35); transition: box-shadow var(--normal) ease; }
.llamada[data-estado="escucha"] .vineta { box-shadow: inset 0 0 0 4px rgb(163 22 28 / 0.85); }

/* ── Barra superior ── */
.barra {
  position: fixed; inset: 0 0 auto 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: calc(var(--seguro-arriba) + 1rem) clamp(1rem, 3vw, 2rem) 1rem;
}
.estado {
  font-size: var(--texto-s); letter-spacing: 0.16em; text-transform: uppercase;
  padding-left: 1.4em; position: relative;
}
.estado::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 0.62em; height: 0.62em; margin-top: -0.31em;
  border-radius: 50%; background: #6ee7a0; box-shadow: 0 0 0 0 rgb(110 231 160 / 0.6);
  animation: latido 2.4s ease-out infinite;
}
.barra-acciones { display: flex; gap: 0.6rem; }
.pastilla {
  padding: 0.6em 1.15em; border-radius: 999px;
  background: rgb(246 236 215 / 0.12); border: 1px solid rgb(246 236 215 / 0.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: var(--texto-s); letter-spacing: 0.08em; text-transform: uppercase;
  transition: background var(--rapido) ease, transform var(--rapido) ease;
}
.pastilla:hover { background: rgb(246 236 215 / 0.22); }
.pastilla:active { transform: scale(0.96); }

/* ── Pantalla de inicio ── */
.inicio {
  position: fixed; inset: 0; z-index: 2;
  display: grid; align-content: end; justify-items: start; gap: 1.1rem;
  padding: 0 clamp(1.25rem, 6vw, 5rem) calc(var(--seguro-abajo) + clamp(2rem, 8vh, 5rem));
}
.inicio h1 { max-width: 11ch; text-shadow: 0 2px 30px rgb(0 0 0 / 0.6); }
.llamar {
  margin-top: 0.6rem; padding: 0.95em 2.1em; border-radius: 999px;
  background: linear-gradient(180deg, var(--terciopelo), var(--terciopelo-hondo));
  box-shadow: 0 0 0 2px var(--oro), 0 18px 40px rgb(109 13 19 / 0.55);
  font-family: var(--fuente-titulo); font-size: var(--texto-l); color: var(--nieve);
  transition: transform var(--rapido) var(--salida), box-shadow var(--rapido) ease;
}
.llamar:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--oro), 0 24px 50px rgb(109 13 19 / 0.7); }
.llamar:active { transform: scale(0.97); }
.nota { font-size: var(--texto-s); opacity: 0.75; }

/* ── Controles de la llamada ── */
.controles {
  position: fixed; inset: auto 0 0 0; z-index: 2;
  display: grid; gap: 1.1rem; justify-items: center;
  padding: 0 clamp(1rem, 4vw, 3rem) calc(var(--seguro-abajo) + 1.4rem);
}
.subtitulo {
  max-width: 34ch; min-height: 2.6em; text-align: center; text-wrap: balance;
  font-family: var(--fuente-titulo); font-size: var(--texto-l); line-height: 1.22;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.85);
}
.fila { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.2rem; width: min(100%, 44rem); }
.fila > :first-child { justify-self: end; }
.colgar-form { justify-self: start; }
.secundario {
  padding: 0.7em 1.2em; border-radius: 999px; background: rgb(20 11 9 / 0.55);
  border: 1px solid rgb(246 236 215 / 0.3); font-size: var(--texto-s);
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: background var(--rapido) ease;
}
.secundario:hover { background: rgb(20 11 9 / 0.8); }
.micro {
  display: grid; justify-items: center; gap: 0.55rem; background: none; padding: 0;
}
.micro-icono {
  width: clamp(5.2rem, 12vw, 7rem); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--nieve) 0 17%, transparent 18%),
    linear-gradient(180deg, var(--terciopelo), var(--terciopelo-hondo));
  box-shadow: 0 0 0 3px var(--oro), 0 14px 34px rgb(0 0 0 / 0.55);
  transition: transform var(--rapido) var(--salida), filter var(--rapido) ease;
}
.micro:hover .micro-icono { transform: scale(1.04); }
.micro:active .micro-icono { transform: scale(0.94); }
.micro[aria-pressed="true"] .micro-icono {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 100%),
    linear-gradient(180deg, #ff5a4f, var(--terciopelo));
  animation: onda 1.3s ease-out infinite;
}
.micro[aria-pressed="true"] .micro-icono::after {
  content: ""; display: block; width: 30%; aspect-ratio: 1; margin: 35%; border-radius: 18%; background: var(--nieve);
}
.micro:disabled { cursor: default; }
.micro:disabled .micro-icono { filter: saturate(0.35) brightness(0.7); }
.micro-texto { font-size: var(--texto-s); letter-spacing: 0.14em; text-transform: uppercase; }
.llamada[data-estado="piensa"] .micro-icono { animation: respira 1.4s ease-in-out infinite; }

.teclado { display: flex; gap: 0.6rem; width: min(100%, 36rem); }
.teclado input {
  flex: 1; padding: 0.85em 1.1em; border-radius: 999px; border: 1px solid rgb(246 236 215 / 0.35);
  background: rgb(20 11 9 / 0.7); color: var(--nieve);
}
.teclado button { padding: 0.85em 1.4em; border-radius: 999px; background: var(--oro); color: var(--tinta); font-weight: 600; }

/* ── Mi lista: hoja de papel ── */
.lista, .mensaje {
  position: fixed; inset: 0; z-index: 5; display: grid; place-items: center;
  padding: 1.25rem; background: rgb(20 11 9 / 0.78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.lista-papel {
  width: min(100%, 30rem); max-height: 82vh; overflow: auto;
  padding: clamp(1.6rem, 5vw, 2.8rem); color: var(--tinta);
  background:
    repeating-linear-gradient(to bottom, transparent 0 2.15rem, rgb(51 33 26 / 0.13) 2.15rem calc(2.15rem + 1px)),
    var(--papel);
  border-radius: 4px; transform: rotate(-1.2deg);
  box-shadow: 0 30px 70px rgb(0 0 0 / 0.6), inset 0 0 60px rgb(160 110 50 / 0.18);
  animation: caer var(--normal) var(--salida);
}
.lista-papel h2 { font-size: var(--texto-l); margin-bottom: 0.9rem; color: var(--terciopelo-hondo); }
.lista-papel ol { padding-left: 1.4em; font-family: var(--fuente-titulo); font-size: var(--texto-l); line-height: 2.15rem; }
.lista-papel li::marker { color: var(--terciopelo); }
.lista-vacia { font-style: italic; line-height: 2.15rem; }
.cerrar {
  margin-top: 1.4rem; padding: 0.7em 1.5em; border-radius: 999px;
  background: var(--pino); color: var(--nieve); font-size: var(--texto-s); letter-spacing: 0.12em; text-transform: uppercase;
}
.mensaje { align-content: center; gap: 1rem; }
.mensaje video { width: min(100%, 60rem); max-height: 76vh; border-radius: 14px; box-shadow: 0 0 0 2px var(--oro), 0 30px 70px rgb(0 0 0 / 0.7); }

/* ── Entrada ── */
.entrada {
  overflow: auto; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(90% 60% at 50% 0%, rgb(226 87 43 / 0.28), transparent 70%),
    linear-gradient(180deg, var(--madera), var(--noche));
}
.entrada-caja { width: min(100%, 25rem); display: grid; gap: 1rem; }
.entrada-caja form { display: grid; gap: 0.5rem; margin-top: 0.8rem; }
.entrada-caja label { font-size: var(--texto-s); letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; margin-top: 0.6rem; }
.entrada-caja input {
  padding: 0.9em 1em; border-radius: 10px; border: 1px solid rgb(246 236 215 / 0.3);
  background: rgb(20 11 9 / 0.6); font-size: 1.15rem;
}
.entrada-caja button {
  margin-top: 1.2rem; padding: 0.95em; border-radius: 999px;
  background: linear-gradient(180deg, var(--terciopelo), var(--terciopelo-hondo)); box-shadow: 0 0 0 2px var(--oro);
  font-family: var(--fuente-titulo); font-size: var(--texto-l);
}
.aviso { padding: 0.8em 1em; border-left: 4px solid var(--brasa); background: rgb(226 87 43 / 0.16); border-radius: 0 8px 8px 0; }

@keyframes latido { 0% { box-shadow: 0 0 0 0 rgb(110 231 160 / 0.6); } 100% { box-shadow: 0 0 0 0.8em rgb(110 231 160 / 0); } }
@keyframes onda { 0% { box-shadow: 0 0 0 3px var(--oro), 0 0 0 0 rgb(255 90 79 / 0.65); } 100% { box-shadow: 0 0 0 3px var(--oro), 0 0 0 1.6rem rgb(255 90 79 / 0); } }
@keyframes respira { 50% { transform: scale(0.93); opacity: 0.75; } }
@keyframes caer { from { opacity: 0; transform: translateY(-24px) rotate(-4deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 30rem) {
  .fila { gap: 0.6rem; }
  .estado { letter-spacing: 0.06em; }
}
