/* ==========================================================================
   MedSpeakPro Design System
   Shared tokens, typography, components, and layout primitives.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------- Custom Properties ---------- */
:root {
  /* Palette — Stripe-inspired dark mode */
  --bg-base: #0A0A0F;
  --bg-surface: #111116;
  --bg-surface-alt: #19191F;
  --bg-surface-hover: #1F1F28;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(28, 176, 246, 0.5);
  --accent: #1CB0F6;
  --accent-hover: #1583B5;
  --accent-glow: rgba(28, 176, 246, 0.10);
  --accent-glow-strong: rgba(28, 176, 246, 0.20);
  --accent-2: #8B5CF6;
  --accent-gradient: linear-gradient(135deg, #1CB0F6 0%, #1CB0F6 40%, #8B5CF6 100%);
  --text-primary: #F0F0F5;
  --text-secondary: #8A8F98;
  --text-tertiary: #5E6068;
  --success: #34D399;
  --warning: #FBBF24;
  --error: #F87171;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.85rem + 0.2vw, 1rem);
  --text-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-xl: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
  --text-2xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-3xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --text-4xl: clamp(2rem, 1.6rem + 1.5vw, 2.5rem);
  --text-5xl: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  --text-display: clamp(3rem, 2.2rem + 3vw, 5rem);

  /* Glass */
  --glass-bg: rgba(17, 17, 22, 0.65);
  --glass-blur: blur(24px) saturate(180%);

  /* Spacing */
  --section-gap: clamp(64px, 8vw, 120px);

  /* Nav height */
  --nav-height: 64px;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Subtle dot grid overlay — Stripe/Linear style */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 70%);
}

body > * {
  position: relative;
  z-index: 1;
}

/* When Lenis is active, it manages scroll */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.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;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 800px;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0;
  transition: transform 0.35s cubic-bezier(0.33, 1, 0.68, 1),
              background 0.35s ease;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
}

.site-nav::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(28, 176, 246, 0.08) 30%, rgba(139, 92, 246, 0.08) 70%, transparent);
}

.site-nav.nav--hidden {
  transform: translateY(-100%);
}

.site-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: var(--text-base);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.33, 1, 0.68, 1);
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 0 20px rgba(28, 176, 246, 0.2), 0 0 12px rgba(139, 92, 246, 0.08), 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(28, 176, 246, 0.3), 0 0 20px rgba(139, 92, 246, 0.15), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  position: relative;
}

.btn--ghost:hover {
  border-color: rgba(28, 176, 246, 0.4);
  background: linear-gradient(135deg, rgba(28, 176, 246, 0.08), rgba(139, 92, 246, 0.06));
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(28, 176, 246, 0.08), 0 0 12px rgba(139, 92, 246, 0.05);
}

.btn--pill {
  border-radius: var(--radius-full);
  padding: 10px 24px;
  font-size: var(--text-sm);
}

.btn--sm {
  padding: 10px 20px;
  font-size: var(--text-sm);
}

.btn--lg {
  padding: 18px 36px;
  font-size: var(--text-lg);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  border-color: rgba(28, 176, 246, 0.15);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(28, 176, 246, 0.06);
  transform: translateY(-3px);
}

.card__icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(28, 176, 246, 0.10), rgba(139, 92, 246, 0.06));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  border: 1px solid rgba(28, 176, 246, 0.08);
}

.card__icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  stroke: var(--accent);
}

.card__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.card__text {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.7;
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(28, 176, 246, 0.06), rgba(139, 92, 246, 0.04));
  border: 1px solid rgba(28, 176, 246, 0.12);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
}

/* ---------- Section headings ---------- */
.section-label {
  display: block;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.section-heading {
  text-align: center;
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.section-heading span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subheading {
  text-align: center;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 64px;
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(28, 176, 246, 0.1) 30%, rgba(139, 92, 246, 0.1) 70%, transparent);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  color: var(--text-tertiary);
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
  text-decoration: none;
}

/* ---------- Glass morphism utility ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
}

/* ---------- Glow accents ---------- */
.glow {
  position: relative;
}

.glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(28, 176, 246, 0.12), rgba(139, 92, 246, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Responsive ---------- */

/* Tablet */
@media (max-width: 1024px) {
  .section-heading {
    font-size: var(--text-4xl);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    font-size: 11px;
  }

  .logo {
    font-size: 16px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-links {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .section-heading {
    font-size: var(--text-3xl);
  }

  .section-subheading {
    font-size: var(--text-base);
    margin-bottom: 40px;
  }

  .btn {
    padding: 12px 24px;
    font-size: var(--text-sm);
  }

  .btn--lg {
    padding: 14px 28px;
    font-size: var(--text-base);
  }

  .card {
    padding: 24px;
  }
}
