:root {
  /* Brand core */
  --primary: #3f51b5;        /* Indigo: modern innovation, trustworthy */
  --primary-strong: #303f9f; /* Darker indigo for hover/active */
  --care: #2ec4b6;           /* Mint: patient-centered accent */
  --warm: #ff7a59;           /* Gentle coral for friendly highlights */

  /* Neutrals */
  --dark: #0f172a;           /* Slate-900: readable body text */
  --light: #f7f9fc;          /* Soft background for simplicity */
  --surface: #ffffff;        /* Card / panel background */
  --muted: #6b7280;          /* Secondary text */
  --border: #e5e7eb;         /* Subtle dividers */

  /* States */
  --focus: #3f51b5;          /* Focus ring matches primary */
  --success: #22c55e;        /* Clinical “ok” state */
  --info: #0ea5e9;           /* Informational highlights */

  /* Rounding / motion / layout */
  --radius: 1rem;
  --transition: all 0.2s ease;
  --max-width: 1200px;
}

/* Base */
* { box-sizing: border-box; padding: 0; margin: 0; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
}

.container {
  width: 90%;
  max-width: var(--max-width);
  margin: auto;
  padding: 4rem 0;
}

/* Hero */
header.hero {
  background: url('hero-placeholder.jpg') center/cover no-repeat;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
}
header.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(16, 23, 42, 0.45); /* subtle slate overlay for readability */
}
header.hero > div {
  position: relative; z-index: 1;
  max-width: 800px; padding: 2rem;
}

/* Type */
h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}
h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  text-align: center;
  color: var(--primary);
}
p { margin-bottom: 1rem; font-size: 1.1rem; color: var(--dark); }
.section { padding: 3rem 0; }

/* Layout */
.grid { display: grid; gap: 2rem; }
@media (min-width: 768px) {
  .two-col { grid-template-columns: repeat(2, 1fr); }
}

/* Cards */
.card {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--border);
}

/* Buttons */
button.primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
button.primary:hover { background: var(--primary-strong); }
button.primary:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--focus) 60%, white);
  outline-offset: 2px;
  border-radius: calc(var(--radius) + 2px);
}

/* Links that need emphasis (e.g., “Contact us”) */
a.cta {
  color: var(--care);
  text-decoration: underline;
}
a.cta:hover { color: var(--primary); }

/* Accent sections (patient-care tone) */
.section--care {
  background: color-mix(in oklab, var(--care) 6%, white);
}
.section--care h2 { color: var(--primary); }

/* Indigo band sections (innovation tone) */
.section--brand {
  background: var(--primary);
  color: #fff;
}
.section--brand h2 { color: #fff; }
.section--brand .card {
  background: #ffffff;
  color: var(--dark);
}

/* Footer */
footer {
  background: var(--dark);
  color: #d1d5db;
  text-align: center;
  padding: 2rem 0;
}

/* Modal */
#videoModal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
}
#videoModal.show { display: flex; }

/* High-contrast users */
@media (prefers-contrast: more) {
  :root { --border: #cbd5e1; }
  button.primary:focus-visible { outline-width: 4px; }
}

/* Refined vertical GIF sizing — no white border */
.media-fit-vertical {
  width: auto;
  height: auto;
  max-height: 500px;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  object-fit: contain;
  display: block;
  background-color: transparent;
}

/* Override card padding in study section */
#study1 .media-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* --- Media card that always fits the image --- */
.card.media-card { padding: 0; overflow: hidden; }

.media-card img.media-fit {
  width: 100%;
  height: 100%;
  /* Keeps faces/devices nicely framed without stretching */
  object-fit: cover;
  display: block;
  /* Create a consistent portrait window that scales */
  aspect-ratio: 4 / 5;         /* adjust to 3/4 if you prefer taller */
  max-height: 620px;           /* prevents giant images on desktops */
  border-radius: var(--radius);
}

/* Optional: keep the text column comfortably wide on large screens */
@media (min-width: 1024px) {
  .two-col { grid-template-columns: 1.1fr 0.9fr; }
}


.media-card img.media-fit {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  object-fit: cover;
}
