/* Un Regalo por Día · sistema visual común (ver DISENO.md) */
html, body { background: #0b1622; }
:root {
  --bg: #0b1622; --bg2: #102033; --bg3: #17304a; --hoja: #12243a;
  --tinta: #f6efe2; --tinta-72: rgba(246, 239, 226, .72); --tinta-52: rgba(246, 239, 226, .52); --linea: rgba(246, 239, 226, .12);
  --oro: #e8b85c; --oro-osc: #b7832a;
  --foil: linear-gradient(135deg, #f9e3a4 0%, #e3b04f 28%, #b7832a 52%, #f2d27f 74%, #c8922f 100%);
  --rojo: #b8312f; --rojo2: #8e2223; --pino: #1d4a3b; --pino2: #133528; --papel: #f8f1e4; --papel2: #eadcc2;
  --tinta-osc: #2a2018; --suave: #7a6d5f; --ok: #3fae74;
  --serif: 'Fraunces', Georgia, serif; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radio: 22px;
  --sale: cubic-bezier(.22, 1, .36, 1); --rebote: cubic-bezier(.34, 1.56, .64, 1); --estado: cubic-bezier(.4, 0, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; font-family: var(--sans); font-size: 18px; line-height: 1.55; color: var(--tinta); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
::selection { background: rgba(232, 184, 92, .35); color: #fff; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.02; margin: 0 0 .4em; letter-spacing: -.025em; font-variation-settings: 'opsz' 144; }
h1 { font-size: clamp(42px, 7.4vw, 92px); letter-spacing: -.03em; line-height: .98; }
h2 { font-size: clamp(32px, 5.2vw, 58px); }
h3 { font-size: 23px; letter-spacing: -.01em; }
h1 em, h2 em, h3 em { font-style: italic; font-weight: 500; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
p { margin: 0 0 1em; }
a { color: var(--oro); }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 3px; border-radius: 8px; }
.oculto { display: none !important; }
.etiqueta-sec { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--tinta-72); margin-bottom: 18px; }
.etiqueta-sec::before { content: ''; width: 28px; height: 1px; background: var(--foil); }
.ayuda { color: var(--tinta-52); font-size: 15px; font-weight: 400; }
.ico { width: 1.15em; height: 1.15em; flex: 0 0 auto; }

/* Grano: une todo y quita lo "digital" */
body::after { content: ''; position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Nieve (canvas que llena adornos.js) */
.nieve { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* Guirnalda de luces (la arma adornos.js) */
.guirnalda { position: absolute; left: 0; right: 0; top: 0; height: 84px; pointer-events: none; z-index: 3; }
.guirnalda svg { width: 100%; height: 100%; overflow: visible; display: block; }
.guirnalda .cable { fill: none; stroke: #0a120c; stroke-width: 2; opacity: .9; }
.guirnalda .foco { animation: titila var(--t, 4s) ease-in-out var(--d, 0s) infinite; transform-box: fill-box; transform-origin: center top; }
.guirnalda .halo { opacity: .55; animation: titila var(--t, 4s) ease-in-out var(--d, 0s) infinite; }
@keyframes titila { 0%, 100% { opacity: 1; } 45% { opacity: .55; } 55% { opacity: .9; } }

/* Botones */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 56px; padding: 0 30px;
  border: 0; border-radius: 999px; background: var(--foil); background-size: 160% 160%; background-position: 0% 50%; color: #2a1c06;
  font: 600 17px/1 var(--sans); letter-spacing: -.01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 -2px 0 rgba(120, 80, 20, .35) inset, 0 10px 30px rgba(232, 184, 92, .28);
  transition: transform .2s var(--estado), background-position .6s var(--sale), box-shadow .25s; }
.btn:hover { background-position: 100% 50%; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 -2px 0 rgba(120, 80, 20, .35) inset, 0 14px 40px rgba(232, 184, 92, .4); }
.btn:active { transform: scale(.97); }
.btn .flecha { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: rgba(42, 28, 6, .9); color: var(--oro); align-items: center; justify-content: center; margin-right: -14px; transition: transform .3s var(--sale); }
.btn:hover .flecha { transform: translateX(3px); }
.btn.grande { min-height: 64px; font-size: 19px; padding: 0 34px; }
.btn.secundario { background: rgba(246, 239, 226, .07); color: var(--tinta); box-shadow: 0 0 0 1px rgba(246, 239, 226, .2) inset; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.secundario:hover { background: rgba(246, 239, 226, .13); }
.btn.verde { background: #25a35a; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 10px 26px rgba(37, 163, 90, .35); }
.btn.ancho { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; color: var(--tinta-52); font: 500 16px var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px; }
.link:hover { color: var(--tinta); }

/* Formularios (sobre fondo oscuro) */
label.campo { display: block; margin: 0 0 18px; font-weight: 600; font-size: 17px; }
label.campo > span { display: block; margin-bottom: 8px; }
input[type=text], input[type=email], input[type=url], textarea {
  width: 100%; padding: 15px 18px; font: 400 18px var(--sans); color: var(--tinta); background: rgba(246, 239, 226, .06);
  border: 1px solid rgba(246, 239, 226, .18); border-radius: 16px; outline: none; transition: border-color .2s, background .2s; }
input::placeholder, textarea::placeholder { color: rgba(246, 239, 226, .35); }
input:focus, textarea:focus { border-color: var(--oro); background: rgba(246, 239, 226, .09); }
textarea { min-height: 170px; resize: vertical; line-height: 1.55; }

/* Página de aviso (errores del servidor) */
.aviso-pagina { max-width: 520px; margin: 14vh auto; padding: 0 20px; text-align: center; }

/* Marca */
.marca { display: inline-flex; align-items: center; gap: 10px; font: 500 19px var(--serif); letter-spacing: -.01em; color: var(--tinta); text-decoration: none; }
.marca img { width: 30px; height: 30px; }

/* Aviso flotante */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; z-index: 150;
  background: var(--papel); color: var(--tinta-osc); padding: 14px 22px; border-radius: 16px; font-size: 17px; font-weight: 500; max-width: calc(100% - 32px);
  text-align: center; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); transition: transform .4s var(--rebote), opacity .25s; pointer-events: none; }
.toast.ver { transform: translate(-50%, 0); opacity: 1; }

/* Confeti dorado */
.confeti { position: fixed; top: -14px; width: 9px; height: 13px; z-index: 160; border-radius: 2px; animation: cae linear forwards; pointer-events: none; }
@keyframes cae { to { transform: translateY(110vh) rotate(720deg); } }

/* Entradas */
.entra { opacity: 0; transform: translateY(24px); filter: blur(8px); animation: entra .9s var(--sale) forwards; animation-delay: var(--d, 0s); }
@keyframes entra { to { opacity: 1; transform: none; filter: blur(0); } }
.revela { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--sale), transform .8s var(--sale); transition-delay: var(--d, 0s); }
.revela.visto { opacity: 1; transform: none; }

/* ---------- Puertas dibujadas (portada, armador y regalo) ---------- */
.pd { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 14px; overflow: hidden; isolation: isolate;
  font-family: var(--serif); color: var(--papel); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 6px 16px rgba(0, 0, 0, .35); }
.pd .n { position: relative; z-index: 3; font: italic 500 clamp(17px, 4.6vw, 26px)/1 var(--serif); letter-spacing: -.02em; }
/* 1 · Regalo: caja roja, cinta dorada en cruz, moño */
.pd.v-regalo { background:
  linear-gradient(90deg, transparent 43%, rgba(255,255,255,.25) 43% 44%, #d9a648 44% 56%, rgba(0,0,0,.15) 56% 57%, transparent 57%),
  linear-gradient(0deg, transparent 43%, #d9a648 43% 57%, transparent 57%),
  radial-gradient(120% 90% at 30% 15%, #d64545, #b8312f 55%, #861f20); }
.pd.v-regalo::before { content: ''; position: absolute; top: 6%; left: 50%; width: 58%; height: 30%; transform: translateX(-50%); z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Cpath d='M30 24C22 10 5 4 5 14c0 9 15 9 25 10zm0 0C38 10 55 4 55 14c0 9-15 9-25 10z' fill='%23e8b85c' stroke='%23a8741f' stroke-width='1.6'/%3E%3Ccircle cx='30' cy='23' r='4.5' fill='%23c8922f'/%3E%3C/svg%3E") center/contain no-repeat; }
.pd.v-regalo .n, .pd.v-oro .n { width: 1.75em; height: 1.75em; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--papel); color: var(--rojo2); font-size: clamp(14px, 3.6vw, 20px); box-shadow: 0 2px 6px rgba(0,0,0,.3); margin-top: 18%; }
/* 2 · Ventanita: pino, arco iluminado, nieve arriba */
.pd.v-ventana { background: linear-gradient(180deg, #275e4b, #1d4a3b 55%, #133528); align-items: flex-end; padding-bottom: 6%; }
.pd.v-ventana .n { font-size: clamp(14px, 3.6vw, 20px); }
.pd.v-ventana::before { content: ''; position: absolute; left: 27%; right: 27%; top: 21%; bottom: 40%; z-index: 1; border-radius: 999px 999px 4px 4px;
  background: linear-gradient(90deg, transparent 46%, var(--papel) 46% 54%, transparent 54%), linear-gradient(0deg, transparent 44%, var(--papel) 44% 52%, transparent 52%),
  radial-gradient(circle at 50% 75%, #ffe3a0, #efae4c 55%, #b5681d);
  box-shadow: 0 0 0 3px var(--papel), 0 0 22px rgba(255, 196, 100, .55); }
.pd.v-ventana::after { content: ''; position: absolute; left: -4%; right: -4%; top: -2%; height: 17%; z-index: 2;
  background: radial-gradient(circle at 50% 0, #fff 62%, transparent 64%) 0 0/20% 100% repeat-x; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
/* 3 · Sobre: papel, solapa en V, sello de lacre */
.pd.v-sobre { background: linear-gradient(160deg, #fbf4e6, #ecdfc6); color: var(--papel); }
.pd.v-sobre::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 58%; z-index: 1; clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #f1e4c9, #dfcba5); filter: drop-shadow(0 2px 2px rgba(0,0,0,.18)); }
.pd.v-sobre .n { width: 1.9em; height: 1.9em; display: flex; align-items: center; justify-content: center; margin-top: 12%;
  border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%; background: radial-gradient(circle at 35% 30%, #d0463f, #a32a28 60%, #7c1d1d);
  color: #f6dcc2; font-size: clamp(14px, 3.6vw, 20px); box-shadow: 0 2px 5px rgba(0,0,0,.35), inset 0 0 0 3px rgba(0,0,0,.12); }
/* 4 · Caja dorada: oro laminado, cinta roja */
.pd.v-oro { background:
  linear-gradient(90deg, transparent 44%, #9c2526 44% 56%, transparent 56%),
  linear-gradient(0deg, transparent 44%, #9c2526 44% 56%, transparent 56%), var(--foil); }
.pd.v-oro::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%); }

/* ---------- Escena de fondo: luna y Papá Noel volando ---------- */
.luna { position: absolute; z-index: 1; width: var(--t, 86px); height: var(--t, 86px); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 62% 38%, rgba(0,0,0,.07) 0 9%, transparent 10%), radial-gradient(circle at 38% 64%, rgba(0,0,0,.06) 0 7%, transparent 8%),
    radial-gradient(circle at 40% 38%, #fffaf0, #f3e4bd 60%, #d8c289);
  box-shadow: 0 0 40px 8px rgba(255, 238, 196, .28), 0 0 140px 50px rgba(255, 226, 160, .1); }
.cielo { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.santa { position: absolute; left: 0; top: var(--y, 120px); width: clamp(270px, 34vw, 480px); opacity: 0;
  animation: vuela var(--dur, 30s) linear var(--retraso, 2.5s) infinite; will-change: transform; }
.santa svg { width: 100%; height: auto; display: block; transform: scaleX(-1); overflow: visible; }
.santa .silueta { fill: #08111b; stroke: #08111b; filter: drop-shadow(0 0 1.5px rgba(255, 228, 170, .95)) drop-shadow(0 0 7px rgba(255, 214, 140, .45)); }
.santa .trazo { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.santa .trazo.fino { stroke-width: 1; }
.santa .chispa { fill: #ffd98a; animation: chispea 1.4s ease-in-out infinite; }
@keyframes chispea { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes vuela {
  0% { transform: translate(105vw, 10px) rotate(-2deg); opacity: 1; }
  15% { transform: translate(72vw, -14px) rotate(-3deg); }
  30% { transform: translate(38vw, -26px) rotate(0deg); }
  45% { transform: translate(4vw, -14px) rotate(2deg); }
  58% { transform: translate(-40vw, 6px) rotate(2deg); opacity: 1; }
  58.1%, 100% { transform: translate(-40vw, 6px); opacity: 0; }
}

/* ---------- Adornos ---------- */
[data-adorno] { pointer-events: none; display: block; }
[data-adorno] svg { width: 100%; height: auto; display: block; overflow: visible; }
.muerdago { position: absolute; z-index: 4; width: 74px; transform-origin: 50% 0; animation: hamaca 6s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.bola { position: absolute; z-index: 4; width: 40px; transform-origin: 50% 0; animation: hamaca 5s ease-in-out infinite; filter: drop-shadow(0 10px 12px rgba(0,0,0,.4)); }
@keyframes hamaca { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.acebo { position: absolute; z-index: 4; width: 92px; filter: drop-shadow(0 6px 8px rgba(0,0,0,.4)); }
.pino { position: absolute; z-index: 1; width: clamp(180px, 22vw, 300px); opacity: .95; filter: drop-shadow(0 10px 14px rgba(0,0,0,.45)); }

@media (prefers-reduced-motion: reduce) {
  .santa { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .entra, .revela { opacity: 1 !important; transform: none !important; filter: none !important; }
}
