:root {
  --primary-900: #042f24;
  --primary-800: #064334;
  --primary-700: #085945;
  --primary-600: #0d6e56;
  --primary-500: #108769;
  --primary-100: #e2f4ee;
  --primary-50: #f0f9f5;
  --gold-500: #c69214;
  --gold-400: #dfa824;
  --gold-100: #fef7e0;
  --sand-50: #faf8f5;
  --sand-100: #f3efe8;
  --dark-ink: #101c18;
  --muted-ink: #4f645d;

  /* Fluid Responsive Typography Scale */
  --font-hero: clamp(2rem, 5.5vw + 0.5rem, 3.75rem);
  --font-h1: clamp(1.85rem, 4.2vw + 0.4rem, 3.25rem);
  --font-h2: clamp(1.45rem, 2.8vw + 0.3rem, 2.35rem);
  --font-h3: clamp(1.15rem, 1.6vw + 0.25rem, 1.65rem);
  --font-h4: clamp(1rem, 1.1vw + 0.2rem, 1.25rem);
  --font-lead: clamp(1rem, 0.6vw + 0.85rem, 1.2rem);
  --font-body: clamp(0.875rem, 0.35vw + 0.78rem, 1rem);
  --font-sm: clamp(0.8125rem, 0.25vw + 0.75rem, 0.875rem);
  --font-xs: clamp(0.72rem, 0.2vw + 0.65rem, 0.75rem);
}

/* Base HTML & Typography Smoothing */
html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--dark-ink);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem; /* 15px - optimal clinical readability */
  line-height: 1.65;
  letter-spacing: -0.011em;
  color: #1a2e27;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Headings with Outfit & Optical Metric Kerning */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-wrap: balance;
}

h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h2 {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h3 {
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.28;
}

h4 {
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.35;
}

/* Paragraphs & Text Elements */
p, li {
  overflow-wrap: break-word;
  word-break: normal;
}

p.lead {
  font-size: var(--font-lead);
  line-height: 1.62;
  letter-spacing: -0.01em;
}

/* Fluid Utility Classes */
.text-fluid-hero {
  font-size: var(--font-hero);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.text-fluid-h1 {
  font-size: var(--font-h1);
  line-height: 1.16;
  letter-spacing: -0.028em;
}

.text-fluid-h2 {
  font-size: var(--font-h2);
  line-height: 1.22;
  letter-spacing: -0.024em;
}

.text-fluid-h3 {
  font-size: var(--font-h3);
  line-height: 1.28;
  letter-spacing: -0.018em;
}

.text-fluid-h4 {
  font-size: var(--font-h4);
  line-height: 1.35;
  letter-spacing: -0.012em;
}

.text-fluid-body {
  font-size: var(--font-body);
  line-height: 1.65;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--primary-600);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-800);
}

/* Glassmorphism */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(16, 135, 105, 0.1);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 135, 105, 0.12);
}

.glass-dark {
  background: rgba(6, 67, 52, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(223, 168, 36, 0.2);
}

/* Subtle patterns */
.pattern-islamic {
  background-color: #064334;
  background-image: radial-gradient(rgba(223, 168, 36, 0.15) 1px, transparent 1px), radial-gradient(rgba(255, 255, 255, 0.05) 1px, #064334 1px);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
}

.pattern-dots {
  background-image: radial-gradient(rgba(16, 135, 105, 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* Animations */
@keyframes pulseSlow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.pulse-slow {
  animation: pulseSlow 3s infinite ease-in-out;
}

@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

.float-gentle {
  animation: floatGentle 4s ease-in-out infinite;
}

/* Gradient text */
.text-gold-gradient {
  background: linear-gradient(135deg, #d4af37 0%, #f3c246 50%, #b8860b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-emerald-gradient {
  background: linear-gradient(135deg, #064334 0%, #0d6e56 50%, #108769 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Custom shadows */
.shadow-clinic {
  box-shadow: 0 10px 30px -5px rgba(6, 67, 52, 0.08), 0 4px 12px -2px rgba(6, 67, 52, 0.04);
}

.shadow-clinic-hover:hover {
  box-shadow: 0 20px 40px -10px rgba(6, 67, 52, 0.16), 0 8px 16px -4px rgba(6, 67, 52, 0.06);
  transform: translateY(-3px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Badges */
.badge-gold {
  background: rgba(223, 168, 36, 0.14);
  color: #996e06;
  border: 1px solid rgba(223, 168, 36, 0.3);
}

.badge-emerald {
  background: rgba(16, 135, 105, 0.12);
  color: #064334;
  border: 1px solid rgba(16, 135, 105, 0.25);
}

/* Custom checkbox/radio */
.custom-radio:checked + label {
  border-color: #0d6e56;
  background-color: #f0f9f5;
}

/* Tooltip & Transitions */
.transition-smooth {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Single-Line Desktop Navigation Rules */
@media (min-width: 1024px) {
  header.glass-nav {
    white-space: nowrap;
  }

  header.glass-nav nav {
    display: flex !important;
    align-items: center;
    white-space: nowrap;
  }

  header.glass-nav nav a,
  header.glass-nav nav button {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center;
  }
}

/* ==========================================================================
   Responsive Typography & Viewport Calibrations (Mobile, Laptop, Desktop)
   ========================================================================== */

/* 1. Mobile Viewport (< 640px) */
@media (max-width: 639px) {
  /* Prevent horizontal blowout from medical terminology */
  h1, h2, h3, h4, p, span, a, button {
    overflow-wrap: break-word;
    word-break: normal;
  }

  /* Refined mobile hero heading */
  .hero-heading {
    font-size: clamp(1.85rem, 6.8vw, 2.35rem) !important;
    line-height: 1.16 !important;
    letter-spacing: -0.025em !important;
  }

  /* Section Titles on Mobile */
  h2.section-title,
  section h2 {
    font-size: clamp(1.35rem, 5.2vw, 1.75rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
  }

  /* Card Headings */
  section h3 {
    font-size: clamp(1.1rem, 4.2vw, 1.35rem);
    line-height: 1.28;
  }

  /* Body copy on Mobile */
  body, p, .text-base {
    font-size: 0.90625rem; /* ~14.5px */
    line-height: 1.62;
  }

  /* Compact top announcement bar */
  .top-announcement-bar {
    font-size: 0.6875rem;
    line-height: 1.4;
  }

  /* Touch accessibility for buttons */
  button, .btn, a[role="button"] {
    min-height: 44px;
  }

  /* Badges & micro-text readability */
  .badge, .text-\[10px\], .text-\[11px\] {
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  /* Modals on mobile */
  .modal-title {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
  }
}

/* 2. Tablet & Laptop Screens (640px to 1439px) */
@media (min-width: 640px) and (max-width: 1439px) {
  /* Balanced proportions for laptop displays */
  h1 {
    letter-spacing: -0.028em;
  }

  /* Ensure single-line navigation fits without dropping to 2nd line */
  header.glass-nav nav {
    font-size: 0.8125rem !important; /* 13px */
  }

  header.glass-nav nav button,
  header.glass-nav nav a {
    padding-left: 0.45rem !important;
    padding-right: 0.45rem !important;
    font-size: 0.8125rem !important;
  }
}

/* 3. Ultra-Wide & Large Desktop Displays (1440px+) */
@media (min-width: 1440px) {
  body {
    font-size: 1rem; /* 16px */
    line-height: 1.7;
  }

  h1.hero-heading {
    font-size: 3.75rem !important; /* 60px */
    line-height: 1.1 !important;
    letter-spacing: -0.035em !important;
  }

  section h2 {
    font-size: 2.375rem; /* 38px */
    line-height: 1.18;
    letter-spacing: -0.028em;
  }

  section h3 {
    font-size: 1.5rem; /* 24px */
    line-height: 1.25;
  }

  /* Header on full wide displays */
  header.glass-nav nav {
    font-size: 0.875rem !important; /* 14px */
  }

  header.glass-nav nav button,
  header.glass-nav nav a {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

