/* ============================================================
   AMS CHARTERED ACCOUNTANTS — DESIGN SYSTEM
   Premium corporate design tokens & global styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;750;800;900&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* — Colors — */
  --ams-primary-navy: #071427;
  --ams-main-navy: #0B1F3A;
  --ams-lighter-navy: #12345A;
  --ams-blue-700: #1E4E8C;
  --ams-blue-100: #EAF2FB;
  --ams-gold-600: #C9A34A;
  --ams-gold-500: #D7B85A;
  --ams-slate-700: #334155;
  --ams-slate-500: #64748B;
  --ams-border: #D8E0EA;
  --ams-bg: #FFFFFF;
  --ams-bg-soft: #F7F9FC;
  --ams-bg-warm: #FAF8F3;
  --ams-white: #FFFFFF;
  --ams-success: #0F766E;
  --ams-error: #B42318;

  /* Legacy aliases for compatibility */
  --color-navy:          var(--ams-main-navy);
  --color-navy-deep:     var(--ams-primary-navy);
  --color-navy-mid:      var(--ams-main-navy);
  --color-navy-light:    var(--ams-lighter-navy);
  --color-blue:          var(--ams-blue-700);
  --color-blue-light:    var(--ams-blue-700);
  --color-blue-pale:     var(--ams-blue-100);
  --color-gold:          var(--ams-gold-600);
  --color-gold-light:    var(--ams-gold-500);
  --color-gold-pale:     var(--ams-bg-warm);
  --color-white:         var(--ams-white);
  --color-gray-50:       var(--ams-bg-soft);
  --color-gray-100:      var(--ams-blue-100);
  --color-gray-200:      var(--ams-border);
  --color-gray-300:      var(--ams-border);
  --color-gray-400:      var(--ams-slate-500);
  --color-gray-500:      var(--ams-slate-500);
  --color-gray-600:      var(--ams-slate-700);
  --color-gray-700:      var(--ams-slate-700);
  --color-gray-800:      var(--ams-primary-navy);
  --color-gray-900:      var(--ams-primary-navy);
  --color-text:          var(--ams-slate-700);
  --color-text-muted:    var(--ams-slate-500);
  --color-text-light:    var(--ams-slate-500);
  --color-success:       var(--ams-success);
  --color-error:         var(--ams-error);
  --color-warning:       var(--ams-gold-600);

  /* — Typography Scale — */
  --font-global: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: var(--font-global);
  --font-body: var(--font-global);

  /* — Font Weights — */
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-extrabold:750;
  --weight-black:    800;

  /* — Transitions — */
  --transition-fast:   160ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* — Z-Index — */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;

  /* — Layout — */
  --gutter:         clamp(1rem, 4vw, 2rem);
  --nav-height:     80px;
}

/* ============================================================
   2. RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-global);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  color: var(--ams-slate-700);
  background-color: var(--ams-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  body {
    font-size: 15.5px;
  }
}

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

a {
  color: var(--ams-blue-700);
  text-decoration: none;
  transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

a:hover, a:focus {
  text-decoration: underline;
  color: var(--ams-blue-700);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-global);
  color: var(--ams-primary-navy);
}

/* Accessibility Focus Ring */
:focus-visible {
  outline: 3px solid rgba(30, 78, 140, 0.35);
  outline-offset: 3px;
}

/* Skip Link styling */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--ams-primary-navy);
  color: var(--ams-white);
  padding: 12px 24px;
  z-index: 9999;
  font-weight: 700;
  border-radius: 0 0 8px 0;
  transition: top var(--transition-fast) ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid rgba(30, 78, 140, 0.35);
  outline-offset: -2px;
}

/* ============================================================
   3. SPACING & CONTAINER UTILITIES
   ============================================================ */
.container {
  width: min(100% - 48px, 1200px);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 32px, 1200px);
  }
}

.section {
  padding-top: 96px;
  padding-bottom: 96px;
}

@media (max-width: 768px) {
  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }
}

/* ============================================================
   4. TYPOGRAPHY UTILITIES
   ============================================================ */
.eyebrow {
  font-family: var(--font-global);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ams-gold-600);
  margin-bottom: 12px;
  display: block;
}

/* Hero Title scale */
.headline-display {
  font-family: var(--font-global);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

@media (max-width: 1024px) {
  .headline-display {
    font-size: clamp(36px, 5vw, 52px);
  }
}

@media (max-width: 768px) {
  .headline-display {
    font-size: clamp(32px, 9vw, 42px);
  }
}

/* Inner Page Title scale */
.headline-xl {
  font-family: var(--font-global);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

@media (max-width: 768px) {
  .headline-xl {
    font-size: clamp(30px, 8vw, 40px);
  }
}

/* Section H2 scale */
.headline-lg {
  font-family: var(--font-global);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

@media (max-width: 768px) {
  .headline-lg {
    font-size: clamp(26px, 7vw, 34px);
    font-weight: 800;
  }
}

/* Card H3 scale */
.headline-sm {
  font-family: var(--font-global);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ams-primary-navy);
}

.body-lg {
  font-size: 18px;
  line-height: 1.65;
}

.body-md {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ams-slate-700);
}

.body-sm {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ams-slate-500);
}

/* Typography Color Overrides */
.text-muted { color: var(--ams-slate-500); }
.text-gold   { color: var(--ams-gold-500); }
.text-blue   { color: var(--ams-blue-700); }
.text-navy   { color: var(--ams-main-navy); }
.text-white  { color: var(--ams-white); }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* ============================================================
   5. CONTRAST FORCE RULES
   ============================================================ */
.hero h1,
.page-header h1,
.dark-section h1,
.dark-section h2,
.cta-banner h2 {
  color: var(--ams-white) !important;
}

.hero p,
.page-header p,
.dark-section p,
.cta-banner p {
  color: rgba(255, 255, 255, 0.88) !important;
}

.hero .eyebrow,
.page-header .eyebrow,
.dark-section .eyebrow {
  color: var(--ams-gold-500) !important;
}

/* ============================================================
   6. GRID & FLEX UTILITIES
   ============================================================ */
.grid {
  display: grid;
  gap: 32px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto-fit { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 1024px) {
  .grid { gap: 24px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid { gap: 20px; }
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr !important; }
}

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.gap-4       { gap: 16px; }

/* ============================================================
   7. SPACING UTILITIES
   ============================================================ */
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mb-8  { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }
.mb-12 { margin-bottom: 48px; }
.mb-16 { margin-bottom: 64px; }

.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }

/* ============================================================
   8. COLOR BACKGROUND UTILITIES
   ============================================================ */
.bg-navy      { background-color: var(--ams-main-navy); }
.bg-navy-deep { background-color: var(--ams-primary-navy); }
.bg-white     { background-color: var(--ams-white); }
.bg-gray-50   { background-color: var(--ams-bg-soft); }
.bg-gold-pale { background-color: var(--ams-bg-warm); }
.bg-blue-pale { background-color: var(--ams-blue-100); }

/* ============================================================
   9. DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--ams-border);
  border: none;
  margin: 48px 0;
}

.divider--gold {
  background: linear-gradient(90deg, transparent, var(--ams-gold-600), transparent);
}
