:root {
  --noche: #006699;
  --noche-2: #0080B8;
  --piedra: #C1EAFF;
  --piedra-2: #DFF5FF;
  --oro: #B8842E;
  --oro-claro: #D9A24E;
  --cochinilla: #8B3A3A;
  --texto: #22303D;
  --texto-suave: #5B6B78;
  --texto-faint: #7C8CA0;
  --borde: #B2D1E0;
  --card-bg: #ffffff;

  --educatec-a: #1e3a5f;
  --educatec-b: #f2994a;
  --keleplay-a: #5b3a8e;
  --keleplay-b: #4fc3dc;
  --r81-a: #0f3d2e;
  --r81-b: #34d399;

  --radius: 16px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--piedra);
  color: var(--texto);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100%;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(700px circle at 15% 0%, rgba(0, 102, 153, 0.12), transparent 60%),
    radial-gradient(700px circle at 85% 10%, rgba(184, 132, 46, 0.14), transparent 60%),
    linear-gradient(180deg, var(--piedra-2), var(--piedra) 45%);
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  padding: 5.5rem 1.5rem 2.5rem;
}

.hero-logo {
  width: min(160px, 30vw);
  height: auto;
  flex-shrink: 0;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
  text-align: left;
  min-width: 0;
}

.hero-wordmark {
  margin: 0;
  line-height: 1;
  font-family: 'Monotype Corsiva', 'Brush Script MT', cursive;
  font-weight: 700;
  font-size: clamp(1rem, 6vw, 2.2rem);
  letter-spacing: 0.5px;
  color: #161616;
  white-space: nowrap;
}
.hero-wordmark .accent { color: #E31E24; }

.hero-tagline {
  margin: 0;
  line-height: 1.2;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(0.5rem, 2.1vw, 0.72rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #161616;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .hero { padding: 3.5rem 0.85rem 2rem; gap: 0.35rem; }
  .hero-logo { width: min(64px, 19vw); }
}

.grid {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; max-width: 480px; }
}

.card {
  --a: var(--educatec-a);
  --b: var(--educatec-b);
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--texto);
  background: var(--card-bg);
  border: 1px solid var(--borde);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px -18px rgba(28, 43, 58, 0.3);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--b) 45%, var(--borde));
  box-shadow: 0 22px 45px -16px color-mix(in srgb, var(--a) 40%, rgba(28, 43, 58, 0.4));
}

.card-keleplay { --a: var(--keleplay-a); --b: var(--keleplay-b); }
.card-r81 { --a: var(--r81-a); --b: var(--r81-b); }

.card-top {
  position: relative;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--a) 55%, #05060a), color-mix(in srgb, var(--b) 30%, #05060a));
}

.card-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

.card-top-text {
  background: linear-gradient(160deg, #0b0c10, color-mix(in srgb, var(--a) 35%, #0b0c10));
}

/* El logo real de R81 (verde/naranja) se lee mejor sobre un fondo claro que sobre el
   degradé oscuro genérico -- mismo tono crema que ya usa EducaTec81. */
.card-r81 .card-top {
  background: linear-gradient(160deg, #f6efe0, #ede2c9);
}

/* El logo de EducaTec81 trae su propio fondo crema sólido (no transparente):
   se iguala el panel a ese tono para que no se vea como una caja recortada. */
.card-educatec .card-top {
  background: linear-gradient(160deg, #f6efe0, #ede2c9);
}

/* El video de Yachay & Ñaño también trae fondo gris claro sólido (no transparente):
   mismo tratamiento que EducaTec81, igualar el panel en vez de dejar el gradiente oscuro. */
.card-keleplay .card-top {
  background: linear-gradient(160deg, #d6d5d9, #c2c1c5);
}

/* Ambos videos (EducaTec81 y Yachay & Ñaño) ya traen su propio fondo sólido pintado
   en el archivo — el padding + drop-shadow pensados para logos con fondo transparente
   dibujaban un rectángulo visible encima del panel ("caja dentro de caja"). Se les
   quita el padding y la sombra, y se usa cover para que el video llene el cuadrante
   completo, borde a borde, como si fuera el panel mismo. */
.card-educatec .card-top,
.card-keleplay .card-top {
  padding: 0;
}

.card-educatec .card-logo,
.card-keleplay .card-logo {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  filter: none;
}

.card-badge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cochinilla);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--oro);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  backdrop-filter: blur(2px);
}

.mini-logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 4.2vw, 1.6rem);
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  justify-content: center;
}
.mini-logo-mark { color: var(--texto-suave); font-size: 1rem; letter-spacing: 0.15em; align-self: center; }

/* R81 aún no tiene logo/video propio: mini-logo estático de dos líneas (nombre
   completo chico y faint arriba, sigla grande con degradé abajo) en vez del
   efecto de máquina de escribir que usaba la tarjeta de Kelemania. */
.mini-logo-static {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  white-space: normal;
  text-align: center;
  line-height: 1;
}

.mini-logo-static .mini-logo-mark {
  font-size: clamp(0.58rem, 3.6vw, 0.85rem);
  letter-spacing: clamp(0.02em, 0.9vw, 0.15em);
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1;
  color: var(--r81-a);
  text-shadow: none;
  margin-top: -28px;
  position: relative;
  z-index: 1;
}

/* Logo de R81: el SVG (rda-animado.svg) trae su propia animación interna,
   así que aquí no se le aplica ninguna animación extra. */
.r81-logo {
  width: 86%;
  max-width: 300px;
  height: auto;
  transform: translateX(-38px);
}

.card-body {
  padding: 1.6rem 1.6rem 1.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  background: var(--texto);
}

.card-tagline {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.card-desc {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  flex: 1;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
}

.card-cta .arrow {
  transition: transform var(--transition);
}

.card:hover .card-cta .arrow {
  transform: translateX(4px);
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 1.5rem 2.5rem;
  color: var(--texto-faint);
  font-size: 0.85rem;
}

.footer p {
  margin: 0;
}

.footer-contact {
  margin-top: 0.4rem !important;
}
