/* ============================================================
   BASE.CSS: Upstar Mental Health Services
   Brand: Teal, Coral, Yellow, Charcoal, Ice Blue
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Brand Colors */
  --navy: #2d3047;
  --navy-dark: #1e2133;
  --navy-light: #3a3d5c;
  --orange: #ff8552;
  --orange-hover: #e86d3a;
  --orange-light: #fff1ec;
  --green: #1b998b;
  --green-hover: #157a6e;
  --green-light: #e6fafc;
  --yellow: #eec643;
  --yellow-hover: #d4ad30;
  --yellow-light: #fdf8e1;

  /* Surfaces */
  --color-bg: #f4fbfc;
  --color-surface: #ffffff;
  --color-surface-2: #e6fafc;
  --color-border: #cde8eb;
  --color-divider: #d8f0f3;

  /* Text */
  --color-text: #1a1f2e;
  --color-text-muted: #5a6375;
  --color-text-faint: #9aa3b5;
  --color-text-inverse: #ffffff;

  /* Semantic */
  --color-primary: var(--navy);
  --color-accent: var(--orange);
  --color-accent-2: var(--green);

  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(45, 48, 71, 0.08);
  --shadow-md: 0 4px 16px rgba(45, 48, 71, 0.1);
  --shadow-lg: 0 12px 40px rgba(45, 48, 71, 0.14);

  /* Layout */
  --content-narrow: 680px;
  --content-default: 1000px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Plus Jakarta Sans', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark mode */
[data-theme='dark'] {
  --color-bg: #0d1117;
  --color-surface: #151b26;
  --color-surface-2: #1a2535;
  --color-border: #243040;
  --color-divider: #1e2a3a;
  --color-text: #e2e6ef;
  --color-text-muted: #8a96aa;
  --color-text-faint: #4a5568;
  --navy: #3d4166;
  --navy-dark: #2d3047;
  --orange: #ff8552;
  --orange-hover: #e86d3a;
  --green: #1b998b;
  --green-hover: #157a6e;
  --yellow: #eec643;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0e1420;
    --color-surface: #151c2c;
    --color-surface-2: #1c2539;
    --color-border: #2a3650;
    --color-divider: #222d44;
    --color-text: #e2e6ef;
    --color-text-muted: #8a96aa;
    --color-text-faint: #4a5568;
  }
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.65;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'], ol[role='list'] { list-style: none; }

input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.2;
  font-family: var(--font-display);
  font-weight: 700;
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 68ch;
}

::selection {
  background: rgba(232, 98, 26, 0.2);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

button { cursor: pointer; background: none; border: none; }

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

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 5vw, var(--space-12));
}

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

.section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn--primary {
  background: var(--orange);
  color: #fff;
}
.btn--primary:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 98, 26, 0.35);
}

.btn--secondary {
  background: transparent;
  color: var(--orange);
  border-color: var(--orange);
}
.btn--secondary:hover {
  background: var(--orange);
  color: #fff;
}

.btn--navy {
  background: var(--navy);
  color: #fff;
}
.btn--navy:hover {
  background: var(--navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26, 46, 74, 0.3);
}

.btn--green {
  background: var(--green);
  color: #fff;
}
.btn--green:hover {
  background: var(--green-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(46, 125, 79, 0.35);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* Tags / Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--orange { background: var(--orange-light); color: var(--orange); }
.badge--green { background: var(--green-light); color: var(--green); }
.badge--yellow { background: var(--yellow-light); color: #8a6000; }
.badge--navy { background: rgba(26,46,74,0.08); color: var(--navy); }

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
