/* ============================================================
   BASE.CSS — Capital Upfitters
   Reset + CSS Custom Properties
   Palette + fonts mirror the Next.js CRM app (approved-design.css)
   so both properties feel like one brand. Do not change tokens here
   without updating the Next.js side too.
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
/* Manrope — geometric with subtle warmth (headings) */
/* Inter — canonical UI sans (body) */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

/* ── Color Tokens (Apple-inspired palette) ────────────────── */
:root {
  /* ── Brand primitives — Apple's calibrated neutrals + Signal Blue ── */
  --brand-ink:             #1d1d1f;  /* Apple's near-black — text on light */
  --brand-navy:            #000000;  /* Apple's true onyx — hero + header bg */
  --brand-navy-mid:        #1d1d1f;  /* raised dark surface */
  --brand-amber:           #0071e3;  /* Signal Blue — filled CTAs (was amber) */
  --brand-amber-dark:      #0066cc;  /* Signal Blue link/hover */
  --brand-white:           #ffffff;  /* Paper */
  --brand-surface:         #f5f5f7;  /* Eggshell — Apple's signature section bg */
  --brand-body:            #1d1d1f;  /* body copy on light */
  --brand-muted:           #6e6e73;  /* Apple's secondary text */
  --brand-line:            transparent; /* Apple uses zero borders */

  /* ── Legacy aliases — kept so existing selectors don't break ── */
  --color-bg:              var(--brand-white);
  --color-surface:         var(--brand-surface);
  --color-surface-2:       #eef0f1;
  --color-surface-dark:    var(--brand-navy);
  --color-surface-dark-2:  var(--brand-navy-mid);

  --color-text:            var(--brand-ink);
  --color-text-secondary:  var(--brand-body);
  --color-text-muted:      var(--brand-muted);
  --color-text-faint:      #8a8f97;
  --color-text-inverse:    var(--brand-white);
  --color-text-inverse-muted: rgba(255, 255, 255, 0.72);

  /* Warm amber replaces the old cool navy accent */
  --color-accent:          var(--brand-amber);
  --color-accent-hover:    var(--brand-amber-dark);
  --color-accent-light:    rgba(249, 166, 7, 0.10);
  --color-accent-navy:     var(--brand-navy);

  --color-border:          var(--brand-line);
  --color-border-dark:     rgba(255, 255, 255, 0.16);
  --color-divider:         var(--brand-line);

  --color-error:           #bc4b4b;
  --color-success:         #2f8f68;
  --color-warning:         #d29417;

  --color-nav-bg:          var(--brand-navy);
  --color-nav-text:        var(--brand-white);
  --color-footer-bg:       var(--brand-navy);
  --color-footer-text:     rgba(255, 255, 255, 0.72);

  /* ── Typography ─────────────────────────────────────────── */
  /* Manrope — geometric with subtle warmth, our SF Pro Display stand-in */
  /* Inter — canonical UI sans, our SF Pro Text stand-in */
  --font-display:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* Type scale */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-lg:    1.125rem;   /* 18px */
  --text-xl:    1.25rem;    /* 20px */
  --text-2xl:   1.5rem;     /* 24px */
  --text-3xl:   1.875rem;   /* 30px */
  --text-4xl:   2.25rem;    /* 36px */
  --text-5xl:   3rem;       /* 48px */
  --text-6xl:   3.75rem;    /* 60px */
  --text-7xl:   4.5rem;     /* 72px */
  --text-8xl:   6rem;       /* 96px */

  /* ── Spacing scale ──────────────────────────────────────── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-7:  1.75rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;

  /* ── Radius ─────────────────────────────────────────────── */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-2xl:  1.25rem;
  --radius-pill: 9999px;

  /* ── Shadows — Apple uses zero shadows sitewide ────────── */
  --shadow-sm:  none;
  --shadow-md:  none;
  --shadow-lg:  none;
  --shadow-xl:  none;

  /* ── Nav ────────────────────────────────────────────────── */
  --nav-height: 64px;

  /* ── Transitions ────────────────────────────────────────── */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* ── Container ──────────────────────────────────────────── */
  --container-max: 1200px;
  --container-pad: clamp(1rem, 4vw, 2.5rem);
}

/* ── Dark mode ──────────────────────────────────────────── */
[data-theme="dark"] {
  --color-bg:              #0d1117;
  --color-surface:         #161b22;
  --color-surface-2:       #1c2128;
  --color-text:            #f0f6fc;
  --color-text-secondary:  #c9d1d9;
  --color-text-muted:      #8b949e;
  --color-text-faint:      #484f58;
  --color-border:          #30363d;
  --color-divider:         #21262d;
  --color-accent-light:    rgba(249, 166, 7, 0.20);
}

/* ── Base typography ────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;             /* Apple's headline weight */
  letter-spacing: -0.02em;      /* Apple's optical negative tracking */
  text-transform: none;         /* sentence case — Apple never uses uppercase */
  line-height: 1.08;
  color: var(--color-text);
}

h1 { font-size: clamp(var(--text-5xl), 7vw, var(--text-8xl)); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-6xl)); font-weight: 600; letter-spacing: -0.025em; }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); font-weight: 600; letter-spacing: -0.02em; }
h4 { font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.015em; }
h5 { font-size: var(--text-xl);  font-weight: 600; letter-spacing: -0.01em; }
h6 { font-size: var(--text-lg);  font-weight: 600; letter-spacing: -0.01em; }

p { line-height: 1.7; color: var(--color-text-secondary); }
p + p { margin-top: var(--space-4); }

/* ── Container ──────────────────────────────────────────── */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container--wide  { max-width: 1400px; }
.container--narrow { max-width: 800px; }

/* ── Section defaults ───────────────────────────────────── */
.section { padding: var(--space-20) 0; }
.section--lg { padding: var(--space-32) 0; }
.section--dark {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--color-text-inverse); }
.section--dark p { color: var(--color-text-inverse-muted); }
.section--surface { background: var(--color-surface); }
.section--surface-2 { background: var(--color-surface-2); }

/* ── Grid helpers ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);  /* Apple's signature pill button */
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--brand-white);          /* white text on Signal Blue */
}
.btn-primary:hover {
  background: var(--color-accent-hover);
}
.btn-outline {
  background: transparent;
  color: var(--color-accent);        /* Signal Blue text, no border */
  border: none;
}
.btn-outline:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}
.btn-ghost {
  background: transparent;
  color: var(--color-accent);
  border: none;
}
.btn-ghost:hover {
  color: var(--color-accent-hover);
}
.btn-dark {
  background: var(--color-surface-dark);
  color: #fff;
}
.btn-dark:hover {
  background: var(--color-accent);
}
.btn-lg { padding: 1.1rem 2.75rem; font-size: var(--text-lg); }
.btn-sm { padding: 0.6rem 1.5rem; font-size: var(--text-sm); }

/* ── Labels / badges ────────────────────────────────────── */
.label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}
.label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-accent);
}
.badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #fff;
}

/* ── Reveal animations ──────────────────────────────────── */
/* NOTE: opacity-only — no translateY. translateY on overflow:hidden cards
   clips child backgrounds mid-animation (the "corroded box" effect). */
.reveal {
  opacity: 0;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Section label ──────────────────────────────────────── */
.section-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.section-label::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* ── Divider ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-8) 0;
}

/* ── Visually hidden ────────────────────────────────────── */
.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;
}
