/* ============================================================
   SpineOS  |  Marketing Site  (Phase 3 redesign)
   Consumes tokens from packages/design/tokens.css.
   Self-contained — no shared app styles required.
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: -0.01em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm, 8px);
}

/* ============================================================
   NAV
   ============================================================ */

.m-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 20);
  background: rgba(244, 246, 248, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
}
.m-nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--s-3, 12px) var(--s-5, 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5, 20px);
}
.m-nav__links {
  display: flex;
  gap: var(--s-5, 20px);
}
.m-nav__link {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--muted);
  letter-spacing: -0.005em;
  transition: color var(--dur-fast, 150ms) var(--ease-default, ease);
}
.m-nav__link:hover { color: var(--ink); }
.m-nav__cta {
  display: flex;
  gap: var(--s-2, 8px);
}

@media (max-width: 720px) {
  .m-nav__links { display: none; }
  .m-nav__inner { padding: 10px var(--s-4, 16px); }
}

/* ============================================================
   BRAND
   ============================================================ */

.m-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.m-brand__mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: #fff;
  display: grid; place-items: center;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-sm, 10px);
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  transition: background var(--dur-fast, 150ms) var(--ease-default, ease),
              transform var(--dur-fast, 150ms) var(--ease-default, ease),
              color var(--dur-fast, 150ms) var(--ease-default, ease);
}
.m-btn:active { transform: scale(0.97); }

.m-btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.m-btn--primary:hover { background: var(--accent-ink); }

.m-btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.m-btn--secondary:hover { background: var(--surface-muted); }

.m-btn--ghost {
  background: transparent;
  color: var(--ink);
}
.m-btn--ghost:hover { background: var(--surface-muted); }

.m-btn--link {
  background: transparent;
  color: var(--accent-ink);
  padding: 0 4px;
  min-height: 44px;
}
.m-btn--link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

.m-btn--sm { min-height: 36px; padding: 0 14px; font-size: var(--text-sm); }
.m-btn--lg { min-height: 52px; padding: 0 28px; font-size: var(--text-lg); }

/* ============================================================
   HERO
   ============================================================ */

.m-hero {
  padding: 64px var(--s-5, 20px) 48px;
  text-align: center;
  max-width: 1040px;
  margin: 0 auto;
}
.m-hero__eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--accent-ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.m-hero__headline {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.028em;
  line-height: 1.04;
  margin: 0;
  color: var(--ink);
}
.m-hero__sub {
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  margin: 18px auto 0;
  max-width: 640px;
}
.m-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 28px;
}
.m-hero__actions .m-btn--lg { min-width: 200px; }

.m-hero__frame {
  margin: 56px auto 0;
  max-width: 1040px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #1a1d23 0%, #0a0c10 100%);
  box-shadow: 0 40px 100px rgba(15, 23, 42, 0.18), 0 6px 20px rgba(15, 23, 42, 0.08);
  border: 1px solid var(--line-strong);
  aspect-ratio: 16 / 9;
  position: relative;
}
.m-hero__chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
  z-index: 1;
}
.m-hero__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.m-hero__art {
  position: absolute;
  inset: 32px 0 0 0;
  display: grid;
  place-items: center;
}
.m-hero__art svg {
  width: 90%;
  max-width: 780px;
  height: 90%;
  opacity: 0.78;
}

/* ============================================================
   SECTION — copy + screenshot pair
   ============================================================ */

.m-section {
  padding: 80px var(--s-5, 20px);
}
.m-section--alt { background: var(--surface); }
.m-section__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.m-section__inner--reversed {
  grid-template-columns: 1fr 1fr;
}
.m-section__inner--reversed .m-section__copy {
  order: 2;
}
.m-section__inner--reversed .m-shot,
.m-section__inner--reversed [aria-hidden="true"] {
  order: 1;
}

@media (max-width: 900px) {
  .m-section { padding: 56px var(--s-4, 16px); }
  .m-section__inner { grid-template-columns: 1fr; gap: 32px; }
  .m-section__inner--reversed .m-section__copy { order: 1; }
  .m-section__inner--reversed .m-shot { order: 2; }
}

.m-section__eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--accent-ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.m-section__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.024em;
  line-height: 1.12;
  margin: 0 0 18px;
  color: var(--ink);
}
.m-section__body {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 28px;
}

/* ============================================================
   SHOT — illustrated screenshots
   ============================================================ */

.m-shot {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
  position: relative;
}

.m-shot--patient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  display: grid;
  place-items: center;
}
.m-shot--clinician,
.m-shot--measure {
  background: linear-gradient(180deg, #1a1d23 0%, #0a0c10 100%);
  padding: 24px;
  display: grid;
  place-items: center;
}
.m-shot--clinician svg,
.m-shot--measure svg { width: 85%; height: 85%; }
.m-shot__tag {
  position: absolute;
  bottom: 18px; right: 18px;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-sm);
}

/* Phone mock inside the patient shot */
.m-mini {
  width: 240px;
  padding: 14px;
  background: var(--surface);
  border-radius: 36px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.24), 0 0 0 9px rgba(0, 0, 0, 0.3);
  aspect-ratio: 9 / 19.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.m-mini__title {
  font-size: 22px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.015em;
  padding: 10px 6px 0;
}
.m-mini__hero {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-mini__hero small {
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.75;
  font-weight: var(--weight-semibold);
}
.m-mini__hero strong {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}
.m-mini__slider {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  margin-top: 4px;
}
.m-mini__thumb {
  position: absolute;
  left: 42%;
  top: -6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.m-mini__row {
  display: flex;
  justify-content: space-between;
  padding: 10px 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.m-mini__trend {
  color: var(--success);
  font-weight: var(--weight-semibold);
  font-size: 14px;
}

/* ============================================================
   STATS BAND
   ============================================================ */

.m-stats {
  padding: 80px var(--s-5, 20px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.m-stats__grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: center;
}
.m-stats__big {
  display: block;
  font-size: clamp(40px, 5vw, 56px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.024em;
  line-height: 1;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}
.m-stats__label {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.55;
  margin: 14px auto 0;
  max-width: 280px;
}

@media (max-width: 720px) {
  .m-stats__grid { grid-template-columns: 1fr; gap: 32px; }
  .m-stats { padding: 48px var(--s-4, 16px); }
}

/* ============================================================
   FINAL CTA
   ============================================================ */

.m-cta {
  padding: 96px var(--s-5, 20px);
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}
.m-cta__title {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.026em;
  line-height: 1.12;
  color: var(--ink);
  margin: 0;
}
.m-cta__sub {
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--muted);
  margin: 18px auto 28px;
  max-width: 600px;
}
.m-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

/* ============================================================
   FOOTER
   ============================================================ */

.m-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 56px var(--s-5, 20px) 32px;
}
.m-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.m-footer__about p {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.6;
  margin: 14px 0 0;
  max-width: 340px;
}
.m-footer__col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m-footer__col a {
  display: block;
  padding: 4px 0;
  font-size: var(--text-base);
  color: var(--muted);
  transition: color var(--dur-fast, 150ms) var(--ease-default, ease);
}
.m-footer__col a:hover { color: var(--ink); }

.m-footer__head {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--subtle, #86868b);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.m-footer__bottom {
  max-width: 1120px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--text-sm);
  color: var(--subtle, #86868b);
}

@media (max-width: 760px) {
  .m-footer__inner { grid-template-columns: 1fr 1fr; }
  .m-footer__about { grid-column: 1 / -1; }
  .m-footer__bottom { flex-direction: column; }
}

/* ============================================================
   Phase 5 polish — 400px / narrow-mobile refinements
   The 720px breakpoint took care of most tablet issues, but the
   hero headline, actions, and footer columns still feel tight
   on iPhone SE / small Android widths. Tightens those without
   disrupting the 720px layout.
   ============================================================ */

@media (max-width: 420px) {
  .m-hero {
    padding: 48px var(--s-4, 16px) 32px;
  }
  .m-hero__headline {
    font-size: clamp(36px, 10vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.025em;
  }
  .m-hero__sub {
    font-size: 16px;
    margin-top: 14px;
  }
  .m-hero__actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
    align-items: stretch;
  }
  .m-hero__actions .m-btn--lg {
    width: 100%;
    min-width: 0;
  }
  .m-hero__frame { margin-top: 40px; }

  .m-section  { padding: 48px var(--s-4, 16px); }
  .m-section__title { font-size: 24px; }
  .m-section__body  { font-size: 16px; }

  .m-cta { padding: 64px var(--s-4, 16px); }
  .m-cta__title { font-size: 28px; }
  .m-cta__actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .m-cta__actions .m-btn--lg { width: 100%; }
}

@media (max-width: 520px) {
  .m-footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .m-footer__about { grid-column: auto; }
  .m-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

