/* ============================================================================
   ALOYSIUS AI · SITIO WEB (aloysius-ai.com) · HOJA DE ESTILO
   ----------------------------------------------------------------------------
   Identidad unificada con el cliente de escritorio (crates/cliente, tema.rs) y
   la extensión (extension/src/ui/theme.css). Fuente única de los tokens:
     · Marca índigo #4C6EF5 (escudo que se difumina en píxeles), borde #3D5AD6.
     · OK / «protegido» verde #2F9E44.
     · Aviso ámbar #F59F00 · error rojo #E03131.
     · Neutros sobrios; tipografía del sistema (SIN webfonts ni CDNs).
   Contraste AA en claro y oscuro. Modo claro/oscuro por prefers-color-scheme,
   con override manual guardado en localStorage (ver js/tema.js).
   ============================================================================ */

:root {
  color-scheme: light dark;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
    "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;

  /* — Neutros (claro) — */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --surface-3: #e4e9f0;
  --border: #d7dce3;
  --border-strong: #c3cbd6;
  --text: #1b1e26;
  --text-muted: #5b6472;
  --text-faint: #697180;

  /* — Marca índigo — */
  --brand: #4c6ef5;
  --brand-strong: #3b5bdb;
  --brand-weak: #eaeffe;
  --brand-btn: #3b5bdb;
  --on-brand: #ffffff;
  --accent: #2f9e44;
  --accent-weak: #e6f4ea;

  /* — Estados — */
  --ok: #2f9e44;      --ok-weak: #e6f4ea;     --ok-ink: #1f7a32;
  --warn: #b56a00;    --warn-weak: #fbeed9;   --warn-ink: #8a5200;   --warn-accent: #f59f00;
  --danger: #d02b2b;  --danger-weak: #fbe7e6; --danger-ink: #b32222; --danger-accent: #e03131;

  /* La marca (escudo que se difumina en píxeles) vive en assets/logo.svg con sus
     colores propios; contrasta en claro y oscuro y no depende de tokens CSS. */

  --shadow-1: 0 1px 2px rgba(20,22,28,.06), 0 1px 3px rgba(20,22,28,.09);
  --shadow-2: 0 10px 30px rgba(20,22,28,.14), 0 3px 8px rgba(20,22,28,.08);
  --radius: 14px; --radius-sm: 9px; --radius-lg: 20px; --pill: 999px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent);

  --maxw: 1120px;
}

/* Tokens oscuros: (a) siguiendo al sistema salvo override claro y
   (b) forzados con [data-theme="dark"]. Mismo listado en ambos selectores. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161c;
    --surface: #1b1e26;
    --surface-2: #232733;
    --surface-3: #2b3040;
    --border: #2e3340;
    --border-strong: #3d4453;
    --text: #e6e8ee;
    --text-muted: #9aa1b0;
    --text-faint: #8b93a1;

    --brand: #4c6ef5;
    --brand-strong: #7f97ff;
    --brand-weak: #1d2440;
    --brand-btn: #3b5bdb;
    --on-brand: #ffffff;
    --accent: #37b24d;
    --accent-weak: #163224;

    --ok: #37b24d;      --ok-weak: #163224;     --ok-ink: #43c05a;
    --warn: #f0a020;    --warn-weak: #2c2410;   --warn-ink: #f0a020;   --warn-accent: #f0a020;
    --danger: #f06064;  --danger-weak: #2e1919; --danger-ink: #f06064; --danger-accent: #f06064;

    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 12px 34px rgba(0,0,0,.55), 0 3px 10px rgba(0,0,0,.4);
    --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent);
  }
}
:root[data-theme="dark"] {
  --bg: #14161c;
  --surface: #1b1e26;
  --surface-2: #232733;
  --surface-3: #2b3040;
  --border: #2e3340;
  --border-strong: #3d4453;
  --text: #e6e8ee;
  --text-muted: #9aa1b0;
  --text-faint: #8b93a1;

  --brand: #4c6ef5;
  --brand-strong: #7f97ff;
  --brand-weak: #1d2440;
  --brand-btn: #3b5bdb;
  --on-brand: #ffffff;
  --accent: #37b24d;
  --accent-weak: #163224;

  --ok: #37b24d;      --ok-weak: #163224;     --ok-ink: #43c05a;
  --warn: #f0a020;    --warn-weak: #2c2410;   --warn-ink: #f0a020;   --warn-accent: #f0a020;
  --danger: #f06064;  --danger-weak: #2e1919; --danger-ink: #f06064; --danger-accent: #f06064;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 12px 34px rgba(0,0,0,.55), 0 3px 10px rgba(0,0,0,.4);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent);
}

/* ============================ Base ====================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand-btn); color: var(--on-brand);
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--brand-strong);
  margin-bottom: .6rem;
}
.muted { color: var(--text-muted); }

/* ============================ Botones =================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 650; cursor: pointer;
  padding: 13px 22px; border-radius: var(--pill);
  border: 1px solid transparent; transition: background .15s ease, border-color .15s ease, transform .05s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-btn); color: var(--on-brand); border-color: var(--brand-btn); }
.btn--primary:hover { background: var(--brand); border-color: var(--brand); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--lg { padding: 15px 28px; font-size: 1.05rem; }
.btn[aria-disabled="true"], .btn.is-soon {
  background: var(--surface-2); color: var(--text-muted);
  border-color: var(--border); cursor: not-allowed; pointer-events: none;
}

.soon-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--warn-weak); color: var(--warn-ink);
  padding: 3px 10px; border-radius: var(--pill); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}

/* ============================ Cabecera ================================== */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt strong { font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-txt span { font-size: .72rem; font-weight: 500; color: var(--text-muted); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text-muted); font-weight: 550; font-size: .95rem; padding: 8px 12px; border-radius: var(--radius-sm); }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.head-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle .ic-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-dark { display: block; }
:root[data-theme="dark"] .theme-toggle .ic-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic-dark { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .ic-light { display: none; }
}

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 16px; box-shadow: var(--shadow-1);
    display: none;
  }
  .nav[data-open="1"] { display: flex; }
  .nav a { padding: 11px 12px; }
  .nav-toggle { display: grid; }
}

/* ============================ Secciones ================================= */
section { padding: 72px 0; }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--text-muted); font-size: 1.08rem; }

/* Héroe */
.hero { padding: 80px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 54px; align-items: center; }
.hero h1 { margin-bottom: .4em; }
.hero-lead { font-size: 1.22rem; color: var(--text-muted); max-width: 40ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
.hero-note { margin-top: 16px; font-size: .9rem; color: var(--text-faint); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 13px; border-radius: var(--pill);
}
.badge svg { color: var(--accent); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-lead { max-width: none; }
}

/* Demostración visual del héroe: maqueta de "difuminado quirúrgico" */
.demo {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-2);
}
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 4px 6px 12px; }
.demo-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); }
.demo-url {
  flex: 1; margin-left: 8px; height: 26px; border-radius: var(--pill);
  background: var(--surface-2); display: flex; align-items: center; padding: 0 12px;
  font-size: .78rem; color: var(--text-faint);
}
.demo-feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.demo-card { background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.demo-thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative; }
.demo-thumb.safe { background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); }
.demo-lines { padding: 9px 10px; }
.demo-line { height: 7px; border-radius: 4px; background: var(--surface-3); margin-bottom: 6px; }
.demo-line.short { width: 60%; }
/* La "región censurada": blur real por CSS sobre contenido neutro (sin desnudez). */
.demo-thumb.blurred::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, #d9b3ff 0 14px, #c79bf0 14px 28px);
  filter: blur(9px); transform: scale(1.2);
}
.demo-thumb.blurred::after {
  content: ""; position: absolute; inset: 0;
  border: 2px solid var(--brand); border-radius: 4px;
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--brand) 8%, transparent);
}
.demo-tag {
  position: absolute; z-index: 2; bottom: 7px; left: 7px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 700; color: var(--on-brand);
  background: var(--brand-btn); padding: 3px 8px; border-radius: var(--pill);
}

/* Tarjetas genéricas */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-1);
}
.card h3 { margin-bottom: .4em; }
.card p { color: var(--text-muted); margin-bottom: 0; }
.card-ic {
  display: grid; place-items: center; width: 46px; height: 46px;
  border-radius: var(--radius-sm); margin-bottom: 16px;
  background: var(--brand-weak); color: var(--brand-strong);
}

/* "Cómo funciona": pasos numerados */
.steps { counter-reset: step; }
.step { position: relative; }
.step .card-ic { background: var(--brand-weak); color: var(--brand-strong); font-weight: 700; }
.step-num {
  font-size: 1.1rem; font-weight: 700; color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}

/* Alternancia: bloque "por qué es distinto" */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }
.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 16px; }
.feature-list li { display: flex; gap: 13px; align-items: flex-start; }
.feature-list .fic {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-weak); color: var(--accent);
}
.feature-list strong { display: block; }
.feature-list span { color: var(--text-muted); font-size: .95rem; }

/* Perfiles */
.profile { display: flex; flex-direction: column; }
.profile-tag {
  align-self: flex-start; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 11px; border-radius: var(--pill); margin-bottom: 14px;
}
.profile.familiar .profile-tag { background: var(--brand-weak); color: var(--brand-strong); }
.profile.bienestar .profile-tag { background: var(--accent-weak); color: var(--ok-ink); }
.profile.corporativo .profile-tag { background: var(--surface-2); color: var(--text); }
.profile ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 9px; }
.profile li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-muted); font-size: .95rem; }
.profile li svg { flex: none; color: var(--accent); margin-top: 3px; }

/* Banda de privacidad */
.band {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-1);
}
.band-grid { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.band-seal {
  width: 76px; height: 76px; flex: none; border-radius: var(--radius);
  display: grid; place-items: center; background: var(--accent-weak); color: var(--accent);
}
@media (max-width: 620px) { .band-grid { grid-template-columns: 1fr; } .band { padding: 28px; } }
.pill-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 8px; }
.pill-list span {
  font-size: .85rem; font-weight: 600; color: var(--ok-ink);
  background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 6px 13px; border-radius: var(--pill);
}

/* Límites honestos */
.limits {
  background: var(--warn-weak);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius-lg); padding: 36px;
}
.limits h2 { color: var(--warn-ink); }
.limits .limit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.limits .limit-head svg { color: var(--warn-accent); flex: none; }
.limits ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .limits ul { grid-template-columns: 1fr; } }
.limits li { display: flex; gap: 11px; align-items: flex-start; }
.limits li svg { flex: none; color: var(--warn-ink); margin-top: 3px; }
.limits li strong { color: var(--text); }
.limits li span { color: var(--warn-ink); }

/* CTA final */
.cta-band {
  text-align: center; background: var(--brand-weak);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-radius: var(--radius-lg); padding: 52px 32px;
}
.cta-band h2 { color: var(--brand-strong); }
.cta-band p { color: var(--text-muted); max-width: 54ch; margin: 0 auto 24px; }

/* ============================ Pie ======================================= */
.site-foot { border-top: 1px solid var(--border); padding: 54px 0 40px; background: var(--surface); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 0 0 14px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.foot-col a { color: var(--text-muted); font-size: .92rem; }
.foot-col a:hover { color: var(--text); }
.foot-about p { color: var(--text-muted); font-size: .92rem; max-width: 34ch; }
.foot-bottom {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  color: var(--text-faint); font-size: .85rem;
}

/* Nota de provisionalidad (placeholders legales/comercial) */
.provisional {
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: .88rem; color: var(--text-muted);
  display: flex; gap: 10px; align-items: flex-start;
}
.provisional svg { flex: none; color: var(--text-faint); margin-top: 2px; }

/* ============================ Página de descarga ======================= */
.dl-hero { text-align: center; padding: 72px 0 40px; }
.dl-hero .mark-lg { margin: 0 auto 20px; display: block; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
@media (max-width: 760px) { .dl-grid { grid-template-columns: 1fr; } }
.dl-card { text-align: left; display: flex; flex-direction: column; }
.dl-card .dl-os { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.dl-card .dl-os svg { color: var(--brand-strong); }
.dl-card h3 { margin: 0; }
.dl-req { font-size: .85rem; color: var(--text-faint); margin: 10px 0 18px; }
.dl-card .btn { width: 100%; margin-top: auto; }
.dl-steps { counter-reset: s; list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.dl-steps li { counter-increment: s; display: flex; gap: 13px; align-items: flex-start; color: var(--text-muted); }
.dl-steps li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-weak); color: var(--brand-strong); font-weight: 700; font-size: .85rem;
  display: grid; place-items: center;
}
.hash-note { font-size: .82rem; color: var(--text-faint); margin-top: 10px; }
