/* ALEROM AI · estilos comunes
   Concepto: el campo de puntos es fijo y ocupa toda la pantalla; el texto se desliza por encima.
   Negro por defecto (la identidad nace en negro); el botón sol/luna cambia toda la web a blanco. */
:root {
  --bg: #000000;
  --bg-2: #121212;
  --line: #1F1F1F;
  --fg: #FFFFFF;
  --fg-2: #D9D9D9;
  --fg-3: #9E9E9E;
  --fg-4: #5C5C5C;
  --red: #E8302A;
  --red-ink: #F2554F; /* rojo para texto: contraste ≥ 4,5:1 sobre negro y paneles */
  --panel: rgba(18, 18, 18, 0.82);
  --veil: rgba(0, 0, 0, 0.72);
  --font: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gut-l: max(20px, env(safe-area-inset-left, 0px));
  --gut-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-2: #F3F3F3;
  --line: #D9D9D9;
  --fg: #000000;
  --fg-2: #1F1F1F;
  --fg-3: #5C5C5C;
  --red-ink: #C4221C; /* rojo para texto: contraste ≥ 4,5:1 sobre blanco y paneles */
  --fg-4: #9E9E9E;
  --panel: rgba(243, 243, 243, 0.86);
  --veil: rgba(255, 255, 255, 0.74);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--bg); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 4px; }
.gut { padding-left: var(--gut-l); padding-right: var(--gut-r); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tipografía de marca: negrita + fina, como ALEROM + AI */
.thin { font-weight: 300; }
.kicker { font: 600 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red-ink); }
.h2r { color: var(--red-ink); }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--fg-2); max-width: 36ch; }
.small { font-size: 13px; color: var(--fg-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Campo de puntos fijo */
#field { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
:root[data-theme="light"] #field, :root[data-theme="light"] .intro { filter: invert(1); }

/* Cabecera */
.top {
  position: fixed; z-index: 30; left: 0; right: 0; top: env(safe-area-inset-top, 0px);
  padding-left: var(--gut-l); padding-right: var(--gut-r);
  background: linear-gradient(var(--bg) 0, var(--bg) 55%, transparent);
  transition: background .4s ease;
}
.top .in { max-width: 1320px; margin: 0 auto; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a.t { color: var(--fg-3); text-decoration: none; font-size: 14px; padding: 10px 12px; border-radius: 999px; }
.nav a.t:hover, .nav a.t[aria-current="page"] { color: var(--fg); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 12px 22px; border-radius: 999px;
  font: 600 15px var(--font); letter-spacing: 0; text-decoration: none; cursor: pointer;
  border: 1px solid var(--fg-4); background: transparent; color: var(--fg);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { border-color: var(--fg); transform: translateY(-1px); }
.btn.solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.solid:hover { background: var(--fg-2); border-color: var(--fg-2); }
.btn.sm { min-height: 40px; padding: 9px 16px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.theme {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer;
}
.theme:hover { border-color: var(--fg-3); }
.theme svg { width: 20px; height: 20px; }
.theme .moon { display: none; }
:root[data-theme="light"] .theme .sun { display: none; }
:root[data-theme="light"] .theme .moon { display: block; }
@media (max-width: 860px) { .nav a.t { display: none; } }

/* Logotipo (mismas proporciones que la intro para que el relevo encaje) */
.logo { position: relative; display: inline-flex; color: var(--fg); text-decoration: none; font-size: 17px; }
.logo.hidden { visibility: hidden; }
.mark { display: flex; align-items: center; gap: .42em; line-height: 1; white-space: nowrap; }
.mark svg { width: 1.9em; height: 1.9em; flex: none; overflow: visible; }
.mark .word { display: flex; gap: .32em; letter-spacing: .1em; }
.mark .b { font-weight: 700; }
.mark .l { font-weight: 300; color: var(--fg-3); }
.mark.school .word { flex-direction: column; gap: .26em; }
.mark.school .word .row { display: flex; gap: .32em; }
.mark.school .sch { display: flex; justify-content: space-between; padding-right: .1em; font-size: .4em; font-weight: 300; color: var(--fg-2); letter-spacing: 0; }
.ghost { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.ghost.g1 { color: var(--fg-3); }
.ghost.g2 { color: var(--fg-4); }
.logo.is-glitching .base { animation: base-jitter .62s steps(1) both; }
.logo.is-glitching .g1 { animation: slice-a .62s steps(1) both; }
.logo.is-glitching .g2 { animation: slice-b .62s steps(1) both; }
.logo.is-glitching .base .dot { animation: dot-jump .62s steps(1) both; }
@keyframes base-jitter {
  0% { transform: none; clip-path: none; } 8% { transform: translateX(2px) skewX(-8deg); }
  14% { transform: translateX(-1px); clip-path: inset(0 0 46% 0); } 20% { transform: none; clip-path: none; }
  46% { transform: translateX(-3px) skewX(6deg); } 52% { transform: translateX(1px); clip-path: inset(38% 0 0 0); }
  58% { transform: none; clip-path: none; } 78% { opacity: .4; } 82% { opacity: 1; }
  100% { transform: none; clip-path: none; opacity: 1; }
}
@keyframes slice-a {
  0% { opacity: 1; clip-path: inset(0 0 82% 0); transform: translateX(-6px); } 10% { clip-path: inset(36% 0 40% 0); transform: translateX(7px); }
  20% { clip-path: inset(70% 0 8% 0); transform: translateX(-4px); } 30% { clip-path: inset(12% 0 64% 0); transform: translateX(9px); }
  40% { clip-path: inset(55% 0 30% 0); transform: translateX(-8px); } 50% { clip-path: inset(84% 0 2% 0); transform: translateX(3px); }
  60% { clip-path: inset(24% 0 58% 0); transform: translateX(-5px); } 70% { clip-path: inset(62% 0 20% 0); transform: translateX(6px); }
  80% { clip-path: inset(4% 0 88% 0); transform: translateX(-2px); } 90% { opacity: 1; clip-path: inset(46% 0 46% 0); transform: translateX(2px); }
  100% { opacity: 0; clip-path: inset(50% 0 50% 0); transform: none; }
}
@keyframes slice-b {
  0% { opacity: 1; clip-path: inset(60% 0 22% 0); transform: translateX(5px); } 12% { clip-path: inset(8% 0 76% 0); transform: translateX(-7px); }
  24% { clip-path: inset(44% 0 42% 0); transform: translateX(4px); } 36% { clip-path: inset(78% 0 6% 0); transform: translateX(-9px); }
  48% { clip-path: inset(18% 0 70% 0); transform: translateX(6px); } 60% { clip-path: inset(50% 0 34% 0); transform: translateX(-3px); }
  72% { clip-path: inset(30% 0 52% 0); transform: translateX(8px); } 84% { opacity: 1; clip-path: inset(88% 0 0 0); transform: translateX(-4px); }
  100% { opacity: 0; clip-path: inset(50% 0 50% 0); transform: none; }
}
@keyframes dot-jump {
  0% { transform: none; } 16% { transform: translate(70px, -28px); } 24% { transform: none; }
  50% { transform: translate(-60px, 18px); opacity: .6; } 58% { transform: none; opacity: 1; } 100% { transform: none; }
}

/* Escenas: cada una ocupa una pantalla y el campo cambia de forma al pasar */
main { position: relative; z-index: 1; }
.scene { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-block: 110px 80px; }
.scene .in { width: 100%; max-width: 1320px; margin: 0 auto; }
.copy { max-width: min(560px, 44vw); display: grid; gap: 22px; min-width: 0; }
.copy h1 { font-size: clamp(42px, 6.2vw, 92px); }
.copy h2 { font-size: clamp(34px, 4.6vw, 66px); }
.copy h2 .thin, .copy h1 .thin { color: var(--fg-3); }
.copy .row { display: flex; gap: 12px; flex-wrap: wrap; }
.facts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 9px 1fr; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; color: var(--fg-2); }
.facts li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-3); transform: translateY(-1px); }
.facts li.r::before { background: var(--red); }
.facts b { color: var(--fg); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 10px; font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 22%, transparent); animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--red) 0%, transparent); } }
.hint { position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font: 600 11px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); }
.hint::after { content: ""; width: 1px; height: 34px; background: linear-gradient(var(--fg-3), transparent); animation: drip 1.8s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.hero { position: relative; }

/* Paneles sólidos (demo, formulario, normativa) */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px, 3.4vw, 44px); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 0; }

/* Móvil y vertical: el campo arriba, el texto abajo sobre un velo */
@media (max-aspect-ratio: 1/1), (max-width: 1099px) {
  .hint { display: none; }
  .scene { align-items: flex-end; padding-block: 46vh 64px; padding-block: 46svh 64px; }
  .scene.tight { padding-block: 120px 64px; align-items: center; }
  .copy { max-width: none; }
  .scene:not(.tight) .copy { background: linear-gradient(transparent, var(--veil) 18%); margin-left: calc(0px - var(--gut-l)); margin-right: calc(0px - var(--gut-r)); padding: 28px var(--gut-r) 8px var(--gut-l); border-radius: 18px; }
}

/* Pie */
footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: var(--bg); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--fg-3); }
footer .in { max-width: 1320px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 32px; }
footer a { color: var(--fg-2); text-decoration: none; }
footer a:hover { color: var(--fg); }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--fg-2); cursor: pointer; }
.linkbtn:hover { color: var(--fg); }

/* Intro a pantalla completa */
.intro { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: grid; place-items: center; overflow: hidden; transition: background-color .9s ease; }
.intro.out { background: transparent; pointer-events: none; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.intro .fx { z-index: 2; }
.intro .halo { position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 48%, #121212 0%, #000 72%); pointer-events: none; transition: opacity .9s ease; }
.intro.out .halo, .intro.out .sky { opacity: 0 !important; transition: opacity .9s ease; }
.intro .lockup { position: relative; z-index: 1; font-size: clamp(30px, 7.2vw, 68px); will-change: transform; transform-origin: 0 50%; }
.intro .lockup .mark .l { color: #9E9E9E; }
.intro .lockup .mark.school .sch { color: #D9D9D9; }
.intro .lockup .mark svg { width: 1.9em; height: 1.9em; }
.intro .lockup .ch { display: inline-block; }
.intro .skip { position: absolute; z-index: 3; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); color: #D9D9D9; border-color: #5C5C5C; transition: opacity .4s; }
.intro .skip:hover { color: #fff; border-color: #9E9E9E; }
.intro.out .skip { opacity: 0; }
.gl-ghost { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.gl-ghost.g1 { filter: brightness(.62); }
.gl-ghost.g2 { filter: brightness(.36); }
.lockup.hard > .mark { animation: hard-base 1.15s steps(1) both; }
.lockup.hard .gl-ghost.g1 { animation: hard-a 1.15s steps(1) both; }
.lockup.hard .gl-ghost.g2 { animation: hard-b 1.15s steps(1) both; }
.lockup.hard > .mark .idot { animation: hard-dot 1.15s steps(1) both; transform-box: fill-box; transform-origin: center; }
@keyframes hard-base {
  0% { transform: none; clip-path: none; filter: none; } 5% { transform: translateX(.12em) skewX(-14deg); filter: invert(1); }
  9% { transform: translateX(-.2em); clip-path: inset(0 0 52% 0); filter: none; } 14% { transform: translateX(.08em) scale(1.04,.92); clip-path: inset(30% 0 12% 0); }
  19% { transform: none; clip-path: none; } 27% { transform: translateX(-.16em) skewX(12deg); opacity: .3; }
  31% { transform: translateX(.22em); opacity: 1; clip-path: inset(46% 0 0 0); } 36% { transform: none; clip-path: none; filter: invert(1); }
  40% { filter: none; } 52% { transform: translateX(.1em) scale(1.08,.86); clip-path: inset(0 0 30% 0); } 57% { transform: none; clip-path: none; }
  68% { transform: translateX(-.06em) skewX(-6deg); opacity: .5; } 72% { transform: none; opacity: 1; } 84% { transform: translateX(.03em); } 88% { transform: none; }
  100% { transform: none; clip-path: none; filter: none; opacity: 1; }
}
@keyframes hard-a {
  0% { opacity: 1; clip-path: inset(0 0 78% 0); transform: translateX(-.4em); } 7% { clip-path: inset(30% 0 44% 0); transform: translateX(.5em); }
  14% { clip-path: inset(66% 0 10% 0); transform: translateX(-.3em); } 21% { clip-path: inset(10% 0 66% 0); transform: translateX(.6em); }
  28% { clip-path: inset(52% 0 32% 0); transform: translateX(-.55em); } 35% { clip-path: inset(82% 0 2% 0); transform: translateX(.25em); }
  42% { clip-path: inset(20% 0 56% 0); transform: translateX(-.35em); } 50% { clip-path: inset(60% 0 22% 0); transform: translateX(.45em); }
  58% { clip-path: inset(2% 0 86% 0); transform: translateX(-.2em); } 66% { clip-path: inset(40% 0 44% 0); transform: translateX(.15em); }
  76% { opacity: 1; clip-path: inset(74% 0 14% 0); transform: translateX(-.08em); } 86% { opacity: 0; } 100% { opacity: 0; clip-path: inset(50% 0 50% 0); transform: none; }
}
@keyframes hard-b {
  0% { opacity: 1; clip-path: inset(56% 0 24% 0); transform: translateX(.35em); } 8% { clip-path: inset(6% 0 74% 0); transform: translateX(-.5em); }
  16% { clip-path: inset(40% 0 40% 0); transform: translateX(.3em); } 24% { clip-path: inset(76% 0 4% 0); transform: translateX(-.65em); }
  32% { clip-path: inset(16% 0 68% 0); transform: translateX(.45em); } 40% { clip-path: inset(48% 0 34% 0); transform: translateX(-.25em); }
  48% { clip-path: inset(28% 0 50% 0); transform: translateX(.55em); } 56% { clip-path: inset(86% 0 0 0); transform: translateX(-.3em); }
  64% { clip-path: inset(34% 0 52% 0); transform: translateX(.12em); } 74% { opacity: 1; clip-path: inset(8% 0 82% 0); transform: translateX(-.1em); }
  84% { opacity: 0; } 100% { opacity: 0; clip-path: inset(50% 0 50% 0); transform: none; }
}
@keyframes hard-dot {
  0% { transform: none; } 8% { transform: translate(90px,-40px); } 14% { transform: translate(-70px,10px) scale(1.4); } 20% { transform: none; }
  33% { transform: translate(110px,20px); opacity: .4; } 39% { transform: none; opacity: 1; } 54% { transform: translate(-90px,-30px) scale(.6); } 60% { transform: none; } 100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Demo */
.demo .in { max-width: 900px; }
.demo .panel { display: grid; gap: 28px; }
.dhead { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.dhead h2 { font-size: clamp(32px, 4.4vw, 56px); }
.dhead p { color: var(--fg-2); max-width: 44ch; margin-top: 12px; }
.dbar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.dbar i { display: block; height: 100%; width: 10%; background: var(--fg); transition: width .5s cubic-bezier(.3,.7,.2,1); }
#demo-card { min-height: 400px; }
.dq { display: grid; gap: 26px; }
.qnum { font-size: 12px; letter-spacing: .14em; color: var(--fg-3); }
.qtext { font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; }
.qtext small { display: block; margin-top: 10px; font-size: 17px; font-weight: 400; letter-spacing: 0; color: var(--fg-3); }
.answers { display: grid; gap: 10px; }
.ans { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 14px; padding: 17px 18px; font: 500 17px var(--font); cursor: pointer; transition: border-color .15s, transform .15s; }
.ans:hover { border-color: var(--fg-3); transform: translateX(3px); }
.ans kbd { font: 600 12px var(--mono); color: var(--fg-3); border: 1px solid var(--line); border-radius: 6px; width: 26px; height: 26px; display: grid; place-items: center; }
.ans.sel { border-color: var(--fg); }
.ans.sel kbd { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.dnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.linkbtn.strong { color: var(--fg); font-weight: 600; }
.anim { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.res { display: grid; gap: 30px; }
.res-top { display: grid; gap: 12px; }
.res-word { font-weight: 800; font-size: clamp(54px, 9vw, 110px); letter-spacing: -.05em; line-height: .9; }
.res-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--fg-2); font-size: 15px; }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 420px; }
.meter i { height: 6px; border-radius: 3px; background: var(--line); }
.res-sum { font-size: 19px; max-width: 48ch; }
.inalerom { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--fg-2); font-size: 15.5px; max-width: 640px; }
.inalerom b { color: var(--fg); }
.cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; }
.cols > div { min-width: 0; display: grid; gap: 14px; align-content: start; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; gap: 26px; } }
.why, .todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 15px; color: var(--fg-2); }
.why li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; }
.why li i { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; }
.why code { display: block; font-size: 12px; color: var(--fg-3); }
.todo li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; }
.todo li::before { content: ""; width: 13px; height: 13px; border: 1.5px solid var(--fg-3); border-radius: 3px; margin-top: 4px; }

/* Piloto */
.pilot .in { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .pilot .in { grid-template-columns: 1fr; gap: 32px; } }
.pilot form { display: grid; gap: 12px; }
.pilot input, .pilot select, .pilot textarea { width: 100%; font: 16px var(--font); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.pilot input:focus, .pilot select:focus, .pilot textarea:focus { border-color: var(--fg); }
.pilot input:focus-visible, .pilot select:focus-visible, .pilot textarea:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.pilot [aria-invalid="true"] { border-color: var(--red-ink); }
.pilot textarea { min-height: 96px; resize: vertical; }
.consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 13px; color: var(--fg-3); }
.consent input { width: auto; margin-top: 2px; }
.fout { font-size: 14px; min-height: 20px; }
.fout.ok { color: var(--fg-2); }
.fout.err { color: var(--red-ink); }

/* Bloque de vertical */
.vert { display: grid; gap: 26px; }
.vert .mark { font-size: clamp(24px, 3.6vw, 40px); color: var(--fg); }
.vert .mark.school .sch { color: var(--fg-2); }
.limits { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 14px; color: var(--fg-3); }
.limits b { color: var(--fg); font-weight: 600; }

/* Cabecera en móvil: logotipo y tres botones en una fila */
@media (max-width: 440px) {
  .top .in { gap: 10px; }
  .nav { gap: 6px; }
  .logo { font-size: 14px; }
  .btn.sm { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .theme { width: 38px; height: 38px; }
  .theme svg { width: 18px; height: 18px; }
}
@media (max-width: 350px) { .logo .mark .word .l { display: none; } }
.btn { white-space: nowrap; }
@media (max-width: 380px) {
  :root { --gut-l: max(16px, env(safe-area-inset-left, 0px)); --gut-r: max(16px, env(safe-area-inset-right, 0px)); }
  .top .in { gap: 8px; }
  .nav { gap: 5px; }
  .logo { font-size: 12.5px; }
  .btn.sm { min-height: 36px; padding: 7px 10px; font-size: 12.5px; }
  .theme { width: 36px; height: 36px; }
}

/* Idioma */
.lang { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--fg); text-decoration: none; font: 700 12px var(--mono); letter-spacing: .06em; }
.lang:hover { border-color: var(--fg-3); }
@media (max-width: 440px) { .lang { width: 38px; height: 38px; font-size: 11px; } }
@media (max-width: 380px) { .lang { width: 34px; height: 34px; } .theme { width: 34px; height: 34px; } .btn.sm { padding: 7px 9px; font-size: 12px; } .nav { gap: 4px; } }

/* Páginas de documento (Normativa, Qué es ALEROM AI) */
  .doc { position: relative; z-index: 1; padding-block: 0 100px; }
  .doc .in { max-width: 1120px; margin: 0 auto; display: grid; gap: 28px; }
  .doc h2 { font-size: clamp(30px, 3.8vw, 50px); }
  .sec { display: grid; gap: 22px; scroll-margin-top: 90px; }
  .sec > p { color: var(--fg-2); max-width: 70ch; }
  .tl { list-style: none; margin: 0; padding: 0; display: grid; }
  .tl li { display: grid; grid-template-columns: 132px 22px 1fr; gap: 0 18px; position: relative; }
  .tl time { font: 600 13px var(--mono); color: var(--fg-3); padding-top: 22px; text-align: right; font-variant-numeric: tabular-nums; }
  .tl .rail { position: relative; }
  .tl .rail::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 1px; background: var(--line); }
  .tl li:first-child .rail::before { top: 26px; }
  .tl li:last-child .rail::before { bottom: calc(100% - 26px); }
  .tl .rail i { position: absolute; left: 4px; top: 21px; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--fg-3); background: var(--bg); }
  .tl li.done .rail i { background: var(--fg-3); border-color: var(--fg-3); }
  .tl li.next .rail i { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 5px color-mix(in srgb, var(--red) 25%, transparent); }
  .tl li.key time { color: var(--red-ink); }
  .tl .body { padding-block: 16px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; min-width: 0; }
  .tl li:last-child .body { border-bottom: 0; }
  .tl h3 { font-size: 19px; letter-spacing: -.01em; line-height: 1.25; }
  .tl p { color: var(--fg-2); font-size: 15.5px; max-width: 68ch; }
  .state { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
  .next .state { color: var(--red-ink); }
  @media (max-width: 640px) {
    .tl li { grid-template-columns: 22px 1fr; }
    .tl time { grid-column: 2; text-align: left; padding-top: 16px; }
    .tl .rail { grid-row: 1 / span 2; grid-column: 1; }
    .tl .body { grid-column: 2; padding-top: 4px; }
  }
  .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  @media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }
  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: grid; gap: 12px; align-content: start; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 0; }
  .card h3 { font-size: 21px; letter-spacing: -.015em; line-height: 1.2; }
  .card p, .card li { color: var(--fg-2); font-size: 15.5px; }
  .card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
  .card .when { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
  .card .when.r { color: var(--red-ink); }
  .fines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  @media (max-width: 760px) { .fines { grid-template-columns: 1fr; } }
  .fines .card b { font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
  .map { width: 100%; border-collapse: collapse; font-size: 15.5px; }
  .map th, .map td { text-align: left; padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
  .map th { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
  .map td:first-child { color: var(--fg); font-weight: 600; width: 34%; }
  .map td { color: var(--fg-2); }
  .scroll-x { overflow-x: auto; }
  .src { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--fg-3); font-size: 14px; }
  .src a { color: var(--fg-2); }
  .note { font-size: 14px; color: var(--fg-3); max-width: 70ch; }
  .mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  @media (max-width: 980px) { .mods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 640px) { .mods { grid-template-columns: 1fr; } }
  .mods .card { gap: 10px; }
  .mods .card.later { background: transparent; border-style: dashed; }
  .mods .card.later h3 { color: var(--fg-2); }
  .phase { display: inline-flex; align-items: center; gap: 8px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
  .phase::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--fg-3); }
  .phase.now { color: var(--fg); }
  .phase.now::before { background: var(--fg); border-color: var(--fg); }
  .phase.first { color: var(--red-ink); }
  .phase.first::before { background: var(--red); border-color: var(--red); }
  .split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px 48px; align-items: start; }
  @media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
  .split > * { min-width: 0; }
  .idea { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
  .idea .thin { color: var(--fg-3); }
  .hero-doc { min-height: auto; padding-block: 150px 60px; }
  @media (max-aspect-ratio: 1/1), (max-width: 1099px) { .hero-doc { padding-block: 44vh 40px; padding-block: 44svh 40px; } }

/* Pasos de "Cómo funciona" */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; counter-reset: s; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); min-width: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); font: 600 13px var(--mono); color: var(--fg-3); padding-top: 3px; }
.steps li.r::before { color: var(--red-ink); }
.steps b { display: block; color: var(--fg); font-size: 17px; letter-spacing: -.01em; margin-bottom: 4px; }
.steps span { color: var(--fg-2); font-size: 15.5px; }
.lvls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.lvls i { font: 600 11px var(--mono); font-style: normal; letter-spacing: .08em; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-2); }
.lvls i.r { color: var(--red-ink); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.nots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
@media (max-width: 760px) { .nots { grid-template-columns: 1fr; } }
.nots li { padding: 16px 0; border-top: 1px solid var(--line); color: var(--fg-2); font-size: 15.5px; min-width: 0; }
.nots b { color: var(--fg); }

/* Botón "¿Qué es Alerom AI?": texto en pantallas grandes, "?" en móvil */
.btn.q .short { display: none; }
@media (max-width: 720px) {
  .btn.q { width: 38px; padding: 0; }
  .btn.q .full { display: none; }
  .btn.q .short { display: inline; font: 700 15px var(--font); }
}
/* En móvil el logotipo se queda en el isotipo para que quepan los botones */
@media (max-width: 560px) {
  .top .logo .mark .word { display: none; }
  .top .logo { font-size: 15px; }
  .btn.q { width: 36px; }
}
@media (max-width: 380px) { .btn.q { width: 34px; min-height: 34px; } }

/* Móvil: en School, SCHOOL va debajo de la A */
.mark .mini { display: none; }
@media (max-width: 560px) {
  .top .logo .mark.school { flex-direction: column; gap: 3px; align-items: center; }
  .top .logo .mark.school svg { width: 1.75em; height: 1.75em; }
  .top .logo .mark.school .mini { display: flex; justify-content: space-between; width: 40px; font: 400 8px var(--font); color: var(--fg-2); line-height: 1; }
}
@media (max-width: 340px) {
  .nav { gap: 3px; }
  .btn.sm { padding: 6px 8px; font-size: 11.5px; }
  .lang, .theme, .btn.q { width: 32px; height: 32px; min-height: 32px; }
}

/* Accesibilidad (WCAG 2.2 AA) */
.skiplink { position: fixed; left: 16px; top: -100px; z-index: 200; background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.skiplink:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }
main:focus { outline: none; }
.qtext:focus, .res-word:focus { outline: none; }
:root.still *, :root.still *::before, :root.still *::after { animation-play-state: paused !important; }
