/* =====================
   BASE / RESET
===================== */

html {
  background-attachment: fixed;
  transition: background 0.6s ease;
}

html[data-bg="green"] {
  background: linear-gradient(180deg, #064e3b, #0f172a);
}

html[data-bg="blue"] {
  background: linear-gradient(180deg, #1e3a8a, #0b1020);
}

html[data-bg="cyan"] {
  background: linear-gradient(180deg, #155e75, #061a1f);
}

html[data-bg="dark"] {
  background: linear-gradient(180deg, #020617, #0f172a);
}

html, body {
  min-height: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =====================
   VARIABLES
===================== */

:root {
  --bg: #0f172a;
  --bg-secondary: #111827;

  --card-bg: #1e293b;
  --card-bg-hover: #243447;

  --text: #e5e7eb;
  --text-secondary: #9ca3af;

  --accent: #22c55e;
  --accent-hover: #16a34a;

  --border: #1f2933;
}

/* =====================
   BODY
===================== */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* overlay oscuro */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.15);
  z-index: 0;
}

.content {
  position: relative;
  z-index: 3;
}

/* =====================
   NAV
===================== */

nav {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  z-index: 10;
  gap: 10px;

  /* 🔴 IMPORTANTE */
  position: sticky;
}
nav {
  position: sticky;
  top: 0;
  position: sticky;
  top: 0;
  position: sticky;
  top: 0;

  /* FIX REAL */
  position: sticky;
}

nav {
  position: sticky;
}

/* 👇 ESTO ES LO IMPORTANTE */
nav {
  position: sticky;
}

nav {
  position: sticky;
}

/* 👉 REAL FIX */
nav {
  position: sticky;
}

nav {
  position: sticky;
}
nav h2 {
  font-size: 18px;
  font-weight: 600;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

nav ul {
  display: flex;
  gap: 25px;
  list-style: none;
}

nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  transition: 0.3s;
}

nav a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text);
}

/* =====================
   MENU DESKTOP
===================== */

#menu {
  display: flex;
  gap: 25px;
  list-style: none;
}

/* =====================
   LANG SELECTOR (DESKTOP)
===================== */

.lang-selector select {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

/* =====================
   MOBILE
===================== */

@media (max-width: 768px) {

  /* hamburguesa visible */
  .menu-toggle {
    display: block;
  }

  /* menú desplegable */
  #menu {
    display: none;
    flex-direction: column;

    position: absolute;
    top: 70px;
    right: 20px;

    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);

    padding: 20px;
    border-radius: 12px;

    border: 1px solid var(--border);
    width: 220px;

    z-index: 999;
  }

  #menu.active {
    display: flex;
  }

  /* FIX CLAVE: idioma no se superpone */
  .lang-selector {
    display: flex;
    align-items: center;
    margin-left: auto;
  }

  .lang-selector select {
    font-size: 11px;
    padding: 4px 8px;
    max-width: 90px;
  }
}

/* =====================
   HERO
===================== */

.hero {
  position: relative;
  z-index: 5;
  text-align: center;
  max-width: 900px;
  margin: auto;
  padding: 140px 20px 100px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.1;
  margin-bottom: 20px;

  background: linear-gradient(90deg, #ffffff, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  text-shadow: 0 10px 40px rgba(34,197,94,0.25);

  animation: fadeHero 1s ease forwards;
}

@keyframes fadeHero {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero p {
  max-width: 600px;
  margin-bottom: 20px;
}

/* NUEVO BLOQUE HERO */

.hero-extra {
  margin-top: 30px;
  text-align: center;
  max-width: 500px;
}

.hero-extra .closing-label {
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0.7;
}

.hero-extra .closing-main {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

/* =====================
   BOTONES
===================== */

.buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.buttons a {
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 160px;
  height: 48px;

  transition: all 0.25s ease;
}

.buttons a:first-child {
  background: var(--accent);
  color: black;
}

.buttons a:first-child:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.buttons a:last-child {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}

.buttons a:last-child:hover {
  background: var(--bg-secondary);
}

/* =====================
   SECCIONES
===================== */

section {
  padding: 60px 20px;
}

section:nth-of-type(even) {
  padding: 100px 20px;
  max-width: 900px;
  margin: auto;
  text-align: center;
}

section:not(:last-of-type) {
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  padding-bottom: 40px;
}

/* =====================
   RITMO VISUAL
===================== */

/* Secciones importantes (hero conceptual) */
section.hero,
section#que-es {
  padding: 120px 20px 100px;
}

/* Secciones normales */
section {
  padding: 80px 20px;
}

/* Secciones densas (más contenido) */
section.grid-heavy {
  padding: 60px 20px;
}

/* =====================
   TÍTULO
===================== */
section h2 {
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;

  font-size: 40px;   /* antes 34px → más presencia cognitiva */
  line-height: 1.15;

  margin-bottom: 45px; /* 👈 ESTE es el espacio clave */
}

section h2::after {
  content: "";
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent);

  margin: 12px auto 0;  /* 👈 antes 6px → ahora más separación visual */
  border-radius: 2px;
  opacity: 0.9;
}

/* INTRO */
.intro {
  position: relative;

  margin-top: 30px;

  background: linear-gradient(135deg, #1e293b, #020617);
  padding: 22px;
  border-radius: 14px;

  border: 1px solid rgba(255,255,255,0.06);

  backdrop-filter: blur(6px);

  overflow: hidden;
}

/* centrado correcto del sistema */
section .intro,
section .closing,
section .section-actions {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
/* Glow sutil consistente en TODAS */
.intro::before {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(circle at top left, rgba(34,197,94,0.12), transparent 60%);
  opacity: 0.6;
}

/* Línea superior elegante */
.intro::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;

  background: linear-gradient(90deg, transparent, #22c55e, transparent);
  opacity: 0.6;
}

/* =====================
   GRID
===================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 40px;
  width: 100%;
}

.grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* =====================
   BOTONES DE SECCIÓN
===================== */

.section-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 10px 16px;
  border-radius: 10px;

  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
  border: 1px solid rgba(34,197,94,0.25);

  color: var(--text);
  text-decoration: none;
  font-size: 14px;

  backdrop-filter: blur(6px);

  transition: all 0.25s ease;

  position: relative;
  overflow: hidden;
}

.action-btn:hover {
  transform: translateY(-2px);

  border-color: var(--accent);

  background: linear-gradient(135deg, rgba(34,197,94,0.25), rgba(34,197,94,0.1));

  box-shadow: 0 6px 20px rgba(34,197,94,0.15);
}

.action-btn:active {
  transform: translateY(0px) scale(0.98);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;

  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.5s;
}

.action-btn:hover::before {
  left: 100%;   
}

/* =====================
   CARD
===================== */

.card {
  position: relative;
  overflow: hidden;

  background: linear-gradient(145deg, #1e293b, #020617);
  padding: 25px;
  border-radius: 14px;

  border: 1px solid rgba(255,255,255,0.05);

  backdrop-filter: blur(8px);

  transform-origin: center;

  transition: transform 0.25s ease, box-shadow 0.25s ease, border 0.25s ease;
}

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #1e293b, #020617);
  padding: 25px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  transform-origin: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border 0.25s ease;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(circle at top left, rgba(34,197,94,0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: scale(1.06) translateY(-6px);
  z-index: 5;

  border-color: rgba(34,197,94,0.3);

  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 30px rgba(34,197,94,0.2);
}

.card:hover::before {
  opacity: 1;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;

  background: linear-gradient(90deg, transparent, #22c55e, transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::after {
  opacity: 1;
}

.card:active {
  transform: scale(0.98);
}

.grid:hover .card {
  transform: scale(0.97);
}

.grid .card:hover {
  transform: scale(1.07) translateY(-6px);
}

.grid {
  perspective: 1000px;
}
/* =====================
   CARD UI (alineación consistente)
===================== */

.card-ui {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.card-ui h3 {
  line-height: 1.3;
  min-height: calc(1.3em * 2);
}

.card-ui p {
  margin-top: 5px;
}

/* Alineación tipográfica en card-ui */

.card-ui h3 {
  text-align: center;
}

.card-ui p {
  text-align: left;
}

@media (max-width: 600px) {
  .card-ui p {
    text-align: left;
  }
}


/* =====================
   CLOSING
===================== */

.closing {
  margin-top: 40px;
  text-align: center;
  max-width: 600px;
}

.closing-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.closing-main {
  font-size: 22px;
  font-weight: 500;

  background: linear-gradient(90deg, #ffffff, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

section .closing {
  text-align: center;
}
/* =====================
   COMUNIDAD
===================== */

.community-form {
  width: 100%;
  max-width: 600px;
}

.community-form input,
.community-form textarea {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;

  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
}

.community-form button {
  margin-top: 10px;
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: black;
  cursor: pointer;
}

/* POSTS */

.post {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 15px;
  border-radius: 10px;
  margin-top: 10px;
}

.post strong {
  color: var(--accent);
  display: block;
  margin-bottom: 5px;
}

.post p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* =====================
   FOOTER
===================== */

footer {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* =====================
   CANVAS
===================== */

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* =====================
   RESPONSIVE
===================== */

@media (max-width: 900px) {
  .grid.grid-3 {
    grid-template-columns: 1fr;
  }
}

html[data-bg="dark"] {
  background: linear-gradient(180deg, #0f172a, #0f172a);
}

html[data-bg="green"] {
  background: linear-gradient(180deg, #0a2e2a, #0f172a);
}

html[data-bg="blue"] {
  background: linear-gradient(180deg, #0a2540, #0f172a);
}

html[data-bg="cyan"] {
  background: linear-gradient(180deg, #062c30, #0f172a);
}

html {
  transition: background 1s ease, filter 1s ease;
}

/* overlay de percepción por modo */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.8s ease, background 0.8s ease;
}

html[data-bg="green"]::before {
  background: radial-gradient(circle at top, rgba(34,197,94,0.12), transparent 60%);
}

html[data-bg="blue"]::before {
  background: radial-gradient(circle at top, rgba(59,130,246,0.12), transparent 60%);
}

html[data-bg="cyan"]::before {
  background: radial-gradient(circle at top, rgba(34,211,238,0.10), transparent 60%);
}
