/* Tokens del skin */
:root{--accent: #4f46e5;--accent-soft: #eef2ff;--accent-strong: #4338ca;--accent-text: #ffffff;--bg: #ffffff;--bg-soft: #f6f7fb;--font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;--line: #e2e8f0;--radius: 14px;--shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 24px rgb(15 23 42 / 0.06);--text: #0f172a;--text-soft: #475569;}

/* Skin «CMSE»: el estilo de los sitios de CMSE (el del tema anterior). Los colores claros, el radio,
   la sombra y la fuente son los tokens del skin (variables de CSS); aquí, el modo oscuro y el resto. */

:root { color-scheme: light dark; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-soft: #121a2e;
    --text: #e2e8f0;
    --text-soft: #94a3b8;
    --line: #1e293b;
    --accent: #818cf8;
    --accent-strong: #a5b4fc;
    --accent-text: #0b1020;
    --accent-soft: #1e1b4b;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; padding-bottom: 4rem; }
/* Una página que termina en portada la apoya sobre el pie, sin hueco ni doble línea. */
main:has(> div > .hero:last-child) { padding-bottom: 0; }
main .hero:last-child { border-bottom: 0; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0.5rem; }
.skip:focus { left: 0.5rem; background: var(--bg); padding: 0.5rem 0.75rem; z-index: 10; }

/* Cabecera y pie */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.languages ul { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.languages a {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--text-soft);
  text-decoration: none;
}
.languages a:hover { background: var(--bg-soft); color: var(--text); }
.languages a[aria-current='page'] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0; color: var(--text-soft); font-size: 0.875rem; }

/* Texto corrido */
.prose { max-width: 46rem; }
.prose h1, .prose h2, .prose h3 { line-height: 1.2; letter-spacing: -0.02em; }
.prose h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); margin: 3.5rem 0 1rem; }
.prose h2 { font-size: clamp(1.5rem, 2vw + 1rem, 2rem); margin: 3rem 0 0.75rem; }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }
.prose p { margin: 0 0 1.1rem; }
.figure { margin-block: 2rem; }
.figure img { border-radius: var(--radius); }
.figure figcaption { margin-top: 0.6rem; color: var(--text-soft); font-size: 0.9rem; }
.notice { margin-top: 1.5rem; padding: 0.75rem 1rem; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; color: var(--text-soft); font-size: 0.9rem; }

/* Botones */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.button-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.button-primary:hover { background: var(--accent-strong); color: var(--accent-text); transform: translateY(-1px); }
.block-button { margin-block: 1.5rem; }

/* Portada */
.hero { padding: clamp(3rem, 8vw, 6rem) 0; }
.hero-lead {
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(40rem 24rem at -10% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.hero:not(.hero-lead) { margin-top: 3rem; background: var(--bg-soft); border-block: 1px solid var(--line); text-align: center; }
.hero:not(.hero-lead) .hero-copy { margin-inline: auto; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero-media .hero-grid { grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .hero-media .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}
.hero-copy { max-width: 44rem; }
.hero-title { font-size: clamp(2.25rem, 5vw + 1rem, 4rem); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 1.25rem; text-wrap: balance; }
.hero-subtitle { font-size: clamp(1.125rem, 1vw + 0.9rem, 1.375rem); color: var(--text-soft); margin: 0 0 2rem; text-wrap: pretty; }
.hero-image img { border-radius: calc(var(--radius) + 6px); box-shadow: var(--shadow); }

/* Ventajas */
.features { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-title { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem); line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 2rem; max-width: 40rem; text-wrap: balance; }
.feature-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
/* De 3 a 6 tarjetas: en filas de 3 (y de 2 cuando son 4), sin huecos al final. */
@media (min-width: 640px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid[data-count='4'] { grid-template-columns: repeat(2, 1fr); }
}
.feature { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); box-shadow: var(--shadow); }
.feature h3 { margin: 0 0 0.5rem; font-size: 1.125rem; line-height: 1.3; }
.feature p { margin: 0; color: var(--text-soft); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Página no encontrada (la escribe el constructor) */
.not-found { width: min(46rem, 100% - 2.5rem); margin: 4rem auto; }
.not-found h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); line-height: 1.2; letter-spacing: -0.02em; }
