/* ===== Áureo — sistema de diseño ===== */
:root {
  --vino: #6E1E33;
  --vino-oscuro: #241017;
  --dorado: #D4AF37;
  --dorado-claro: #E8CC6B;
  --beige: #EFE6D3;
  --crema: #FBF7EE;
  --texto: #2A1B1F;
  --texto-suave: #6b5a52;
  --exito: #3f7d52;
  --error: #a8382c;
  --radio: 14px;
  --sombra: 0 10px 30px rgba(36, 16, 23, 0.12);
  --sombra-fuerte: 0 18px 45px rgba(36, 16, 23, 0.22);
  --fuente-titulo: "Playfair Display", Georgia, "Times New Roman", serif;
  --fuente-texto: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Transición fluida entre páginas ---------- */
@view-transition {
  navigation: auto;
}
::view-transition-old(root) {
  animation: aureo-sale 0.62s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
::view-transition-new(root) {
  animation: aureo-entra 0.62s cubic-bezier(0.2, 0, 0.2, 1) forwards;
}
@keyframes aureo-sale {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0.55; transform: translateX(-8%); }
}
@keyframes aureo-entra {
  from { opacity: 0; transform: translateX(6%); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Grupos con nombre propio: cada uno se mueve por separado (efecto de capas) */
.site-header { view-transition-name: vt-header; }
.site-header + section { view-transition-name: vt-hero; }
.site-footer { view-transition-name: vt-footer; }

::view-transition-old(vt-header) {
  animation: aureo-sale 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
::view-transition-new(vt-header) {
  animation: aureo-entra 0.5s cubic-bezier(0.2, 0, 0.2, 1) both;
}

::view-transition-old(vt-hero) {
  animation: aureo-sale-grande 0.68s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both;
}
::view-transition-new(vt-hero) {
  animation: aureo-entra-grande 0.68s cubic-bezier(0.2, 0, 0.2, 1) 0.05s both;
}

::view-transition-old(vt-footer) {
  animation: aureo-sale 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}
::view-transition-new(vt-footer) {
  animation: aureo-entra 0.7s cubic-bezier(0.2, 0, 0.2, 1) 0.1s both;
}

@keyframes aureo-sale-grande {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0.4; transform: translateX(-14%); }
}
@keyframes aureo-entra-grande {
  from { opacity: 0; transform: translateX(12%); }
  to   { opacity: 1; transform: translateX(0); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--fuente-texto);
  color: var(--texto);
  background: var(--crema);
  line-height: 1.6;
}

h1, h2, h3, .brand-word {
  font-family: var(--fuente-titulo);
  color: var(--vino-oscuro);
  margin: 0 0 0.4em;
}

a { color: var(--vino); }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--vino-oscuro), var(--vino));
  color: var(--crema);
  box-shadow: var(--sombra);
}
.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
@media (max-width: 900px) {
  .site-header .container { justify-content: center; text-align: center; }
  .main-nav { justify-content: center; gap: 10px 16px; order: 3; width: 100%; }
  .progress-widget { order: 2; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--crema);
}
.brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.brand-word {
  color: var(--dorado-claro);
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 0.02em;
}
.main-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--beige);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--dorado-claro);
  border-color: var(--dorado);
}

/* Widget de progreso (gamificación) */
.progress-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.progress-widget strong { color: var(--dorado-claro); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 20% -10%, rgba(212,175,55,0.25), transparent),
    linear-gradient(160deg, var(--vino-oscuro) 0%, var(--vino) 55%, #7c2a41 100%);
  color: var(--crema);
  padding: 72px 0 90px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
}
.hero-crown {
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
}
.hero h1 {
  color: var(--crema);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.15;
}
.hero .lead {
  color: var(--beige);
  font-size: 1.15rem;
  max-width: 46ch;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

.hero-panel {
  background: rgba(251, 247, 238, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radio);
  padding: 24px;
  backdrop-filter: blur(2px);
}
.hero-panel h3 { color: var(--dorado-claro); font-size: 1.1rem; }
.hero-panel ul { padding-left: 1.1em; margin: 0; color: var(--beige); }
.hero-panel li { margin-bottom: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-dorado {
  background: linear-gradient(180deg, var(--dorado-claro), var(--dorado));
  color: var(--vino-oscuro);
  box-shadow: 0 8px 20px rgba(212,175,55,0.35);
}
.btn-dorado:hover { box-shadow: 0 10px 26px rgba(212,175,55,0.5); }
.btn-fantasma {
  background: transparent;
  color: var(--crema);
  border-color: rgba(251,247,238,0.5);
}
.btn-fantasma:hover { border-color: var(--dorado-claro); color: var(--dorado-claro); }
.btn-vino {
  background: var(--vino);
  color: var(--crema);
}
.btn-vino:hover { background: var(--vino-oscuro); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Secciones ---------- */
section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title p { color: var(--texto-suave); max-width: 60ch; margin: 10px auto 0; }
.eyebrow {
  display: inline-block;
  color: var(--vino);
  background: var(--beige);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ---------- Tarjetas de curso ---------- */
.grid-cursos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.tarjeta-curso {
  background: #fff;
  border-radius: var(--radio);
  padding: 26px;
  box-shadow: var(--sombra);
  border-top: 5px solid var(--dorado);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tarjeta-curso:hover { transform: translateY(-4px); box-shadow: var(--sombra-fuerte); }
.tarjeta-curso .code {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--vino);
  letter-spacing: 0.06em;
}
.tarjeta-curso h3 { margin: 0; }
.tarjeta-curso p { color: var(--texto-suave); margin: 0; flex: 1; }
.tarjeta-curso .ir { color: var(--vino); font-weight: 700; }

/* ---------- Genérico: tarjetas / paneles ---------- */
.panel {
  background: #fff;
  border-radius: var(--radio);
  padding: 28px;
  box-shadow: var(--sombra);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 780px) { .grid-2 { grid-template-columns: 1fr; } }

.grid-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.feature {
  background: var(--beige);
  border-radius: var(--radio);
  padding: 22px;
}
.feature .icono { font-size: 1.6rem; }

/* ---------- Unidades del curso ---------- */
.lista-unidades { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.unidad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid #eadfca;
  border-radius: 12px;
  padding: 16px 20px;
}
.unidad .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--vino);
  color: var(--dorado-claro);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.unidad.disponible { border-color: var(--dorado); }
.unidad .estado { font-size: 0.8rem; font-weight: 700; }
.unidad.disponible .estado { color: var(--exito); }
.unidad.proximamente .estado { color: var(--texto-suave); }
.unidad.proximamente { opacity: 0.7; }

/* ---------- Lección ---------- */
.leccion { max-width: 760px; margin: 0 auto; }
.leccion .ejemplo {
  background: var(--beige);
  border-left: 5px solid var(--dorado);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 18px 0;
}
.leccion code, .formula {
  font-family: "Cambria Math", Georgia, serif;
  font-style: italic;
}

/* ---------- Ejercicios de práctica ---------- */
.ejercicio {
  background: #fff;
  border: 1px solid #eadfca;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.ejercicio p.enunciado { font-weight: 600; margin-top: 0; }
.opciones { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.opciones label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #e6d9bd;
  border-radius: 8px;
  cursor: pointer;
}
.opciones label:hover { background: var(--crema); }
.retro { margin-top: 10px; font-weight: 600; display: none; padding: 8px 12px; border-radius: 8px; }
.retro.correcto { display: block; background: #e7f3ea; color: var(--exito); }
.retro.incorrecto { display: block; background: #f8e6e3; color: var(--error); }

/* ---------- Examen cronometrado ---------- */
.examen-box {
  background: var(--vino-oscuro);
  color: var(--crema);
  border-radius: var(--radio);
  padding: 26px;
}
.examen-box h3 { color: var(--dorado-claro); }
.temporizador {
  font-family: var(--fuente-titulo);
  font-size: 2.4rem;
  color: var(--dorado-claro);
  text-align: center;
  margin: 10px 0;
  letter-spacing: 0.04em;
}
.examen-meta { display: flex; justify-content: center; gap: 24px; color: var(--beige); font-size: 0.9rem; margin-bottom: 16px; }
.examen-box .ejercicio { color: var(--texto); }

/* ---------- Insignias ---------- */
.grid-insignias { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; }
.insignia {
  text-align: center;
  background: #fff;
  border-radius: 12px;
  padding: 18px 10px;
  box-shadow: var(--sombra);
  opacity: 0.35;
  filter: grayscale(1);
}
.insignia.conseguida { opacity: 1; filter: none; border: 2px solid var(--dorado); }
.insignia .medalla { font-size: 2rem; }
.insignia .nombre { font-size: 0.85rem; font-weight: 700; margin-top: 6px; }

/* ---------- Comparación por localidad ---------- */
.form-localidad { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.form-localidad input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #d8c9a3;
  font-size: 1rem;
}
table.tabla-posiciones { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
table.tabla-posiciones th, table.tabla-posiciones td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee1c5;
}
table.tabla-posiciones th { background: var(--beige); }
table.tabla-posiciones tr.tu-fila { background: #fbf1cf; font-weight: 700; }
.aviso-demo {
  font-size: 0.85rem;
  color: var(--texto-suave);
  background: var(--beige);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--vino-oscuro);
  color: var(--beige);
  padding: 40px 0;
  font-size: 0.9rem;
  text-align: center;
}
.site-footer a { color: var(--dorado-claro); }

/* ---------- Utilidades ---------- */
.oculto { display: none !important; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
