/* ===== Variables ===== */
:root {
  --rojo: #c8102e;
  --rojo-osc: #8e0b20;
  --verde: #1f6f43;
  --verde-osc: #0f3d26;
  --dorado: #f4c542;
  --crema: #fff8ec;
  --noche: #0b1a2e;
  --noche-2: #13284a;
  --texto: #1d1d1d;
  --blanco: #ffffff;
  --radio: 18px;
  --sombra: 0 10px 30px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--texto);
  background: var(--crema);
  line-height: 1.6;
  overflow-x: hidden;
}

#nieve {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
}

h1, h2 { font-family: 'Mountains of Christmas', cursive; line-height: 1.1; }

/* ===== Botones ===== */
.btn {
  display: inline-block;
  background: var(--rojo);
  color: var(--blanco);
  border: none;
  padding: .9rem 1.8rem;
  border-radius: 999px;
  font: 800 1rem 'Nunito', sans-serif;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--rojo-osc);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--rojo-osc); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--rojo-osc); }
.btn-sec { background: var(--verde); box-shadow: 0 6px 0 var(--verde-osc); }
.btn-sec:hover { box-shadow: 0 8px 0 var(--verde-osc); }

/* ===== Navegación ===== */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.5rem;
  background: rgba(11, 26, 46, .92);
  backdrop-filter: blur(6px);
}
.logo { color: var(--blanco); font-weight: 800; font-size: 1.2rem; text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: #dfe7f5; text-decoration: none; font-weight: 600; transition: color .2s; }
.nav-links a:hover { color: var(--dorado); }
.nav-toggle { display: none; background: none; border: none; color: var(--blanco); font-size: 1.6rem; cursor: pointer; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 2rem;
  padding: 5rem 8vw 3rem;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(244, 197, 66, .18), transparent 55%),
    linear-gradient(180deg, var(--noche) 0%, var(--noche-2) 100%);
  color: var(--blanco);
  overflow: hidden;
}
.hero::after { /* colinas nevadas */
  content: "";
  position: absolute; left: -5%; right: -5%; bottom: -60px;
  height: 160px;
  background: var(--crema);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-sub { color: var(--dorado); font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-size: .85rem; }
.hero h1 { font-size: clamp(3.2rem, 9vw, 6.5rem); color: var(--blanco); text-shadow: 0 4px 0 var(--rojo); margin: .3rem 0 1rem; }
.hero-texto { max-width: 34ch; font-size: 1.15rem; color: #d6deec; margin-bottom: 2rem; }
.hero-contenido { position: relative; z-index: 2; }

/* Luces colgantes */
.luces {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  list-style: none;
  padding-top: 6px;
  border-top: 2px solid #2b3d5a;
}
.luces li {
  width: 12px; height: 22px;
  border-radius: 50%;
  background: var(--rojo);
  position: relative;
  animation: brillo 1.4s infinite alternate;
}
.luces li::before {
  content: ""; position: absolute; top: -6px; left: 3px;
  width: 6px; height: 7px; background: #444; border-radius: 2px;
}
.luces li:nth-child(3n+1) { background: var(--dorado); animation-delay: .4s; --c: var(--dorado); }
.luces li:nth-child(3n+2) { background: #3ddc84; animation-delay: .8s; --c: #3ddc84; }
.luces li:nth-child(3n)   { --c: var(--rojo); }
@keyframes brillo {
  from { opacity: .45; box-shadow: none; }
  to   { opacity: 1; box-shadow: 0 4px 18px 4px var(--c, var(--rojo)); }
}

/* Árbol CSS */
.arbol {
  position: relative; z-index: 2;
  justify-self: center;
  width: 280px; height: 380px;
}
.estrella {
  position: absolute; top: -10px; left: 50%;
  transform: translateX(-50%);
  font-size: 3.4rem; color: var(--dorado);
  text-shadow: 0 0 20px var(--dorado);
  animation: girar 4s ease-in-out infinite;
  z-index: 3;
}
@keyframes girar { 50% { transform: translateX(-50%) scale(1.15) rotate(12deg); } }
.capa {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: solid transparent; border-right: solid transparent;
  border-bottom: solid var(--verde);
  filter: drop-shadow(0 6px 0 var(--verde-osc));
}
.c1 { top: 40px;  border-width: 0 70px 100px; }
.c2 { top: 100px; border-width: 0 105px 130px; }
.c3 { top: 170px; border-width: 0 140px 160px; }
.tronco {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 46px; height: 55px; background: #6b3e1f; border-radius: 4px;
}
.adorno {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.2);
  animation: brillo 1.8s infinite alternate;
}
.a1 { top: 110px; left: 120px; background: var(--rojo); }
.a2 { top: 170px; left: 90px;  background: var(--dorado); --c: var(--dorado); animation-delay: .5s; }
.a3 { top: 185px; left: 175px; background: #4fc3f7; --c: #4fc3f7; animation-delay: 1s; }
.a4 { top: 250px; left: 70px;  background: var(--rojo); animation-delay: .3s; }
.a5 { top: 265px; left: 150px; background: var(--dorado); --c: var(--dorado); animation-delay: .9s; }
.a6 { top: 245px; left: 205px; background: #4fc3f7; --c: #4fc3f7; animation-delay: 1.3s; }

/* ===== Secciones ===== */
.seccion { padding: 5rem 8vw; text-align: center; }
.seccion h2 { font-size: clamp(2.3rem, 5vw, 3.4rem); color: var(--rojo); margin-bottom: .5rem; }
.intro { color: #555; margin-bottom: 2.5rem; }
.seccion-oscura { background: linear-gradient(180deg, var(--verde-osc), var(--verde)); color: var(--blanco); }
.seccion-oscura h2 { color: var(--dorado); margin-bottom: 2rem; }
.seccion-crema { background: #fdeedd; }

/* Contador */
.contador { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
.unidad {
  min-width: 120px;
  background: rgba(255,255,255,.1);
  border: 2px solid rgba(244,197,66,.5);
  border-radius: var(--radio);
  padding: 1.3rem 1rem;
}
.unidad span { display: block; font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.unidad small { text-transform: uppercase; letter-spacing: .15em; font-size: .75rem; color: #cfe8d9; }
.mensaje-navidad { margin-top: 2rem; font-size: 2rem; font-weight: 800; color: var(--dorado); }

/* Tarjetas */
.tarjetas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1100px; margin: 0 auto;
}
.tarjeta {
  background: var(--blanco);
  border-radius: var(--radio);
  padding: 2rem 1.5rem;
  box-shadow: var(--sombra);
  border-top: 6px solid var(--rojo);
  transition: transform .25s;
}
.tarjeta:nth-child(even) { border-top-color: var(--verde); }
.tarjeta:hover { transform: translateY(-8px) rotate(-1deg); }
.tarjeta-icono { font-size: 2.8rem; margin-bottom: .6rem; }
.tarjeta h3 { color: var(--verde-osc); margin-bottom: .4rem; }
.tarjeta p { color: #555; font-size: .95rem; }

/* Recetas */
.recetas { max-width: 720px; margin: 0 auto; display: grid; gap: 1rem; text-align: left; }
.receta {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
}
.receta summary {
  list-style: none;
  cursor: pointer;
  padding: 1.2rem 1.5rem;
  font-weight: 800; font-size: 1.15rem;
  display: flex; align-items: center; gap: .8rem;
  color: var(--verde-osc);
}
.receta summary::-webkit-details-marker { display: none; }
.receta summary::after { content: "+"; margin-left: auto; font-size: 1.5rem; color: var(--rojo); transition: transform .2s; }
.receta[open] summary::after { transform: rotate(45deg); }
.receta summary span { font-size: 1.6rem; }
.receta ul, .receta p { padding: 0 1.5rem 1rem 3.2rem; color: #444; }
.receta p { padding-left: 1.5rem; padding-bottom: 1.4rem; font-style: italic; }

/* Carta */
.carta {
  max-width: 560px; margin: 0 auto;
  background: var(--crema);
  color: var(--texto);
  padding: 2rem;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  text-align: left;
  display: grid; gap: .5rem;
  background-image: repeating-linear-gradient(transparent 0 31px, #ecdcc4 31px 32px);
}
.carta label { font-weight: 800; color: var(--rojo-osc); }
.carta input, .carta textarea {
  font: inherit;
  padding: .75rem 1rem;
  border: 2px solid #e5d3b8;
  border-radius: 10px;
  background: var(--blanco);
  margin-bottom: .6rem;
  resize: vertical;
}
.carta input:focus, .carta textarea:focus { outline: none; border-color: var(--rojo); }
.carta .btn { justify-self: center; margin-top: .5rem; }
.carta-enviada { max-width: 560px; margin: 0 auto; }
.sobre { font-size: 4rem; animation: volar 1.2s ease-out; }
@keyframes volar { from { transform: translateY(40px) scale(.5); opacity: 0; } }
#carta-texto { font-size: 1.2rem; margin: 1rem 0 2rem; }

/* Pie */
.pie {
  background: var(--noche);
  color: #c9d3e3;
  text-align: center;
  padding: 2rem 1rem;
  display: grid; gap: .8rem; justify-items: center;
}
.btn-nieve {
  background: transparent; color: #c9d3e3;
  border: 1px solid #3a4d6e; border-radius: 999px;
  padding: .4rem 1rem; cursor: pointer; font: inherit;
}
.btn-nieve:hover { border-color: var(--dorado); color: var(--dorado); }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--noche);
    max-height: 0; overflow: hidden;
    transition: max-height .3s;
  }
  .nav-links.abierto { max-height: 300px; }
  .nav-links a { padding: 1rem 1.5rem; border-top: 1px solid #1f3355; }

  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 4rem; }
  .hero-texto { margin-inline: auto; }
  .arbol { transform: scale(.75); margin-top: -2rem; }
  .unidad { min-width: 0; flex: 1 1 40%; }
  .unidad span { font-size: 2.3rem; }
  .seccion { padding: 4rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
