/* Carta Natalizia (Natale di Cristallo 2026): "Cuore di ghiaccio" con agrifoglio.
   Struttura in templates/_carta_ed-natale-2026.html. Disegnata su 250x360, scalata col contenitore.
   Sporgenze: lati ≤ 4 unità su 250 (≈3 px su una carta da 190 px), in alto il cristallo non supera la zucca Stregata. */

.ntl { position: absolute; inset: 0; container-type: inline-size; color: #eef8ff; font-family: var(--tn-body, 'Figtree', sans-serif);
  --m1: #ffe08a; --m2: #b8862b; --m3: #fff1c2; --m4: #8a5a12; --ntl-glow: #ffc44d; }
/* metallo della cornice = livello della carta base */
.ntl-l-comune   { --m1: #d6d1e6; --m2: #5b5570; --m3: #ece8f6; --m4: #34304a; --ntl-glow: #a99bd6; }
.ntl-l-bronzo   { --m1: #f0b27a; --m2: #7c4720; --m3: #f6cfa6; --m4: #4e2a10; --ntl-glow: #ffa25c; }
.ntl-l-argento  { --m1: #ffffff; --m2: #8e97aa; --m3: #f2f5fb; --m4: #565e72; --ntl-glow: #cfe0ff; }
.ntl-l-diamante { --m1: #c9b4ff; --m2: #6fd3ff; --m3: #ffffff; --m4: #b06cff; --ntl-glow: #9fe9ff; }
.ntl-m1 { stop-color: var(--m1); } .ntl-m2 { stop-color: var(--m2); } .ntl-m3 { stop-color: var(--m3); } .ntl-m4 { stop-color: var(--m4); }
.ntl-l-diamante .ntl-m1 { animation: ntl-prisma 6s linear infinite; }
.ntl-l-diamante .ntl-m2 { animation: ntl-prisma 6s linear -2s infinite; }
.ntl-l-diamante .ntl-m4 { animation: ntl-prisma 6s linear -4s infinite; }

.ntl > * { position: absolute; }
.ntl-fondo { inset: 0; width: 100%; height: 100%; }
.ntl-faccette { stroke: rgba(160, 230, 255, .1); stroke-width: 1; }
.ntl-anello { left: 50%; top: 40%; width: 128%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.ntl-anello svg { width: 100%; height: 100%; animation: ntl-gira 60s linear infinite; }
.ntl-anello text { font-size: 13px; fill: #9fe9ff; opacity: .45; letter-spacing: 9px; filter: drop-shadow(0 0 3px #4fd8ff); }

/* finestra della foto: bordo superiore a cristalli */
.ntl-vetro, .ntl-luce { left: 10%; top: 11%; width: 80%; height: 58%; overflow: hidden;
  clip-path: polygon(0 16%, 9% 7%, 18% 12%, 30% 0, 42% 9%, 50% 3%, 58% 9%, 70% 0, 82% 12%, 91% 7%, 100% 16%, 100% 92%, 88% 100%, 12% 100%, 0 92%); }
.ntl-vetro img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.8) contrast(1.1) brightness(.92); transition: filter .6s; }
.ntl-vetro::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(120,200,255,.22), transparent 40%, rgba(4,16,40,.75)), radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(2,10,30,.8)); }
.ntl-luce { background: radial-gradient(ellipse at 50% 45%, rgba(160,240,255,.7), transparent 60%); mix-blend-mode: screen; opacity: 0; transition: opacity .6s; pointer-events: none; }

.ntl-cornice { left: -6%; top: -6.11%; width: 112%; height: 111.11%; overflow: visible; pointer-events: none; z-index: 3; }
.ntl-brillo { filter: drop-shadow(0 0 4px var(--ntl-glow)) drop-shadow(0 0 12px rgba(120,220,255,.5)); }
.ntl-lucine { filter: drop-shadow(0 0 4px #9fe9ff); }
.ntl-lucine circle { animation: ntl-lucina 2s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); }
.ntl-goccia { fill: #dff8ff; opacity: 0; animation: ntl-goccia 3.6s ease-in infinite; }
.ntl-goccia-b { animation-delay: -1.3s; } .ntl-goccia-c { animation-delay: -2.4s; }
.ntl-palla { transform-box: view-box; }
.ntl-palla-s { transform-origin: 104px 250px; animation: ntl-dondola 3.8s ease-in-out infinite alternate; }
.ntl-palla-d { transform-origin: 146px 250px; animation: ntl-dondola 3.1s ease-in-out -1.2s infinite alternate; }
.ntl-palla-rossa { filter: drop-shadow(0 0 5px rgba(216,40,63,.6)); }
.ntl-palla-viola { filter: drop-shadow(0 0 5px rgba(145,70,255,.7)); }
.ntl-brina { fill: none; stroke: #e9fbff; stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160;
  animation: ntl-brina 6s ease-in-out infinite; filter: drop-shadow(0 0 3px #8fe8ff); }
.ntl-brina-b { animation-delay: -3s; }
.ntl-crepa { fill: none; stroke: #e6fdff; stroke-width: 1.6; stroke-dasharray: 120; stroke-dashoffset: 120; transition: stroke-dashoffset 1s ease-out;
  filter: drop-shadow(0 0 4px #4fd8ff) drop-shadow(0 0 10px #4fd8ff); }

/* in cima: fiocco di cristallo che ruota, agrifoglio sotto */
.ntl-agrifoglio { left: 50%; top: -4.5%; width: 48%; transform: translateX(-50%); z-index: 4; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.55)); }
.ntl-cristallo { left: 50%; top: -8.6%; width: 21%; transform: translateX(-50%); z-index: 5; overflow: visible; pointer-events: none; }
.ntl-gira { transform-box: fill-box; transform-origin: 50% 50%; animation: ntl-gira 24s linear infinite; }

.ntl-serie { left: 12%; top: 15%; z-index: 6; font-family: var(--tn-head, 'Bricolage Grotesque', sans-serif); font-weight: 800; font-size: 3.8cqw;
  color: #04223a; background: linear-gradient(90deg, var(--m2), var(--m3), var(--m2)); padding: .3cqw 2.4cqw; border-radius: 999px;
  white-space: nowrap; box-shadow: 0 0 12px rgba(140,230,255,.55); }
.ntl-livello { right: 12%; top: 15%; z-index: 6; display: flex; gap: 1.4cqw; align-items: center; font-size: 4cqw; font-weight: 800;
  padding: .8cqw 3cqw; border-radius: 999px; background: rgba(6,8,20,.85); border: 1px solid var(--m2); color: var(--m1); }
.ntl-livello .tc-gem { width: 2.4cqw; height: 2.4cqw; }
.ntl-live { left: 12%; top: 22%; z-index: 6; background: var(--tn-live, #ff3b5c); color: #fff; font-size: 3.6cqw; font-weight: 800;
  padding: .6cqw 2.4cqw; border-radius: 6px; box-shadow: 0 0 14px rgba(255,59,92,.7); }
.ntl-titolo { left: 0; right: 0; top: 77.5%; text-align: center; z-index: 5; line-height: 1.15; }
.ntl-nome { font-family: var(--tn-head, 'Bricolage Grotesque', sans-serif); font-weight: 800; font-size: 10.2cqw; line-height: 1; color: #fff;
  text-shadow: 0 0 10px rgba(120,220,255,.9), 0 2px 0 #052040; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8%; }
.ntl-meta { font-size: 4cqw; letter-spacing: .16em; text-transform: uppercase; color: #9fe9ff; font-weight: 700; margin-top: 1cqw; }
.ntl-numeri { left: 0; right: 0; bottom: 3%; z-index: 5; display: flex; justify-content: center; gap: 10cqw; font-size: 3.8cqw; color: #8fb6d8; text-align: center; line-height: 1.15; }
.ntl-numeri b { display: block; color: #fff; font-size: 5cqw; font-family: var(--tn-head, sans-serif); }
/* tre fiocchi che scendono dentro la carta (si fermano prima del fondo: niente sporge sotto) */
.ntl-neve { top: 2%; width: 1.3cqw; height: 1.3cqw; border-radius: 50%; background: #fff; opacity: 0; pointer-events: none; z-index: 7;
  animation: ntl-cade var(--d) linear var(--w) infinite; }

/* al passaggio: il ghiaccio si incrina e la luce esce dalle crepe */
.tc-ed:hover .ntl-crepa, .tc-ed:focus-within .ntl-crepa { stroke-dashoffset: 0; }
.tc-ed:hover .ntl-luce, .tc-ed:focus-within .ntl-luce { opacity: 1; }
.tc-ed:hover .ntl-vetro img, .tc-ed:focus-within .ntl-vetro img { filter: saturate(1.1) brightness(1.15) sepia(.12) hue-rotate(-8deg); }
.tc-ed:hover .ntl-anello svg { animation-duration: 8s; }
.tc-ed:hover .ntl-gira { animation-duration: 3s; }
.tc-ed:hover .ntl-lucine circle { animation-duration: .45s; }
.tc-ed:hover .ntl-palla-s, .tc-ed:hover .ntl-palla-d { animation-duration: .9s; }
/* su touch l'incrinatura compare da sola ogni tanto */
@media (hover: none) {
  .ntl-crepa { animation: ntl-incrina 9s ease-in-out infinite; }
  .ntl-luce { animation: ntl-riflesso 9s ease-in-out infinite; }
}
@container (max-width: 170px) { .ntl-numeri { display: none; } .ntl-meta { letter-spacing: .06em; } }

@keyframes ntl-gira { to { transform: rotate(360deg); } }
@keyframes ntl-prisma { 0%, 100% { stop-color: #c9b4ff; } 25% { stop-color: #6fd3ff; } 50% { stop-color: #8dffb0; } 75% { stop-color: #ffb3e6; } }
@keyframes ntl-lucina { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes ntl-dondola { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes ntl-brina { 0% { stroke-dashoffset: 160; } 50%, 80% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ntl-goccia { 0%, 60% { opacity: 0; transform: translateY(0); } 65% { opacity: 1; } 100% { opacity: 0; transform: translateY(26px); } }
@keyframes ntl-cade { 0% { opacity: 0; transform: translate(0, 0); } 10% { opacity: .85; } 85% { opacity: .85; } 100% { opacity: 0; transform: translate(var(--dx, 8px), 120cqw); } }
@keyframes ntl-incrina { 0%, 76%, 100% { stroke-dashoffset: 120; } 82%, 94% { stroke-dashoffset: 0; } }
@keyframes ntl-riflesso { 0%, 78%, 100% { opacity: 0; } 84%, 94% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ntl *, .ntl { animation: none !important; transition: none !important; }
  .ntl-lucine circle { opacity: .8; }
  .ntl-neve, .ntl-goccia { display: none; }
}
