/* ==========================================================================
   SomaVue — How It Works walkthrough
   Scoped styles for /how-it-works/. All selectors are prefixed .hiw-
   so nothing here can bleed into the marketing site or the app.
   ========================================================================== */

.hiw-page {
  --hiw-primary: #184e46;
  --hiw-primary-ink: #ffffff;
  --hiw-primary-soft: color-mix(in oklab, #184e46 10%, transparent);
  --hiw-primary-line: color-mix(in oklab, #184e46 30%, transparent);
  --hiw-surface: #ffffff;
  --hiw-surface-2: #faf8f4;
  --hiw-surface-3: #f2ede4;
  --hiw-text: #1a1a1a;
  --hiw-text-muted: #5a5a5a;
  --hiw-text-faint: #8a8a8a;
  --hiw-border: #e5ded1;
  --hiw-border-strong: #c9c0af;
  --hiw-shadow-sm: 0 1px 2px rgba(24, 78, 70, 0.04), 0 2px 6px rgba(24, 78, 70, 0.03);
  --hiw-shadow-md: 0 4px 16px rgba(24, 78, 70, 0.08), 0 12px 40px rgba(24, 78, 70, 0.06);
  --hiw-radius: 14px;
  --hiw-radius-lg: 20px;
  --hiw-radius-pill: 999px;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--hiw-text);
  background: var(--hiw-surface-2);
  min-height: 100vh;
}

/* ---------- Container + spacing ---------- */
.hiw-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero ---------- */
.hiw-hero {
  padding: 88px 0 40px;
  text-align: center;
}
.hiw-hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hiw-primary);
  background: var(--hiw-primary-soft);
  border: 1px solid var(--hiw-primary-line);
  padding: 6px 14px;
  border-radius: var(--hiw-radius-pill);
  margin-bottom: 18px;
  font-weight: 600;
}
.hiw-hero-title {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--hiw-text);
}
.hiw-hero-lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--hiw-text-muted);
  max-width: 640px;
  margin: 0 auto 8px;
}

/* ---------- Tier tabs ---------- */
.hiw-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px auto 12px;
  padding: 6px;
  background: var(--hiw-surface);
  border: 1px solid var(--hiw-border);
  border-radius: var(--hiw-radius-pill);
  width: fit-content;
  box-shadow: var(--hiw-shadow-sm);
}
.hiw-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 22px;
  border-radius: var(--hiw-radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--hiw-text-muted);
  cursor: pointer;
  transition: color .18s, background .18s;
  font-family: inherit;
}
.hiw-tab:hover { color: var(--hiw-text); }
.hiw-tab.is-active {
  background: var(--hiw-primary);
  color: var(--hiw-primary-ink);
  box-shadow: 0 2px 8px rgba(24, 78, 70, 0.25);
}
.hiw-tab-price {
  font-weight: 500;
  opacity: 0.75;
  margin-left: 6px;
  font-size: 12px;
}

/* ---------- Track ---------- */
.hiw-track {
  padding: 24px 0 80px;
  display: none;
}
.hiw-track.is-active { display: block; }
.hiw-track-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}
.hiw-track-intro h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.hiw-track-intro p {
  font-size: 15px;
  color: var(--hiw-text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ---------- Steps ---------- */
.hiw-steps {
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.hiw-step {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 48px;
  align-items: center;
}
.hiw-step:nth-child(even) {
  grid-template-columns: 1.35fr 1fr;
}
.hiw-step:nth-child(even) .hiw-step-body { order: 2; }
.hiw-step:nth-child(even) .hiw-step-shot { order: 1; }

.hiw-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--hiw-radius-pill);
  background: var(--hiw-primary);
  color: var(--hiw-primary-ink);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.hiw-step-title {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.hiw-step-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--hiw-text-muted);
  margin: 0 0 16px;
}
.hiw-step-callout {
  font-size: 13px;
  color: var(--hiw-primary);
  background: var(--hiw-primary-soft);
  border-left: 3px solid var(--hiw-primary);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-top: 12px;
  font-weight: 500;
}

/* Screenshot placeholder / real image container */
.hiw-step-shot {
  background: var(--hiw-surface);
  border: 1px solid var(--hiw-border);
  border-radius: var(--hiw-radius-lg);
  overflow: hidden;
  box-shadow: var(--hiw-shadow-md);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hiw-step-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Video steps ---
   Video is used only where scrolling/motion is the point of the shot
   (see /how-it-works/index.html: 02-parsed-panel, 03-flag-opened,
   07-practitioner-pdf-preview, 10-clinic-branded-patient-pdf).
   Poster PNG doubles as the fallback if playback is blocked. */
.hiw-step-shot--video {
  background: #f2ede4; /* muted surface while poster loads */
}
.hiw-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f2ede4;
}
.hiw-video-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
/* Respect users who ask for reduced motion — pause videos, keep poster visible. */
@media (prefers-reduced-motion: reduce) {
  .hiw-video {
    animation: none !important;
  }
  /* Note: browsers will still autoplay muted videos even with reduced-motion;
     we can't universally halt them via CSS. The static poster is what shows
     until metadata loads, which is the closest we can get without JS. */
}
.hiw-shot-placeholder {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(
      45deg,
      var(--hiw-surface-3),
      var(--hiw-surface-3) 12px,
      var(--hiw-surface-2) 12px,
      var(--hiw-surface-2) 24px
    );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--hiw-text-muted);
  text-align: center;
  padding: 24px;
}
.hiw-shot-placeholder-name {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--hiw-primary);
  letter-spacing: 0.02em;
}
.hiw-shot-placeholder-hint {
  font-size: 12px;
  color: var(--hiw-text-faint);
  max-width: 320px;
  line-height: 1.5;
}

/* ---------- Track close / CTA ---------- */
.hiw-track-cta {
  margin-top: 80px;
  background: var(--hiw-surface);
  border: 1px solid var(--hiw-border);
  border-radius: var(--hiw-radius-lg);
  padding: 44px 40px;
  text-align: center;
  box-shadow: var(--hiw-shadow-sm);
}
.hiw-track-cta h3 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.hiw-track-cta p {
  font-size: 15px;
  color: var(--hiw-text-muted);
  margin: 0 0 22px;
}
.hiw-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--hiw-primary);
  color: var(--hiw-primary-ink);
  padding: 14px 28px;
  border-radius: var(--hiw-radius-pill);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: transform .12s, box-shadow .12s;
  box-shadow: 0 2px 8px rgba(24, 78, 70, 0.2);
}
.hiw-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(24, 78, 70, 0.28);
}
.hiw-cta-note {
  display: block;
  font-size: 12px;
  color: var(--hiw-text-faint);
  margin-top: 12px;
}

/* ---------- Compare tiers (bottom) ---------- */
.hiw-compare {
  background: var(--hiw-surface);
  border-top: 1px solid var(--hiw-border);
  padding: 64px 0 88px;
}
.hiw-compare summary {
  cursor: pointer;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--hiw-primary);
  padding: 12px 0;
  list-style: none;
}
.hiw-compare summary::-webkit-details-marker { display: none; }
.hiw-compare summary::after {
  content: " ▾";
  transition: transform .18s;
  display: inline-block;
}
.hiw-compare[open] summary::after { transform: rotate(180deg); }
.hiw-compare-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 24px 0 32px;
}
.hiw-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: var(--hiw-surface);
}
.hiw-compare-table th,
.hiw-compare-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--hiw-border);
  vertical-align: top;
}
.hiw-compare-table th {
  font-weight: 700;
  font-size: 13px;
  color: var(--hiw-text);
  background: var(--hiw-surface-2);
}
.hiw-compare-table th.hiw-col-feature {
  color: var(--hiw-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}
.hiw-compare-table td.hiw-check { color: var(--hiw-primary); font-weight: 600; }
.hiw-compare-table td.hiw-dash { color: var(--hiw-text-faint); }

/* ---------- Footer strip ---------- */
.hiw-footer-strip {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--hiw-text-faint);
  border-top: 1px solid var(--hiw-border);
  background: var(--hiw-surface-2);
}
.hiw-footer-strip a { color: var(--hiw-primary); text-decoration: none; }
.hiw-footer-strip a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .hiw-hero { padding: 64px 0 24px; }
  .hiw-step,
  .hiw-step:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hiw-step:nth-child(even) .hiw-step-body { order: 0; }
  .hiw-step:nth-child(even) .hiw-step-shot { order: 0; }
  .hiw-steps { gap: 48px; }
  .hiw-track-cta { padding: 32px 24px; }
  .hiw-tabs { flex-wrap: wrap; }
  .hiw-tab { padding: 10px 16px; font-size: 13px; }
  .hiw-tab-price { display: none; }
  .hiw-compare-table th,
  .hiw-compare-table td { padding: 10px 12px; font-size: 13px; }
}

/* ---------- Compact top bar (mirrors marketing site) ---------- */
.hiw-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hiw-border);
}
.hiw-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.hiw-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--hiw-text);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.hiw-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--hiw-primary);
  color: var(--hiw-primary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hiw-topnav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hiw-topnav a {
  color: var(--hiw-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.hiw-topnav a:hover { color: var(--hiw-text); }
.hiw-topnav .hiw-topnav-cta {
  background: var(--hiw-primary);
  color: var(--hiw-primary-ink);
  padding: 8px 16px;
  border-radius: var(--hiw-radius-pill);
  font-weight: 600;
}
.hiw-topnav .hiw-topnav-cta:hover { color: var(--hiw-primary-ink); opacity: 0.9; }
@media (max-width: 640px) {
  .hiw-topnav a:not(.hiw-topnav-cta) { display: none; }
}
