/* ============================================================
   LAREAL — Design System v1
   Latin America REITs Association
   Last updated: 2026-05-26
   ============================================================
   This file is the single source of truth for the LAREAL visual
   system. Never hardcode colors, font sizes, or spacing in
   page-level stylesheets — always reference the variables here.
   ============================================================ */

/* ---------- 1. CSS RESET (minimal, normalized) ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

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

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

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

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

ul,
ol {
  list-style: none;
}

/* ---------- 2. DESIGN TOKENS ---------- */

:root {
  /* ----- Colors (Brandbook v1) ----- */
  --color-navy:   #1B2936;  /* Estabilidade — hero, headers, impact sections */
  --color-orange: #FF7226;  /* Presença — strategic accent, max 1 per composition */
  --color-cream:  #E9E1D6;  /* Clareza — alternating section backgrounds */
  --color-body:   #232220;  /* Autoridade — body text */
  --color-white:  #FFFFFF;  /* Default page background */

  /* Tonal variants (derived, use sparingly) */
  --color-navy-90: rgba(27, 41, 54, 0.90);
  --color-navy-70: rgba(27, 41, 54, 0.70);
  --color-navy-40: rgba(27, 41, 54, 0.40);
  --color-navy-12: rgba(27, 41, 54, 0.12);
  --color-navy-06: rgba(27, 41, 54, 0.06);

  --color-cream-60: rgba(233, 225, 214, 0.60);
  --color-cream-30: rgba(233, 225, 214, 0.30);
  --color-cream-12: rgba(233, 225, 214, 0.12);

  --color-body-70: rgba(35, 34, 32, 0.70);
  --color-body-50: rgba(35, 34, 32, 0.50);

  /* ----- Typography ----- */
  --font-sans: 'Almarai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font weights — Almarai supports 300, 400, 700, 800 */
  --fw-light:    300;
  --fw-regular:  400;
  --fw-bold:     700;
  --fw-extra:    800;

  /* Font sizes — fluid via clamp(min, preferred, max) */
  --fs-display:  clamp(2.75rem, 5.5vw + 0.5rem, 4rem);      /* 44 → 64 */
  --fs-h1:       clamp(2rem, 3.5vw + 0.5rem, 2.75rem);      /* 32 → 44 */
  --fs-h2:       clamp(1.5rem, 2.2vw + 0.5rem, 2rem);       /* 24 → 32 */
  --fs-h3:       clamp(1.125rem, 1.2vw + 0.5rem, 1.5rem);   /* 18 → 24 */
  --fs-body-lg:  clamp(1rem, 0.4vw + 0.85rem, 1.0625rem);   /* 16 → 17 */
  --fs-body:     1rem;                                       /* 16 */
  --fs-body-sm:  0.9375rem;                                  /* 15 */
  --fs-caption:  0.75rem;                                    /* 12 */
  --fs-micro:    0.6875rem;                                  /* 11 */

  /* Stat numbers — extra large for big numbers blocks */
  --fs-stat:     clamp(3.5rem, 7vw, 5rem);                  /* 56 → 80 */

  /* Line heights */
  --lh-tight:    1.05;   /* displays, big numbers */
  --lh-snug:     1.2;    /* headlines */
  --lh-normal:   1.5;    /* body */
  --lh-relaxed:  1.7;    /* long-form prose */

  /* Letter spacing */
  --ls-tight:    -0.02em;
  --ls-normal:   0;
  --ls-wide:     0.08em;   /* captions in uppercase */

  /* ----- Spacing scale (8px base) ----- */
  --space-2xs:  0.25rem;   /* 4  */
  --space-xs:   0.5rem;    /* 8  */
  --space-sm:   0.75rem;   /* 12 */
  --space-md:   1rem;      /* 16 */
  --space-lg:   1.5rem;    /* 24 */
  --space-xl:   2rem;      /* 32 */
  --space-2xl:  3rem;      /* 48 */
  --space-3xl:  4rem;      /* 64 */
  --space-4xl:  6rem;      /* 96 */
  --space-5xl:  8rem;      /* 128 */
  --space-6xl:  12rem;     /* 192 */

  /* Section paddings — vertical rhythm */
  --section-py-sm:  clamp(3rem, 6vw, 4.5rem);
  --section-py-md:  clamp(4rem, 8vw, 6.5rem);
  --section-py-lg:  clamp(5rem, 10vw, 9rem);

  /* ----- Layout ----- */
  --container-max:   1280px;
  --container-pad:   clamp(1.25rem, 4vw, 2.5rem);
  --content-narrow:  720px;
  --content-medium:  960px;

  /* ----- Borders & radius ----- */
  --radius-none:   0;
  --radius-sm:     2px;
  --radius-md:     4px;
  --radius-lg:     8px;
  --radius-pill:   999px;

  --border-thin:   1px solid var(--color-navy-12);
  --border-cream:  1px solid var(--color-cream-30);
  --border-accent: 2px solid var(--color-orange);

  /* ----- Motion ----- */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:  160ms;
  --dur-base:  240ms;
  --dur-slow:  480ms;

  /* ----- Z-index ----- */
  --z-base:    1;
  --z-raised:  10;
  --z-nav:     100;
  --z-modal:   1000;
}

/* ---------- 3. BASE TYPOGRAPHY ---------- */

html {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: var(--fw-light);
  color: var(--color-body);
  background-color: var(--color-white);
}

body {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-normal);
  font-weight: var(--fw-light);
}

/* Type primitives — semantic, no decoration here */
.t-display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: var(--fw-light);
}

.t-h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  font-weight: var(--fw-light);
}

.t-h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  font-weight: var(--fw-light);
}

.t-h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  font-weight: var(--fw-regular);
}

.t-body-lg {
  font-size: var(--fs-body-lg);
  line-height: var(--lh-relaxed);
  font-weight: var(--fw-light);
}

.t-body {
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-weight: var(--fw-light);
}

.t-body-sm {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-normal);
  font-weight: var(--fw-light);
}

.t-caption {
  font-size: var(--fs-caption);
  line-height: 1.3;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-weight: var(--fw-regular);
}

.t-stat {
  font-size: var(--fs-stat);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: var(--fw-light);
  font-variant-numeric: tabular-nums;
}

/* ---------- 4. LAYOUT PRIMITIVES ---------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container-narrow {
  width: 100%;
  max-width: var(--content-narrow);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container-medium {
  width: 100%;
  max-width: var(--content-medium);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-py-md);
}

.section-lg {
  padding-block: var(--section-py-lg);
}

.section-sm {
  padding-block: var(--section-py-sm);
}

/* Surface variants — section backgrounds */
.surface-navy {
  background-color: var(--color-navy);
  color: var(--color-cream);
}

.surface-cream {
  background-color: var(--color-cream);
  color: var(--color-body);
}

.surface-white {
  background-color: var(--color-white);
  color: var(--color-body);
}

/* ---------- 5. COMPONENT BASE: BUTTONS ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-regular);
  letter-spacing: 0.02em;
  border-radius: var(--radius-none);
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  cursor: pointer;
  text-align: center;
  min-height: 48px; /* WCAG touch target */
}

.btn-primary {
  background-color: var(--color-orange);
  color: var(--color-white);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--color-cream);
  border: 1px solid var(--color-cream-30);
}

.btn-secondary:hover {
  border-color: var(--color-cream);
  background-color: var(--color-cream-12);
}

.btn-ghost-dark {
  background-color: transparent;
  color: var(--color-body);
  border: 1px solid var(--color-navy-12);
}

.btn-ghost-dark:hover {
  border-color: var(--color-navy);
  background-color: var(--color-navy-06);
}

/* ---------- 6. ACCENT UTILITIES ---------- */

.accent-bar {
  display: inline-block;
  width: 48px;
  height: 2px;
  background-color: var(--color-orange);
  margin-bottom: var(--space-lg);
}

.text-orange {
  color: var(--color-orange);
}

.text-navy {
  color: var(--color-navy);
}

.text-cream {
  color: var(--color-cream);
}

/* Divider line — sober, institutional */
.divider {
  height: 1px;
  background-color: var(--color-navy-12);
  border: none;
  margin-block: var(--space-2xl);
}

.divider-cream {
  background-color: var(--color-cream-12);
}

/* ---------- 7. FOCUS STATES (a11y) ---------- */

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

/* ---------- 8. SELECTION ---------- */

::selection {
  background-color: var(--color-orange);
  color: var(--color-white);
}

/* ---------- 9. REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 10. SCREEN READER ONLY ---------- */

.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;
}

/* ---------- 11. RESPONSIVE BREAKPOINTS REFERENCE ----------
   --bp-sm:   375px   small phones
   --bp-md:   768px   tablets, small laptops
   --bp-lg:   1280px  laptops, desktops
   --bp-xl:   1440px  large desktops
   Note: Mobile-first. Use min-width media queries.
   ============================================================ */
