:root {
  --purple-deep: #0d0714;
  --purple-darker: #130a1f;
  --purple-dark: #1a0d2e;
  --purple-mid: #2d1654;
  --purple-core: #4a1d96;
  --purple-bright: #7c3aed;
  --purple-light: #a855f7;
  --purple-glow: #c084fc;
  --purple-pale: #e9d5ff;
  --accent-gold: #fbbf24;
  --accent-teal: #2dd4bf;
  --accent-pink: #f472b6;
  --text-main: #f3e8ff;
  --text-muted: #c4b5fd;
  --text-dim: #7c6a94;
  --card-bg: rgba(45, 22, 84, 0.4);
  --card-border: rgba(168, 85, 247, 0.2);
  --nav-height: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Raleway', sans-serif;
  background: var(--purple-deep);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
}

/* -- PARTICLES -- */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* Detrás de todo */
  pointer-events: none;
  /* Para que puedas hacer clic en los botones */
}

/* -- BACKGROUND -- */
.bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(124, 58, 237, .15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 70%, rgba(168, 85, 247, .10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 0%, rgba(192, 132, 252, .08) 0%, transparent 50%),
    linear-gradient(180deg, var(--purple-deep) 0%, #0a0515 100%);
  z-index: 0;
}

/* -- NAV -- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(13, 7, 20, .85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(168, 85, 247, .15);
  transition: all .3s ease;
}

nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
}

/* Esto asegura que el contenido se vea por encima de las partículas */
main, footer {
  position: relative;
  z-index: 10;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img {
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, .6));
}

.nav-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--purple-glow);
  letter-spacing: .05em;
  text-shadow: 0 0 20px rgba(168, 85, 247, .5);
}

.nav-links {
  display: flex;
  gap: .25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: .45rem 1rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}

.nav-links a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, .2), rgba(168, 85, 247, .1));
  opacity: 0;
  transition: opacity .25s;
}

.nav-links a:hover {
  color: var(--purple-glow);
  text-shadow: 0 0 12px rgba(192, 132, 252, .6);
}

.nav-links a:hover::before {
  opacity: 1;
}

/* -- HERO -- */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) 2rem 4rem;
}

/* Hero compacto — igual en todas las páginas interiores */
.page-hero {
  min-height: 40vh;
  padding: calc(var(--nav-height) + 2rem) 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

@media (max-width: 768px) {
  .page-hero .hero-title {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
  }

  .page-hero .hero-subtitle {
    font-size: .95rem;
    margin-bottom: 1.25rem;
  }
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  background: url('../assets/logos/mystic_cave_bg.png') center/cover no-repeat;
  opacity: .12;
  filter: saturate(.5) blur(2px);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 58, 237, .15);
  border: 1px solid rgba(168, 85, 247, .3);
  border-radius: 100px;
  padding: .4rem 1.2rem;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--purple-glow);
  margin-bottom: 2rem;
  animation: fadeInDown .8s ease both;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-teal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-teal);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .5;
    transform: scale(1.4);
  }
}

.hero-logo-wrap {
  position: relative;
  margin-bottom: 1.5rem;
  animation: fadeInUp .9s ease .1s both;
}

.hero-logo {
  width: 260px;
  height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(168, 85, 247, .5)) drop-shadow(0 0 80px rgba(124, 58, 237, .3));
  animation: float 6s ease-in-out infinite;
  border-radius: 50%;
  overflow: hidden;
}

.hero-logo-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, .2);
  animation: spin-slow 20s linear infinite;
}

.hero-logo-ring::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--purple-light);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--purple-light);
}

@keyframes spin-slow {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.hero-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--purple-glow) 40%, var(--purple-light) 70%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
  animation: fadeInUp 1s ease .2s both;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 300;
  animation: fadeInUp 1s ease .35s both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 1s ease .5s both;
}

/* -- BUTTONS -- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .85rem 2rem;
  background: linear-gradient(135deg, var(--purple-core), var(--purple-bright));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all .3s ease;
  box-shadow: 0 4px 30px rgba(124, 58, 237, .4);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .15), transparent);
  transition: left .5s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(124, 58, 237, .6);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .85rem 2rem;
  background: transparent;
  border: 1px solid rgba(168, 85, 247, .4);
  border-radius: 10px;
  color: var(--purple-glow);
  font-family: 'Raleway', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  transition: all .3s ease;
}

.btn-outline:hover {
  background: rgba(168, 85, 247, .1);
  border-color: var(--purple-light);
  box-shadow: 0 0 20px rgba(168, 85, 247, .2);
}

/* -- SECTIONS -- */
section {
  position: relative;
  z-index: 2;
  padding: 5rem 2rem;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-tag {
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--purple-light);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
}

.section-tag::before,
.section-tag::after {
  content: '';
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--purple-light));
}

.section-tag::before {
  background: linear-gradient(270deg, var(--purple-light), transparent);
}

.section-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-main), var(--purple-glow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
  text-align: center;
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: .95rem;
  max-width: 500px;
  margin: 0 auto 3rem;
  line-height: 1.7;
  font-weight: 300;
}

/* -- STATS BAR -- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: rgba(168, 85, 247, .1);
  border: 1px solid rgba(168, 85, 247, .15);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 6rem;
}

.stat-item {
  padding: 2rem 1.5rem;
  text-align: center;
  background: rgba(13, 7, 20, .8);
  transition: background .3s;
}

.stat-item:hover {
  background: rgba(45, 22, 84, .4);
}

.stat-number {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--purple-light);
  text-shadow: 0 0 20px rgba(168, 85, 247, .4);
  display: block;
  line-height: 1;
  margin-bottom: .4rem;
}

.stat-label {
  font-size: .75rem;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Estilos para la Sección de Noticias */
/* Estilos para las tarjetas de noticias manuales */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.news-card {
  background: rgba(30, 15, 50, 0.5);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-left: 4px solid var(--purple-glow);
  padding: 25px;
  border-radius: 0 15px 15px 0;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.news-card:hover {
  background: rgba(45, 20, 80, 0.7);
  transform: translateY(-5px);
  border-color: var(--purple-glow);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.news-date {
  font-size: 0.75rem;
  color: var(--purple-light);
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.news-item-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 15px;
  line-height: 1.3;
}

.news-excerpt {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}

.news-link {
  color: var(--purple-glow);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: right;
}

.news-link:hover {
  text-decoration: underline;
}

/* -- CLASS CARDS -- */
.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.class-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: all .35s cubic-bezier(.34, 1.56, .64, 1);
  backdrop-filter: blur(10px);
}

.class-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(168, 85, 247, .5);
  background: rgba(74, 29, 150, .3);
}

.class-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, .15), transparent 70%);
  opacity: 0;
  transition: opacity .35s;
}

.class-card:hover .class-card-glow {
  opacity: 1;
}

.class-img {
  width: 90px;
  height: 78px;
  object-fit: contain;
  margin-bottom: .75rem;
  filter: drop-shadow(0 4px 12px rgba(168, 85, 247, .3));
  transition: filter .35s, transform .35s;
}

.class-card:hover .class-img {
  filter: drop-shadow(0 6px 20px rgba(192, 132, 252, .6));
  transform: scale(1.05);
}

.class-name {
  font-family: 'Cinzel Decorative', serif;
  font-size: .75rem;
  color: var(--purple-glow);
  margin-bottom: .4rem;
  line-height: 1.3;
}

.class-desc {
  font-size: .7rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* -- FEATURE CARDS -- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: all .3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.feature-card:hover {
  border-color: rgba(168, 85, 247, .4);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(74, 29, 150, .3);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
}

.feature-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1rem;
  color: var(--purple-glow);
  margin-bottom: .6rem;
}

.feature-text {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* -- DIVIDER -- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, .3), transparent);
  margin: 0 2rem;
  position: relative;
  z-index: 2;
}

/* -- FOOTER -- */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.25rem 2rem;
  background: rgba(10, 5, 20, .92);
  border-top: 1px solid rgba(168, 85, 247, .15);
  width: 100%;
  box-sizing: border-box;
}

.footer-logo {
  display: none;
}

.footer-links {
  display: none;
}

.footer-copy {
  font-size: .9rem;
  color: var(--text-dim);
  letter-spacing: .05em;
}

/* -- ANIMATIONS -- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── NAV MÓVIL ─────────────────────────────────────────────────────────── */

/* Botón hamburguesa — oculto en escritorio */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.nav-burger span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--purple-glow);
  transition: transform .3s ease, opacity .3s ease;
  transform-origin: center;
}

/* Animación X al abrir */
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Enlace activo */
.nav-links a.nav-active {
  color: var(--purple-glow);
}

@media (max-width: 768px) {
  .nav-burger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 5, 20, .97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(168, 85, 247, .2);
    padding: .5rem 0 1rem;
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: .85rem 2rem;
    font-size: .95rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(168, 85, 247, .08);
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }
}

/* -- SCROLLBAR -- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--purple-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--purple-core);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--purple-bright);
}

/* ── BOTÓN VOLVER ARRIBA (solo móvil) ───────────────────────────────────── */
.back-to-top {
  display: none;
}

@media (max-width: 768px) {
  .back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.85);
    border: 1px solid rgba(168, 85, 247, 0.5);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
    cursor: pointer;
    z-index: 998;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
  }

  .back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}