/* ==========================================================================
   DESIGN TOKENS — Alvarez Construction LLC
   ÚNICO archivo con valores HEX. Todo el sitio (CSS y animaciones GSAP) consume estas variables.
   Para cambiar la identidad cromática edita solo la sección 1 (marca) y, si hace falta, la 2.
   ========================================================================== */

/* ---- @font-face (autoalojadas, sin peticiones a terceros) ---- */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ------------------------------------------------------------------
     1) MARCA — extraída del logo (assets/images/brand/logo.webp)
        naranja #F6A022 · gris acero #8D9DA8 · pizarra #505D6F
     ------------------------------------------------------------------ */
  --brand-orange: #f6a022;
  --brand-steel:  #8d9da8;
  --brand-slate:  #505d6f;

  /* ------------------------------------------------------------------
     2) ESCALAS DERIVADAS del logo (mismo tono azul-pizarra, distinta luminosidad)
     ------------------------------------------------------------------ */
  --ink-950: #0e1319;   /* negro azulado */
  --ink-900: #151c25;
  --ink-800: #1d2733;   /* grafito */
  --ink-700: #2a3646;
  --ink-600: #3b4859;
  --steel-300: #aebac3;
  --steel-200: #cbd3d9;
  --steel-100: #e3e8eb;
  --paper-50:  #f7f5f1; /* blanco cálido */
  --paper-100: #efebe4;
  --paper-200: #e3ddd2; /* gris arquitectónico cálido */
  --orange-400: #f8b347;
  --orange-600: #d9870f;
  --orange-700: #965a0a; /* naranja para TEXTO sobre fondos claros (AA) */
  --white: #ffffff;
  --black: #000000;

  /* Canales RGB para transparencias: rgb(var(--ink-950-rgb) / 0.5) */
  --ink-950-rgb: 14 19 25;
  --ink-900-rgb: 21 28 37;
  --paper-50-rgb: 247 245 241;
  --orange-rgb: 246 160 34;

  /* Semánticos (solo estados de formulario; no forman parte de la identidad) */
  --color-success: #5cb88c;
  --color-warning: var(--brand-orange);
  --color-error:   #e87a70;

  /* ------------------------------------------------------------------
     3) TOKENS SEMÁNTICOS — tema claro por defecto.
        .theme-dark los reasigna (ver base.css). Los componentes usan SOLO estos.
     ------------------------------------------------------------------ */
  --color-primary:        var(--brand-orange);
  --color-primary-hover:  var(--orange-400);
  --color-secondary:      var(--brand-slate);
  --color-accent:         var(--brand-orange);
  --color-accent-hover:   var(--orange-600);
  --color-accent-text:    var(--orange-700);

  --color-background:        var(--paper-50);
  --color-surface:           var(--paper-100);
  --color-surface-elevated:  var(--white);
  --color-text-primary:      var(--ink-900);
  --color-text-secondary:    var(--ink-600);
  --color-text-muted:        var(--brand-slate);
  --color-text-inverse:      var(--paper-50);
  --color-border:            rgb(var(--ink-900-rgb) / 0.14);
  --color-border-strong:     rgb(var(--ink-900-rgb) / 0.32);
  --color-overlay:           rgb(var(--ink-950-rgb) / 0.62);
  --color-on-primary:        var(--ink-950);   /* texto sobre botones naranja */

  /* ------------------------------------------------------------------
     4) TIPOGRAFÍA
     ------------------------------------------------------------------ */
  --font-heading: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body:    "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-xs:   clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
  --text-sm:   clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg:   clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-xl:   clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem);
  --text-2xl:  clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --text-3xl:  clamp(2.25rem, 1.6rem + 3vw, 4.25rem);
  --text-4xl:  clamp(2.75rem, 1.7rem + 5vw, 6.5rem);
  --text-display: clamp(3.25rem, 1.4rem + 8.6vw, 10.5rem);

  --lh-tight: 0.98;
  --lh-snug:  1.12;
  --lh-body:  1.65;
  --tracking-display: -0.025em;
  --tracking-caps: 0.16em;

  /* ------------------------------------------------------------------
     5) ESPACIADO, RADIOS, SOMBRAS
     ------------------------------------------------------------------ */
  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;
  --section-y: clamp(4.5rem, 9vw, 9rem);
  --gutter:    clamp(1.25rem, 4vw, 3.5rem);

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(var(--ink-950-rgb) / 0.08), 0 2px 8px rgb(var(--ink-950-rgb) / 0.06);
  --shadow-md: 0 8px 30px rgb(var(--ink-950-rgb) / 0.12);
  --shadow-lg: 0 30px 80px rgb(var(--ink-950-rgb) / 0.28);
  --shadow-glow: 0 0 0 1px rgb(var(--orange-rgb) / 0.4), 0 10px 40px rgb(var(--orange-rgb) / 0.18);

  /* ------------------------------------------------------------------
     6) MOVIMIENTO (CSS y GSAP leen estos valores — ver assets/js/tokens.js)
     ------------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast:   180ms var(--ease-out);
  --transition-normal: 320ms var(--ease-out);
  --transition-slow:   700ms var(--ease-out);
  --duration-fast: 0.25;     /* segundos (GSAP) */
  --duration-normal: 0.7;
  --duration-slow: 1.2;
  --stagger: 0.08;

  /* ------------------------------------------------------------------
     7) LAYOUT
     ------------------------------------------------------------------ */
  --container-width: 1440px;
  --container-narrow: 920px;
  --header-h: 84px;

  /* Breakpoints: referencia (las @media usan estos mismos valores literales; JS los lee de aquí) */
  --bp-sm: 600;
  --bp-md: 900;
  --bp-lg: 1200;

  /* Z-index */
  --z-base: 1;
  --z-sticky: 50;
  --z-header: 100;
  --z-menu: 200;
  --z-lightbox: 300;
  --z-progress: 400;
  --z-loader: 1000;
}

/* Preferencia de movimiento reducido: sin transiciones largas */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 1ms linear;
    --transition-normal: 1ms linear;
    --transition-slow: 1ms linear;
    --duration-fast: 0;
    --duration-normal: 0;
    --duration-slow: 0;
  }
}
