/* Estilos de la landing con paneles, parallax y efectos. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Merriweather:wght@300;400;700&display=swap');

:root {
  --color-gold: #d9b46b;
  --color-cream: #f2ede6;
  --color-night: #05060f;
  --color-stone: #3b3f4d;
  --section-padding: clamp(4rem, 8vh, 7rem) clamp(1.5rem, 6vw, 4rem);
  --btn-radius: 999px;
  --btn-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

/* Scroll snap global para enganchar cada panel a pantalla completa */
html,
body {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  font-family: 'Merriweather', serif;
  color: var(--color-cream);
  background-color: var(--color-night);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

main.landing {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

/* Paneles a pantalla completa con animación fade */
.panel {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--section-padding);
  text-align: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Capas parallax que se desplazan horizontalmente */
.parallax-layer {
  will-change: transform;
  transition: transform 0.2s ease-out;
}

.landing__hero .landing__logo,
.landing__hero .landing__subtitle,
.landing__hero .landing__scroll-hint {
  position: relative;
  z-index: 2;
}

.landing__hero {
  background: radial-gradient(circle at top, rgba(217, 180, 107, 0.15), rgba(5, 6, 15, 0.95)),
              linear-gradient(180deg, rgba(19, 21, 33, 0.65) 0%, rgba(5, 6, 15, 1) 100%);
  gap: clamp(1.5rem, 4vh, 2.5rem);
}

.landing__logo {
  width: clamp(220px, 35vw, 420px);
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
  opacity: 0;
  transform: translateY(24px) scale(0.9);
  animation:
    logo-reveal 1.15s ease-out 0.1s forwards,
    logo-glow 5s ease-in-out 1.5s infinite;
}

.landing__subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  letter-spacing: 0.3rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  animation: subtitle-rise 0.9s ease-out 0.45s forwards;
}

.landing__scroll-hint {
  position: absolute;
  bottom: clamp(-0.25rem, 2vh, 1.75rem);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  animation:
    hint-reveal 0.9s ease-out 0.9s forwards,
    hint-float 2.8s infinite ease-in-out 1.8s;
}

.landing__scroll-hint svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  transform: rotate(180deg);
}

@keyframes hint-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

@keyframes logo-reveal {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.9);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 0px rgba(217, 180, 107, 0)); }
  50% { filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 22px rgba(217, 180, 107, 0.32)); }
}

@keyframes subtitle-rise {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hint-reveal {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing__chapter {
  isolation: isolate;
  color: var(--color-cream);
}

.landing__chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.85;
  transition: opacity 0.6s ease;
  z-index: 0;
}

.landing__chapter:hover::before,
.landing__chapter:focus-within::before {
  opacity: 0.95;
}

.scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

.scene svg {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.space-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.particles-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.chapter__content {
  position: relative;
  z-index: 4;
  max-width: 720px;
  backdrop-filter: blur(3px);
  background: rgba(6, 8, 18, 0.35);
  padding: clamp(2rem, 4vh, 3rem) clamp(1.5rem, 5vw, 3.5rem);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.particles-container canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.chapter__content h2 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.1rem, 4vw, 3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
  color: var(--color-gold);
}

.chapter__content p {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.7;
  margin: 0 0 2rem;
}

.chapter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.25rem 1.75rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(228, 199, 122, 0.08), rgba(192, 146, 63, 0.22));
  border: 1px solid rgba(228, 199, 122, 0.35);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3);
  font-family: 'Cinzel', serif;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  backdrop-filter: blur(6px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 0.85rem 2.5rem;
  border-radius: var(--btn-radius);
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: var(--btn-shadow);
}

.btn--primary {
  background: linear-gradient(135deg, #e4c77a, #c0923f);
  color: #221403;
}

.btn--ghost {
  background: rgba(0, 0, 0, 0.55);
  color: var(--color-cream);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn:hover,
.btn:focus {
  transform: translateY(-4px);
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.45);
}

.btn--ghost:hover,
.btn--ghost:focus {
  background: rgba(255, 255, 255, 0.12);
}

.landing__chapter--winterfell::before {
  background:
    linear-gradient(180deg, rgba(79, 47, 26, 1) 0%, rgba(84, 53, 29, 0.85) 25%, rgba(62, 49, 40, 0.75) 45%, rgba(55, 77, 104, 0.8) 60%, rgba(132, 161, 185, 0.95) 100%);
}

.winterfell-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.winterfell-layer {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.winterfell-layer--aurora {
  background: radial-gradient(circle at 30% 20%, rgba(126, 196, 255, 0.35), rgba(126, 196, 255, 0) 38%),
    radial-gradient(circle at 70% 12%, rgba(126, 196, 255, 0.22), rgba(126, 196, 255, 0) 32%),
    linear-gradient(115deg, rgba(51, 121, 199, 0.25) 0%, rgba(161, 211, 255, 0.05) 24%, rgba(51, 121, 199, 0.25) 48%, rgba(161, 211, 255, 0.05) 72%, rgba(51, 121, 199, 0.22) 100%);
  background-size: cover;
  background-position: center top;
  mix-blend-mode: screen;
  opacity: 0.7;
}

.winterfell-layer--sky {
  background-image: url('../imgs/index/capa_0_cielo.png');
  background-size: cover;
  background-position: center top;
  opacity: 0.95;
}

.winterfell-layer--clouds {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 50%);
  background-size: cover;
  opacity: 0.75;
  filter: blur(2px);
}

.winterfell-layer--castle {
  background-image: url('../imgs/index/capa_1_castillo.png');
  background-size: min(74vw, 900px);
  background-position: 54% 55%;
  opacity: 0.92;
}

.winterfell-layer--mist {
  background: radial-gradient(ellipse at 50% 60%, rgba(104, 144, 184, 0.22) 0%, rgba(104, 144, 184, 0) 70%),
    radial-gradient(ellipse at 20% 70%, rgba(175, 207, 233, 0.16) 0%, rgba(175, 207, 233, 0) 70%);
  background-size: cover;
  opacity: 0.9;
  filter: blur(3px);
}

.winterfell-layer--ground {
  background-image: url('../imgs/index/capa_3_suelo.png');
  background-size: min(140vw, 1600px);
  background-position: center 86%;
  opacity: 0.96;
}

.winterfell-layer--tree {
  background-image: url('../imgs/index/capa_2_arbol.png');
  background-size: min(46vw, 520px);
  background-position: 20% 64%;
  opacity: 0.98;
}

.snow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.snow-layer,
.snow-layer::before,
.snow-layer::after {
  background-repeat: repeat;
  background-image:
    radial-gradient(1.2px 1.2px at 18px 24px, rgba(255, 255, 255, 0.6) 55%, transparent 58%),
    radial-gradient(2px 2px at 52px 92px, rgba(255, 255, 255, 0.95) 62%, transparent 65%),
    radial-gradient(2.8px 2.8px at 118px 16px, rgba(255, 255, 255, 0.88) 62%, transparent 65%),
    radial-gradient(1.8px 1.8px at 184px 72px, rgba(255, 255, 255, 0.7) 55%, transparent 58%),
    radial-gradient(3.2px 3.2px at 220px 120px, rgba(255, 255, 255, 0.82) 60%, transparent 63%);
}

.snow-layer {
  background-size: 280px 210px;
  animation: snowfall-veer 14s linear infinite;
}

.snow-layer::before,
.snow-layer::after {
  content: '';
  position: absolute;
  inset: -140px 0 0 0;
}

.snow-layer::before {
  background-size: 220px 170px;
  opacity: 0.72;
  animation: snowfall-fast 11s linear infinite;
}

.snow-layer::after {
  background-size: 180px 140px;
  opacity: 0.55;
  filter: blur(0.4px);
  animation: snowfall-wide 18s linear infinite;
}

@keyframes snowfall-fast {
  0% {
    transform: translate3d(-10px, -80px, 0);
  }
  60% {
    transform: translate3d(18px, 70px, 0);
  }
  100% {
    transform: translate3d(-12px, 210px, 0);
  }
}

@keyframes snowfall-veer {
  0% {
    transform: translate3d(6px, -50px, 0);
  }
  50% {
    transform: translate3d(-12px, 90px, 0);
  }
  100% {
    transform: translate3d(8px, 190px, 0);
  }
}

@keyframes snowfall-wide {
  0% {
    transform: translate3d(16px, -70px, 0);
  }
  45% {
    transform: translate3d(-20px, 60px, 0);
  }
  100% {
    transform: translate3d(22px, 200px, 0);
  }
}

.landing__chapter--shire::before {
  background:
    linear-gradient(180deg, rgba(121, 75, 24, 1) 0%, rgba(138, 92, 30, 0.85) 20%, rgba(106, 78, 27, 0.8) 40%, rgba(67, 108, 43, 0.85) 65%, rgba(156, 202, 99, 0.95) 100%);
}

.leaf-layer {
  position: absolute;
  inset: -6% 0 0 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

.leaf {
  position: absolute;
  top: -10%;
  left: calc(8% * var(--index));
  width: 18px;
  height: 26px;
  background: radial-gradient(circle at 30% 30%, #ffdedb 0 20%, transparent 25%),
    linear-gradient(135deg, #a10f1f 0%, #d92632 50%, #861018 100%);
  border-radius: 50% 40% 60% 30% / 50% 50% 50% 40%;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform-origin: center;
  animation: leaf-fall var(--fall-duration) linear infinite;
  animation-delay: var(--fall-delay);
  filter: drop-shadow(0 0 6px rgba(217, 38, 50, 0.4));
}

.leaf:nth-child(1) { --index: 1; --fall-duration: 12s; --fall-delay: -1s; }
.leaf:nth-child(2) { --index: 3; --fall-duration: 15s; --fall-delay: -3s; }
.leaf:nth-child(3) { --index: 5; --fall-duration: 13s; --fall-delay: -5s; }
.leaf:nth-child(4) { --index: 7; --fall-duration: 16s; --fall-delay: -2s; }
.leaf:nth-child(5) { --index: 9; --fall-duration: 14s; --fall-delay: -4s; }
.leaf:nth-child(6) { --index: 11; --fall-duration: 17s; --fall-delay: -6s; }
.leaf:nth-child(7) { --index: 2; --fall-duration: 19s; --fall-delay: -7s; }
.leaf:nth-child(8) { --index: 4; --fall-duration: 18s; --fall-delay: -9s; }
.leaf:nth-child(9) { --index: 6; --fall-duration: 21s; --fall-delay: -8s; }
.leaf:nth-child(10) { --index: 8; --fall-duration: 20s; --fall-delay: -10s; }
.leaf:nth-child(11) { --index: 10; --fall-duration: 22s; --fall-delay: -11s; }
.leaf:nth-child(12) { --index: 12; --fall-duration: 18s; --fall-delay: -12s; }

@keyframes leaf-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -120px, 0) rotate(0deg) scale(0.9);
  }
  10% {
    opacity: 1;
  }
  50% {
    transform: translate3d(-40px, 50vh, 0) rotate(150deg) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate3d(60px, 110vh, 0) rotate(300deg) scale(1);
  }
}

.landing__chapter--space::before {
  background:
    linear-gradient(180deg, rgba(78, 50, 32, 1) 0%, rgba(57, 44, 48, 0.85) 25%, rgba(37, 33, 56, 0.8) 45%, rgba(18, 21, 48, 0.9) 65%, rgba(5, 6, 15, 1) 100%);
}

@media (max-width: 768px) {
  .chapter__content {
    background: rgba(6, 8, 18, 0.55);
    padding: clamp(1.75rem, 8vw, 2.5rem) clamp(1.5rem, 6vw, 2rem);
  }

  .chapter__actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
