/* Healthipulse landing page
   Palette: leaf ink, mint paper, hibiscus (the pulse), leaf green, mist, pollen.
   Type: Bitter for headings, DM Sans for everything else. Both self-hosted (OFL). */

@font-face {
  font-family: "Bitter";
  src: url("fonts/bitter.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dmsans.woff") format("woff");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dmsans-italic.woff") format("woff");
  font-weight: 100 1000;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #0E2B25;
  --ink-soft: #3F5A53;
  --paper: #F4F8F6;
  --white: #FFFFFF;
  --hibiscus: #B3124F;
  --hibiscus-deep: #8E0C3D;
  --leaf: #1D6B53;
  --mist: #D8E6E0;
  --pollen: #F2B84B;

  --serif: "Bitter", "Rockwell", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: clamp(1.85rem, 1.3rem + 2.2vw, 2.75rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.6vw, 4.75rem);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 72rem;
  --section-space: clamp(4.5rem, 9vw, 8rem);
  --radius-s: 6px;
  --radius-m: 14px;
  --radius-l: 34px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--leaf); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--hibiscus); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--serif); color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 760; line-height: 1.02; letter-spacing: -0.025em; max-width: 20ch; }
h2 { font-size: var(--step-3); font-weight: 720; line-height: 1.1; letter-spacing: -0.015em; }
h3 { font-size: var(--step-1); font-weight: 660; line-height: 1.25; }
p { margin: 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--white); padding: 0.6rem 1rem; border-radius: var(--radius-s); z-index: 20; }
.skip:focus { top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.75rem 1.4rem;
  border-radius: 999px; border: 2px solid transparent;
  font: 600 var(--step-0)/1 var(--sans); text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-small { min-height: 2.5rem; padding: 0.55rem 1.1rem; font-size: 0.95rem; }
.btn-primary { background: var(--hibiscus); color: var(--white); }
.btn-primary:hover { background: var(--hibiscus-deep); color: var(--white); }
.btn-quiet { color: var(--ink); border-color: var(--ink); }
.btn-quiet:hover { background: var(--ink); color: var(--paper); }
.btn-leaf { background: var(--leaf); color: var(--white); }
.btn-leaf:hover { background: var(--ink); color: var(--white); }
.btn-light { background: var(--white); color: var(--hibiscus); }
.btn-light:hover { background: var(--paper); color: var(--hibiscus-deep); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.site-header.scrolled { border-bottom-color: var(--mist); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 2.4rem; height: auto; color: var(--ink); overflow: visible; }
.brand-dot { fill: var(--hibiscus); }
.brand-word { font: 720 1.35rem/1 var(--serif); letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.site-nav a:not(.btn):hover { color: var(--hibiscus); }
.menu-toggle { display: none; }

/* Hero */
.hero { padding-top: clamp(2.5rem, 6vw, 5rem); }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.6rem 3rem; margin-top: 1.8rem; }
.lede { font-size: var(--step-1); line-height: 1.55; max-width: 36rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.journey { margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0 var(--gutter) clamp(3rem, 6vw, 4.5rem); }
.journey-trace { height: clamp(80px, 10vw, 140px); }
.journey-trace svg { width: 100%; height: 100%; overflow: visible; }
.trace-base { stroke: var(--mist); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.trace {
  fill: none; stroke: var(--hibiscus); stroke-width: 3.5;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.journey-steps {
  list-style: none; margin: 1.4rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  text-align: center; counter-reset: step;
}
.journey-steps li { display: grid; gap: 0.35rem; justify-items: center; align-content: start; padding-inline: 0.9rem; }
.journey-steps strong { font: 660 1.08rem/1.25 var(--serif); }
.journey-steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-bottom: 0.3rem;
  border-radius: 50%; background: var(--white); border: 2px solid var(--hibiscus); color: var(--hibiscus);
  font: 700 0.85rem/1 var(--sans);
}
.journey-steps span { font-size: 0.94rem; line-height: 1.45; color: var(--ink-soft); max-width: 15rem; }

/* One orchestrated moment: the trace draws, each step arrives as the line reaches it. */
.js .trace { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.js .journey-steps li { opacity: 0; transform: translateY(6px); }
.js .journey.play .trace { animation: draw 2.8s cubic-bezier(.45,.05,.35,1) forwards; }
.js .journey.play .journey-steps li { animation: arrive 0.5s ease-out forwards; }
.js .journey.play .journey-steps li:nth-child(1) { animation-delay: 0.35s; }
.js .journey.play .journey-steps li:nth-child(2) { animation-delay: 0.9s; }
.js .journey.play .journey-steps li:nth-child(3) { animation-delay: 1.45s; }
.js .journey.play .journey-steps li:nth-child(4) { animation-delay: 2.0s; }
.js .journey.play .journey-steps li:nth-child(5) { animation-delay: 2.5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes arrive { to { opacity: 1; transform: none; } }

/* Sections */
.section { padding-block: var(--section-space); }
.services { background: var(--white); }
.services h2 { max-width: 20ch; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.25rem 3rem; margin-top: 3.5rem; }
.service { display: grid; align-content: start; gap: 0.7rem; }
.service p { color: var(--ink-soft); max-width: 34ch; }
.icon { width: 2.5rem; height: 2.5rem; fill: none; stroke: var(--hibiscus); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 0.3rem; }

/* Families */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.split-copy { display: grid; gap: 1.4rem; justify-items: start; }
.split-copy > p { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); max-width: 36rem; }
.ticks { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; display: grid; gap: 0.8rem; }
.ticks li { position: relative; padding-left: 2rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.4em; width: 1.1rem; height: 0.6rem;
  border-left: 2.5px solid var(--leaf); border-bottom: 2.5px solid var(--leaf); transform: rotate(-45deg);
}

.phone {
  justify-self: center; width: min(100%, 22.5rem);
  padding: 0.7rem; border-radius: 2.6rem; background: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(14, 43, 37, 0.55);
}
.phone-screen { background: var(--paper); border-radius: 2rem; padding: 1.4rem 1.2rem 1.5rem; }
.phone-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.phone-title { font: 700 1.15rem/1 var(--serif); }
.phone-status { font-size: 0.78rem; font-weight: 600; color: var(--leaf); background: var(--mist); border-radius: 999px; padding: 0.3rem 0.65rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; padding: 0 0 1.05rem 1.6rem; display: grid; gap: 0.1rem; font-size: 0.85rem; line-height: 1.35; color: var(--ink-soft); }
.timeline li::before { content: ""; position: absolute; left: 0.3rem; top: 0.35rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--leaf); }
.timeline li::after { content: ""; position: absolute; left: calc(0.6rem - 1px); top: 1.1rem; bottom: 0.1rem; width: 2px; background: var(--mist); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.live::before { background: var(--hibiscus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hibiscus) 22%, transparent); }
.timeline .t { font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); opacity: 0.8; }
.timeline b { color: var(--ink); font-weight: 650; font-size: 0.92rem; }
.mini-map { display: block; margin-top: 0.55rem; background: var(--white); border: 1px solid var(--mist); border-radius: var(--radius-m); padding: 0.5rem; }
.mini-map svg { width: 100%; height: auto; }
.mini-map .road { fill: none; stroke: var(--mist); stroke-width: 9; stroke-linecap: round; }
.mini-map .route { fill: none; stroke: var(--leaf); stroke-width: 3; stroke-dasharray: 3 4; stroke-linecap: round; }
.mini-map .rider { fill: var(--hibiscus); stroke: var(--white); stroke-width: 2.5; }
.mini-map .home { fill: var(--ink); stroke: var(--white); stroke-width: 2.5; }

/* Safety */
.safety { background: var(--ink); color: var(--mist); }
.safety h2, .safety h3 { color: var(--white); }
.safety-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.safety h2 { max-width: 17ch; }
.safety-lede { margin-top: 1.5rem; font-size: var(--step-1); line-height: 1.55; max-width: 36rem; }
.safety-note { margin-top: 1.8rem; display: inline-block; padding: 0.85rem 1.1rem; border-radius: var(--radius-m); background: rgba(255,255,255,0.07); border-left: 4px solid var(--hibiscus); }
.safety a { color: var(--white); font-weight: 700; }
.safety a:hover { color: var(--pollen); }
.safety-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.2rem; }
.safety-points li { display: grid; gap: 0.5rem; padding-left: 1.4rem; border-left: 2px solid rgba(216, 230, 224, 0.25); }
.safety-points p { color: color-mix(in srgb, var(--mist) 88%, transparent); }

/* Providers */
.partners-head { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 4rem; align-items: end; }
.partners-head p { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); }
.steps { list-style: none; margin: 3.5rem 0 3rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: s; }
.steps li { position: relative; display: grid; gap: 0.6rem; align-content: start; padding: 1.9rem 1.6rem 1.7rem; background: var(--white); border-radius: var(--radius-m); border-top: 4px solid var(--leaf); }
.steps li::before { counter-increment: s; content: "Step " counter(s); font-size: var(--step--1); font-weight: 600; color: var(--leaf); }
.steps p { color: var(--ink-soft); }

/* FAQ */
.faq { background: var(--white); }
.faq-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 2.5rem 5rem; align-items: start; }
.faq h2 { max-width: 12ch; }
.faq-list details { border-bottom: 1px solid var(--mist); }
.faq-list details:first-child { border-top: 1px solid var(--mist); }
.faq-list summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 1.25rem 0; font: 640 var(--step-1)/1.3 var(--serif);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; flex: none; width: 0.7rem; height: 0.7rem; margin-right: 0.3rem;
  border-right: 2.5px solid var(--hibiscus); border-bottom: 2.5px solid var(--hibiscus);
  transform: rotate(45deg) translateY(-3px); transition: transform 0.2s;
}
.faq-list details[open] summary::after { transform: rotate(225deg) translateY(-3px); }
.faq-list details p { padding: 0 2.5rem 1.4rem 0; color: var(--ink-soft); max-width: 40rem; }

/* Closing band */
.closing { background: var(--hibiscus); color: var(--white); padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.closing h2 { color: var(--white); max-width: 22ch; }
.closing-row { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; justify-content: space-between; }

/* Footer */
.site-footer { background: var(--ink); color: var(--mist); padding-top: 3.5rem; }
.site-footer .brand, .site-footer .brand:hover { color: var(--white); }
.site-footer .brand-mark { color: var(--white); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; padding-bottom: 2.5rem; }
.footer-note { margin-top: 1rem; font-size: 0.95rem; }
.footer-note a { color: var(--white); font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.8rem; align-items: center; }
.footer-links a { color: var(--mist); text-decoration: none; font-size: 0.95rem; }
.footer-links a:hover { color: var(--white); text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(216, 230, 224, 0.18); padding-block: 1.3rem 1.6rem; font-size: var(--step--1); color: color-mix(in srgb, var(--mist) 75%, transparent); }

/* Tablet */
@media (max-width: 1000px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .safety-grid, .faq-grid, .partners-head { grid-template-columns: 1fr; }
  .phone { margin-top: 0.5rem; }
}

/* Small screens: the pulse stays across the top, steps stack beneath it */
@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0.5rem 1rem;
    font: 600 0.95rem/1 var(--sans); color: var(--ink); background: transparent;
    border: 2px solid var(--ink); border-radius: 999px; cursor: pointer;
  }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--mist); padding: 0.5rem 0 1.25rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 0.85rem 0; border-bottom: 1px solid var(--mist); font-size: 1.05rem; }
  .site-nav .btn { margin-top: 1rem; }
  .header-row { position: relative; }
  .no-js .site-nav { display: flex; position: static; flex-wrap: wrap; flex-direction: row; padding: 0 0 1rem; border: 0; }
  .no-js .menu-toggle { display: none; }
  .no-js .header-row { flex-wrap: wrap; }

  .journey-steps { grid-template-columns: 1fr; gap: 0; text-align: left; margin-top: 2rem; }
  .journey-steps li { grid-template-columns: 1.9rem 1fr; justify-items: start; column-gap: 0.9rem; row-gap: 0.15rem; padding: 0 0 1.4rem; }
  .journey-steps li::before { grid-row: 1 / span 2; margin: 0; }
  .journey-steps strong, .journey-steps span { grid-column: 2; max-width: none; }
  .service-grid, .steps { grid-template-columns: 1fr; }
  .service-grid { gap: 2.6rem; }
  .steps { margin-block: 2.5rem 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .trace { stroke-dasharray: none; stroke-dashoffset: 0; animation: none !important; }
  .js .journey-steps li { opacity: 1; transform: none; animation: none !important; }
  .btn, .faq-list summary::after { transition: none; }
}
