/* ============================================================
   HealthSaarthi — landing page (DocConnect-inspired layout)
   Palette: teal / deep-green clinical  ·  #266b68
   Type: Lato (headings) + Inter (body)
   ============================================================ */

:root {
  --teal: #266b68;
  --teal-700: #1e5754;
  --teal-800: #163f3d;
  --teal-900: #0f2c2b;
  --teal-050: #eef4f3;
  --teal-100: #d9e8e6;

  --mint: #e8f3ef;
  --ink: #12211f;
  --body: #3a4a48;
  --muted: #6a7a78;
  --line: #e4ebe9;
  --backdrop: #e7ecea;
  --card: #ffffff;

  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 31, .05), 0 4px 14px rgba(16, 32, 31, .05);
  --shadow-md: 0 12px 32px rgba(16, 32, 31, .10);
  --shadow-lg: 0 26px 60px rgba(16, 32, 31, .16);

  --maxw: 1200px;
  --gutter: clamp(20px, 4.5vw, 56px);

  --font-head: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ---------- Narrow-screen hardening ----------
   Grid and flex items default to min-width:auto, i.e. their min-content width.
   That lets one unbreakable child (a nowrap button, a long URL) push its track
   wider than the screen and drag the whole column off-canvas — the text then
   wraps to the blown-out width and gets clipped at the viewport edge.
   Allowing tracks to shrink below min-content makes that impossible. */
.hero-grid > *,
.why-grid > *,
.steps-grid > *,
.feature-row > *,
.trends-grid > *,
.metric-cards > *,
.stats-grid > *,
.abha-grid > *,
.dash-mini-grid > *,
.footer-cols > * { min-width: 0; }

/* and no single long word can widen a container either */
body { overflow-wrap: break-word; }

html, body { width: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--body);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0;
  font-weight: 700;
}

p { margin: 0; }
a { color: var(--teal); text-decoration: none; }

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 5px;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--teal);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 1000;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

/* ---------- Page wrapper: full-bleed, no card treatment ---------- */
.shell {
  width: 100%;
  background: #fff;
}

/* One shared content container — full-width sections, centered content */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding-block: clamp(56px, 8vw, 104px); }
.band { background: var(--mint); position: relative; overflow: hidden; }
.band > .container { position: relative; z-index: 1; }

/* Core Features: watercolor background image with a light overlay for text contrast */
#features {
  background-image:
    linear-gradient(rgba(245, 249, 247, 0.55), rgba(245, 249, 247, 0.55)),
    url("assets/features-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* How It Works: paper-texture background with a light overlay for legibility */
#steps {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
    url("assets/card-paper.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ---------- Torn-paper section boundaries ----------
   A strip pinned to the bottom of a section, filled with the NEXT section's
   colour and clipped to an irregular jagged top edge — reads as the upper
   section's paper torn away to reveal the one beneath. Sits in the bottom
   padding, above the background but clear of content. */
.tear {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26px;
  z-index: 4;
  background: var(--tear-fill, #fff);
  pointer-events: none;
  /* soft shadow cast down from the torn edge onto the section below */
  filter: drop-shadow(0 3px 3px rgba(16, 32, 31, 0.13));
}
.tear-a {
  clip-path: polygon(0% 50%, 2% 28%, 6% 66%, 9% 22%, 14% 58%, 17% 34%, 21% 72%, 26% 26%, 30% 60%, 33% 40%, 38% 78%, 42% 24%, 46% 64%, 49% 36%, 54% 70%, 58% 28%, 63% 62%, 66% 44%, 71% 76%, 75% 26%, 80% 58%, 83% 38%, 88% 68%, 92% 30%, 96% 60%, 100% 44%, 100% 100%, 0% 100%);
}
.tear-b {
  clip-path: polygon(0% 38%, 3% 70%, 7% 26%, 11% 62%, 15% 32%, 19% 76%, 24% 22%, 28% 58%, 31% 44%, 36% 80%, 40% 28%, 45% 64%, 48% 20%, 53% 70%, 57% 36%, 61% 78%, 65% 26%, 69% 60%, 73% 34%, 78% 74%, 82% 24%, 86% 64%, 90% 40%, 94% 76%, 97% 32%, 100% 56%, 100% 100%, 0% 100%);
}
@media (max-width: 560px) {
  .tear { height: 16px; }  /* shorter, calmer tear on mobile */
}
/* subtle depth layer — parallaxed via --bandShift (set by JS); harmless when static */
.band::before {
  content: "";
  position: absolute;
  left: -10%; right: -10%; top: -25%;
  height: 150%;
  background: radial-gradient(55% 45% at 72% 28%, rgba(38, 107, 104, 0.07), transparent 70%);
  transform: translate3d(0, var(--bandShift, 0px), 0);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Scroll effects ---------- */
[data-parallax] { will-change: transform; }

/* Reveal-on-scroll — only when motion is allowed; .sa is set by JS so
   non-JS users never get the hidden start-state. */
@media (prefers-reduced-motion: no-preference) {
  .sa .section-head > *,
  .sa .hero-copy > *,
  .sa .patients-copy > *,
  .sa .abha-copy > *,
  .sa .abha-media,
  .sa .step-card,
  .sa .feature-row,
  .sa .stat-card,
  .sa .patients-media,
  .sa .why-tagline,
  .sa .trends-tagline,
  .sa .trends-legend {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
  }
  .sa .section-head > *.in,
  .sa .hero-copy > *.in,
  .sa .patients-copy > *.in,
  .sa .abha-copy > *.in,
  .sa .abha-media.in,
  .sa .step-card.in,
  .sa .feature-row.in,
  .sa .stat-card.in,
  .sa .patients-media.in,
  .sa .why-tagline.in,
  .sa .trends-tagline.in,
  .sa .trends-legend.in {
    opacity: 1;
    transform: none;
  }
}

.section-head { max-width: 1000px; margin-bottom: clamp(34px, 5vw, 54px); }
.section-head.center { margin-inline: auto; text-align: center; }

/* Shared section eyebrow — single source of truth for every section label */
.eyebrow {
  text-transform: capitalize;
  letter-spacing: 0.04em;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 14px;
}
.section-title { font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.14; }
.section-lede {
  margin-top: 16px;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  color: var(--body);
}
.section-head.center .section-lede { margin-inline: auto; max-width: 62ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-700); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--teal-100); }
.btn-ghost:hover { background: var(--teal-050); border-color: var(--teal); }
.btn-light { background: #fff; color: var(--teal-800); }
.btn-light:hover { background: #eef5f4; }
.btn-sm { padding: 10px 20px; font-size: .92rem; }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 1px 12px rgba(16, 32, 31, 0.05);  /* faint separation over light sections */
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { height: 38px; width: auto; }

.site-nav { display: flex; align-items: center; }
.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
}
.nav-menu > li > a:not(.btn):not(.nav-login) {
  color: var(--body);
  font-weight: 500;
  font-size: .98rem;
}
.nav-menu > li > a:not(.btn):not(.nav-login):hover { color: var(--teal); }
.nav-actions { display: flex; align-items: center; gap: 18px; }
.nav-login { color: var(--teal); font-weight: 600; font-size: .96rem; }
.nav-login:hover { color: var(--teal-700); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  /* guard against decorative overflow on small screens.
     `hidden` first as the fallback for Safari < 16, which ignores `clip`. */
  overflow-x: hidden;
  overflow-x: clip;
  background:
    radial-gradient(120% 100% at 88% 0%, var(--mint) 0%, rgba(232, 243, 239, 0) 62%),
    #fff;
  padding-block: clamp(40px, 6vw, 84px);
}
.hero .container { position: relative; z-index: 1; }

/* Ambient decorative orbs — behind content, above the section background.
   Own clipping wrapper so the heavy blur is contained without clipping the
   hero content (which keeps its parallax + hover transforms). */
.hero-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(62px);
  will-change: transform;
}
.orb-1 {
  width: 360px; height: 360px;
  top: -50px; left: -40px;
  opacity: .58;
  background: radial-gradient(circle at 32% 32%, #f2fdfb, #c9ede7 72%);
  animation: orbDrift1 13s ease-in-out infinite alternate;
}
.orb-2 {
  width: 300px; height: 300px;
  bottom: -50px; right: 8%;
  opacity: .52;
  background: radial-gradient(circle at 40% 40%, #f5fefc, #d3f0ea 74%);
  animation: orbDrift2 10s ease-in-out infinite alternate;
  animation-delay: -3s;
}
.orb-3 {
  width: 240px; height: 240px;
  top: 20%; right: -30px;
  opacity: .55;
  background: radial-gradient(circle at 50% 45%, #eefcf9, #bfe9e1 76%);
  animation: orbDrift3 16s ease-in-out infinite alternate;
  animation-delay: -6s;
}
@keyframes orbDrift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(120px, 80px) scale(1.15); } }
@keyframes orbDrift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-100px, -70px) scale(1.12); } }
@keyframes orbDrift3 { from { transform: translate(0,0) scale(1); } to { transform: translate(-90px, 110px) scale(1.18); } }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.04fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.85rem, 3.8vw, 2.8rem);
  line-height: 1.24;
  max-width: 20ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  color: var(--body);
  margin-top: 20px;
  max-width: 46ch;
}
.hero-trust {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 34px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 500;
}
/* ---------- Star rating ---------- */
.rating { display: inline-flex; align-items: center; gap: 8px; }
.stars {
  --rating: 4.9;
  position: relative;
  display: inline-block;
  font-family: "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.1rem;
  line-height: 1;
  white-space: nowrap;
}
.stars::before {
  content: "★★★★★";
  color: #dce4e2;
}
.stars::after {
  content: "★★★★★";
  color: #f5a623;
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--rating) / 5 * 100%);
  overflow: hidden;
}
.rating-score { font-size: .95rem; font-weight: 600; color: var(--body); }
.rating-score strong { color: var(--teal-700); font-weight: 800; }
.avatars { display: inline-flex; }
.avatars span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
  border: 2px solid #fff;
  margin-left: -10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.avatars span:first-child { margin-left: 0; }
.avatars span:nth-child(2) { background: var(--teal-700); }
.avatars span:nth-child(3) { background: #3f8a86; }
.avatars span:nth-child(4) { background: var(--teal-800); }
.avatars .more { background: var(--teal-050); color: var(--teal); }

.hero-visual { position: relative; }
/* Hover lift on desktop. IMPORTANT: parallax writes translateY to the OUTER
   .hero-visual; the scale lives on the INNER <img> — separate transform
   layers, so scroll-parallax and hover-scale combine instead of overwriting. */
.hero-visual img {
  width: 100%;
  height: auto;
  transform-origin: center center;
  transition: transform .25s ease-out, filter .25s ease-out;
}
@media (hover: hover) and (pointer: fine) {
  .hero-visual img:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 26px 44px rgba(16, 32, 31, .20));
  }
}
@media (hover: none) {
  .hero-visual img:active { transform: scale(1.03); }
}
/* Hero ECG heartbeat — recreated as inline SVG (original was baked into the photo).
   A dim static line with a bright pulse travelling along it via stroke-dashoffset.
   Lives inside .hero-visual so it rides the existing parallax (no conflict). */
.hero-ecg {
  position: absolute;
  top: 3%;
  right: -3%;
  width: 66%;
  height: 46px;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}
.hero-ecg path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.hero-ecg__base { stroke: #e5433a; opacity: 0.4; }
.hero-ecg__pulse {
  stroke: #ff4d42;
  stroke-dasharray: 130 1000;
  filter: drop-shadow(0 0 4px rgba(255, 70, 60, 0.75));
}
@media (prefers-reduced-motion: no-preference) {
  .hero-ecg__pulse { animation: ecgPulse 2.4s linear infinite; }
}
@keyframes ecgPulse {
  from { stroke-dashoffset: 1130; }
  to   { stroke-dashoffset: 0; }
}

/* ---------- Why grid (circular icons) ---------- */
.why-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.why-card {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)),
    url("assets/card-paper.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease-out, box-shadow .22s ease-out;
}
.why-card:hover { transform: scale(1.03); box-shadow: 0 22px 48px rgba(16, 32, 31, 0.20); }
/* icon pops a little more than the card itself on hover */
.why-card .ic-round { transition: transform .24s ease-out; }
.why-card:hover .ic-round { transform: scale(1.12); }
/* No shape behind the icon — sits on the plain white card.
   Every icon renders in an identical 56x56 box regardless of its
   source dimensions; object-fit: contain preserves aspect, no crop. */
.ic-round {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
}
.ic-round img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}
.why-card h3 { font-size: 1.16rem; margin-bottom: 8px; }
.why-card p { color: var(--muted); font-size: .96rem; }

.why-tagline {
  margin: clamp(38px, 5vw, 58px) auto 0;
  max-width: 760px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.why-tagline em { font-style: italic; color: var(--teal-800); font-weight: 700; }

/* ---------- Three simple steps ---------- */
.steps-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step-card {
  text-align: center;
  padding: 8px 18px;
}
.step-num {
  display: block;
  color: var(--teal-700);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(3rem, 5.5vw, 4rem);
  line-height: 1;
  margin-bottom: 14px;
}
.step-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: .98rem; }

/* ---------- Feature rows ---------- */
.feature-rows { display: flex; flex-direction: column; gap: clamp(52px, 8vw, 96px); }
.feature-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;   /* text wider; phone column trimmed for the smaller mockup */
  gap: clamp(30px, 6vw, 76px);
  align-items: center;
}
/* mirror the split so the text column stays the wide one on alternating rows */
.feature-row.reverse { grid-template-columns: 1fr 1.5fr; }
.feature-row.reverse .feature-text { order: 2; }
.feature-row.reverse .feature-media { order: 1; }

/* icon sits inline, left of the title, both vertically centered */
.feature-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.feature-text .feature-head h3 { margin: 0; }
/* no shape behind the icon; sits on the section background */
.feature-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
}
.feature-badge img { width: 60px; height: 60px; object-fit: contain; }
.feature-num {
  display: block;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 6px;
}
.feature-text h3 { font-size: clamp(1.5rem, 3vw, 2.05rem); margin-bottom: 16px; }
.feature-text p { color: var(--body); font-size: 1.04rem; }
.feature-text p + p { margin-top: 14px; }
/* "What you gain" — a bordered footer strip (receipt divider), not a card:
   no fill/rounded/shadow, just a thin top rule with breathing room above. */
.feature-gain {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--teal-100);
  color: var(--teal-800);
  font-weight: 600;
  font-size: 1.05rem;
}
.feature-gain strong { color: var(--teal-700); }
/* Inline Trophy Lottie that replaces the "What you gain:" label.
   Fixed box reserves layout space so nothing shifts when the SVG loads. */
.gain-trophy {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  margin-left: -8px;   /* nudged right from the flush-left position */
}
.gain-trophy svg { display: block; width: 100%; height: 100%; }
.gain-text { flex: 1 1 auto; min-width: 0; margin-left: -6px; }

/* phone screenshot frame */
.feature-media { display: flex; justify-content: center; position: relative; }
.shot {
  width: min(180px, 58vw);
  aspect-ratio: 9 / 19;
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
  border: 8px solid var(--teal-900);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.shot-center img { object-position: center center; }
/* Composite lifestyle image (already includes its own phone frame + person):
   drop the device chrome and show the full transparent PNG, not a cropped screen. */
.shot-composite {
  width: min(340px, 92%);
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.shot-composite img { width: 100%; height: auto; object-fit: contain; }
/* Desktop only: larger, more prominent Core Feature images + rebalanced columns
   (mobile keeps the base 340px / single-column sizing). */
@media (min-width: 861px) {
  .shot-composite { width: min(470px, 40vw); }
  .feature-row { grid-template-columns: 1.2fr 1fr; }
  .feature-row.reverse { grid-template-columns: 1fr 1.2fr; }
}

/* ---------- Health Trends ---------- */
/* The .trends-anchor glow below is inset -10% horizontally, which on narrow
   screens reaches past the container and widens the page. Clip on x only, so
   the glow still bleeds to the viewport edge but never creates a scrollbar. */
#trends { overflow-x: hidden; overflow-x: clip; }
.trends-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.trends-anchor { display: flex; justify-content: center; position: relative; }
.trends-anchor::before {
  content: "";
  position: absolute;
  inset: -6% -10%;
  background: radial-gradient(closest-side, var(--mint), transparent 78%);
  z-index: 0;
}
/* Health Trends composite: scroll-triggered scale-in (on the wrapper) + hover scale
   (on the image) — its own animation, independent of the generic reveal. */
@media (prefers-reduced-motion: no-preference) {
  .trends-anchor .shot-composite {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity .6s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
  }
  .trends-anchor.in .shot-composite { opacity: 1; transform: scale(1); }
}
.trends-anchor .shot-composite { position: relative; z-index: 1; }
.trends-anchor .shot-composite img { transition: transform .22s ease-out; }
.trends-anchor .shot-composite img:hover { transform: scale(1.04); }
.metric-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.metric-card:hover { box-shadow: 0 20px 46px rgba(16, 32, 31, 0.16), inset 0 0 0 1px rgba(38, 107, 104, 0.4); border-color: rgba(38, 107, 104, 0.4); animation-play-state: paused; }

/* Gentle idle float for the four Health Trends metric cards.
   Scoped to .in so the float only exists once the scroll-entrance fires; each
   card's animation-delay (>= entrance 0.6s + its stagger) makes the float begin
   only AFTER the fade-up finishes — a seamless handoff since both rest at
   translateY(0). Staggered durations/delays keep it organic, not in lockstep.
   Disabled under reduced-motion (also caught by the global reduce rule); paused
   on hover (above) so it never fights the hover stroke/shadow. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes cardFloat {
    from { transform: translateY(0); }
    to   { transform: translateY(-7px); }
  }
  .metric-card.in { animation: cardFloat 4.5s ease-in-out infinite alternate; animation-delay: 1s; }
  .metric-card.in:nth-child(2) { animation-duration: 5s;   animation-delay: 1.2s; }
  .metric-card.in:nth-child(3) { animation-duration: 5.5s; animation-delay: 1.4s; }
  .metric-card.in:nth-child(4) { animation-duration: 4s;   animation-delay: 1.6s; }
}
.metric-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.metric-card h3 { font-size: 1.08rem; margin-bottom: 4px; }
.metric-value { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--ink); line-height: 1; }
.metric-value span { font-family: var(--font-body); font-size: .82rem; font-weight: 500; color: var(--muted); }
.metric-note { margin-top: 12px; font-size: .84rem; color: var(--muted); }
.spark { width: 100%; height: 64px; }
.spark svg { width: 100%; height: 100%; display: block; overflow: visible; }

.status-pill { font-size: .74rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.status-normal     { background: var(--teal-050); color: var(--teal-700); }
.status-borderline { background: #fbf1e3; color: #b56d16; }
.status-high       { background: #fbeaea; color: #b5271c; }

.trends-legend {
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center;
  margin-top: clamp(30px, 4vw, 46px);
  color: var(--muted); font-size: .9rem; font-weight: 500;
}
.trends-legend span { display: inline-flex; align-items: center; gap: 8px; }
.trends-legend .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-normal { background: var(--teal); }
.dot-borderline { background: #d98a2b; }
.dot-high { background: #cf3a2c; }

.trends-tagline {
  margin: 22px 0 0; max-width: 860px; text-align: left;
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.2rem, 2.3vw, 1.6rem); color: var(--teal-800);
  line-height: 1.55; letter-spacing: -0.01em;
}
.trends-tagline em { font-style: normal; color: var(--teal); }
/* Health Trends: text is left-aligned on desktop (re-centered on mobile below) */
#trends .section-head.center { text-align: left; margin-inline: 0; }
#trends .section-head.center .section-lede { margin-inline: 0; }

/* ---------- What patients get — full-bleed image banner with overlaid text ---------- */
.patients-banner {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: 0;
}
.patients-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;   /* vertical bias keeps both faces in frame */
  transform: scale(1.16);        /* zoom in to trim the dead space at the edges */
  transform-origin: 60% center;  /* centre the couple with even side padding */
  z-index: 0;
}
/* dark on the left (behind text), fading to clear on the right */
.patients-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    rgba(26, 68, 66, 0.95) 0%,
    rgba(26, 68, 66, 0.90) 28%,
    rgba(26, 68, 66, 0.55) 46%,
    rgba(26, 68, 66, 0.12) 62%,
    rgba(26, 68, 66, 0) 76%,
    rgba(26, 68, 66, 0) 88%,
    rgba(26, 68, 66, 0.18) 100%);  /* faint tint frames the right edge */
}
.patients-banner__inner { position: relative; z-index: 2; width: 100%; }
.patients-copy { max-width: 560px; }
/* light-on-dark text over the scrim */
#patients .eyebrow { color: #a7e8d3; }
#patients .section-title { color: #fff; }
#patients .section-lede { color: #dfeeea; }
#patients .check-list li { color: #eaf4f1; }
#patients .ic-check { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* ---------- ABHA (Digital Health ID) ---------- */
.abha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.abha-media img { width: 100%; height: auto; display: block; }
.abha-sub {
  margin-top: 8px;
  color: var(--teal);
  font-weight: 600;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
}
.abha-list-title {
  margin-top: 22px;
  margin-bottom: 4px;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  font-size: 1.08rem;
}
@media (max-width: 860px) {
  .abha-grid { grid-template-columns: 1fr; }
  .abha-media { order: -1; max-width: 560px; margin-inline: auto; }
}

.check-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 16px; }
.check-list li { display: flex; gap: 14px; align-items: flex-start; color: var(--body); font-size: 1.02rem; }
.ic-check {
  flex: 0 0 auto;
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--teal); color: #fff; margin-top: 1px;
}
.ic-check svg { width: 17px; height: 17px; }

/* ---------- Dashboard / proof (light) ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: clamp(34px, 5vw, 50px);
}
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 20px 46px rgba(16, 32, 31, 0.16), inset 0 0 0 1px rgba(38, 107, 104, 0.4); border-color: rgba(38, 107, 104, 0.4); }
.stat-value { font-family: var(--font-head); font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 900; color: var(--teal); line-height: 1; }
.stat-label { color: var(--muted); font-size: .95rem; font-weight: 500; }

/* ---------- Your Dashboard — browser/app frame mockup ---------- */
.dash-frame {
  max-width: 1040px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 64px -26px rgba(16, 32, 31, 0.30);
  background: #fff;
}
.dash-chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #eef4f3;
  border-bottom: 1px solid var(--line);
}
.dash-dots { display: inline-flex; gap: 7px; flex: 0 0 auto; }
.dash-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.dash-dots i:nth-child(1) { background: #ff5f57; }
.dash-dots i:nth-child(2) { background: #febc2e; }
.dash-dots i:nth-child(3) { background: #28c840; }
.dash-addr {
  flex: 1 1 auto;
  text-align: right;   /* bare logo, no pill, sits at the right of the header bar */
}
.dash-body { background: #f6f9f8; padding: clamp(20px, 3vw, 34px); }
.dash-body .stats-grid { margin-bottom: 0; }
.stat-card--revenue { position: relative; background: #eef7f2; border-color: var(--teal-100); }
.stat-badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--teal);
  padding: 4px 9px;
  border-radius: 999px;
}
.dash-note {
  text-align: center;
  margin: 24px auto 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.02rem;
}
.dash-logo { height: 26px; width: auto; display: inline-block; vertical-align: middle; }
/* Featured revenue "hero" stat — full width, dark teal, money animation on the right */
.stat-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #1a4442;
  border-radius: var(--radius);
  padding: 26px 32px;
  margin-bottom: 16px;
}
.stat-hero__text { display: flex; flex-direction: column; gap: 6px; }
.stat-hero .stat-value { color: #fff; font-size: clamp(2.2rem, 5vw, 3rem); }
.stat-hero .stat-label { color: #cbe5df; font-size: 1.05rem; font-weight: 600; }
.stat-hero__anim { flex: 0 0 auto; width: 96px; height: 96px; }
/* Compact grid of the remaining 5 stats below the hero */
.dash-mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.dash-mini-grid .stat-card { padding: 18px 16px; }
.dash-mini-grid .stat-value { font-size: clamp(1.35rem, 2.2vw, 1.85rem); }
.dash-mini-grid .stat-label { font-size: .8rem; }
@media (max-width: 980px) { .dash-mini-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .dash-mini-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-hero { padding: 20px; gap: 14px; }
  .stat-hero__anim { width: 64px; height: 64px; }
}

.dashboard-visual {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.dashboard-visual img { width: 100%; height: auto; }

/* ---------- Footer (dark) ---------- */
.site-footer {
  background: var(--teal-900);
  color: #9fbfbc;
  padding-block: clamp(48px, 6vw, 72px) 40px;
}
.footer-cols {
  display: grid;
  /* Contact gets the widest link column: it holds the pill button, which needs
     ~215px on one line and would overflow an even 1fr split around 1024px. */
  grid-template-columns: 1.6fr 1fr 1fr 1.5fr;
  gap: 32px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-logo { height: 34px; width: auto; margin-bottom: 16px; filter: brightness(0) invert(1); }
.footer-brand p { max-width: 40ch; color: #90b3b0; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 4px; }
/* padding-block (not gap) carries the rhythm, so each link clears the 40px
   minimum touch target on mobile while the visual spacing stays as before */
.footer-col a {
  color: #9fbfbc;
  font-size: .94rem;
  padding-block: 8px;
  line-height: 1.5;
}
.footer-col a:hover { color: #fff; }

/* Contact: the clinic URL reads as a website, so it gets a button affordance
   rather than sitting in the list looking like the email above it. */
.footer-col .footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  padding: 11px 15px;
  max-width: 100%;
  font-size: .9rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, transform .18s ease;
}
.footer-col .footer-cta svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .85; }
.footer-col .footer-cta:hover {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  transform: translateY(-1px);
}
.footer-copy { margin-top: 26px; font-size: .88rem; color: #6f918e; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; margin-inline: auto; }
  .hero-ecg { display: none; }   /* hide the decorative ECG when stacked */
  /* comfortable spacing when section titles wrap on small screens */
  .section-title { line-height: 1.28; }
  .steps-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .steps-grid .step-card { text-align: center; }

  .feature-row, .feature-row.reverse { grid-template-columns: 1fr; }
  /* mobile: every row is text first, image second, regardless of its desktop side */
  .feature-text, .feature-row.reverse .feature-text { order: 1; }
  .feature-media, .feature-row.reverse .feature-media { order: 2; }
  /* mobile: center all Core Features text + stack the "what you gain" strip
     as icon-above-text, centered (desktop keeps the inline hanging-indent) */
  #features .feature-text { text-align: center; }
  #features .feature-head { justify-content: center; }  /* flex row — needs justify, not text-align */
  #features .feature-gain {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }
  #features .feature-gain .gain-trophy { margin-left: 0; }
  #features .feature-gain .gain-text { flex: 0 1 auto; margin-left: 0; }

  .trends-grid { grid-template-columns: 1fr; }
  .trends-anchor { order: -1; }
  /* Health Trends: re-center text on mobile */
  #trends .section-head.center { text-align: center; margin-inline: auto; }
  #trends .section-head.center .section-lede { margin-inline: auto; }
  .trends-tagline { text-align: center; margin-inline: auto; }

  /* mobile: uniform dark scrim + centered text (no room for a left-right gradient) */
  .patients-banner { min-height: 460px; }
  .patients-bg { transform: none; object-position: center 20%; }
  .patients-overlay { background: rgba(26, 68, 66, 0.82); }
  .patients-banner__inner { text-align: center; }
  .patients-copy { max-width: 560px; margin-inline: auto; }
  #patients .check-list { max-width: 420px; margin-inline: auto; }
}

@media (max-width: 560px) {
  .container { padding-inline: 16px; }
  .why-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .metric-cards { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  .hero-title { line-height: 1.16; }

  /* "Connect with a MediSage Officer Now" needs 370px as a single nowrap line,
     which is wider than a 360px phone. Let this one label wrap and give it the
     full column width, so it reads as a deliberate full-width mobile button
     instead of dragging the hero column off-screen. Scoped to the hero CTA —
     the short nav button must stay on one line. */
  .hero-cta { width: 100%; }
  .hero-cta .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.32;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
