/* =========================================================
   Natale 2026 · Famiglia Russo — base, hero, controlli
   Palette unica: notte, abete, bordeaux, oro, crema
   ========================================================= */
:root {
  --night: #0c1d27;
  --night-2: #12303b;
  --pine: #173f33;
  --pine-2: #245a48;
  --wine: #7a1d2a;
  --wine-2: #9b2b38;
  --gold: #cfa862;
  --gold-2: #ecd5a0;
  --cream: #f7efe1;
  --paper: #faf6ef;
  --ink: #1d2a2e;
  --muted: #6d716a;
  --line: rgba(207,168,98,.38);

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
  --script: 'Pinyon Script', cursive;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; background: var(--night); } /* lo scroll fluido lo gestisce js/app.js */
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--night);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
svg use, .btn svg, .ornament svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

#snow, #sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#snow { z-index: 1; }
#sparks { z-index: 60; }

/* ---------- Ingresso morbido ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 120ms + 200ms); }
body.ready .reveal { opacity: 1; transform: none; }

.eyebrow {
  font-family: var(--sans); font-weight: 600; font-size: .74rem;
  letter-spacing: .32em; text-transform: uppercase; color: var(--gold-2);
}
.eyebrow.dark { color: var(--wine); }
.eyebrow .sep { color: var(--gold); margin: 0 .6em; }

/* =================== HERO =================== */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center;
  padding: 130px 1.5rem 30vh;
  color: var(--cream); text-align: center;
  overflow: hidden;
  background:
    radial-gradient(90% 55% at 50% 100%, rgba(236,170,90,.28), transparent 60%),
    radial-gradient(60% 40% at 80% 10%, rgba(36,90,72,.35), transparent 70%),
    linear-gradient(180deg, #08151d 0%, var(--night) 35%, var(--night-2) 70%, #1b4048 100%);
}
.scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.stars { position: absolute; inset: 0 0 35% 0; transform: translateY(calc(var(--sy, 0) * .15px)); }
.stars { will-change: transform; }
.stars i {
  position: absolute; width: var(--s); height: var(--s); border-radius: 50%;
  background: #fff8e6; box-shadow: 0 0 6px rgba(255,240,200,.8);
  animation: twinkle var(--t) ease-in-out infinite var(--d);
}
@keyframes twinkle { 50% { opacity: .2; } }


.aurora {
  position: absolute; left: -20%; right: -20%; top: 5%; height: 45%;
  background: linear-gradient(110deg, transparent 25%, rgba(110,200,160,.14) 42%, rgba(207,168,98,.10) 55%, transparent 72%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000 60%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 35%, #000 60%, transparent);
  will-change: transform;
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora { from { transform: translateX(-6%) skewY(-4deg); } to { transform: translateX(6%) skewY(3deg); } }

.layer { position: absolute; left: 0; bottom: 0; width: 100%; }
.layer.far  { height: 46%; fill: #163845; transform: translateY(calc(var(--sy, 0) * .12px)); }
.layer.mid  { height: 38%; fill: #0f2a2b; transform: translateY(calc(var(--sy, 0) * .06px)); }
.layer.near { height: 24%; fill: var(--paper); filter: drop-shadow(0 -10px 30px rgba(255,230,180,.18)); }

/* villaggio: sagome scure con finestre calde */
.village { position: absolute; left: 0; right: 0; bottom: 12%; height: 80px; }
.house {
  position: absolute; bottom: var(--b); left: var(--x);
  width: var(--w); height: calc(var(--w) * .7);
  background: #0d2526;
}
.house::before { /* tetto */
  content: ""; position: absolute; left: -12%; right: -12%; bottom: 100%; height: calc(var(--w) * .5);
  background: linear-gradient(#e9e4da 0 22%, #0d2526 22%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.house i { /* finestre */
  position: absolute; top: 30%; width: 18%; height: 30%;
  background: #ffcf7a; border-radius: 1px;
  box-shadow: 0 0 10px 2px rgba(255,190,100,.65);
  animation: flicker var(--f) ease-in-out infinite;
}
.house i:nth-child(1) { left: 18%; }
.house i:nth-child(2) { right: 18%; animation-delay: -1.3s; }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .78; } 50% { opacity: .55; } 55% { opacity: .9; } }

/* ---------- Ghirlanda: luci calde, tutte dello stesso tono ---------- */
.garland { position: absolute; top: 0; left: 0; right: 0; height: 80px; z-index: 3; pointer-events: none; }
.garland svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.garland path { fill: none; stroke: rgba(30,40,35,.9); stroke-width: 1.4; }
.bulb {
  position: absolute; width: 9px; height: 14px; margin-left: -4.5px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 45% 35%, #fffdf3 0 15%, var(--c) 60%);
  box-shadow: 0 0 8px 2px var(--c), 0 0 22px 6px color-mix(in srgb, var(--c) 45%, transparent);
  transform-origin: 50% -3px; transform: rotate(var(--a));
  animation: glow 3.2s ease-in-out infinite var(--d);
}
.bulb::before { content: ""; position: absolute; top: -4px; left: 2px; width: 5px; height: 5px; border-radius: 1px; background: #2c3a33; }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- Monogramma (ghirlanda + R) ---------- */
.crest {
  position: relative; flex: 0 0 auto;
  display: grid; place-items: center;
  width: 46px; height: 46px;
}
.crest svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: wreath 7s ease-in-out infinite; }
.crest b {
  position: relative; margin-top: -2px;
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.35rem; line-height: 1;
  color: var(--wine);
}
@keyframes wreath { 50% { transform: rotate(-5deg) scale(1.03); } }

/* ---------- Firma nella hero ---------- */
.signature { display: flex; flex-direction: column; align-items: center; }
.crest-lg { width: 84px; height: 84px; }
.crest-lg::before { /* bagliore dietro la ghirlanda */
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,240,205,.95), rgba(236,213,160,.55) 60%, transparent 72%);
  filter: blur(1px);
}
.crest-lg b { font-size: 2.3rem; color: var(--wine); }
.sig-name {
  display: flex; align-items: baseline; justify-content: center; gap: .55rem;
  margin-top: .9rem; color: var(--gold-2);
}
.sig-small { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 1.15rem; color: rgba(247,239,225,.75); }
.sig-big {
  font-family: var(--serif); font-weight: 500; font-size: 1.9rem; letter-spacing: .14em; text-transform: uppercase;
  background: linear-gradient(100deg, var(--gold) 10%, #fff3d6 45%, var(--gold-2) 60%, var(--gold) 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 6s ease-in-out infinite;
}
.sig-line { width: 46px; height: 1px; align-self: center; background: linear-gradient(90deg, transparent, var(--gold)); }
.sig-line:last-child { transform: scaleX(-1); }
.sig-year { margin-top: .35rem; font-size: .68rem; font-weight: 600; letter-spacing: .42em; text-transform: uppercase; color: rgba(236,213,160,.7); }
.sig-year span { color: var(--gold); margin: 0 .35em; }

/* ---------- Testi hero ---------- */
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
h1 { margin: 1.4rem 0 1.2rem; line-height: .9; }
.h1-script {
  display: block; font-family: var(--script); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 3.6rem); color: var(--gold-2);
  margin-bottom: -.15em; transform: rotate(-4deg);
}
.h1-main {
  display: block; font-family: var(--serif); font-weight: 300;
  font-size: clamp(5rem, 17vw, 11rem); letter-spacing: -.02em;
  font-variation-settings: "opsz" 144;
  background: linear-gradient(100deg, var(--cream) 20%, var(--gold-2) 40%, #fff7e4 50%, var(--gold-2) 60%, var(--cream) 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.lede { max-width: 520px; margin: 0 auto; font-size: 1.08rem; line-height: 1.7; color: rgba(247,239,225,.78); }

/* ---------- Countdown ---------- */
.count[hidden], .today-note[hidden] { display: none; }
.count {
  margin: 2.6rem auto 0; max-width: 560px;
  padding: 1.4rem 1.2rem 1.5rem;
  border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(180deg, rgba(30,52,62,.72), rgba(16,36,46,.6));
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
}
.count-title { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(247,239,225,.65); }
.count-title em { display: block; margin-top: .4rem; font-family: var(--serif); font-style: italic; font-size: 1.3rem; letter-spacing: 0; text-transform: none; color: var(--cream); }
.count-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 1.1rem; }
.count-grid div { padding: 0 .4rem; border-left: 1px solid var(--line); }
.count-grid div:first-child { border-left: 0; }
.count-grid b {
  display: block; font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.1rem, 6vw, 3.1rem); line-height: 1.05; color: var(--cream);
  font-variant-numeric: lining-nums tabular-nums;
}
.count-grid b.tick { animation: tick .6s var(--ease); }
@keyframes tick { from { opacity: .2; transform: translateY(-8px); } }
.count-grid span { font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold-2); }

.today-note {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 1.6rem;
  padding: .6rem 1.2rem; border-radius: 999px;
  background: rgba(207,168,98,.16); border: 1px solid var(--line);
  font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--gold-2);
}

.btn {
  display: inline-flex; align-items: center; gap: .6rem; margin-top: 2.4rem;
  padding: .95rem 1.7rem; border-radius: 999px;
  color: var(--night); background: linear-gradient(180deg, var(--gold-2), var(--gold));
  font-weight: 700; font-size: .92rem; letter-spacing: .04em; text-decoration: none;
  box-shadow: 0 14px 30px -10px rgba(207,168,98,.6), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.btn svg { width: 18px; height: 18px; stroke-width: 2; animation: nudge 2s ease-in-out infinite; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -12px rgba(207,168,98,.75), inset 0 1px 0 rgba(255,255,255,.5); }
@keyframes nudge { 50% { transform: translateY(3px); } }


@media (max-width: 640px) {
  .hero { padding: 110px 1.2rem 26vh; }
  .hero { padding-top: 120px; }
  .count { padding: 1.1rem .6rem 1.2rem; }
  .count-grid span { font-size: .56rem; letter-spacing: .14em; }
  .crest-lg { width: 70px; height: 70px; }
  .crest-lg b { font-size: 1.9rem; }
  .sig-big { font-size: 1.5rem; }
  .sig-line { width: 24px; }
}
