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

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --crema: #FAF7F0;
  --verde-900: #0F3D1E;
  --verde-700: #166534;
  --dorado-500: #C9A227;
  --gris-texto: #4A5148;
  --fuente-titulos: "Playfair Display", Georgia, "Times New Roman", serif;
  --fuente-cuerpo: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--crema);
  background-image:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(circle at 82% 88%, rgba(201, 162, 39, 0.10) 0%, rgba(201, 162, 39, 0) 46%);
  color: var(--gris-texto);
  font-family: var(--fuente-cuerpo);
  display: grid;
  place-items: center;
}

.escena {
  width: 100%;
  max-width: 760px;
  padding: clamp(1.5rem, 6vw, 4rem) clamp(1rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo {
  width: clamp(72px, 9vw, 96px);
  height: auto;
  margin: 0 0 clamp(1rem, 3vw, 2rem);
  animation: aparecer 1.1s ease-out both;
}

.botanica {
  width: min(34rem, 86vw);
  height: auto;
  color: var(--verde-700);
  margin: 0 0 clamp(0.25rem, 1.5vw, 0.75rem);
  animation: respirar 8s ease-in-out 2.9s infinite alternate;
}

.trazos path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dibujar 2.4s cubic-bezier(0.33, 0.7, 0.3, 1) forwards;
}

.trazos path:nth-child(2) { animation-delay: 0.12s; }
.trazos path:nth-child(3) { animation-delay: 0.24s; }
.trazos path:nth-child(4) { animation-delay: 0.36s; }
.trazos path:nth-child(5) { animation-delay: 0.48s; }
.trazos path:nth-child(6) { animation-delay: 0.60s; }
.trazos path:nth-child(7) { animation-delay: 0.72s; }
.trazos path:nth-child(n + 8) {
  stroke: var(--dorado-500);
  animation-delay: 0.9s;
}

h1 {
  margin: 0;
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: clamp(3.2rem, 12vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--verde-900);
  text-align: center;
  animation: aparecer 1.4s ease-out 0.15s both;
}

.tagline {
  margin: clamp(0.9rem, 2.5vw, 1.4rem) 0 0;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gris-texto);
  animation: aparecer 1.4s ease-out 0.35s both;
}

.escena--error .logo--error {
  width: clamp(64px, 8vw, 84px);
  margin-bottom: clamp(1rem, 4vw, 2rem);
}

.codigo {
  margin: 0;
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: clamp(5rem, 18vw, 10rem);
  line-height: 1;
  color: var(--verde-900);
}

.mensaje {
  margin: 0.4rem 0 clamp(1.75rem, 5vw, 2.5rem);
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  color: var(--gris-texto);
}

.volver {
  color: var(--verde-700);
  font-weight: 600;
  text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--dorado-500);
}

.volver:hover,
.volver:focus-visible {
  color: var(--verde-900);
  border-bottom-color: var(--verde-900);
}

.volver:focus-visible {
  outline: 2px solid var(--dorado-500);
  outline-offset: 4px;
}

@keyframes dibujar {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

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

@keyframes respirar {
  from { transform: translateY(0); }
  to { transform: translateY(-5px); }
}
