/* =============================================================
   BASE.CSS — Design Tokens · Reset · Typography
   Responsabilidad: Variables globales, reset y estilos base.
   NO contiene layout ni componentes.
   Branding: docs/reference/BRANDING.md
   ============================================================= */

/* ── 1. DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* ── Paleta: "Entre bambalinas" ─────────────────────────── */
  --color-primary:     #0A0A0A;   /* Negro Escénico */
  --color-surface:     #1A1A1A;   /* Negro elevado */
  --color-surface-2:   #2C2C2C;   /* Carbón Cálido */
  --color-cream:       #F5F0E8;   /* Crema Antiguo */
  --color-accent:      #C5A55A;   /* Oro de Proscenio */
  --color-accent-2:    #D4B96A;   /* Oro claro (hover) */
  --color-magenta:     #B8255F;   /* Magenta Rosa (≤15%) */
  --color-magenta-2:   #D42E70;   /* Magenta hover */
  --color-text:        #F5F0E8;   /* Crema como texto principal */
  --color-text-muted:  #8A8A8A;   /* Gris Medio */
  --color-border:      rgba(245, 240, 232, 0.08);

  /* ── Tipografía: Cormorant Garamond + DM Sans ──────────── */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'DM Sans', 'Helvetica Neue', sans-serif;

  /* Escala fluida */
  --text-hero:   clamp(3rem, 6vw, 5.5rem);      /* 48–88px */
  --text-h1:     clamp(2rem, 4vw, 3.5rem);       /* 32–56px */
  --text-h2:     clamp(1.5rem, 3vw, 2.25rem);    /* 24–36px */
  --text-h3:     clamp(1.125rem, 2vw, 1.5rem);   /* 18–24px */
  --text-body:   clamp(0.95rem, 1.2vw, 1.1rem);  /* 15–18px */
  --text-sm:     clamp(0.8rem, 1vw, 0.875rem);   /* 13–14px */
  --text-xs:     0.75rem;                         /* 12px */

  /* Escalas fijas (retro-compat) */
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  /* Tracking */
  --tracking-tight:   -0.01em;
  --tracking-normal:   0.02em;
  --tracking-wide:     0.15em;

  --leading-tight:   1.15;
  --leading-normal:  1.5;
  --leading-loose:   1.75;

  --font-light:    300;
  --font-regular:  400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;

  /* Espaciado (escala 4px) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 720px;

  /* Bordes */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.6);
  --shadow-gold: 0 0 30px rgba(197, 165, 90, 0.15);
  --shadow-magenta: 0 0 30px rgba(184, 37, 95, 0.2);

  /* Transiciones */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.4, 0, 1, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-slower: 700ms;

  /* Z-index */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-nav:     300;
  --z-toast:   400;
}

/* ── 2. RESET ───────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

ul,
ol {
  list-style: none;
}

/* ── 3. TIPOGRAFÍA ─────────────────────────────────────────── */

/* Headings: Cormorant Garamond (display) */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-normal);
}

/* Utilidades de tamaño */
.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }
.text-4xl   { font-size: var(--text-4xl); }
.text-5xl   { font-size: var(--text-5xl); }
.text-6xl   { font-size: var(--text-6xl); }

.text-muted  { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-magenta { color: var(--color-magenta); }

.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

/* ── 4. SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-primary); }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* ── 5. SELECCIÓN ──────────────────────────────────────────── */
::selection {
  background-color: var(--color-accent);
  color: var(--color-primary);
}
