/* ======================================================
   At Last Health · Brand stylesheet
   Light mode = marketing; Dark mode = product
   ====================================================== */

:root {
  /* Light mode (marketing) */
  --bg: #F4F5F1;
  --bg-card: #FFFFFF;
  --bg-stone: #E8EBE6;
  --bg-stone-deep: #DDE2DA;
  --ink: #14161D;
  --ink-muted: #5C6068;
  --ink-soft: #8C9094;
  --green: #2D5A3F;
  --green-bright: #5BAA7F;
  --green-pale: #E5EBE5;
  --border: #D8DCD3;
  --border-strong: #C8CDC2;
  --danger: #A33A2A;
  --warning: #B27A1F;

  /* Dark mode (product) — softened for approachability */
  --d-bg: #1F2522;
  --d-bg-elev: #272E2A;
  --d-bg-card: #2D3530;
  --d-bg-stone: #2F3631;
  --d-ink: #E8EAE3;
  --d-ink-muted: #A8B0AA;
  --d-ink-soft: #828A85;
  --d-border: #3A4239;
  --d-border-strong: #454D44;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', monospace;

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;

  /* Shadows (used very sparingly) */
  --shadow-card: 0 1px 2px rgba(20, 22, 29, 0.04);
  --shadow-pop: 0 8px 32px rgba(20, 22, 29, 0.08);

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 920px;
}

/* ======================================================
   Reset and base
   ====================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  letter-spacing: -0.005em;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, button, select { font-family: inherit; }

/* Body class toggles */
body.dark {
  background: var(--d-bg);
  color: var(--d-ink);
}

/* ======================================================
   Typography
   ====================================================== */

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: inherit;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 500;
}
body.dark .eyebrow { color: var(--green-bright); }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted { color: var(--ink-muted); }
body.dark .muted { color: var(--d-ink-muted); }

/* Display sizes */
.h-display {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 500;
}
.h-1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 500;
}
.h-2 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 500;
}
.h-3 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 500;
}

.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--ink-muted);
}
body.dark .lead { color: var(--d-ink-muted); }

/* ======================================================
   Layout primitives
   ====================================================== */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) {
  .container, .container-narrow { padding: 0 20px; }
}

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.section-lg { padding: 128px 0; }
@media (max-width: 768px) {
  .section { padding: 64px 0; }
  .section-lg { padding: 80px 0; }
}

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 24px; } .gap-6 { gap: 32px; }

/* ======================================================
   Wordmark — brand lock-up (wb system)
   ====================================================== */

/* New brand-compliant wordmark lock-up */
.wordmark-b {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  text-decoration: none;
  gap: 3px;
}
.wb-top {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.wb-at   { color: var(--green); }
.wb-last { color: var(--ink); }
.wb-rule {
  height: 1.5px;
  background: var(--green);
  border-radius: 1px;
}
.wb-sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
/* Dark variant */
.wb-dark .wb-last { color: var(--d-ink); }
.wb-dark .wb-at   { color: var(--green-bright); }
.wb-dark .wb-rule { background: var(--green-bright); }
.wb-dark .wb-sub  { color: var(--d-ink-muted); }
/* Size scale */
.wb-sm .wb-top { font-size: 15px; }
.wb-sm .wb-sub { font-size: 7px; }
.wb-sm         { gap: 2px; }
.wb-lg .wb-top { font-size: 28px; }
.wb-lg .wb-sub { font-size: 10px; }
.wb-lg         { gap: 4px; }
.wb-xl .wb-top { font-size: 36px; }
.wb-xl .wb-sub { font-size: 11px; }
.wb-xl         { gap: 5px; }

/* Legacy single-line wordmark (kept for fallback) */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark .dot { color: var(--green); }
body.dark .wordmark { color: var(--d-ink); }
body.dark .wordmark .dot { color: var(--green-bright); }
.wordmark-sm { font-size: 16px; }
.wordmark-lg { font-size: 32px; }

/* Standalone signature dot */
.sig-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
}
body.dark .sig-dot { background: var(--green-bright); }

/* ======================================================
   Buttons
   ====================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--r-sm);
  border: 0.5px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease, color 120ms ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-primary:hover { background: var(--green-deep); }

/* Ink button — use when green CTA would clash with a green surface */
.btn-ink {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn-ink:hover { background: #000; }

/* Alias kept for backward compat */
.btn-green {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-green:hover { background: var(--green-deep); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-stone); }

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  padding: 12px 12px;
}
.btn-ghost:hover { color: var(--ink); }

.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn .arrow { display: inline-block; transition: transform 160ms ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* Dark-mode buttons */
body.dark .btn-primary {
  background: var(--green-bright);
  color: var(--d-bg);
  border-color: var(--green-bright);
}
body.dark .btn-primary:hover { background: #6FBB91; }
body.dark .btn-secondary {
  background: transparent;
  color: var(--d-ink-muted);
  border-color: var(--d-border-strong);
}
body.dark .btn-secondary:hover { background: var(--d-bg-elev); color: var(--d-ink); }

/* ======================================================
   Cards
   ====================================================== */

.card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.card-stone {
  background: var(--bg-stone);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.card-dark {
  background: var(--d-bg-elev);
  border: 0.5px solid var(--d-border);
  border-radius: var(--r-lg);
  padding: 28px;
  color: var(--d-ink);
}

body.dark .card {
  background: var(--d-bg-card);
  border-color: var(--d-border);
  color: var(--d-ink);
}
body.dark .card-stone {
  background: var(--d-bg-stone);
  border-color: var(--d-border);
  color: var(--d-ink);
}

/* ======================================================
   Marketing header / nav
   ====================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 245, 241, 0.85);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 0.5px solid var(--border);
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-header nav a {
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 500;
  transition: color 120ms ease;
}
.site-header nav a:hover { color: var(--ink); }
.header-cta { display: flex; align-items: center; gap: 12px; }

@media (max-width: 760px) {
  .site-header nav { display: none; }
}

/* ======================================================
   Marketing footer
   ====================================================== */

.site-footer {
  border-top: 0.5px solid var(--border);
  padding: 64px 0 48px;
  background: var(--bg);
}
.site-footer .row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 760px) {
  .site-footer .row { grid-template-columns: 1fr 1fr; gap: 32px; }
}
.site-footer h5 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 16px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a {
  font-size: 14px;
  color: var(--ink-muted);
}
.site-footer a:hover { color: var(--ink); }
.site-footer .legal {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 0.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ======================================================
   Hero
   ====================================================== */

.hero {
  padding: 48px 0 64px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}
.hero h1 { margin-bottom: 24px; }
.hero p.lead { margin: 0 0 32px; max-width: 540px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero app UI frame */
.hero-visual {
  position: relative;
  background: var(--d-bg);
  border-radius: var(--r-xl);
  border: 0.5px solid var(--d-border);
  color: var(--d-ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}

/* ======================================================
   Stat strip
   ====================================================== */

.stat-strip {
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
}
.stat-strip .row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 32px 0;
}
@media (max-width: 880px) {
  .stat-strip .row { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
.stat-strip .stat {
  border-left: 0.5px solid var(--border);
  padding: 8px 24px;
}
.stat-strip .stat:first-child { border-left: none; }
@media (max-width: 880px) {
  .stat-strip .stat { border-left: none; padding: 8px 0; }
}
.stat-strip .num {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.stat-strip .num .unit {
  font-size: 16px;
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 2px;
}
.stat-strip .label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ======================================================
   Pillar / mechanism cards
   ====================================================== */

.pillar {
  padding: 32px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
}
.pillar .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--green);
  margin-bottom: 20px;
}
.pillar .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--green-pale);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.pillar h3 { margin-bottom: 12px; }
.pillar p { color: var(--ink-muted); margin: 0; line-height: 1.55; font-size: 15px; }

/* ======================================================
   Timeline
   ====================================================== */

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--border);
  z-index: 0;
}
@media (max-width: 880px) {
  .timeline { grid-template-columns: 1fr; gap: 24px; }
  .timeline::before { display: none; }
}
.timeline .step { position: relative; }
.timeline .dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 0.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.04em;
}
.timeline .step.active .dot {
  background: var(--green);
  color: var(--bg);
  border-color: var(--green);
}
.timeline .label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
  font-weight: 500;
}
.timeline h4 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.timeline p {
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ======================================================
   Buyer tabs (B2B section)
   ====================================================== */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-stone);
  border-radius: var(--r-md);
  width: fit-content;
  margin-bottom: 32px;
}
.tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 120ms ease;
}
.tab.active {
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.tab:hover:not(.active) { color: var(--ink); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 240ms ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======================================================
   FAQ
   ====================================================== */

.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item {
  border-top: 0.5px solid var(--border);
  padding: 24px 0;
}
.faq-item:last-child { border-bottom: 0.5px solid var(--border); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.faq-q .chev {
  color: var(--ink-muted);
  transition: transform 200ms ease;
  font-size: 20px;
  line-height: 1;
}
.faq-item.open .faq-q .chev { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  color: var(--ink-muted);
  line-height: 1.6;
  font-size: 15px;
  transition: max-height 280ms ease, margin 280ms ease;
}
.faq-item.open .faq-a {
  max-height: 320px;
  margin-top: 16px;
}

/* ======================================================
   Final CTA band
   ====================================================== */

/* On the dark CTA band, primary CTA uses Bright green per brand guide */
.cta-band .btn-primary {
  background: var(--green-bright);
  border-color: var(--green-bright);
  color: var(--d-bg);
}
.cta-band .btn-primary:hover {
  background: #6FBB91;
  border-color: #6FBB91;
}

.cta-band {
  background: var(--d-bg);
  color: var(--d-ink);
  border-radius: var(--r-xl);
  padding: 80px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
@media (max-width: 760px) { .cta-band { padding: 56px 32px; } }

.cta-band h2 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.cta-band p {
  font-size: 17px;
  color: var(--d-ink-muted);
  max-width: 540px;
  margin: 0 auto 32px;
}

/* ======================================================
   Pilot outcome cards
   ====================================================== */

.outcome {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.outcome .num {
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 10px;
}
.outcome .num.green { color: var(--green); }
.outcome .num .unit {
  font-size: 18px;
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 2px;
}
.outcome .label {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.5;
}
.outcome .micro {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ======================================================
   Forms
   ====================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.field label {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--bg-card);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45, 90, 63, 0.12);
}
body.dark .input, body.dark .select, body.dark .textarea {
  background: var(--d-bg-card);
  border-color: var(--d-border-strong);
  color: var(--d-ink);
}
body.dark .input:focus, body.dark .select:focus, body.dark .textarea:focus {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(91, 170, 127, 0.18);
}

/* ======================================================
   Utilities
   ====================================================== */

.divider { height: 0.5px; background: var(--border); border: none; margin: 0; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; } .mb-5 { margin-bottom: 48px; }
.max-prose { max-width: 720px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Pill / badge */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: var(--green-pale);
  color: var(--green);
  border-radius: 999px;
}
.pill .dot-mini {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}

/* Subtle micro-label, used throughout */
.micro {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
body.dark .micro { color: var(--d-ink-soft); }

/* Inline source citation, sits within body copy */
.src {
  font-size: 0.82em;
  color: var(--ink-soft);
  white-space: nowrap;
}
