/* =====================================================================
   Brand tokens · shared by sites/presentacion, sites/catalogo, sites/marca
   and (ported) the Next.js app. Every value is documented in
   docs/business/marca.md (sección "Sistema visual").

   Naming follows Tailwind 4 theme namespaces where one exists
   (--color-*, --font-*, --text-*, --leading-*, --tracking-*, --radius-*,
   --shadow-*, --ease-*, --container-*) so the app can paste them into
   @theme. Brand-specific scales (--space-*, --duration-*, --z-*) are
   prefixed so they never collide with Tailwind defaults.

   Golden ratio: φ = 1.618. Spacing and radii are Fibonacci numbers
   (each ≈ previous × φ). The type scale climbs by √φ, so every second
   step is ×φ. Motion durations are Fibonacci milliseconds.

   Fonts (load once per page, before this file):
   https://fonts.googleapis.com/css2?family=Manrope:wght@400..700&family=Inter:opsz,wght@14..32,400..700&display=swap
   ===================================================================== */

:root {
  /* ---------- primitives: warm neutrals ("lino" → "tinta") ---------- */
  --color-neutral-0: #ffffff;
  --color-neutral-25: #fcfbf8;
  --color-neutral-50: #f7f4ef;   /* lino: page background */
  --color-neutral-100: #efebe4;
  --color-neutral-200: #e3ded5;
  --color-neutral-300: #cfc8bc;
  --color-neutral-400: #ada597;
  --color-neutral-500: #8a8275;
  --color-neutral-600: #6b645a;  /* muted text, 5.3:1 on lino */
  --color-neutral-700: #4f4a42;
  --color-neutral-800: #36322d;
  --color-neutral-900: #24211d;
  --color-neutral-950: #1c1a17;  /* tinta: text, 15.8:1 on lino */
  --color-neutral-1000: #141311;

  /* ---------- primitives: accent ("barro", Mexican clay) ---------- */
  --color-clay-50: #fbefe9;
  --color-clay-100: #f5dacd;
  --color-clay-200: #ebb59c;
  --color-clay-300: #e07a52;     /* accent on dark surfaces */
  --color-clay-400: #c9633b;
  --color-clay-500: #b4532d;     /* brand accent */
  --color-clay-600: #9a4425;     /* accent text on light, 5.9:1 */
  --color-clay-700: #7c361e;
  --color-clay-800: #5e2917;
  --color-clay-900: #401c10;

  /* ---------- primitives: status (dashboards: confirmed / pending / declined) ---------- */
  --color-green-50: #e9f4ee;
  --color-green-500: #2e7d5b;
  --color-green-600: #276b4d;
  --color-green-300: #5dbb8e;
  --color-amber-50: #fbf1de;
  --color-amber-500: #c2861f;
  --color-amber-600: #8a5a12;
  --color-amber-300: #e0a94a;
  --color-red-50: #fbeae8;
  --color-red-500: #b3261e;
  --color-red-300: #f0857a;
  --color-blue-50: #e8eef6;
  --color-blue-500: #2f5d8c;
  --color-blue-300: #7fa8d6;

  /* ---------- semantic colors (light theme, default) ---------- */
  --color-bg: var(--color-neutral-50);
  --color-surface: var(--color-neutral-25);
  --color-surface-raised: var(--color-neutral-0);
  --color-surface-sunken: var(--color-neutral-100);
  --color-text: var(--color-neutral-950);
  --color-text-muted: var(--color-neutral-600);
  --color-text-subtle: var(--color-neutral-500);   /* ≥ 18.66px bold / 24px only, or decorative */
  --color-border: var(--color-neutral-200);
  --color-border-strong: var(--color-neutral-300);
  --color-accent: var(--color-clay-500);
  --color-accent-hover: var(--color-clay-600);
  --color-accent-text: var(--color-clay-600);
  --color-accent-soft: var(--color-clay-50);
  --color-on-accent: var(--color-neutral-0);
  --color-inverse: var(--color-neutral-950);        /* ink surfaces / primary buttons */
  --color-inverse-hover: var(--color-neutral-800);
  --color-on-inverse: var(--color-neutral-50);
  --color-focus: var(--color-clay-500);
  --color-success: var(--color-green-600);
  --color-success-soft: var(--color-green-50);
  --color-warning: var(--color-amber-600);
  --color-warning-soft: var(--color-amber-50);
  --color-danger: var(--color-red-500);
  --color-danger-soft: var(--color-red-50);
  --color-info: var(--color-blue-500);
  --color-info-soft: var(--color-blue-50);
  --color-nav-bg: rgb(247 244 239 / 0.72);           /* lino at 72% under backdrop blur */
  --color-device: #1a1917;                           /* phone body */
  --color-device-edge: #3a3833;
  --color-device-statusbar: #f7f6f3;                 /* band above real app screenshots */
  --color-selection: var(--color-clay-100);

  /* ---------- typography ---------- */
  --font-display: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* Fluid scale: min at 360px viewport → max at 1440px. Max values climb by √φ from 17px. */
  --text-xs: clamp(0.75rem, 0.7292rem + 0.0926vw, 0.8125rem);    /* 12 → 13 */
  --text-sm: clamp(0.875rem, 0.8542rem + 0.0926vw, 0.9375rem);   /* 14 → 15 */
  --text-base: clamp(1rem, 0.9792rem + 0.0926vw, 1.0625rem);     /* 16 → 17 */
  --text-lg: clamp(1.125rem, 1.0625rem + 0.2778vw, 1.3125rem);   /* 18 → 21 */
  --text-xl: clamp(1.25rem, 1.1042rem + 0.6481vw, 1.6875rem);    /* 20 → 27 */
  --text-2xl: clamp(1.4375rem, 1.1875rem + 1.1111vw, 2.1875rem); /* 23 → 35 */
  --text-3xl: clamp(1.625rem, 1.25rem + 1.6667vw, 2.75rem);      /* 26 → 44 */
  --text-4xl: clamp(1.875rem, 1.3333rem + 2.4074vw, 3.5rem);     /* 30 → 56 */
  --text-5xl: clamp(2.125rem, 1.3333rem + 3.5185vw, 4.5rem);     /* 34 → 72 */
  --text-6xl: clamp(2.375rem, 1.25rem + 5vw, 5.75rem);           /* 38 → 92 */
  --text-7xl: clamp(2.75rem, 1.2083rem + 6.8519vw, 7.375rem);    /* 44 → 118 */

  --font-weight-light: 300;
  --font-weight-display: 500;  /* Manrope headings and big figures (600 for panel numbers); lighter weights look thin on screens without smoothing */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --leading-none: 1;
  --leading-tight: 1.05;     /* display */
  --leading-snug: 1.236;     /* headings: 2 / φ */
  --leading-normal: 1.5;     /* UI text */
  --leading-relaxed: 1.618;  /* long reading, φ */

  --tracking-tighter: -0.035em; /* ≥ 72px display */
  --tracking-tight: -0.025em;   /* headings (Manrope) */
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-caps: 0.14em;      /* eyebrows in small caps */

  /* Hook for display-face axes. Manrope has only a weight axis, so nothing to set. */
  --font-display-settings: normal;

  /* ---------- spacing: Fibonacci ---------- */
  --space-3: 3px;
  --space-5: 5px;
  --space-8: 8px;
  --space-13: 13px;
  --space-21: 21px;
  --space-34: 34px;
  --space-55: 55px;
  --space-89: 89px;
  --space-144: 144px;
  /* fluid section rhythm */
  --space-section: clamp(55px, 3.5rem + 6vw, 144px);
  --space-gutter: clamp(21px, 0.9rem + 2vw, 55px);

  /* ---------- radii: Fibonacci ----------
     Nested rule: inner radius = outer radius − padding between them,
     never below --radius-3. Helper: calc(var(--outer-r) - var(--outer-pad)). */
  --radius-3: 3px;
  --radius-5: 5px;     /* inputs inside cards, tags */
  --radius-8: 8px;     /* small controls */
  --radius-13: 13px;   /* cards (sm), menus */
  --radius-21: 21px;   /* cards, panels */
  --radius-34: 34px;   /* hero surfaces, sheets */
  --radius-55: 55px;   /* oversized feature blocks */
  --radius-pill: 999px;

  /* ---------- shadows: layered, warm-tinted (offsets on Fibonacci) ---------- */
  --shadow-color: 28 26 23;   /* = neutral-950 as rgb triplet */
  --shadow-xs: 0 1px 2px rgb(var(--shadow-color) / 0.06);
  --shadow-sm:
    0 1px 1px rgb(var(--shadow-color) / 0.04),
    0 2px 5px rgb(var(--shadow-color) / 0.05),
    0 5px 13px -3px rgb(var(--shadow-color) / 0.06);
  --shadow-md:
    0 1px 2px rgb(var(--shadow-color) / 0.04),
    0 3px 8px rgb(var(--shadow-color) / 0.05),
    0 8px 21px -5px rgb(var(--shadow-color) / 0.08),
    0 21px 34px -13px rgb(var(--shadow-color) / 0.08);
  --shadow-lg:
    0 1px 2px rgb(var(--shadow-color) / 0.04),
    0 5px 13px rgb(var(--shadow-color) / 0.05),
    0 13px 34px -8px rgb(var(--shadow-color) / 0.10),
    0 34px 89px -21px rgb(var(--shadow-color) / 0.16);
  --shadow-ring: 0 0 0 1px rgb(var(--shadow-color) / 0.07);   /* hairline edge for cards on lino */

  /* ---------- motion: Fibonacci milliseconds ---------- */
  --duration-instant: 89ms;    /* hover color, press */
  --duration-fast: 144ms;      /* small UI: toggles, pills */
  --duration-base: 233ms;      /* buttons, menus */
  --duration-slow: 377ms;      /* cards, nav state */
  --duration-slower: 610ms;    /* section reveals */
  --duration-slowest: 987ms;   /* hero entrances */
  --stagger: 89ms;             /* delay between siblings in a reveal group */

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);        /* expo-out: entrances, reveals */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);      /* UI state changes */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);    /* moves between two states on screen */
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);         /* exits only */

  --reveal-distance: 21px;

  /* ---------- z-index ---------- */
  --z-below: -1;
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-nav: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* ---------- layout ---------- */
  --container-narrow: 610px;   /* reading column */
  --container-base: 987px;
  --container-wide: 1220px;    /* page container */
  --measure: 34em;             /* max line length for body copy */
  --nav-height: 64px;
  --golden-major: 61.8%;
  --golden-minor: 38.2%;

  color-scheme: light;
}

/* =====================================================================
   Dark theme (complete). Opt-in: <html data-theme="dark"> for a whole page,
   or class="theme-dark" on a band/section (an "ink" band inside a light page).
   The marketing sites stay light by default; this is not tied to
   prefers-color-scheme on purpose (the brand is light-first).
   ===================================================================== */
[data-theme="dark"],
.theme-dark {
  --color-bg: var(--color-neutral-1000);
  --color-surface: #1c1a17;
  --color-surface-raised: #24211d;
  --color-surface-sunken: #0f0e0c;
  --color-text: #f3efe8;
  --color-text-muted: #b3ab9e;      /* 8.2:1 on bg */
  --color-text-subtle: #8e877b;     /* 5.2:1 on bg */
  --color-border: #34302a;
  --color-border-strong: #4a453d;
  --color-accent: var(--color-clay-300);
  --color-accent-hover: #ea9471;
  --color-accent-text: var(--color-clay-300);  /* 6.3:1 on bg */
  --color-accent-soft: rgb(224 122 82 / 0.14);
  --color-on-accent: var(--color-neutral-1000);
  --color-inverse: #f3efe8;
  --color-inverse-hover: #ffffff;
  --color-on-inverse: var(--color-neutral-950);
  --color-focus: var(--color-clay-300);
  --color-success: var(--color-green-300);
  --color-success-soft: rgb(93 187 142 / 0.14);
  --color-warning: var(--color-amber-300);
  --color-warning-soft: rgb(224 169 74 / 0.14);
  --color-danger: var(--color-red-300);
  --color-danger-soft: rgb(240 133 122 / 0.14);
  --color-info: var(--color-blue-300);
  --color-info-soft: rgb(127 168 214 / 0.14);
  --color-nav-bg: rgb(20 19 17 / 0.72);
  --color-device-edge: #4a4740;
  --color-selection: rgb(224 122 82 / 0.32);
  --shadow-color: 0 0 0;
  --shadow-ring: 0 0 0 1px rgb(255 255 255 / 0.08);
  color-scheme: dark;
}
