/* ==========================================================================
   Webportal Design System v2 — Tokens ("Oscuro premium")
   Fuente única de verdad: color, tipografía, espaciado, radios, sombras,
   movimiento. Todas las páginas cargan este archivo primero.
   Reglas de uso: design/DESIGN-SYSTEM.md · Guía visual: design/styleguide.html
   Fuentes: autoalojadas en assets/fonts (subconjunto latin de Google Fonts,
   licencia OFL). Cada página precarga Geist y DM Serif Display en su <head>.
   ========================================================================== */

/* Geist variable (400–600) y Geist Mono variable (400–500). DM Serif Display
   solo en cursiva 400: es lo único que usa .c-accent (25 KB). Elegida el
   2026-10-09 tras comparar 6 opciones (design/prueba-tipografias/); las
   anteriores, Newsreader e Instrument Serif, están en archive/. */
@font-face {
  font-family: "Geist";
  src: url("../assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../assets/fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("../assets/fonts/dm-serif-display-italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  /* ---------- Suelo y superficies (casi negro con matiz violeta) ---------- */
  --bg:        #08070b;   /* fondo de página */
  --bg-raised: #0d0c12;   /* bandas alternas, footer */
  --surface-1: #111017;   /* tarjetas */
  --surface-2: #17161e;   /* paneles internos, inputs, mini-UIs */
  --surface-3: #201e29;   /* chips activos, hover */
  --surface-4: #2a2835;   /* elementos elevados dentro de mini-UIs */

  /* Líneas finas: separan todo, nunca sombras grises */
  --line:        rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --line-bright: rgba(255, 255, 255, 0.22);

  /* ---------- Texto ---------- */
  --fg:   #f4f3f8;   /* titulares y texto fuerte */
  --fg-2: #a6a3b5;   /* párrafos (7.9:1 sobre --bg) */
  --fg-3: #7f7c8e;   /* captions, metadatos (4.7:1, mínimo AA) */
  --fg-4: #4f4c5a;   /* solo decorativo: nunca para texto legible */

  /* ---------- Marca ---------- */
  --violet-200: #ddd4ff;
  --violet-300: #c2b4ff;
  --violet-400: #a48bff;   /* texto/acento violeta sobre oscuro */
  --violet-500: #7c5cff;   /* color de marca: botón primario */
  --violet-600: #6a48f5;
  --violet-700: #5232cc;
  --violet-900: #1b1238;

  --peach-200: #ffd6c4;
  --peach-300: #ffb99c;    /* acento cálido */
  --peach-400: #ff9b78;
  --peach-600: #d8653f;
  --peach-900: #2e160e;

  --blue-400: #7aa2ff;

  /* Semánticos */
  --color-primary:       var(--violet-500);
  --color-primary-hover: #8d71ff;
  --color-accent:        var(--peach-300);
  --color-focus:         var(--violet-400);
  --success: #3fd99a;
  --warning: #f5b74e;
  --danger:  #ff5d6c;

  /* Color fijo por línea de servicio (iconos, gráficos, chips, tarjetas) */
  --service-web: var(--violet-400);
  --service-seo: var(--peach-300);
  --service-ppc: var(--blue-400);

  /* ---------- Gradientes y brillos ---------- */
  /* Palabra destacada en serif cursiva (una por titular, como máximo) */
  --gradient-accent: linear-gradient(100deg, var(--violet-300) 0%, var(--violet-400) 45%, var(--peach-300) 100%);
  --gradient-primary: linear-gradient(180deg, #8f74ff 0%, var(--violet-600) 100%);
  --glow-top:
    radial-gradient(60% 55% at 70% 0%, rgba(124, 92, 255, 0.28) 0%, transparent 70%),
    radial-gradient(40% 40% at 95% 35%, rgba(255, 155, 120, 0.12) 0%, transparent 70%);
  --glow-bottom:
    radial-gradient(55% 70% at 50% 100%, rgba(124, 92, 255, 0.30) 0%, transparent 70%),
    radial-gradient(30% 40% at 78% 100%, rgba(255, 155, 120, 0.16) 0%, transparent 70%);

  /* Tarjetas de color de servicio (estilo "feature card") */
  --card-web: linear-gradient(160deg, #6a48f5 0%, #3b2596 55%, #1d1340 100%);
  --card-seo: linear-gradient(160deg, #e0805c 0%, #b4502f 60%, #5c2414 100%);
  --card-ppc: linear-gradient(160deg, #f4eefc 0%, #e9ddf6 50%, #f6d9cf 100%);

  /* ---------- Tipografía ---------- */
  --font-sans:  "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "DM Serif Display", ui-serif, Georgia, serif;        /* solo cursiva de acento */
  --font-mono:  "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-2xs:  0.6875rem;                                    /* 11 — etiquetas mono */
  --text-xs:   0.75rem;                                      /* 12 */
  --text-sm:   0.875rem;                                     /* 14 */
  --text-base: 1rem;                                         /* 16 */
  --text-md:   1.125rem;                                     /* 18 */
  --text-lg:   clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);      /* 20–24 */
  --text-xl:   clamp(1.5rem, 1.3rem + 0.8vw, 2rem);          /* 24–32 */
  --text-2xl:  clamp(1.875rem, 1.4rem + 1.9vw, 3rem);        /* 30–48 */
  --text-3xl:  clamp(2.25rem, 1.5rem + 3vw, 4rem);           /* 36–64 */
  --text-display: clamp(3rem, 1.6rem + 5.8vw, 6.25rem);      /* 48–100 */
  --text-hero: clamp(2.5rem, 1.55rem + 3.6vw, 4.5rem);       /* 40–72 — h1 con titular largo (fórmula de landing) */

  --leading-display: 0.98;
  --leading-tight: 1.08;
  --leading-snug:  1.25;
  --leading-body:  1.6;

  --tracking-display: -0.045em;
  --tracking-tight:   -0.035em;
  --tracking-snug:    -0.015em;
  --tracking-mono:    0.06em;

  /* ---------- Espaciado (base 4px) ---------- */
  --space-1:  0.25rem;   /* 4 */
  --space-2:  0.5rem;    /* 8 */
  --space-3:  0.75rem;   /* 12 */
  --space-4:  1rem;      /* 16 */
  --space-5:  1.25rem;   /* 20 */
  --space-6:  1.5rem;    /* 24 */
  --space-8:  2rem;      /* 32 */
  --space-10: 2.5rem;    /* 40 */
  --space-12: 3rem;      /* 48 */
  --space-16: 4rem;      /* 64 */
  --space-20: 5rem;      /* 80 */
  --space-24: 6rem;      /* 96 */
  --space-32: 8rem;      /* 128 */

  --section-y: clamp(3.5rem, 1.25rem + 8vw, 9rem);   /* 56 px en móvil → 144 px en escritorio */
  --gutter:    clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --container: 1240px;
  --container-narrow: 760px;
  --nav-h: 68px;

  /* ---------- Radios (gramática por rol) ---------- */
  --radius-xs:   6px;    /* chips internos, barras */
  --radius-sm:   10px;   /* elementos dentro de mini-UIs */
  --radius-md:   14px;   /* ventanas de mini-UI, inputs de área */
  --radius-lg:   20px;   /* tarjetas */
  --radius-xl:   28px;   /* paneles grandes, banda CTA */
  --radius-pill: 999px;  /* botones, chips, badges, nav */

  /* ---------- Profundidad (en oscuro: luz arriba + sombra negra) ---------- */
  --highlight:  inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md:  0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg:  0 30px 80px -24px rgba(0, 0, 0, 0.85);
  --glow-primary: 0 0 0 1px rgba(164, 139, 255, 0.35), 0 10px 32px -8px rgba(124, 92, 255, 0.65);

  /* ---------- Movimiento ---------- */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur-base: 280ms;
  --dur-slow: 700ms;

  /* ---------- Capas ---------- */
  --z-raised: 10;
  --z-nav: 100;
  --z-overlay: 1000;
}

/* --dur-fast se mantiene: lo usan cambios de color y la respuesta al pulsar,
   que no marean. Los desplazamientos (base/slow) se quitan. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}

/* Más contraste (ajuste del sistema): líneas y grises más marcados */
@media (prefers-contrast: more) {
  :root {
    --line:        rgba(255, 255, 255, 0.2);
    --line-strong: rgba(255, 255, 255, 0.32);
    --line-bright: rgba(255, 255, 255, 0.5);
    --fg-2: #cbc8d8;
    --fg-3: #aaa7b9;
  }
}
