:root {
  --fondo: #ffffff;
  --fondo-alt: #f4f6fb;
  --texto: #1a1f2b;
  --texto-suave: #5b6478;
  --borde: #dde2ec;
  --acento: #2f6df6;
  --acento-suave: #e8effe;
  --verde: #1f8b4c;
  --amarillo: #b07d00;
  --sombra: 0 1px 3px rgba(20, 30, 60, .08), 0 8px 24px rgba(20, 30, 60, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #10141c;
    --fondo-alt: #171d28;
    --texto: #e8ecf4;
    --texto-suave: #9aa4b8;
    --borde: #29323f;
    --acento: #6c9bff;
    --acento-suave: #1b2740;
    --verde: #5cd08a;
    --amarillo: #f0c14b;
    --sombra: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- navegacion ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .9rem 1.5rem;
  background: color-mix(in srgb, var(--fondo) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--borde);
  flex-wrap: wrap;
}
.nav .marca { font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--texto); }
.nav a.link { text-decoration: none; color: var(--texto-suave); font-size: .95rem; }
.nav a.link:hover, .nav a.link[aria-current="page"] { color: var(--acento); }
.nav .sep { flex: 1; }

/* ---------- layout ---------- */
.contenedor { max-width: 860px; margin: 0 auto; padding: 0 1.5rem; }
.hero { padding: 4rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.1; margin: 0 0 1rem; letter-spacing: -.03em; }
.hero p { font-size: 1.15rem; color: var(--texto-suave); margin: 0; max-width: 62ch; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--acento);
  background: var(--acento-suave); padding: .3rem .7rem; border-radius: 999px; margin-bottom: 1.2rem;
}

section { padding: 2rem 0; }
h2 { font-size: 1.6rem; margin: 2.5rem 0 .8rem; letter-spacing: -.02em; }
h3 { font-size: 1.15rem; margin: 1.8rem 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--acento); }

/* ---------- tarjetas ---------- */
.grilla { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 2rem 0; }
.tarjeta {
  display: block; padding: 1.5rem; border: 1px solid var(--borde); border-radius: 14px;
  background: var(--fondo-alt); text-decoration: none; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tarjeta:hover { transform: translateY(-3px); box-shadow: var(--sombra); border-color: var(--acento); }
.tarjeta h3 { margin: 0 0 .4rem; font-size: 1.25rem; }
.tarjeta p { color: var(--texto-suave); font-size: .95rem; margin: 0 0 .8rem; }
.tarjeta .meta { font-size: .82rem; color: var(--texto-suave); }
.tarjeta .flecha { color: var(--acento); font-weight: 600; font-size: .9rem; }

/* ---------- video ---------- */
.video-caja { margin: 2rem 0; border-radius: 14px; overflow: hidden; box-shadow: var(--sombra); border: 1px solid var(--borde); background: #000; }
video { display: block; width: 100%; height: auto; }
.pie { font-size: .85rem; color: var(--texto-suave); margin-top: .6rem; text-align: center; }

/* ---------- formulas y bloques ---------- */
.formula {
  font-family: "Cambria Math", Georgia, "Times New Roman", serif;
  font-size: 1.15em; font-style: italic;
  background: var(--acento-suave); padding: .1em .4em; border-radius: 5px; white-space: nowrap;
}
.formula-bloque {
  font-family: "Cambria Math", Georgia, "Times New Roman", serif;
  font-size: 1.5rem; font-style: italic; text-align: center;
  padding: 1.3rem; margin: 1.5rem 0;
  background: var(--fondo-alt); border: 1px solid var(--borde); border-radius: 12px;
  overflow-x: auto;
}
.nota {
  border-left: 3px solid var(--amarillo); background: var(--fondo-alt);
  padding: .9rem 1.2rem; margin: 1.5rem 0; border-radius: 0 8px 8px 0; font-size: .96rem;
}
.nota strong { color: var(--amarillo); }

/* ---------- tablas ---------- */
.tabla-scroll { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 460px; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-suave); font-weight: 600; }
tbody tr:hover { background: var(--fondo-alt); }
td .formula { white-space: nowrap; }
.paso-num { color: var(--acento); font-weight: 700; width: 2.5rem; }

/* ---------- pasos ---------- */
ol.pasos { padding-left: 0; list-style: none; counter-reset: paso; margin: 1.5rem 0; }
ol.pasos li {
  counter-increment: paso; position: relative;
  padding: .9rem 0 .9rem 3rem; border-bottom: 1px solid var(--borde);
}
ol.pasos li:last-child { border-bottom: none; }
ol.pasos li::before {
  content: counter(paso); position: absolute; left: 0; top: .95rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--acento-suave); color: var(--acento);
  display: grid; place-items: center; font-size: .85rem; font-weight: 700;
}

/* ---------- footer ---------- */
footer {
  margin-top: 4rem; padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--borde); color: var(--texto-suave); font-size: .9rem;
}
footer .contenedor { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.volver { display: inline-block; margin: 2.5rem 0 0; font-size: .95rem; text-decoration: none; }
.volver:hover { text-decoration: underline; }
