:root {
  --navy: #0a2540;
  --azul: #60a5fa;
  --azul-texto: #2563eb;
  --cielo: #67e8f9;
  --menta: #ccfbf1;
  --durazno: #fad19e;
  --texto: #35506b;
  --apagado: #64748b;
  --borde: #e2e8f0;
  --fondo-suave: #f6f9fc;
  --serif: "Merriweather", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--texto);
  font: 16px/1.7 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; }

/* Fondo con manchas suaves de color, como la web de la plataforma. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40rem 30rem at 85% -5%, rgba(96, 165, 250, 0.18), transparent 70%),
    radial-gradient(34rem 26rem at -10% 20%, rgba(204, 251, 241, 0.7), transparent 70%),
    radial-gradient(30rem 22rem at 70% 105%, rgba(250, 209, 158, 0.25), transparent 70%);
}

a { color: var(--azul-texto); }

.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* --- Cabecera --- */
.cabecera {
  position: sticky; top: 0; z-index: 2;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.cabecera-fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.marca { display: inline-flex; align-items: center; font-weight: 600; color: var(--navy); text-decoration: none; letter-spacing: -0.01em; }

.menu { position: relative; }
.menu summary {
  cursor: pointer; list-style: none; font-size: 14px; font-weight: 500; color: var(--navy);
  padding: 8px 14px; border: 1px solid var(--borde); border-radius: 999px; background: #fff;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; color: var(--apagado); }
.menu nav {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px;
  display: flex; flex-direction: column; padding: 8px;
  background: #fff; border: 1px solid var(--borde); border-radius: 16px;
  box-shadow: 0 24px 50px -24px rgba(10, 37, 64, 0.35);
}
.menu nav a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--navy); font-size: 14px; }
.menu nav a:hover { background: var(--fondo-suave); }
.menu nav a[aria-current="page"] { color: var(--azul-texto); font-weight: 600; background: #eff6ff; }

/* --- Títulos --- */
main { padding-top: 48px; padding-bottom: 80px; }
h1 { color: var(--navy); font-size: clamp(30px, 4.4vw, 44px); font-weight: 600; line-height: 1.12; margin: 0 0 10px; letter-spacing: -0.03em; }
h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--azul); letter-spacing: -0.02em; }
.sub { color: var(--apagado); margin: 0 0 36px; max-width: 60ch; }

/* --- Portada del inicio --- */
.portada { text-align: center; padding: 32px 0 16px; }
.portada .sub { margin-left: auto; margin-right: auto; font-size: 18px; }
.portada h1 { font-size: clamp(36px, 6vw, 60px); }
.eyebrow {
  display: inline-block; margin: 0 0 16px; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--navy); background: rgba(255, 255, 255, 0.8); border: 1px solid var(--borde);
}

/* Tarjetas: todas del mismo alto, con el enlace al fondo. */
.tarjetas {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: 1fr;
}
.tarjetas li { display: flex; }
.tarjetas a {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border-radius: 24px; text-decoration: none;
  background: rgba(255, 255, 255, 0.85); border: 1px solid var(--borde);
  box-shadow: 0 20px 44px -32px rgba(10, 37, 64, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tarjetas a:hover { transform: translateY(-3px); border-color: var(--azul); box-shadow: 0 28px 50px -30px rgba(37, 99, 235, 0.45); }
.tarjeta-titulo { color: var(--navy); font-size: 19px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.tarjeta-texto { color: var(--apagado); font-size: 15px; line-height: 1.55; }
.tarjeta-ir { margin-top: auto; padding-top: 12px; color: var(--azul-texto); font-size: 14px; font-weight: 600; }

/* --- Documentos --- */
.doc { display: grid; gap: 40px; }
@media (min-width: 960px) {
  .doc { grid-template-columns: 270px minmax(0, 1fr); align-items: start; }
  .indice { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; }
}

.indice { font-size: 14px; border: 1px solid var(--borde); border-radius: 20px; padding: 18px; background: rgba(255, 255, 255, 0.85); }
.indice p { margin: 0 0 8px; font-weight: 600; color: var(--navy); }
.indice ul { margin: 0; padding: 0; list-style: none; }
.indice li { margin: 6px 0; line-height: 1.4; }
.indice a { color: var(--texto); text-decoration: none; }
.indice a:hover { color: var(--azul-texto); }

article { min-width: 0; max-width: 760px; }
article h2 { color: var(--navy); font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; margin: 48px 0 12px; scroll-margin-top: 84px; }
article h2:first-child { margin-top: 0; }
article h3 { color: var(--navy); font-size: 18px; font-weight: 600; line-height: 1.35; margin: 32px 0 10px; scroll-margin-top: 84px; }
article strong { color: var(--navy); }
article p, article ul, article ol { margin: 14px 0; }
article li { margin: 6px 0; }
article a { overflow-wrap: anywhere; }
article table { display: block; overflow-x: auto; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
article th, article td { border: 1px solid var(--borde); padding: 8px 12px; text-align: left; vertical-align: top; }
article th { background: var(--fondo-suave); color: var(--navy); }

/* --- Pie --- */
.pie { border-top: 1px solid var(--borde); color: var(--apagado); font-size: 14px; background: rgba(255, 255, 255, 0.7); }
.pie p { margin: 22px 0; }

.marca, .menu summary { white-space: nowrap; }
@media (max-width: 420px) {
  .marca { font-size: 15px; }
  .menu summary { padding: 7px 12px; font-size: 13px; }
}

@media (max-width: 420px) {
  .solo-ancho { display: none; }
}
