/* ============================================================
   NORTEARTE — Brand tokens compartidos por las 3 propuestas
   Paleta y tipografía confirmadas desde el manual de identidad
   gráfica del cliente (Nortearte-Identidad Grafica.pdf).

   Nota: las fuentes se cargan en formato original (OTF/TTF)
   hasta que se conviertan a WOFF2 (~3x mejor compresión).
   Ver README.md, sección "Optimizar fuentes".
   ============================================================ */

/* ------------------------------------------------------------
   @font-face — Cabinet Grotesk (Tipografía Primaria)
   ------------------------------------------------------------ */
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('fonts/subset-CabinetGrotesk-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('fonts/subset-CabinetGrotesk-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('fonts/subset-CabinetGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('fonts/subset-CabinetGrotesk-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------
   @font-face — IBM Plex Sans (Tipografía Secundaria)
   ------------------------------------------------------------ */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/subset-IBMPlexSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/subset-IBMPlexSans-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/subset-IBMPlexSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/subset-IBMPlexSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------
   @font-face — IBM Plex Sans Condensed (para metadata en C)
   ------------------------------------------------------------ */
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  src: url('fonts/subset-IBMPlexSansCondensed-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans Condensed';
  src: url('fonts/subset-IBMPlexSansCondensed-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------
   Custom properties — Paleta y sistema tipográfico
   ------------------------------------------------------------ */
:root {
  /* Paleta — valores exactos del manual (RGB confirmados) */
  --color-principal:    #DC4B28;
  --color-secundario:   #5078AF;
  --color-terciario:    #6E875F;
  --color-texto:        #1E1E1E;
  --color-fondo-claro:  #F3F3F3;

  /* Variantes derivadas */
  --color-principal-rgb:   220, 75, 40;
  --color-secundario-rgb:  80, 120, 175;
  --color-terciario-rgb:   110, 135, 95;
  --color-texto-rgb:       30, 30, 30;
  --color-fondo-claro-rgb: 243, 243, 243;

  /* Tipografía — familias */
  --font-primaria:   'Cabinet Grotesk', system-ui, -apple-system, sans-serif;
  --font-secundaria: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-condensed:  'IBM Plex Sans Condensed', 'IBM Plex Sans', sans-serif;

  /* Escala tipográfica — base (sobreescribible por propuesta) */
  --fs-display: clamp(3rem, 8vw, 7rem);
  --fs-h1:      clamp(2rem, 5vw, 4rem);
  --fs-h2:      clamp(1.5rem, 3vw, 2.5rem);
  --fs-h3:      clamp(1.125rem, 1.8vw, 1.5rem);
  --fs-body:    clamp(1rem, 1.2vw, 1.125rem);
  --fs-meta:    0.875rem;
  --fs-micro:   0.75rem;

  /* Espaciado base */
  --space-xs:  0.5rem;
  --space-s:   1rem;
  --space-m:   2rem;
  --space-l:   4rem;
  --space-xl:  8rem;
  --space-2xl: 12rem;

  /* Anchos máximos */
  --max-w-text:    65ch;
  --max-w-content: 1280px;
  --max-w-wide:    1600px;
}

/* ------------------------------------------------------------
   Reset mínimo + defaults globales
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-secundaria);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--color-texto);
  background-color: var(--color-fondo-claro);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primaria);
  line-height: 1.1;
  font-weight: 700;
}

/* Accesibilidad: foco visible para teclado */
:focus-visible {
  outline: 2px solid var(--color-principal);
  outline-offset: 3px;
}

/* Utilidad: ocultar visualmente pero accesible para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Selección de texto en color de marca */
::selection {
  background-color: var(--color-principal);
  color: var(--color-fondo-claro);
}

/* ------------------------------------------------------------
   Scroll reveal — usado por motion.js (data-reveal)
   ------------------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

[data-reveal="left"]  { transform: translateX(-28px); }
[data-reveal="right"] { transform: translateX(28px); }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal="fade"]  { transform: none; }

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------------
   Animación: gradient drift (continua y muy lenta)
   ------------------------------------------------------------ */
@keyframes gradient-drift {
  0%   { transform: scale(1.05) translate(0, 0); }
  33%  { transform: scale(1.08) translate(-1.5%, 1%); }
  66%  { transform: scale(1.06) translate(1%, -1%); }
  100% { transform: scale(1.05) translate(0, 0); }
}

@keyframes gradient-shift {
  0%, 100% { filter: hue-rotate(0deg) saturate(1); }
  50%      { filter: hue-rotate(-8deg) saturate(1.15); }
}
