/* ============================================================
   CYNTEK — variables.css
   Sistema de diseño: colores, tipografía, espaciado, sombras,
   radios, z-index, transiciones y tema claro/oscuro.
   ============================================================ */

/* ------------------------------------------------------------
   1. TIPOGRAFÍA (familias)
   ------------------------------------------------------------ */
:root {
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Inter',   -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  /* ------------------------------------------------------------
     2. PALETA DE MARCA (fija, no cambia con el tema)
     ------------------------------------------------------------ */
  --cyntek-orange:      #FF5F45;
  --cyntek-orange-deep: #E8472C;
  --cyntek-orange-glow: #FF7A5C;
  --cyntek-grey:        #616161;
  --cyntek-grey-warm:   #828282;

  /* ------------------------------------------------------------
     3. NEUTROS (base, se reutilizan en ambos temas)
     ------------------------------------------------------------ */
  --black:      #0A0A0A;
  --charcoal:   #141414;
  --graphite:   #1C1C1C;
  --steel:      #2A2A2A;
  --metal:      #3A3A3A;
  --light-grey: #E6E6E6;
  --off-white:  #F5F5F5;
  --white:      #FFFFFF;

  /* ------------------------------------------------------------
     4. ESCALA TIPOGRÁFICA (rem)
     Base 16px en html.
     ------------------------------------------------------------ */
  --fs-xs:   0.6875rem; /* 11px — eyebrows, labels */
  --fs-sm:   0.75rem;   /* 12px — eyebrows grandes, meta */
  --fs-base: 1rem;      /* 16px — body */
  --fs-md:   1.0625rem; /* 17px — body grande */
  --fs-lg:   1.25rem;   /* 20px — lead */
  --fs-xl:   1.5rem;    /* 24px — h4 */
  --fs-2xl:  2rem;      /* 32px — h3 */
  --fs-3xl:  2.75rem;   /* 44px — h2 */
  --fs-4xl:  3.75rem;   /* 60px — h1 secciones */
  --fs-5xl:  5rem;      /* 80px — h1 hero */
  --fs-6xl:  6.5rem;    /* 104px — display hero XL */

  /* Pesos */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    800;

  /* Line-height */
  --lh-tight:   1.05;
  --lh-snug:    1.2;
  --lh-normal:  1.4;
  --lh-relaxed: 1.6;

  /* Tracking */
  --ls-tight:   -0.02em;
  --ls-tighter: -0.035em;
  --ls-wide:    0.08em;
  --ls-wider:   0.14em;
  --ls-widest:  0.22em;

  /* ------------------------------------------------------------
     5. ESCALA DE ESPACIADO (sistema 8px)
     ------------------------------------------------------------ */
  --sp-1:  0.25rem;  /*  4px */
  --sp-2:  0.5rem;   /*  8px */
  --sp-3:  0.75rem;  /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-5:  1.5rem;   /* 24px */
  --sp-6:  2rem;     /* 32px */
  --sp-7:  2.5rem;   /* 40px */
  --sp-8:  3rem;     /* 48px */
  --sp-9:  4rem;     /* 64px */
  --sp-10: 5rem;     /* 80px */
  --sp-11: 6rem;     /* 96px */
  --sp-12: 8rem;     /* 128px */

  /* Espaciado vertical de sección */
  --section-py:        clamp(4rem, 8vw, 8rem);
  --section-py-lg:     clamp(5rem, 10vw, 10rem);
  --container-max:     1320px;
  --container-px:      clamp(1.25rem, 4vw, 3rem);
  --container-narrow:  880px;

  /* ------------------------------------------------------------
     6. RADIOS
     ------------------------------------------------------------ */
  --radius-xs:  2px;
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  10px;
  --radius-xl:  16px;
  --radius-full: 999px;

  /* ------------------------------------------------------------
     7. BORDES
     ------------------------------------------------------------ */
  --border-width:       1px;
  --border-width-thick: 2px;

  /* ------------------------------------------------------------
     8. TRANSICIONES
     ------------------------------------------------------------ */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-soft:  cubic-bezier(0.4, 0, 0.2, 1);

  --dur-fast:   150ms;
  --dur-base:   300ms;
  --dur-slow:   500ms;
  --dur-slower: 800ms;

  --transition-theme: background-color var(--dur-base) var(--ease-soft),
                      border-color     var(--dur-base) var(--ease-soft),
                      color            var(--dur-base) var(--ease-soft);

  /* ------------------------------------------------------------
     9. Z-INDEX (escala ordenada)
     ------------------------------------------------------------ */
  --z-base:     1;
  --z-content:  10;
  --z-sticky:   100;
  --z-header:   500;
  --z-dropdown: 600;
  --z-overlay:  900;
  --z-modal:    1000;
  --z-loader:   9999;

  /* ------------------------------------------------------------
     10. LAYOUT
     ------------------------------------------------------------ */
  --header-h:        80px;
  --header-h-scroll: 64px;
  --header-h-mobile: 64px;
}

/* ============================================================
   TEMA OSCURO (por defecto)
   ============================================================ */
:root,
:root[data-theme="dark"],
body.theme-dark {

  /* Superficies */
  --surface-0: var(--black);       /* fondo más profundo */
  --surface-1: var(--charcoal);    /* fondo principal */
  --surface-2: var(--graphite);    /* cards, bloques */
  --surface-3: var(--steel);       /* elementos elevados */
  --surface-4: var(--metal);       /* bordes, separadores fuertes */

  /* Texto */
  --text-primary:   #F2F2F2;
  --text-secondary: #B5B5B5;
  --text-muted:     #7A7A7A;
  --text-inverse:   var(--black);
  --text-accent:    var(--cyntek-orange);

  /* Bordes */
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-strong:  rgba(255, 255, 255, 0.18);
  --border-accent:  var(--cyntek-orange);

  /* Header */
  --header-bg-transparent: transparent;
  --header-bg-solid:       rgba(10, 10, 10, 0.88);
  --header-border:         rgba(255, 255, 255, 0.08);
  --header-text:           #F2F2F2;
  --header-text-hover:     var(--cyntek-orange);

  /* Sombras */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-xl:  0 24px 80px rgba(0, 0, 0, 0.65);
  --shadow-accent: 0 8px 32px rgba(255, 95, 69, 0.28);

  /* Overlays */
  --overlay-dark:   rgba(0, 0, 0, 0.65);
  --overlay-darker: rgba(0, 0, 0, 0.82);
  --overlay-gradient: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.15) 0%,
    rgba(10, 10, 10, 0.55) 55%,
    rgba(10, 10, 10, 0.95) 100%
  );

  /* Grid técnico de fondo */
  --grid-line: rgba(255, 255, 255, 0.035);

  /* Estado */
  --state-hover:   rgba(255, 255, 255, 0.04);
  --state-active:  rgba(255, 255, 255, 0.08);
  --state-focus:   var(--cyntek-orange);

  color-scheme: dark;
}

/* ============================================================
   TEMA CLARO
   ============================================================ */
:root[data-theme="light"],
body.theme-light {

  /* Superficies */
  --surface-0: #FFFFFF;
  --surface-1: var(--off-white);
  --surface-2: #FFFFFF;
  --surface-3: var(--light-grey);
  --surface-4: #D6D6D6;

  /* Texto */
  --text-primary:   #0F0F0F;
  --text-secondary: #4A4A4A;
  --text-muted:     #8A8A8A;
  --text-inverse:   var(--white);
  --text-accent:    var(--cyntek-orange-deep);

  /* Bordes */
  --border-subtle:  rgba(0, 0, 0, 0.05);
  --border-default: rgba(0, 0, 0, 0.10);
  --border-strong:  rgba(0, 0, 0, 0.20);
  --border-accent:  var(--cyntek-orange-deep);

  /* Header */
  --header-bg-transparent: transparent;
  --header-bg-solid:       rgba(255, 255, 255, 0.92);
  --header-border:         rgba(0, 0, 0, 0.08);
  --header-text:           #0F0F0F;
  --header-text-hover:     var(--cyntek-orange-deep);

  /* Sombras */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl:  0 24px 80px rgba(0, 0, 0, 0.16);
  --shadow-accent: 0 8px 32px rgba(232, 71, 44, 0.22);

  /* Overlays */
  --overlay-dark:   rgba(0, 0, 0, 0.45);
  --overlay-darker: rgba(0, 0, 0, 0.65);
  --overlay-gradient: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0.75) 100%
  );

  /* Grid técnico de fondo */
  --grid-line: rgba(0, 0, 0, 0.04);

  /* Estado */
  --state-hover:   rgba(0, 0, 0, 0.03);
  --state-active:  rgba(0, 0, 0, 0.06);
  --state-focus:   var(--cyntek-orange-deep);

  color-scheme: light;
}

/* ============================================================
   PREFERENCIAS DEL SISTEMA
   Si el usuario no ha elegido tema, respeta el del SO.
   El JS sobreescribe con data-theme="dark"|"light" en <html>.
   ============================================================ */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    /* Se mantiene dark por defecto por decisión de marca.
       El JS fuerza data-theme="dark" al cargar si no hay nada guardado.
       Este bloque queda como salvaguarda para futuros cambios. */
  }
}

/* ============================================================
   ACCESIBILIDAD — reducción de movimiento
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast:   0ms;
    --dur-base:   0ms;
    --dur-slow:   0ms;
    --dur-slower: 0ms;
  }
}