/* =====================================================
   ERNESTO CISNEROS - MAIN CSS
   Un universo común, múltiples climas internos
   ===================================================== */

/* =====================================================
   CSS VARIABLES
   ===================================================== */
:root {
  /* Colors - Golden Cosmic Palette */
  --bg-deep: #080604;
  --bg-dark: #0d0a06;
  --bg-card: rgba(20, 16, 10, 0.6);
  --gold: #d4a030;
  --gold-bright: #f0c860;
  --gold-dim: rgba(212, 160, 48, 0.5);
  --gold-faint: rgba(212, 160, 48, 0.15);
  --text-primary: #e8dcc8;
  --text-secondary: rgba(200, 175, 130, 0.7);
  --line: rgba(180, 130, 60, 0.15);

  /* Typography */
  --font-display: 'Cinzel', serif;
  --font-body: 'Cormorant Garamond', serif;
  --font-mono: 'Space Mono', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Layout */
  --max-width: 1400px;
  --nav-height: 70px;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 18px;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--gold-bright);
}

img {
  max-width: 100%;
  height: auto;
}

/* =====================================================
   PARTICLE CANVAS
   ===================================================== */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* =====================================================
   NAVIGATION
   ===================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(8, 6, 4, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-faint);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 50px;
  width: auto;
  mix-blend-mode: lighten;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-menu > li {
  position: relative;
}

.nav-item {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.nav-item:hover,
.nav-item.active {
  color: var(--gold);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(13, 10, 6, 0.97);
  border: 1px solid var(--gold-faint);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--gold-faint);
  transition: all 0.3s;
}

.nav-dropdown-item:last-child {
  border-bottom: none;
}

.nav-dropdown-item:hover {
  color: var(--gold);
  background: var(--gold-faint);
}

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--gold);
  transition: 0.3s;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  border-top: 1px solid var(--gold-faint);
  padding: 3rem 2rem;
  text-align: center;
  background: var(--bg-deep);
  position: relative;
  z-index: 10;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-faint);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.social-links a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.social-links svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.copyright {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* =====================================================
   MAIN CONTENT WRAPPER
   ===================================================== */
.main-content {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-height);
}

/* =====================================================
   COMMON SECTIONS
   ===================================================== */
.section {
  padding: var(--space-lg) var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: var(--space-md);
}

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-height) + 4rem) var(--space-md) var(--space-lg);
  position: relative;
  background: radial-gradient(ellipse at center top, rgba(212, 160, 48, 0.08) 0%, transparent 60%);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: var(--text-secondary);
  font-style: italic;
  max-width: 600px;
}

/* =====================================================
   AUDIO CONTROL (for pages with background music)
   ===================================================== */
.audio-control {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(13, 10, 6, 0.9);
  border: 1px solid var(--gold-faint);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
}

.audio-control:hover {
  border-color: var(--gold);
  background: rgba(20, 16, 10, 0.95);
}

.audio-icon {
  width: 20px;
  height: 20px;
  fill: var(--gold);
}

.audio-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.audio-bars span {
  width: 3px;
  background: var(--gold);
  border-radius: 1px;
  animation: audioBar 0.8s ease-in-out infinite;
}

.audio-bars span:nth-child(1) { height: 60%; animation-delay: 0s; }
.audio-bars span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.audio-bars span:nth-child(3) { height: 40%; animation-delay: 0.4s; }
.audio-bars span:nth-child(4) { height: 80%; animation-delay: 0.1s; }

.audio-control.paused .audio-bars span {
  animation: none;
  height: 30%;
}

@keyframes audioBar {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

/* =====================================================
   CARDS GRID
   ===================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--gold-faint);
  border-radius: 4px;
  padding: var(--space-md);
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-4px);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.card-text {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.btn:hover {
  background: var(--gold-faint);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.btn-primary {
  background: var(--gold-faint);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .nav-menu {
    gap: 1rem;
  }
  
  .section {
    padding: var(--space-md) var(--space-sm);
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 6, 4, 0.98);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    border-bottom: 1px solid var(--gold-faint);
    z-index: 1000;
    max-height: calc(100vh - var(--nav-height, 70px));
    overflow-y: auto;
  }

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

  .nav-menu > li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--gold-faint);
    width: 100%;
  }

  .nav-menu > li:last-child {
    border-bottom: none;
  }

  .nav-dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    padding-left: 1rem;
    min-width: auto;
    margin-top: 0.5rem;
  }

  .nav-dropdown-item {
    padding: 0.5rem 0;
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 2rem);
    min-height: 60vh;
  }

  .audio-control {
    bottom: 1rem;
    right: 1rem;
  }

  .audio-label {
    display: none;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .nav-container {
    padding: 0.8rem 1rem;
  }

  .nav-logo img {
    height: 40px;
  }

  .footer {
    padding: 2rem 1rem;
  }
}
