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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background-color: var(--color-midnight-abyss);
  color: var(--color-comet);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
}

a { text-decoration: none; }


/* ─────────────────────────────────────────────────────
   Utilities
───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--color-midnight-abyss);
  color: var(--color-arctic-mist);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-badges);
  border: 1px solid rgba(186, 215, 247, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: var(--text-body);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn:hover  { opacity: 0.82; transform: translateY(-1px); }
.btn:active { opacity: 1;    transform: translateY(0); }

.btn--primary {
  background: var(--color-neon-violet);
  color: var(--color-ghost-white);
}

.btn--outline {
  background: rgba(186, 214, 247, 0.06);
  color: var(--color-ghost-white);
  box-shadow: inset 0 0 0 1px rgba(186, 215, 247, 0.2);
}


/* ─────────────────────────────────────────────────────
   Reveal animation (IntersectionObserver adds .visible)
───────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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


/* ─────────────────────────────────────────────────────
   Navigation
───────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 62px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, box-shadow 0.35s ease;
}

.nav.scrolled {
  background: rgba(5, 6, 15, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(186, 215, 247, 0.07);
}

.nav__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__logo {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-ghost-white);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 28px;
  margin-left: auto;
}

.nav__links a {
  color: var(--color-azure-glow);
  font-size: var(--text-body);
  font-weight: 500;
  transition: color 0.2s;
}

.nav__links a:hover { color: var(--color-ghost-white); }

.nav__cta { margin-left: 4px; }

/* Hamburger button */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-ghost-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ─────────────────────────────────────────────────────
   Hero
───────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 120px 24px 96px;
  display: flex;
  align-items: center;
}

.hero__bg-glow {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(ellipse at 50% 20%, rgba(102, 58, 243, 0.14) 0%, transparent 65%);
  pointer-events: none;
}

.hero__inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 72px;
  position: relative;
  z-index: 1;
}

.hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: hero-in 0.8s ease both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__title {
  font-size: var(--text-display-xl);
  line-height: var(--leading-display-xl);
  color: var(--color-ghost-white);
  letter-spacing: -0.03em;
}

.hero__tagline {
  font-size: var(--text-heading-lg);
  line-height: var(--leading-heading-lg);
  color: var(--color-comet);
  font-weight: 400;
}

.hero__desc {
  font-size: var(--text-body-lg);
  color: var(--color-azure-glow);
  line-height: 1.65;
  max-width: 380px;
}

.hero__visual {
  flex: 1;
  display: flex;
  justify-content: center;
  animation: hero-in 0.8s 0.15s ease both;
}


/* ─── Map card ─── */
.map-card {
  width: 100%;
  max-width: 420px;
  background: rgba(186, 214, 247, 0.03);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow:
    rgba(199, 211, 234, 0.12) 0px 1px 1px 0px inset,
    rgba(199, 211, 234, 0.05) 0px 24px 48px 0px inset,
    rgba(6, 6, 14, 0.7) 0px 24px 32px 0px,
    rgba(102, 58, 243, 0.1) 0px 0px 80px 0px;
}

.map-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-card__dim {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: var(--text-caption);
  color: var(--color-interstellar-gray);
}

.battle-map {
  width: 100%;
  border-radius: 8px;
  background: rgba(5, 6, 15, 0.85);
  display: block;
}

.map-card__footer {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.map-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: rgba(63, 73, 89, 0.35);
  color: var(--color-whisper-blue);
  border-radius: var(--radius-md);
  font-size: var(--text-caption);
  border: 1px solid rgba(186, 215, 247, 0.07);
}


/* ─────────────────────────────────────────────────────
   Sections — shared
───────────────────────────────────────────────────── */
.section {
  padding: 104px 24px;
}

.section--alt {
  background: rgba(186, 214, 247, 0.012);
  border-top: 1px solid rgba(186, 215, 247, 0.06);
  border-bottom: 1px solid rgba(186, 215, 247, 0.06);
}

.section__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.section__inner--center {
  align-items: center;
  text-align: center;
}

.section__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}

.section__title {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  color: var(--color-ghost-white);
  letter-spacing: -0.025em;
}

.section__desc {
  font-size: var(--text-body-lg);
  color: var(--color-azure-glow);
  line-height: 1.65;
}


/* ─────────────────────────────────────────────────────
   Módulos — cards grid
───────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: rgba(186, 214, 247, 0.03);
  border-radius: 12px;
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    rgba(199, 211, 234, 0.12) 0px 1px 1px 0px inset,
    rgba(199, 211, 234, 0.05) 0px 24px 48px 0px inset,
    rgba(6, 6, 14, 0.6) 0px 16px 32px 0px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow:
    rgba(199, 211, 234, 0.15) 0px 1px 1px 0px inset,
    rgba(199, 211, 234, 0.07) 0px 24px 48px 0px inset,
    rgba(6, 6, 14, 0.6) 0px 16px 32px 0px,
    rgba(102, 58, 243, 0.14) 0px 0px 40px 0px;
}

.card__icon { font-size: 28px; }

.card__title {
  font-size: var(--text-subheading);
  color: var(--color-ghost-white);
  font-weight: 600;
}

.card__desc {
  font-size: var(--text-body);
  color: var(--color-azure-glow);
  line-height: 1.65;
  flex: 1;
}


/* ─────────────────────────────────────────────────────
   Mapas — preview grid
───────────────────────────────────────────────────── */
.maps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.map-preview {
  background: rgba(186, 214, 247, 0.03);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: rgba(199, 211, 234, 0.1) 0px 1px 1px 0px inset;
  transition: transform 0.22s ease;
}

.map-preview:hover { transform: translateY(-5px); }

.map-preview__visual {
  height: 190px;
  position: relative;
  overflow: hidden;
}

/* CSS grid overlay */
.map-preview__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(182, 217, 252, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(182, 217, 252, 0.055) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* Atmospheric backgrounds per type */
.map-preview__visual--dungeon {
  background:
    radial-gradient(ellipse at 35% 55%, rgba(102, 58, 243, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 25%, rgba(182, 217, 252, 0.06) 0%, transparent 45%),
    var(--color-midnight-abyss);
}

.map-preview__visual--forest {
  background:
    radial-gradient(ellipse at 50% 65%, rgba(58, 180, 90, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 25%, rgba(58, 160, 90, 0.07) 0%, transparent 40%),
    var(--color-midnight-abyss);
}

.map-preview__visual--tavern {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(210, 150, 50, 0.13) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(180, 100, 30, 0.07) 0%, transparent 40%),
    var(--color-midnight-abyss);
}

.map-preview__visual--cave {
  background:
    radial-gradient(ellipse at 60% 40%, rgba(130, 58, 220, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 25% 70%, rgba(102, 58, 243, 0.09) 0%, transparent 40%),
    var(--color-midnight-abyss);
}

.map-preview__info {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-preview__name {
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-comet);
}

.map-preview__tags {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────
   Herramientas — tools grid
───────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tool-card {
  background: rgba(186, 214, 247, 0.03);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 0 0 1px rgba(186, 215, 247, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 0 0 1px rgba(186, 215, 247, 0.15),
    rgba(102, 58, 243, 0.1) 0px 0px 32px 0px;
}

.tool-card__num {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-neon-violet);
}

.tool-card__title {
  font-size: var(--text-subheading);
  color: var(--color-ghost-white);
  font-weight: 600;
}

.tool-card__desc {
  font-size: var(--text-body);
  color: var(--color-azure-glow);
  line-height: 1.65;
}


/* ─────────────────────────────────────────────────────
   Comunidad
───────────────────────────────────────────────────── */
.community-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}


/* ─────────────────────────────────────────────────────
   Footer
───────────────────────────────────────────────────── */
.footer {
  padding: 32px 24px;
  border-top: 1px solid rgba(186, 215, 247, 0.06);
}

.footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer__logo {
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--color-ghost-white);
}

.footer__copy {
  font-size: var(--text-caption);
  color: var(--color-interstellar-gray);
}


/* ─────────────────────────────────────────────────────
   Responsive — tablet (≤ 900px)
───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }

  .section__title { font-size: var(--text-heading-lg); }
}


/* ─────────────────────────────────────────────────────
   Responsive — mobile (≤ 768px)
───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Nav */
  .nav__hamburger { display: flex; }
  .nav__cta       { display: none; }

  .nav__links {
    position: fixed;
    top: 62px; left: 0; right: 0; bottom: 0;
    background: rgba(5, 6, 15, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
    margin-left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .nav__links.open {
    opacity: 1;
    pointer-events: all;
  }

  .nav__links a { font-size: var(--text-heading); }

  /* Hero */
  .hero {
    flex-direction: column;
    padding: 96px 20px 72px;
    min-height: auto;
  }

  .hero__inner {
    flex-direction: column;
    gap: 48px;
  }

  .hero__title   { font-size: var(--text-display); }
  .hero__tagline { font-size: var(--text-heading); }
  .hero__desc    { max-width: 100%; }
  .hero__visual  { width: 100%; }
  .map-card      { max-width: 100%; }

  /* Sections */
  .section { padding: 72px 20px; }

  .maps-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 400px) {
  .hero__title { font-size: var(--text-heading-lg); }
  .section__title { font-size: var(--text-heading); }
}
