/* ============================================================
   TEMA NAVIDEÑO (temporal) — krukansuu.com
   ------------------------------------------------------------
   Todo cuelga de `html.xmas`, que pone christmas.js según CHRISTMAS_MODE. Sin
   esa clase esta hoja no aplica nada y la web queda como siempre.

   Modo oscuro = el diseño base del tema. Modo claro = el bloque
   `html.xmas[data-theme="light"]` del final (crema, rojo y verde).

   Colores de las tarjetas: no se repinta cada tarjeta, se cambian los tokens
   de superficie (--ux-surface, --ux-line…) de la hoja principal. Dentro de las
   secciones rojas los mismos tokens pasan a bordó.
   ============================================================ */

html.xmas{
  --xmas-red:#c8283a;
  --xmas-red-deep:#9b1c2c;
  --xmas-green:#2f9c5a;
  --xmas-gold:#ffd76a;
  --xmas-snow:#ffffff;
  --xmas-flake:#ffffff;
  --xmas-star:#ffd76a;
  --xmas-wire:#1f6b3c;
  --xmas-ice:#bfe6ff;

  /* Masks reutilizadas: borde ondulado de nieve. */
  --xmas-drift:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 30' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1200V14C1150 26 1110 10 1060 18S960 28 900 16 800 6 740 18 640 28 580 15 480 8 420 19 320 27 260 15 160 7 100 18 30 24 0 16Z'/%3E%3C/svg%3E");
  --xmas-ground:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 30' preserveAspectRatio='none'%3E%3Cpath d='M0 30V14C50 4 90 20 140 12S240 2 300 14 400 24 460 12 560 2 620 15 720 22 780 11 880 3 940 13 1040 23 1100 12 1170 6 1200 14V30Z'/%3E%3C/svg%3E");
  --xmas-cap:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M0 14C0 8 6 5 14 6 22 1 34 2 42 6 54 2 66 3 74 6 86 1 100 2 108 6 120 2 132 3 142 6 154 1 168 2 176 6 188 4 200 7 200 14Z'/%3E%3C/svg%3E");
}

/* ---------- Tokens: oscuro ---------- */
html.xmas[data-theme="dark"]{
  --ux-page:#0b1f17;
  --ux-primary-light:#3a0f18;
  --ux-surface:#123526;
  --ux-surface-raised:#1a4532;
  --ux-line:rgba(255,215,106,.22);
  --cream:#0b1f17;
  --white:#123526;
  --gray-light:#1a4532;
}
html.xmas[data-theme="dark"] :is(.story-solution, .included, .testimonials){
  --ux-surface:#4a1521;
  --ux-surface-raised:#5a1a28;
  --white:#4a1521;
  --ux-primary-light:#2e0c14;
}

/* ============================================================
   1. BANNER
   ============================================================ */
html.xmas .xmas-banner{
  position:relative; z-index:1001;
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px 18px;
  padding:8px 16px;
  background:linear-gradient(90deg,#9b1c2c,#c8283a 50%,#9b1c2c);
  color:#fff; font-family:var(--font-head, inherit); font-size:.9rem; font-weight:600; line-height:1.35;
  text-align:center;
  box-shadow:inset 0 -1px 0 rgba(255,215,106,.35);
}
html.xmas .xmas-banner p{ margin:0; }
html.xmas .xmas-banner b{ color:#ffd76a; font-weight:700; }
html.xmas .xmas-banner-msg{ flex:1 1 auto; }
html.xmas .xmas-banner s{ opacity:.8; }
/* Silenciar / activar el sonido del trineo */
html.xmas .xmas-sound{
  flex:none; display:inline-grid; place-items:center;
  width:30px; height:30px; padding:0; margin:-4px 0;
  border-radius:50%; border:1px solid rgba(255,215,106,.45);
  background:rgba(255,255,255,.14); color:#fff; font-size:15px; line-height:1;
  cursor:pointer;
}
html.xmas .xmas-sound[hidden]{ display:none; }
html.xmas .xmas-sound:hover{ background:rgba(255,255,255,.26); }
html.xmas .xmas-sound:focus-visible{ outline:2px solid #ffd76a; outline-offset:2px; }
@media (min-width:900px){
  html.xmas .xmas-banner{ padding-inline:24px 28px; }
  html.xmas .xmas-banner-msg{ padding-left:30px; } /* compensa la campanita para centrar el mensaje */
}
@media (max-width:600px){
  html.xmas .xmas-banner{ padding:6px 12px; font-size:.8rem; gap:2px 10px; }
  html.xmas .xmas-banner{ flex-wrap:nowrap; text-align:left; }
}

/* ============================================================
   2. HEADER
   ============================================================ */
html.xmas .site-header{
  background:rgba(10,32,23,.88);
  border-bottom-color:rgba(255,215,106,.25);
}

/* Guirnalda */
html.xmas .xmas-garland{
  position:absolute; left:0; right:0; bottom:-11px; height:20px;
  pointer-events:none; z-index:2;
}
html.xmas .xmas-wire{
  position:absolute; inset:0 0 auto; width:100%; height:12px; overflow:visible;
}
html.xmas .xmas-wire path{
  fill:none; stroke:var(--xmas-wire); stroke-width:2; vector-effect:non-scaling-stroke;
}
html.xmas .xmas-bulb{
  position:absolute; top:8px; width:7px; height:10px; margin-left:-3.5px;
  border-radius:50% 50% 50% 50% / 40% 40% 60% 60%;
  background:var(--c); box-shadow:0 0 8px 2px var(--c);
  animation:xmas-twinkle 1.6s ease-in-out infinite;
}
html.xmas .xmas-bulb::before{
  content:""; position:absolute; top:-3px; left:1.5px; width:4px; height:4px; border-radius:1px;
  background:#2c4a36;
}
html.xmas .xmas-bulb.is-r{ --c:#ff3b4e; }
html.xmas .xmas-bulb.is-y{ --c:#ffd76a; }
html.xmas .xmas-bulb.is-g{ --c:#3ddc84; }
html.xmas .xmas-bulb.is-v{ --c:#b67cff; }
@keyframes xmas-twinkle{
  0%, 100%{ opacity:1; }
  50%{ opacity:.3; box-shadow:0 0 2px 0 var(--c); }
}

/* Adornos colgando */
html.xmas .xmas-ornaments{
  position:absolute; left:0; right:0; top:100%; height:0;
  pointer-events:none; z-index:1;
}
html.xmas .xmas-orn{
  position:absolute; top:0; width:1px; height:var(--len);
  background:linear-gradient(#ffd76a, #c9a34a);
  transform-origin:50% 0;
  animation:xmas-swing 3.2s ease-in-out infinite alternate;
}
html.xmas .xmas-orn i{
  position:absolute; left:50%; top:100%; width:15px; height:15px; margin-left:-7.5px;
  border-radius:50%;
  background:radial-gradient(circle at 32% 30%, rgba(255,255,255,.9) 0 2px, rgba(255,255,255,.35) 3px, transparent 6px), var(--c);
  box-shadow:0 2px 6px rgba(0,0,0,.35), inset -2px -3px 5px rgba(0,0,0,.25);
}
html.xmas .xmas-orn i::before{
  content:""; position:absolute; top:-3px; left:5px; width:5px; height:4px; border-radius:1px; background:#d9b450;
}
html.xmas .xmas-orn.is-r{ --c:#d42a36; }
html.xmas .xmas-orn.is-y{ --c:#e8b93b; }
html.xmas .xmas-orn.is-g{ --c:#24894c; }
html.xmas .xmas-orn.is-v{ --c:#8a4ff0; }
@keyframes xmas-swing{
  from{ transform:rotate(-7deg); }
  to{ transform:rotate(7deg); }
}

/* Gorro sobre el logo (solo el del header) */
html.xmas .site-header .logo{ position:relative; }
html.xmas .site-header .logo::before{
  content:""; position:absolute; left:-12px; top:-2px; width:28px; height:24px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 34'%3E%3Cpath d='M6 26C8 14 16 4 28 4c5 0 8 4 9 10-3-3-6-4-8-2 1 4 1 9 1 14Z' fill='%23d42a36'/%3E%3Cpath d='M28 4c5 0 8 4 9 10-3-3-6-4-8-2' fill='%23a3121f'/%3E%3Crect x='3' y='23' width='30' height='8' rx='4' fill='%23fff'/%3E%3Ccircle cx='36' cy='17' r='4' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat;
  transform:rotate(-18deg);
  pointer-events:none;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.3));
}

/* ============================================================
   3. FONDO Y SECCIONES
   ============================================================ */
html.xmas body{ background:#0b1f17; }
html.xmas body::before{
  content:""; position:fixed; inset:0; z-index:-2; pointer-events:none;
  background:linear-gradient(180deg,#0b1f17 0%,#0f2a1f 35%,#1a1012 70%,#0b1f17 100%);
}

/* Estrellitas, detrás del contenido */
html.xmas .xmas-stars{ position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden; }
html.xmas .xmas-stars i{
  position:absolute; width:var(--s); height:var(--s); border-radius:50%;
  background:var(--xmas-star); box-shadow:0 0 6px 1px var(--xmas-star);
  animation:xmas-star 3.6s ease-in-out infinite;
}
@keyframes xmas-star{
  0%, 100%{ opacity:.85; transform:scale(1); }
  50%{ opacity:.15; transform:scale(.6); }
}

/* Secciones rojas, verde y pie */
html.xmas :is(.story-solution, .included, .testimonials){
  position:relative;
  background:linear-gradient(180deg,#3a0f18,#2a0b12);
}
html.xmas .testimonials .rail-edge-fade{ background:linear-gradient(to right, transparent, #300d15); }
html.xmas .lessons{ position:relative; background:#123222; --ux-surface:#123222; }

/* Montoncito de nieve arriba de cada sección de color */
html.xmas :is(.story-solution, .included, .testimonials, .lessons)::before{
  content:""; position:absolute; left:0; right:0; top:0; height:22px; z-index:1;
  background:var(--xmas-snow);
  -webkit-mask:var(--xmas-drift) top/100% 100% no-repeat;
          mask:var(--xmas-drift) top/100% 100% no-repeat;
  pointer-events:none;
}

html.xmas .site-footer{
  position:relative;
  background:#2a0b12;
  border-top:7px solid transparent;
  border-image:repeating-linear-gradient(135deg,#d42a36 0 10px,#ffffff 10px 20px) 7;
}
/* Suelo nevado justo antes del pie */
html.xmas .site-footer::before{
  content:""; position:absolute; left:0; right:0; top:-33px; height:27px;
  background:var(--xmas-snow);
  -webkit-mask:var(--xmas-ground) bottom/100% 100% no-repeat;
          mask:var(--xmas-ground) bottom/100% 100% no-repeat;
  pointer-events:none;
}

/* Hero: resplandores rojo y verde y brillo dorado arriba */
html.xmas .hero{
  background-image:radial-gradient(ellipse 70% 260px at 50% 0, rgba(255,215,106,.13), transparent 70%);
}
html.xmas .hero::before{ background:radial-gradient(circle, rgba(212,42,54,.42), transparent 70%); }
html.xmas .hero::after{ background:radial-gradient(circle, rgba(47,156,90,.38), transparent 70%); }

/* Tarjetas: nieve encima y lazo en algunas */
html.xmas :is(.included-grid > *, .story-pains li, .hero-book .book-buy, .basics-strip-card){
  position:relative;
  border-color:var(--ux-line);
}
html.xmas .story-pains li{ border-left-color:var(--story-pain); }
html.xmas :is(.included-grid > *, .story-pains li, .hero-book .book-buy, .basics-strip-card)::before{
  content:""; position:absolute; left:14px; right:14px; top:-6px; height:11px;
  background:var(--xmas-snow);
  -webkit-mask:var(--xmas-cap) center/100% 100% no-repeat;
          mask:var(--xmas-cap) center/100% 100% no-repeat;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.18));
  pointer-events:none;
}
html.xmas :is(.included-grid > *:nth-child(odd), .story-pains li:nth-child(2), .hero-book .book-buy)::after{
  content:"🎀"; position:absolute; top:-14px; right:-8px; font-size:24px; line-height:1;
  transform:rotate(14deg); pointer-events:none;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.25));
}

/* ❄ antes de los h2 de sección (texto alternativo vacío: no se lee) */
html.xmas .section-title::before{
  content:"❄\FE0E\00a0";
  content:"❄\FE0E\00a0" / "";
  color:var(--xmas-ice); font-weight:400;
}

/* ============================================================
   4. EFECTOS ANIMADOS
   ============================================================ */
html.xmas .xmas-fx{
  position:fixed; inset:0; z-index:900; overflow:hidden; pointer-events:none;
}
html.xmas .xmas-snow{ position:absolute; inset:0; width:100%; height:100%; color:var(--xmas-flake); }

/* Trineo: de derecha a izquierda cada 14 s. Con transform, no con left. */
html.xmas .xmas-sleigh{
  position:absolute; top:17vh; left:0;
  font-size:34px; line-height:1; white-space:nowrap;
  transform:translate(100vw, 0);
  animation:xmas-sleigh 14s linear infinite;
  will-change:transform;
}
html.xmas .xmas-sleigh > span{
  display:inline-block;
  filter:drop-shadow(0 0 6px rgba(255,215,106,.85)) drop-shadow(0 0 14px rgba(255,215,106,.45));
  animation:xmas-bob 1.6s ease-in-out infinite alternate;
}
@keyframes xmas-sleigh{
  0%{ transform:translate(100vw, 0); }
  62%, 100%{ transform:translate(-100%, 0); }
}
@keyframes xmas-bob{
  from{ transform:translateY(-7px); }
  to{ transform:translateY(7px); }
}

/* Arbolitos iluminados en las esquinas */
html.xmas .xmas-tree{
  position:fixed; bottom:10px; z-index:800; pointer-events:none;
  font-size:46px; line-height:1;
  animation:xmas-glow-tree 2.4s ease-in-out infinite alternate;
}
html.xmas .xmas-tree.is-left{ left:12px; }
html.xmas .xmas-tree.is-right{ right:12px; }
@keyframes xmas-glow-tree{
  from{ filter:drop-shadow(0 0 4px rgba(255,215,106,.4)); }
  to{ filter:drop-shadow(0 0 14px rgba(255,215,106,.95)); }
}

/* Hero: regalos y estrella flotando, etiqueta sobre el h1 */
html.xmas .hero > .xmas-float{
  position:absolute; z-index:0; margin:0; max-width:none;
  font-size:40px; line-height:1; pointer-events:none;
  animation:xmas-float 5s ease-in-out infinite alternate;
}
html.xmas .hero > .xmas-float.is-gift1{ left:6%; top:150px; transform:rotate(-10deg); }
html.xmas .hero > .xmas-float.is-gift2{ right:6%; top:360px; font-size:34px; animation-delay:-2s; }
html.xmas .hero > .xmas-float.is-star{
  right:13%; top:58px; font-size:30px; animation-delay:-3.5s;
  filter:drop-shadow(0 0 10px rgba(255,215,106,.8));
}
@keyframes xmas-float{
  from{ translate:0 -8px; rotate:-6deg; }
  to{ translate:0 10px; rotate:6deg; }
}

/* ============================================================
   5. BOTONES DE COMPRA
   `.xmas-gift-btn` lo pone el script a los que cambia de texto (incluye el
   claro del cierre). El brillo (::after de .cta-shine/.buy-fx) se mantiene:
   va por encima del fondo y aquí no se toca.
   ============================================================ */
html.xmas :is(.btn.btn-primary, .btn.xmas-gift-btn){
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 8' preserveAspectRatio='none'%3E%3Cpath d='M0 0H60V3C54 7 48 3 42 5S30 8 24 4 12 2 6 5 0 5 0 4Z' fill='%23fff' fill-opacity='.92'/%3E%3C/svg%3E") top left/60px 7px repeat-x,
    repeating-linear-gradient(45deg, rgba(255,255,255,.11) 0 7px, transparent 7px 19px),
    linear-gradient(135deg,#e0343f,#b3121f 55%,#d42a36) !important;
  border:2px solid #ffd76a !important;
  color:#fff !important;
  box-shadow:0 12px 28px -10px rgba(212,42,54,.7);
  text-shadow:0 1px 1px rgba(80,0,10,.45);
}
html.xmas :is(.btn.btn-primary, .btn.xmas-gift-btn):hover{
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 8' preserveAspectRatio='none'%3E%3Cpath d='M0 0H60V3C54 7 48 3 42 5S30 8 24 4 12 2 6 5 0 5 0 4Z' fill='%23fff' fill-opacity='.92'/%3E%3C/svg%3E") top left/60px 7px repeat-x,
    repeating-linear-gradient(45deg, rgba(255,255,255,.11) 0 7px, transparent 7px 19px),
    linear-gradient(135deg,#2f9c5a,#1c6b3c) !important;
  color:#fff !important;
  box-shadow:0 12px 28px -10px rgba(47,156,90,.75);
}
/* El latido morado del botón pasa a rojo y dorado. */
@media (prefers-reduced-motion: no-preference){
  html.xmas :is(.btn.buy-fx, .hero-book .book-buy .hero-buy-cta){ animation-name:xmas-btn-glow; }
}
@keyframes xmas-btn-glow{
  0%, 100%{ box-shadow:0 14px 34px -10px rgba(212,42,54,.6), 0 0 0 0 rgba(255,215,106,.55); }
  50%{ box-shadow:0 18px 46px -8px rgba(224,52,63,.85), 0 0 0 10px rgba(255,215,106,0); }
}

html.xmas .top-nav a.btn.header-buy{ white-space:nowrap; }

/* ============================================================
   MÓVIL
   ============================================================ */
@media (max-width:760px){
  html.xmas .xmas-tree,
  html.xmas .hero > .xmas-float{ display:none; }
}
@media (max-width:480px){
  /* Menos movimiento en el celular: estrellas, luces y bolas quedan quietas
     (la nieve ni se crea, ver christmas.js). Sigue el trineo. */
  html.xmas :is(.xmas-bulb, .xmas-orn, .xmas-stars i){ animation:none !important; }
}
@media (max-width:400px){
  html.xmas .xmas-banner{ font-size:.74rem; }
}
@media (max-width:600px){
  html.xmas .xmas-sleigh{ font-size:22px; top:13vh; }
  html.xmas .xmas-orn.is-desk{ display:none; }
  html.xmas .xmas-orn{ height:calc(var(--len) * .55); }
  html.xmas .xmas-orn i{ width:12px; height:12px; margin-left:-6px; }
  html.xmas .site-header .logo::before{ width:22px; height:19px; left:-9px; top:0; }
  html.xmas :is(.included-grid > *:nth-child(odd), .story-pains li:nth-child(2), .hero-book .book-buy)::after{
    right:-4px; font-size:20px;
  }
}

/* ============================================================
   MOVIMIENTO REDUCIDO: sin nieve ni trineo (el script no los crea) y nada se
   mueve. Las luces quedan encendidas, quietas.
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  html.xmas .xmas-fx{ display:none; }
  html.xmas :is(.xmas-bulb, .xmas-orn, .xmas-stars i, .xmas-tree, .xmas-float, .xmas-sleigh, .xmas-sleigh > span){
    animation:none !important;
  }
}

/* ============================================================
   6. MODO CLARO
   ============================================================ */
html.xmas[data-theme="light"]{
  --ux-page:#fbf6ee;
  --ux-primary-light:#fbe9e6;
  --ux-surface:#ffffff;
  --ux-surface-raised:#fffaf3;
  --ux-line:rgba(176,30,45,.16);
  --cream:#fbf6ee;
  --white:#ffffff;

  --xmas-snow:#e3e8ef;
  --xmas-flake:#c3ccd6;
  --xmas-star:#d9a520;
  --xmas-wire:#2f7d4a;
  --xmas-ice:#c8283a;
}
html.xmas[data-theme="light"] :is(.story-solution, .included, .testimonials){
  --ux-surface:#fffaf8;
  --ux-line:rgba(200,40,58,.22);
  --ux-primary-light:#f9e0dc;
  background:linear-gradient(180deg,#fcebe8,#f8dedb);
}
html.xmas[data-theme="light"] .testimonials .rail-edge-fade{ background:linear-gradient(to right, transparent, #f9e1de); }
html.xmas[data-theme="light"] .lessons{ background:#eaf5ee; --ux-surface:#eaf5ee; }
html.xmas[data-theme="light"] body{ background:#fbf6ee; }
html.xmas[data-theme="light"] body::before{
  background:linear-gradient(180deg,#fbf6ee 0%,#fdf3ec 35%,#fbeeee 70%,#f4f8f1 100%);
}
html.xmas[data-theme="light"] .site-header{
  background:rgba(255,251,245,.9);
  border-bottom-color:rgba(47,125,74,.3);
}
html.xmas[data-theme="light"] .xmas-stars i{ box-shadow:0 0 4px rgba(217,165,32,.6); opacity:.6; }
html.xmas[data-theme="light"] .hero{
  background-image:radial-gradient(ellipse 70% 260px at 50% 0, rgba(255,200,80,.18), transparent 70%);
}
html.xmas[data-theme="light"] .hero::before{ background:radial-gradient(circle, rgba(212,42,54,.22), transparent 70%); }
html.xmas[data-theme="light"] .hero::after{ background:radial-gradient(circle, rgba(47,156,90,.22), transparent 70%); }
html.xmas[data-theme="light"] .xmas-sleigh > span{
  filter:drop-shadow(0 0 5px rgba(230,170,40,.8));
}
