/* =========================================================
   CÁLICE · WEBFONTS DE PRODUCCIÓN
   Los binarios se copian desde ESP_CALICE con PREPARAR_FUENTES.ps1.
   ========================================================= */
@font-face {
  font-family: "CALICE Verbum";
  src: url("/fonts/CALICE-Verbum-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "CALICE Verbum";
  src: url("/fonts/CALICE-Verbum-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/SourceSerif4-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Paleta canónica CÁLICE */
  --oliva-900: #393B24;
  --oliva-700: #4D4E34;
  --oliva-500: #5E5F43;
  --oliva-300: #A4A38D;
  --oliva-100: #DBD9CF;
  --editorial-oscuro: #282923;
  --marfil: #FFFBF2;

  --calice-bg: var(--oliva-300);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--calice-bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.landing {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  background: var(--calice-bg);
}

/* Logo + eje + símbolo: una única versión vectorial del master */
.brand-mark {
  position: absolute;
  left: 50%;
  top: 22.2%;
  transform: translateX(-50%);
  display: block;
  width: auto;
  height: min(48.2vh, 494px);
  max-width: 23vw;
}

/* Voz propia de CÁLICE */
.copy {
  position: absolute;
  left: 50%;
  top: 74.1%;
  width: min(590px, 48vw);
  transform: translateX(-50%);
  text-align: center;
  font-family: "CALICE Verbum", "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

.copy h1 {
  margin: 0;
  color: var(--marfil);
  font: inherit;
  font-size: clamp(18px, 1.35vw, 21px);
  line-height: 1.20;
  font-weight: 400;
}

.copy .support {
  margin: 17px auto 0;
  max-width: 455px;
  color: var(--oliva-900);
  font-size: clamp(15px, 1.10vw, 17px);
  line-height: 1.18;
  font-weight: 400;
}

/* Texto fuente: se trata como una capa editorial distinta del copy propio */
.verse {
  position: absolute;
  top: 7.5%;
  right: 5.5%;
  width: 190px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--oliva-100);
  text-align: right;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-synthesis: none;
}

.verse p {
  margin: 0;
  font-size: clamp(14px, 1.02vw, 16px);
  line-height: 1.08;
  font-weight: 400;
}

.verse cite {
  display: block;
  margin-top: 14px;
  color: var(--oliva-100);
  font-family: "CALICE Verbum", "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
  font-style: normal;
  font-weight: 700;
}

/* Contacto: utility / trust signal, deliberadamente secundario */
.contact {
  position: absolute;
  left: 5.5%;
  bottom: 5.0%;
  color: var(--oliva-900);
  font-family: "CALICE Verbum", "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.015em;
  text-decoration: none;
  font-weight: 400;
  opacity: 0.88;
  transition: opacity 160ms ease;
}

.contact:hover {
  opacity: 1;
}

.contact:focus-visible {
  outline: 1px solid var(--oliva-900);
  outline-offset: 5px;
}

/* Móvil: conserva la composición del AI, con contacto en el vacío inferior izquierdo */
@media (max-width: 767px) {
  .landing {
    min-height: 620px;
  }

  .brand-mark {
    top: 22.4%;
    height: min(53.6vh, 458px);
    max-width: 72vw;
  }

  .copy {
    top: 7.0%;
    width: calc(100% - 44px);
  }

  .copy h1 {
    font-size: clamp(14px, 3.75vw, 16px);
    line-height: 1.18;
  }

  .copy .support {
    margin-top: 12px;
    max-width: 320px;
    font-size: clamp(12.5px, 3.35vw, 14px);
    line-height: 1.16;
  }

  .verse {
    top: auto;
    right: 7.5%;
    bottom: 5.1%;
    width: 160px;
  }

  .verse p {
    font-size: clamp(12.5px, 3.35vw, 13.5px);
    line-height: 1.08;
  }

  .verse cite {
    margin-top: 12px;
    font-size: 11px;
  }

  .contact {
    left: 7.5%;
    bottom: 2.6%;
    font-size: 10.5px;
    opacity: 0.82;
  }
}

/* Pantallas desktop especialmente bajas */
@media (max-height: 680px) and (min-width: 768px) {
  .brand-mark {
    top: 20.5%;
    height: 45vh;
  }

  .copy {
    top: 73.4%;
  }

  .verse {
    top: 5.5%;
  }

  .contact {
    bottom: 4%;
  }
}

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


/* =========================================================
   v05 · INTERACCIÓN
   Una capa muy contenida: entrada + "luz" de puntero + contacto.
   No requiere Worker ni backend; todo ocurre en el navegador.
   ========================================================= */

.landing {
  --pointer-x: 50%;
  --pointer-y: 50%;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(
      circle 470px at var(--pointer-x) var(--pointer-y),
      rgba(219, 217, 207, 0.180) 0%,
      rgba(219, 217, 207, 0.085) 30%,
      rgba(219, 217, 207, 0.000) 72%
    );
  transition: opacity 420ms ease;
}

/* Mantener el contenido por encima de la luz */
.brand-mark,
.copy,
.verse,
.contact {
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .landing.pointer-active::before {
    opacity: 1;
  }
}

/* Entrada: solo se activa si hay JS.
   Si JS falla o está desactivado, todo sigue siendo visible. */
.js .brand-mark,
.js .copy,
.js .verse,
.js .contact {
  opacity: 0;
}

.js.is-ready .brand-mark {
  opacity: 1;
  animation: calice-brand-in 1120ms cubic-bezier(.22,.61,.36,1) both;
}

.js.is-ready .copy {
  opacity: 1;
  animation: calice-copy-in 920ms 430ms cubic-bezier(.22,.61,.36,1) both;
}

.js.is-ready .verse {
  opacity: 1;
  animation: calice-verse-in 900ms 720ms cubic-bezier(.22,.61,.36,1) both;
}

.js.is-ready .contact {
  opacity: 0.88;
  animation: calice-contact-in 760ms 980ms ease-out both;
}

@keyframes calice-brand-in {
  from {
    opacity: 0;
    filter: blur(3.5px);
    transform: translateX(-50%) translateY(11px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes calice-copy-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes calice-verse-in {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes calice-contact-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 0.88;
    transform: translateY(0);
  }
}

/* El correo se comporta como una pequeña pieza editorial,
   no como un botón. */
.contact::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease;
}

.contact:hover::after,
.contact:focus-visible::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .landing::before {
    display: none;
  }

  .js .brand-mark,
  .js .copy,
  .js .verse,
  .js .contact,
  .js.is-ready .brand-mark,
  .js.is-ready .copy,
  .js.is-ready .verse,
  .js.is-ready .contact {
    opacity: 1;
    animation: none !important;
    filter: none !important;
  }

  .js.is-ready .contact {
    opacity: 0.88;
  }
}
