/* ============================================
   Astrocronos Círculo de Estudios
   Stylesheet v1.0
   ============================================ */

/* Variables */
:root {
  --color-bg: #0a0a0a;
  --color-gold: #d4af37;
  --color-gold-light: #f3d87e;
  --color-purple: #2d0a31;
  --color-purple-deep: #1a051f;
  --color-white: #f5f5f5;
  --color-muted: #a8a8a8;
  --font-title: 'Playfair Display', serif;
  --font-body: 'Montserrat', sans-serif;
  --transition-fast: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-white);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Glassmorphism */
.glass {
  background: rgba(20, 20, 20, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 12px;
}

/* Tipografía */
h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.2;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--color-gold);
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

/* Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1100;
  background: linear-gradient(90deg, var(--color-purple-deep), var(--color-purple));
  color: var(--color-gold-light);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.top-bar__countdown {
  font-variant-numeric: tabular-nums;
  color: #fff;
}

/* Sticky Header Banner */
.sticky-header {
  position: fixed;
  top: 34px;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  padding: 0.6rem 0;
  transition: transform var(--transition-fast);
}

.sticky-header--hidden {
  transform: translateY(-100%);
}

.sticky-header__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-gold);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  transition: background var(--transition-fast), transform var(--transition-fast);
  width: fit-content;
  margin: 0 auto;
}

.sticky-header__inner:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: scale(1.02);
}

.icon-telegram {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1rem 4rem;
  overflow: hidden;
}

#starsCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.constellation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.constellation:nth-of-type(2) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600'%3E%3Cpath d='M100,300 L200,250 L300,320 L400,280 L500,350' fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.4'/%3E%3Ccircle cx='100' cy='300' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Ccircle cx='200' cy='250' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Ccircle cx='300' cy='320' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Ccircle cx='400' cy='280' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Ccircle cx='500' cy='350' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Cpath d='M600,100 L650,180 L720,150 L780,200' fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.4'/%3E%3Ccircle cx='600' cy='100' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Ccircle cx='650' cy='180' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Ccircle cx='720' cy='150' r='2' fill='%23d4af37' opacity='0.6'/%3E%3Ccircle cx='780' cy='200' r='2' fill='%23d4af37' opacity='0.6'/%3E%3C/svg%3E");
}

.constellation:nth-of-type(3) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600'%3E%3Cpath d='M150,450 L220,400 L300,460 L380,420' fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.3'/%3E%3Ccircle cx='150' cy='450' r='1.5' fill='%23d4af37' opacity='0.5'/%3E%3Ccircle cx='220' cy='400' r='1.5' fill='%23d4af37' opacity='0.5'/%3E%3Ccircle cx='300' cy='460' r='1.5' fill='%23d4af37' opacity='0.5'/%3E%3Ccircle cx='380' cy='420' r='1.5' fill='%23d4af37' opacity='0.5'/%3E%3Cpath d='M500,500 L580,480 L640,520' fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.3'/%3E%3Ccircle cx='500' cy='500' r='1.5' fill='%23d4af37' opacity='0.5'/%3E%3Ccircle cx='580' cy='480' r='1.5' fill='%23d4af37' opacity='0.5'/%3E%3Ccircle cx='640' cy='520' r='1.5' fill='%23d4af37' opacity='0.5'/%3E%3C/svg%3E");
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2.5rem;
}

.hero__title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: var(--color-gold);
  margin-bottom: 1rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--color-muted);
  margin-bottom: 2rem;
  font-weight: 300;
}

.hero__caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Botones Astrocronos */
.btn-astrocronos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-bg);
  background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-light) 50%, var(--color-gold) 100%);
  background-size: 200% auto;
  border-radius: 50px;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
  animation: shimmer 3s linear infinite, pulse-gold 2s infinite;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-astrocronos:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
}

.btn-astrocronos:active {
  transform: scale(0.98);
}

@keyframes shimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.35); }
  50% { box-shadow: 0 0 35px rgba(212, 175, 55, 0.6); }
}

/* Split Worlds */
.split-worlds {
  padding: 6rem 0;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-purple-deep) 50%, var(--color-bg) 100%);
}

.split-worlds__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .split-worlds__inner {
    grid-template-columns: 1fr auto 1fr;
    gap: 3rem;
  }
}

.split-worlds__side h2 {
  font-size: 1.8rem;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}

.split-worlds__side p {
  color: var(--color-muted);
  font-size: 0.95rem;
  max-width: 280px;
  margin: 0 auto;
}

.split-worlds__center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.split-worlds__logo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(212, 175, 55, 0.2), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(45, 10, 49, 0.4), transparent 60%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--color-gold);
  text-align: center;
  padding: 1rem;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.split-worlds__logo:hover {
  box-shadow: 0 0 50px rgba(212, 175, 55, 0.25);
  transform: scale(1.05);
}

/* Biblioteca */
.library {
  padding: 5rem 0;
}

.library__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) {
  .library__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .library__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--transition-smooth);
  background: var(--color-purple-deep);
  border: 1px solid rgba(212, 175, 55, 0.1);
}

.card:hover {
  transform: translateY(-8px);
}

.card__media {
  position: relative;
  overflow: hidden;
}

.card__media img,
.card__media iframe {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border: none;
  display: block;
  transition: transform var(--transition-smooth);
}

.card__media--video {
  position: relative;
  display: block;
}

.card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--color-gold);
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.6);
  opacity: 0.9;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
}

.card:hover .card__media img {
  transform: scale(1.05);
}

.card:hover .card__play {
  opacity: 1;
  transform: scale(1.1);
}

.card__body {
  padding: 1.5rem;
  position: relative;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.card__body h3 {
  font-size: 1.25rem;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}

.card__body p {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.card__glyph {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: var(--color-gold);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
  pointer-events: none;
}

.card:hover .card__glyph {
  opacity: 1;
  transform: translateY(0);
}

/* Body Banner (Astrolabio) */
.body-banner {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 3rem 0;
  padding: 2rem;
  background-image: url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  cursor: pointer;
  overflow: hidden;
}

.body-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.85) 0%, rgba(45, 10, 49, 0.7) 100%);
  z-index: 1;
}

.body-banner__content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.body-banner h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}

.body-banner p {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.body-banner__caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Templo / Comunidad */
.temple {
  padding: 5rem 0;
  background: radial-gradient(ellipse at center, rgba(45, 10, 49, 0.25) 0%, transparent 70%);
}

.temple__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

@media (min-width: 480px) {
  .temple__links {
    flex-direction: row;
    justify-content: center;
  }
}

.temple__btn {
  min-width: 260px;
}

/* Testimonios (Pergaminos) */
.testimonials {
  padding: 5rem 0;
  overflow: hidden;
}

.testimonials__track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}

.testimonials__track::-webkit-scrollbar {
  height: 6px;
}

.testimonials__track::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}

.testimonial {
  flex: 0 0 85%;
  max-width: 380px;
  scroll-snap-align: center;
  background: linear-gradient(135deg, rgba(26, 5, 31, 0.9), rgba(45, 10, 49, 0.8));
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
}

@media (min-width: 640px) {
  .testimonial {
    flex: 0 0 45%;
  }
}

@media (min-width: 992px) {
  .testimonial {
    flex: 0 0 32%;
  }
}

.testimonial::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  opacity: 0.6;
}

.testimonial p {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-white);
  margin-bottom: 1rem;
}

.testimonial cite {
  display: block;
  text-align: right;
  color: var(--color-gold);
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 600;
}

/* Footer */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* FAB Telegram */
.fab-telegram {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
  z-index: 1200;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: pulse-fab 2.5s infinite;
}

.fab-telegram svg {
  width: 28px;
  height: 28px;
}

.fab-telegram:hover {
  transform: scale(1.1);
  box-shadow: 0 0 35px rgba(212, 175, 55, 0.8);
}

@keyframes pulse-fab {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
}

/* Modal Exit Intent */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: 2.5rem;
  border-radius: 16px;
  text-align: center;
  transform: translateY(20px);
  transition: transform var(--transition-smooth);
}

.modal-overlay--visible .modal {
  transform: translateY(0);
}

.modal--nebula {
  background: 
    radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(45, 10, 49, 0.6) 0%, transparent 60%),
    rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.15);
}

.modal__close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  font-size: 1.8rem;
  color: var(--color-muted);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.modal__close:hover {
  color: var(--color-gold);
}

.modal__title {
  font-size: 1.6rem;
  color: var(--color-gold);
  margin-bottom: 0.75rem;
}

.modal__text {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.modal__caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .body-banner {
    background-attachment: scroll;
  }
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Banners Astrocronos (reutilizable) */
.banner-astrocronos {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--color-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.banner-astrocronos:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.7);
}
