/* ==========================================================================
   BASE.CSS — Design Tokens, Reset, Typography, Utilities
   Prateek Shukla — prateekshukla.in
   ========================================================================== */

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

/* ---------- Design Tokens ---------- */
:root {
  /* Brand Colours */
  --color-navy: #0F2D5B;
  --color-navy-dark: #0a1f3f;
  --color-navy-light: #1a4178;
  --color-blue: #2563EB;
  --color-blue-dark: #1d4ed8;
  --color-blue-light: #3b82f6;
  --color-teal: #14B8A6;
  --color-teal-dark: #0d9488;
  --color-teal-light: #2dd4bf;
  --color-bg: #E5EAF2;
  --color-text: #1F2937;
  --color-white: #FFFFFF;

  /* Neutral Scale */
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Responsive Type Scale (mobile-first, clamp to desktop) */
  --fs-h1: clamp(2rem, 4vw + 0.5rem, 3rem);       /* 32→48px */
  --fs-h2: clamp(1.625rem, 3vw + 0.5rem, 2.25rem); /* 26→36px */
  --fs-h3: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);  /* 20→28px */
  --fs-h4: clamp(1.125rem, 1.5vw + 0.5rem, 1.375rem); /* 18→22px */
  --fs-body: 1rem;        /* 16px */
  --fs-small: 0.875rem;   /* 14px */
  --fs-caption: 0.75rem;  /* 12px */

  /* Line Heights */
  --lh-h1: 1.25;   /* 60/48 */
  --lh-h2: 1.22;   /* 44/36 */
  --lh-h3: 1.29;   /* 36/28 */
  --lh-h4: 1.36;   /* 30/22 */
  --lh-body: 1.625; /* 26/16 */
  --lh-small: 1.57; /* 22/14 */
  --lh-caption: 1.5; /* 18/12 */

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

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-wide: 1400px;
  --header-height: 80px;

  /* Borders & Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --border-light: 1px solid var(--color-gray-200);
  --border-subtle: 1px solid rgba(15, 45, 91, 0.08);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 45, 91, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 45, 91, 0.06), 0 1px 2px rgba(15, 45, 91, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 45, 91, 0.07), 0 2px 4px -2px rgba(15, 45, 91, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 45, 91, 0.08), 0 4px 6px -4px rgba(15, 45, 91, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 45, 91, 0.1), 0 8px 10px -6px rgba(15, 45, 91, 0.04);

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

/* ---------- Base Element Styles ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-navy);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: 600;
}

h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  font-weight: 600;
}

p {
  margin-bottom: var(--space-md);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
}

/* ---------- Links ---------- */
a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-navy);
}

a:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Images ---------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Lists ---------- */
ul, ol {
  list-style: none;
}

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-navy);
  color: var(--color-white);
  font-size: var(--fs-small);
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--transition-fast);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: var(--color-white);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--wide {
  max-width: var(--max-width-wide);
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-3xl) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-4xl) 0;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: var(--space-5xl) 0;
  }
}

.section--bg {
  background-color: var(--color-bg);
}

.section--navy {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.section--navy h2,
.section--navy h3,
.section--navy h4 {
  color: var(--color-white);
}

.section--navy p {
  color: rgba(255, 255, 255, 0.85);
}

.section--navy a {
  color: var(--color-teal-light);
}

.section--navy a:hover {
  color: var(--color-white);
}

/* ---------- Section Header ---------- */
.section__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .section__header {
    margin-bottom: var(--space-3xl);
  }
}

.section__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-teal);
  margin-bottom: var(--space-xs);
  display: block;
}

.section--navy .section__eyebrow {
  color: var(--color-teal-light);
}

.section__subtitle {
  font-size: 1.0625rem;
  color: var(--color-gray-500);
  margin-top: var(--space-md);
  line-height: var(--lh-body);
}

.section--navy .section__subtitle {
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- Grid System ---------- */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .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: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid { gap: var(--space-xl); }
}

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-teal { color: var(--color-teal); }
.text-blue { color: var(--color-blue); }
.text-navy { color: var(--color-navy); }
.text-gray { color: var(--color-gray-500); }
.text-white { color: var(--color-white); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Teal Accent Divider ---------- */
.divider {
  width: 48px;
  height: 3px;
  background-color: var(--color-teal);
  border: none;
  border-radius: var(--radius-full);
  margin: var(--space-lg) 0;
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Lead Text ---------- */
.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-gray-600);
}

@media (min-width: 768px) {
  .lead {
    font-size: 1.1875rem;
  }
}

/* ---------- Tag / Label ---------- */
.tag {
  display: inline-block;
  padding: var(--space-2xs) var(--space-xs);
  font-size: var(--fs-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sm);
  background-color: rgba(20, 184, 166, 0.1);
  color: var(--color-teal-dark);
}

/* ---------- Prose (for article/long-form content) ---------- */
.prose h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.prose h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.prose p {
  margin-bottom: var(--space-md);
}

.prose ul,
.prose ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: var(--space-xs);
}

.prose blockquote {
  border-left: 3px solid var(--color-teal);
  padding-left: var(--space-lg);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--color-gray-600);
}
