/* ==========================================================
   Cocoa con Betty · Estilos principales
   Fuentes autoalojadas (sin CDN → compatible con CSP estricta)
   ========================================================== */

@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-variable.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f0e7;
  --ink: #3e271d;
  --accent: #a37257;

  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Montserrat", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("../img/fondo.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Velo suave sobre el fondo (necesita content/position para existir) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(230, 217, 198, 0.35) 0%, rgba(246, 240, 231, 0.15) 50%),
    rgba(62, 39, 29, 0.04);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* ---------- Contenedor ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: clamp(2rem, 5vh, 4rem) 1.25rem;
  text-align: center;
}

/* ---------- Logo ---------- */
.hero__logo {
  line-height: 0;
}

.hero__logo img {
  display: block;
  width: clamp(14rem, 50vw, 28rem);
  height: auto;
}

/* ---------- Divisor ---------- */
.hero__divider {
  display: block;
  width: 28px;
  height: 1.5px;
  margin: 0.3rem 0 0.5rem;
  background-color: var(--accent);
  border-radius: 1px;
}

/* ---------- Textos ---------- */
.hero__title {
  max-width: 30ch;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.8vw, 2.7rem);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero__subtitle {
  margin-top: 0.2rem;
  font-size: clamp(0.78rem, 1.35vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-indent: 0.16em;       /* compensa el espaciado final para centrar */
  text-transform: lowercase;
  color: var(--ink);
}

/* ---------- Animación de entrada ---------- */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  background: linear-gradient(160deg, #f6f0e7 0%, #e9d3bc 100%);
  pointer-events: none;
  animation: intro-fade 1.2s ease-out 0.2s both;
}

@keyframes intro-fade {
  to { opacity: 0; visibility: hidden; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes grow {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

.hero__logo,
.hero__title,
.hero__subtitle {
  animation: rise 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero__divider {
  animation: grow 0.6s ease-out 1s both;
}

.hero__logo     { animation-delay: 0.7s; }
.hero__title    { animation-delay: 1.1s; }
.hero__subtitle { animation-delay: 1.3s; }

/* ---------- Móviles ---------- */
@media (max-width: 48em) {
  body {
    background-position: 42% center;   /* ajusta para encuadrar taza y laptop */
  }

  .hero {
    padding-top: 1.8rem;
    gap: 0.4rem;
  }

  .hero__logo img {
    width: min(80vw, 22rem);
  }
}

/* ---------- Accesibilidad: sin animación si el usuario lo pide ---------- */
@media (prefers-reduced-motion: reduce) {
  html::after { display: none; }

  .hero__logo,
  .hero__divider,
  .hero__title,
  .hero__subtitle {
    animation: none;
  }
}
