/* ============================================================
   @FONT-FACE
   Fuente de los tokens: design-system/tokens/*.css — no editar
   valores aquí, solo consumirlos.
   ============================================================ */

@font-face {
  font-family: "Lexend Giga";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/LexendGiga-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Lexend Giga";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF;
  src: url("/fonts/LexendGiga-Variable-ext.woff2") format("woff2");
}

@font-face {
  font-family: "Kumbh Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/KumbhSans-Variable.woff2") format("woff2");
}

@font-face {
  font-family: "Kumbh Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF;
  src: url("/fonts/KumbhSans-Variable-ext.woff2") format("woff2");
}

/* ============================================================
   :ROOT — TOKENS
   Fuente de verdad: design-system/tokens/ (DS de Claude Design).
   No hay DESIGN.md en la raíz del repo — este DS lo sustituye.
   ============================================================ */

:root {
  color-scheme: light;

  /* --- Color de marca --- */
  --segen-black: #000000;
  --segen-red-500: #B60032;
  --segen-yellow-500: #FBBE00;
  /* Fallback sólido — sobrescrito abajo en @supports para navegadores con
     sintaxis de color relativo (oklch(from ...)): Chrome/Edge 119+, Safari
     16.4+, Firefox 128+. Sin este fallback, un navegador sin soporte deja la
     propiedad completa inválida-en-tiempo-de-cómputo (fondo → transparent,
     color heredado → no el de esta regla) en vez de un rojo/amarillo cercano. */
  --segen-red-50: #FCE8ED;
  --segen-red-100: #F7CBD6;
  --segen-red-600: #9C0029;
  --segen-red-700: #820022;
  --segen-yellow-50: #FEF5D6;
  --segen-yellow-100: #FCE9AC;
  --segen-yellow-600: #DBA300;
  --segen-yellow-700: #B98700;

  /* --- Neutrales --- */
  --neutral-0: #FFFFFF;
  --neutral-50: #F5F5F5;
  --neutral-100: #EBEBEB;
  --neutral-200: #DADADA;
  --neutral-300: #C2C2C2;
  --neutral-400: #A3A3A3;
  --neutral-500: #878787;
  --neutral-600: #6B6B6B;
  --neutral-700: #4A4A4A;
  --neutral-800: #1D1D1D;
  --neutral-900: #000000;

  /* --- Color semántico --- */
  --color-success-500: #1E4B45;
  --color-info-500: oklch(56% 0.11 235);
  --color-warning-500: var(--segen-yellow-500);
  --color-danger-500: var(--segen-red-500);
  --color-bg: var(--neutral-0);
  --color-bg-subtle: var(--neutral-50);
  --color-surface: var(--neutral-0);
  --color-surface-sunken: var(--neutral-100);
  --color-surface-inverse: var(--neutral-800);
  --color-border: var(--neutral-200);
  --color-border-strong: var(--neutral-400);
  --color-text-primary: var(--neutral-900);
  --color-text-secondary: var(--neutral-600);
  --color-text-disabled: var(--neutral-400);
  --color-text-inverse: var(--neutral-0);
  --color-primary: var(--segen-red-500);
  --color-primary-hover: var(--segen-red-600);
  --color-primary-active: var(--segen-red-700);
  --color-primary-tint: var(--segen-red-50);
  --color-accent: var(--segen-yellow-500);
  --color-accent-hover: var(--segen-yellow-600);
  --color-accent-tint: var(--segen-yellow-50);
  --color-focus-ring: var(--segen-yellow-500);
  --color-link: var(--segen-red-500);
  --color-link-hover: var(--segen-red-600);

  /* --- Tipografía ---
     NOTA (conflicto documentado con css-architecture): el skill pide
     font-size fluido en html vía clamp(rem + vw). Esta escala viene fija
     del DS de Claude Design (tokens/typography.css) y ya fue aprobada
     como parte de la identidad de marca — no se reinventa aquí. Si se
     quiere una capa fluida encima, sería un cambio deliberado aparte,
     no un ajuste silencioso de esta hoja. */
  --font-display: "Lexend Giga", Arial, sans-serif;
  --font-body: "Kumbh Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --weight-thin: 100;
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-black: 900;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.5rem;
  --text-5xl: 4.5rem;
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --tracking-tight: -0.02em;
  --tracking-normal: 0em;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.08em;

  /* --- Espaciado (macro/meso/micro vía la escala del DS) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* --- Efectos --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --border-thin: 1px;
  --border-md: 2px;
  --border-thick: 4px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .14);
  --shadow-focus: 0 0 0 3px rgba(251, 189, 0, .5);
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 320ms;
}

/* ============================================================
   PROGRESSIVE ENHANCEMENT — color relativo
   Reemplaza los fallbacks sólidos de arriba por los valores derivados del
   color de marca cuando el navegador soporta oklch(from ...).
   ============================================================ */

@supports (color: oklch(from red l c h)) {
  :root {
    --segen-red-50: oklch(from var(--segen-red-500) 0.96 0.02 h);
    --segen-red-100: oklch(from var(--segen-red-500) 0.9 0.045 h);
    --segen-red-600: oklch(from var(--segen-red-500) calc(l - 0.09) c h);
    --segen-red-700: oklch(from var(--segen-red-500) calc(l - 0.16) c h);
    --segen-yellow-50: oklch(from var(--segen-yellow-500) 0.97 0.03 h);
    --segen-yellow-100: oklch(from var(--segen-yellow-500) 0.93 0.06 h);
    --segen-yellow-600: oklch(from var(--segen-yellow-500) calc(l - 0.1) c h);
    --segen-yellow-700: oklch(from var(--segen-yellow-500) calc(l - 0.2) c h);
  }
}

/* ============================================================
   RESET
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ============================================================
   BASE TYPOGRAPHY
   ============================================================ */

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

a {
  color: var(--color-link);
}

a:hover {
  color: var(--color-link-hover);
}

button,
input,
select,
textarea {
  font-family: var(--font-body);
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* ============================================================
   GLOBAL COMPONENTS
   ============================================================ */

/* --- Botones --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: var(--border-thin) solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 22px;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

.btn-secondary:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text-primary);
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  background: var(--color-primary-tint);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-primary);
}

/* --- Header / nav (chrome de includes/header.php) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-surface);
  border-bottom: var(--border-thin) solid var(--color-border);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px var(--space-6);
}

.site-nav__logo {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
  color: var(--color-text-primary);
}

.site-nav__logo:hover {
  color: var(--color-text-primary);
}

.site-nav__logo img {
  display: block;
  width: auto;
  height: 32px;
}

.site-nav__menu {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.site-nav__menu a {
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--color-text-primary);
}

.site-nav__menu a:hover,
.site-nav__menu a[aria-current="page"] {
  color: var(--color-primary);
}

.site-nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}

.site-nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-primary);
}

/* --- Footer (chrome de includes/footer.php) --- */
.site-footer {
  padding: var(--space-8) 0;
  background: var(--neutral-900);
  color: var(--neutral-400);
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  font-size: var(--text-sm);
}

/* ============================================================
   MOBILE MEDIA QUERIES
   Agrupadas al final, mismo orden que el desktop equivalente.
   ============================================================ */

@media (max-width: 760px) {
  .site-nav__toggle {
    display: flex;
  }

  .site-nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    background: var(--color-surface);
    border-bottom: var(--border-thin) solid var(--color-border);
    padding: var(--space-4) var(--space-6);
  }

  .site-nav__menu.is-open {
    display: flex;
  }
}
