/* Base styles, the reusable ws-* UI components, and the marketing site chrome for PulseLayers.
   The base + ws-* component layer is ported from the backend app (Warpspeed/wwwroot/css/site.css)
   so the site and the product look like one system; app-only pieces (the clinician board, the
   diagnosis color system, the login card) are intentionally left out. All colors come from the
   design tokens in theme.css so every component themes itself. */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ws-font-sans);
  background-color: var(--ws-bg);
  color: var(--ws-text);
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--ws-font-mono);
  font-variant-numeric: tabular-nums;
}

a { color: var(--ws-primary); text-decoration: none; }
a:hover { color: var(--ws-primary-hover); text-decoration: underline; }

h1, h2, h3 { color: var(--ws-text-strong); }

/* ── Reusable components (shared with the app) ───────────────────────────── */

.ws-card {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius);
}

.ws-field { margin-bottom: 16px; }

.ws-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ws-text);
}

.ws-input {
  width: 100%;
  padding: 11px 13px;
  font-size: 0.95rem;
  color: var(--ws-text);
  background: var(--ws-surface-2);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ws-input::placeholder { color: var(--ws-text-muted); }

.ws-input:focus {
  border-color: var(--ws-primary);
  box-shadow: 0 0 0 3px var(--ws-focus-ring);
}

.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--ws-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ws-btn-block { width: 100%; }

.ws-btn-primary { background: var(--ws-primary); color: var(--ws-primary-contrast); }
.ws-btn-primary:hover { background: var(--ws-primary-hover); color: var(--ws-primary-contrast); text-decoration: none; }

.ws-btn-outline { background: transparent; color: var(--ws-text); border-color: var(--ws-border); }
.ws-btn-outline:hover { border-color: var(--ws-primary); color: var(--ws-primary); text-decoration: none; }

/* Light/dark toggle button (sun in dark mode, moon in light mode). */
.ws-theme-toggle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  color: var(--ws-text);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.ws-theme-toggle:hover { color: var(--ws-primary); border-color: var(--ws-primary); }
.ws-theme-toggle--floating { position: fixed; top: 18px; right: 18px; z-index: 50; }
.ws-theme-toggle .icon-moon { display: none; }
.ws-theme-toggle .icon-sun { display: inline-flex; }
[data-theme="light"] .ws-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .ws-theme-toggle .icon-moon { display: inline-flex; }

/* ── Brand (shared with the app) ─────────────────────────────────────────── */

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--ws-primary); flex: 0 0 auto; }
.brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ws-text-strong);
}
.brand-name .accent { color: var(--ws-primary); }
.brand-beta {
  align-self: flex-start;
  margin-top: 1px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ws-primary);
  background: color-mix(in srgb, var(--ws-primary) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--ws-primary) 38%, transparent);
  padding: 1px 6px;
  border-radius: 999px;
}

/* ── Marketing site chrome ───────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--ws-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ws-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand-link { text-decoration: none; }
.brand-link:hover { text-decoration: none; }

.site-nav { display: flex; gap: 6px; margin: 0 auto 0 14px; padding: 0; list-style: none; align-items: center; }
.site-nav a {
  padding: 8px 12px;
  border-radius: var(--ws-radius-sm);
  color: var(--ws-text-muted);
  font-weight: 500;
}
.site-nav a:hover { color: var(--ws-text); background: var(--ws-surface-2); text-decoration: none; }
.site-nav a.active {
  color: var(--ws-primary);
  background: color-mix(in srgb, var(--ws-primary) 14%, transparent);
}

.site-header-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.site-nav + .site-header-end { margin-left: 0; }

/* ── Sections & hero ─────────────────────────────────────────────────────── */

.section { padding: 72px 0; }
.section-head { max-width: 62ch; margin-bottom: 32px; }
.section-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-sub { margin: 0; color: var(--ws-text-muted); }

.hero {
  padding: 104px 0 84px;
  background: radial-gradient(1100px 560px at 50% -12%, color-mix(in srgb, var(--ws-primary) 12%, transparent), transparent 60%);
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.hero p {
  margin: 0 0 32px;
  max-width: 62ch;
  font-size: 1.12rem;
  color: var(--ws-text-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--ws-font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ws-primary);
}

/* ── Feature grid ────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: start;
}

.feature-card { padding: 22px; }
.feature-card .feature-icon { color: var(--ws-primary); margin-bottom: 12px; }
.feature-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.feature-card p { margin: 0; font-size: 0.9rem; color: var(--ws-text-muted); }

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--ws-border);
  padding: 28px 0;
  background: var(--ws-surface);
}
.site-footer .container {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ws-text-muted);
}
.footer-links { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--ws-text-muted); }
.site-footer a:hover { color: var(--ws-primary); }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 48px 0; }
  .footer-links { margin-left: 0; }
}

/* ── Accessibility & motion ──────────────────────────────────────────────── */

.ws-input:focus-visible,
.ws-btn:focus-visible,
.ws-theme-toggle:focus-visible,
.site-nav a:focus-visible {
  outline: 2px solid var(--ws-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes ws-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
  .card-grid > .feature-card { animation: ws-rise 0.45s ease both; }
  .card-grid > .feature-card:nth-child(1) { animation-delay: 0.02s; }
  .card-grid > .feature-card:nth-child(2) { animation-delay: 0.08s; }
  .card-grid > .feature-card:nth-child(3) { animation-delay: 0.14s; }
  .card-grid > .feature-card:nth-child(4) { animation-delay: 0.20s; }
}

/* ── Nav dropdowns ───────────────────────────────────────────────────────── */

.site-nav .has-sub { position: relative; }
.site-nav .has-sub > a::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
}
.site-nav .sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 6px;
  margin: 0;
  list-style: none;
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm);
  box-shadow: var(--ws-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}
.site-nav .has-sub:hover .sub,
.site-nav .has-sub:focus-within .sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.site-nav .sub a { display: block; font-size: 0.9rem; font-weight: 400; }

/* ── Stats ───────────────────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
}
.stat {
  padding: 24px 20px;
  text-align: center;
}
.stat-figure {
  font-family: var(--ws-font-mono);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ws-primary);
  font-variant-numeric: tabular-nums;
}
.stat-figure .affix { font-size: 0.5em; color: var(--ws-text-muted); }
.stat-label {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ws-text-muted);
}
.stat-sources {
  margin-top: 22px;
  font-size: 0.78rem;
  color: var(--ws-text-muted);
}
.stat-sources a { color: var(--ws-text-muted); text-decoration: underline; }
.stat-sources a:hover { color: var(--ws-primary); }

/* ── Steps ───────────────────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  counter-reset: step;
}
.step { position: relative; padding: 22px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  font-family: var(--ws-font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ws-primary);
  background: color-mix(in srgb, var(--ws-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ws-primary) 38%, transparent);
  border-radius: 50%;
}
.step h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; }
.step p { margin: 0; font-size: 0.9rem; color: var(--ws-text-muted); }
.step-timing {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 10px;
  font-family: var(--ws-font-mono);
  font-size: 0.78rem;
  color: var(--ws-primary);
  background: color-mix(in srgb, var(--ws-primary) 12%, transparent);
  border-radius: 999px;
}

/* ── Split (two-column audience) sections ────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.split-panel { padding: 28px; }
.split-panel h3 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 600; }

.check-list { list-style: none; margin: 0 0 22px; padding: 0; }
.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  font-size: 0.93rem;
  color: var(--ws-text-muted);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--ws-primary);
  border-bottom: 2px solid var(--ws-primary);
  transform: rotate(-45deg);
}

/* ── Prose ───────────────────────────────────────────────────────────────── */

.prose { max-width: 68ch; }
.prose p { color: var(--ws-text-muted); }
.prose h2 { margin-top: 36px; font-size: 1.3rem; }
.prose h3 { margin-top: 26px; font-size: 1.05rem; }
.lead { font-size: 1.08rem; color: var(--ws-text-muted); }

/* ── Footer columns & subscribe ──────────────────────────────────────────── */

.footer-top { padding: 44px 0 28px; background: var(--ws-surface); border-top: 1px solid var(--ws-border); }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
}
.footer-col h4 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ws-text-strong);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; font-size: 0.88rem; }
.footer-col a { color: var(--ws-text-muted); }
.footer-col a:hover { color: var(--ws-primary); }
.footer-col address { font-style: normal; font-size: 0.88rem; color: var(--ws-text-muted); line-height: 1.7; }

.subscribe { display: flex; gap: 8px; margin-top: 6px; }
.subscribe .ws-input { flex: 1 1 auto; }

/* ── Timeline (evolution of cardiac monitoring) ──────────────────────────── */

.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--ws-border), color-mix(in srgb, var(--ws-primary) 60%, transparent));
}
.timeline li { position: relative; padding-bottom: 22px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ws-bg);
  border: 2px solid var(--ws-border);
}
.timeline li.is-current::before { border-color: var(--ws-primary); background: var(--ws-primary); }
.timeline-title { font-weight: 600; color: var(--ws-text-strong); }
.timeline li.is-current .timeline-title { color: var(--ws-primary); }
.timeline-note { display: block; font-size: 0.88rem; color: var(--ws-text-muted); }

/* ── Spec cards (device comparison) ──────────────────────────────────────── */

.spec { padding: 24px; }
.spec h3 {
  margin: 0 0 4px;
  font-family: var(--ws-font-mono);
  font-size: 1.05rem;
  font-weight: 600;
}
.spec .spec-kicker {
  display: block;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: var(--ws-text-muted);
}
.spec ul { list-style: none; margin: 0; padding: 0; }
.spec li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--ws-text-muted);
  border-top: 1px solid var(--ws-border);
}
.spec li:first-child { border-top: none; }

/* ── Testimonials ────────────────────────────────────────────────────────── */

.quote { padding: 22px; }
.quote blockquote {
  margin: 0 0 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ws-text);
}
.quote blockquote::before { content: "\201C"; color: var(--ws-primary); }
.quote blockquote::after { content: "\201D"; color: var(--ws-primary); }
.quote cite {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ws-text-muted);
}

/* ── Note / callout ──────────────────────────────────────────────────────── */

.note {
  padding: 16px 18px;
  font-size: 0.88rem;
  color: var(--ws-text-muted);
  background: var(--ws-surface-2);
  border: 1px solid var(--ws-border);
  border-left: 3px solid var(--ws-status-pending);
  border-radius: var(--ws-radius-sm);
}
.note strong { color: var(--ws-text-strong); }

/* ── Link list (patient resources) ───────────────────────────────────────── */

.res-card { padding: 22px; display: flex; flex-direction: column; }
.res-card h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; }
.res-card p { margin: 0 0 16px; font-size: 0.9rem; color: var(--ws-text-muted); flex: 1 1 auto; }

/* Non-interactive button, for CTAs whose destination does not exist yet. */
.ws-btn.is-disabled {
  cursor: default;
  color: var(--ws-text-muted);
  background: transparent;
  border-color: var(--ws-border);
}
.ws-btn.is-disabled:hover { color: var(--ws-text-muted); border-color: var(--ws-border); }
.ws-btn .badge-soon {
  font-family: var(--ws-font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ws-primary);
  background: color-mix(in srgb, var(--ws-primary) 14%, transparent);
  border-radius: 999px;
  padding: 2px 7px;
}

/* ── Person cards (leadership, board, advisory) ──────────────────────────── */

.person { padding: 22px; }
.person .person-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  font-family: var(--ws-font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ws-primary);
  background: color-mix(in srgb, var(--ws-primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ws-primary) 38%, transparent);
  border-radius: 50%;
}
.person h3 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 600; }
.person .person-role { margin: 0; font-size: 0.88rem; color: var(--ws-text-muted); }

/* ── Legal documents (privacy policy, terms) ─────────────────────────────── */

.legal { max-width: 76ch; }
.legal h2 {
  margin: 34px 0 10px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.legal h2:first-child { margin-top: 0; }
.legal p {
  margin: 0 0 14px;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--ws-text-muted);
}
.legal-list { margin: 0 0 18px; padding: 0; list-style: none; }
.legal-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--ws-text-muted);
}
.legal-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ws-primary);
}
.legal-list strong { color: var(--ws-text-strong); display: block; margin-bottom: 2px; }
