/* ============================================================
   CAPITAL BUILD CONSTRUCTION — Design System
   Foundation tokens, type scale, spacing, utilities
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ------------------------------------------------------------ */
:root {
  /* ---- Brand Colors ---- */
  --color-navy:          #0B1D3A;
  --color-navy-light:    #132B52;
  --color-navy-dark:     #060F1F;
  --color-gold:          #C9A84C;
  --color-gold-light:    #D4BA6E;
  --color-gold-dark:     #A8872E;
  --color-offwhite:      #F7F5F0;

  /* ---- Supporting Neutrals ---- */
  --color-white:         #FFFFFF;
  --color-gray-50:       #FAFAF8;
  --color-gray-100:      #F0EDE6;
  --color-gray-200:      #E0DCD3;
  --color-gray-300:      #C4BFB3;
  --color-gray-400:      #9B9588;
  --color-gray-500:      #706A5F;
  --color-gray-600:      #524E45;
  --color-gray-700:      #3A3731;
  --color-gray-800:      #252320;
  --color-gray-900:      #141311;

  /* ---- Semantic Colors ---- */
  --color-text-primary:    var(--color-navy);
  --color-text-secondary:  var(--color-gray-600);
  --color-text-muted:      var(--color-gray-400);
  --color-text-inverse:    var(--color-offwhite);
  --color-text-accent:     var(--color-gold-dark);
  --color-bg-primary:      var(--color-white);
  --color-bg-secondary:    var(--color-offwhite);
  --color-bg-dark:         var(--color-navy);
  --color-border:          var(--color-gray-200);
  --color-border-dark:     var(--color-gray-300);
  --color-focus:           var(--color-gold);
  --color-error:           #C0392B;
  --color-success:         #27AE60;

  /* ---- Typography ---- */
  /* Display / Headings: DM Serif Display — strong, authoritative serif */
  --font-heading:   'DM Serif Display', Georgia, 'Times New Roman', serif;
  /* Body: Inter — clean, highly legible modern sans-serif */
  --font-body:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

  /* ---- Type Scale (Major Third — 1.250) ---- */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-md:    1.125rem;   /* 18px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   1.875rem;   /* 30px */
  --text-3xl:   2.25rem;    /* 36px */
  --text-4xl:   2.75rem;    /* 44px */
  --text-5xl:   3.5rem;     /* 56px */
  --text-6xl:   4.5rem;     /* 72px */

  /* ---- Line Heights ---- */
  --leading-none:    1;
  --leading-tight:   1.15;
  --leading-snug:    1.3;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  /* ---- Font Weights ---- */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* ---- Letter Spacing ---- */
  --tracking-tight:    -0.02em;
  --tracking-normal:    0;
  --tracking-wide:      0.02em;
  --tracking-wider:     0.05em;
  --tracking-widest:    0.1em;

  /* ---- Spacing Scale (8px base) ---- */
  --space-1:    0.25rem;    /*  4px */
  --space-2:    0.5rem;     /*  8px */
  --space-3:    0.75rem;    /* 12px */
  --space-4:    1rem;       /* 16px */
  --space-5:    1.25rem;    /* 20px */
  --space-6:    1.5rem;     /* 24px */
  --space-8:    2rem;       /* 32px */
  --space-10:   2.5rem;     /* 40px */
  --space-12:   3rem;       /* 48px */
  --space-16:   4rem;       /* 64px */
  --space-20:   5rem;       /* 80px */
  --space-24:   6rem;       /* 96px */
  --space-32:   8rem;       /* 128px */

  /* ---- Layout ---- */
  --container-sm:    640px;
  --container-md:    768px;
  --container-lg:    1024px;
  --container-xl:    1200px;
  --container-max:   1440px;
  --gutter:          var(--space-6);

  /* ---- Borders ---- */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;
  --border-thin:   1px solid var(--color-border);
  --border-medium: 2px solid var(--color-border);

  /* ---- Shadows ---- */
  --shadow-xs:    0 1px 2px rgba(11, 29, 58, 0.05);
  --shadow-sm:    0 1px 3px rgba(11, 29, 58, 0.08), 0 1px 2px rgba(11, 29, 58, 0.06);
  --shadow-md:    0 4px 6px rgba(11, 29, 58, 0.07), 0 2px 4px rgba(11, 29, 58, 0.05);
  --shadow-lg:    0 10px 15px rgba(11, 29, 58, 0.08), 0 4px 6px rgba(11, 29, 58, 0.04);
  --shadow-xl:    0 20px 25px rgba(11, 29, 58, 0.10), 0 8px 10px rgba(11, 29, 58, 0.04);
  --shadow-gold:  0 4px 14px rgba(201, 168, 76, 0.25);

  /* ---- Transitions ---- */
  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:  150ms;
  --duration-base:  250ms;
  --duration-slow:  400ms;
  --transition-base: all var(--duration-base) var(--ease-out);
  --transition-fast: all var(--duration-fast) var(--ease-out);
  --transition-slow: all var(--duration-slow) var(--ease-out);

  /* ---- Z-Index Scale ---- */
  --z-behind:    -1;
  --z-base:       0;
  --z-raised:     10;
  --z-dropdown:   100;
  --z-sticky:     200;
  --z-overlay:    300;
  --z-modal:      400;
  --z-toast:      500;
}


/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* Remove animations for reduced-motion users */
@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;
  }
}


/* ------------------------------------------------------------
   3. TYPOGRAPHY
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-regular); /* DM Serif Display is best at 400 */
  line-height: var(--leading-tight);
  color: var(--color-navy);
  letter-spacing: var(--tracking-tight);
}

h1, .h1 {
  font-size: var(--text-4xl);
  line-height: var(--leading-none);
  letter-spacing: -0.03em;
}

h2, .h2 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

h3, .h3 {
  font-size: var(--text-2xl);
}

h4, .h4 {
  font-size: var(--text-xl);
}

h5, .h5 {
  font-size: var(--text-lg);
}

h6, .h6 {
  font-size: var(--text-md);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

/* Body variants */
.text-lg    { font-size: var(--text-lg); }
.text-md    { font-size: var(--text-md); }
.text-base  { font-size: var(--text-base); }
.text-sm    { font-size: var(--text-sm); }
.text-xs    { font-size: var(--text-xs); }

.text-lead {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

.text-small-print {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

/* Section label — small caps above headings */
.section-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--color-gold-dark);
  margin-bottom: var(--space-3);
}

/* Gold accent underline for headings */
.heading-accent::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background-color: var(--color-gold);
  margin-top: var(--space-4);
  border-radius: var(--radius-full);
}

.heading-accent--center::after {
  margin-left: auto;
  margin-right: auto;
}

/* Responsive type scaling */
@media (min-width: 768px) {
  h1, .h1 { font-size: var(--text-5xl); }
  h2, .h2 { font-size: var(--text-4xl); }
  h3, .h3 { font-size: var(--text-3xl); }
  h4, .h4 { font-size: var(--text-2xl); }
  .text-lead { font-size: var(--text-lg); }
}

@media (min-width: 1440px) {
  h1, .h1 { font-size: var(--text-6xl); }
  h2, .h2 { font-size: var(--text-5xl); }
}

p + p {
  margin-top: var(--space-4);
}


/* ------------------------------------------------------------
   4. LAYOUT UTILITIES
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container--narrow {
  max-width: var(--container-md);
}

.container--wide {
  max-width: var(--container-max);
}

.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (min-width: 768px) {
  .section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }
}

@media (min-width: 1440px) {
  .section {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5 {
  color: var(--color-offwhite);
}

.section--cream {
  background-color: var(--color-bg-secondary);
}

/* Flexbox helpers */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1440px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid   { gap: var(--space-8); }
}

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Visibility */
.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;
}
html.native-scroll,
html.native-scroll body {
  scroll-behavior: auto !important;
}

/* Kill scroll-linked lag if Lenis left transform on body */
html:not(.lenis) body {
  transform: none !important;
}