/* ===== ReSync — landing page styles =====
   Palette matches the app's "Warm Sunrise" system (resync_health_app/theme/colors.ts):
   Sol (amber sun) carries primary actions and key numbers; Luna (violet moon) carries
   the UI accents; the canvas is the app's deep plum night. Site and app should feel
   like the same product. */

:root {
  /* Dark theme = default (Warm Sunrise night) */
  --bg: #191225;         /* app canvas */
  --bg-alt: #221a38;     /* app bgTop */
  --surface: #231b3a;    /* app card */
  --surface-2: #2c2148;  /* app cardAlt */
  --text: #f4ede6;
  --text-dim: rgba(244, 237, 230, 0.62);
  --text-mute: rgba(244, 237, 230, 0.5);
  --brand: #a99cf0;      /* Luna — accents, eyebrows, links */
  --brand-strong: #6c62c4;
  --accent: #f5a623;     /* Sol — CTAs, stat numbers */
  --accent-ink: #2a1802; /* text on Sol */
  --border: rgba(244, 237, 230, 0.16);
  --hairline: rgba(244, 237, 230, 0.1);
  --radius: 16px;
  --radius-lg: 20px;
  --maxw: 1080px;
  /* System stack only — no webfont, so nothing is fetched off a CDN. */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbf7f2;         /* warm off-white */
    --bg-alt: #f3ecfa;
    --surface: #ffffff;
    --text: #241b3d;
    --text-dim: #5f5578;
    --text-mute: #7b7292;
    --brand: #5b4bc4;      /* Luna, darkened for contrast on light */
    --brand-strong: #3a2f8a;
    --accent: #b26200;     /* Sol, darkened for contrast on light */
    --accent-ink: #ffffff;
    --border: rgba(36, 27, 61, 0.14);
    --hairline: rgba(36, 27, 61, 0.08);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;   /* clears the sticky header when jumping to a section */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.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;
}

a { color: var(--brand); }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--hairline);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; flex: 0 0 auto; }
.logo-mark {
  display: inline-flex;
  width: 28px; height: 28px;
  line-height: 0;
  flex: 0 0 auto;
}
.logo-mark img { width: 100%; height: 100%; display: block; }
.logo-text { font-size: 1.1rem; letter-spacing: -0.02em; }

.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--text-dim); text-decoration: none; font-size: 0.92rem; white-space: nowrap; transition: color 0.15s; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); }
.nav a[data-nav].active::after {
  content: ""; display: block; height: 2px; border-radius: 2px;
  background: var(--brand); margin-top: 3px;
}
.nav-cta {
  color: var(--accent-ink) !important; background: var(--accent);
  padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.nav-cta:hover { opacity: 0.9; }


/* ===== Buttons ===== */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  padding: 13px 24px; border-radius: 999px; font-size: 0.98rem;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.12s, opacity 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); }

/* ===== Hero ===== */
.hero {
  padding: 110px 0 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero::before {
  content: ""; position: absolute; inset: -40% 0 auto 0; height: 560px;
  /* sunrise: Sol cresting over a Luna horizon */
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(ellipse at 50% 14%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 62%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.eyebrow, .section-eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem;
  font-weight: 700; color: var(--brand); margin-bottom: 16px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 22px; }
.hero-sub { font-size: 1.12rem; color: var(--text-dim); max-width: 660px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.hero-microcopy { font-size: 0.9rem; color: var(--text-mute); }

/* the four levers the engine plans across */
.lever-strip {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin: 4px 0 22px;
}
.lever-strip li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  font-size: 0.88rem; font-weight: 500; color: var(--text-dim);
}
.lever-strip span { color: var(--accent); font-size: 0.95rem; line-height: 1; }
.scroll-cue {
  display: inline-grid; place-items: center; width: 42px; height: 42px;
  margin-top: 42px; border-radius: 50%; border: 1px solid var(--border);
  color: var(--text-dim); text-decoration: none; font-size: 1.1rem;
  animation: bob 1.8s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--brand); border-color: var(--brand); }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { animation: none; } html { scroll-behavior: auto; } }

/* ===== Sections ===== */
/* Sections size to their content — the copy is now dense enough that forcing every
   section to a full viewport would clip it on laptops. */
.section { padding: 96px 0; scroll-margin-top: 84px; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 18px; max-width: 780px; }
.section-lead { font-size: 1.08rem; color: var(--text-dim); max-width: 700px; margin-bottom: 40px; }

/* stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  display: flex; flex-direction: column;
}
.stat-number { display: block; font-size: 2.5rem; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 10px; }
.stat-card p { font-size: 0.95rem; color: var(--text-dim); }
.stat-source {
  margin-top: auto; padding-top: 14px;
  font-size: 0.78rem !important; color: var(--text-mute) !important;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* who it's for */
.who-intro { margin: 44px 0 18px; color: var(--text-dim); }
.who-list { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.who-list li {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 14px 18px; font-weight: 500; font-size: 0.95rem;
}

/* how it works — numbered steps */
.step-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.step-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.step-num {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; margin-bottom: 14px;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--brand); font-weight: 700; font-size: 0.95rem;
}
.step-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.step-card p { color: var(--text-dim); font-size: 0.95rem; }
.step-note { margin-top: 24px; color: var(--text-dim); font-size: 0.98rem; }

/* features / why */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.feature-icon { font-size: 1.8rem; color: var(--brand); display: block; margin-bottom: 14px; line-height: 1; }
.feature-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 0.95rem; }

/* the short "what it's built on" note that replaced the science section */
.disclaimer {
  margin-top: 40px; padding: 20px 22px; max-width: 820px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 12px;
  color: var(--text-dim); font-size: 0.95rem;
}
.disclaimer strong { color: var(--text); }

/* demo */
/* demo — a portrait capture of the app itself, so the frame is phone-shaped rather
   than the 16/9 box the placeholder used. Source is 366x858; capped below that so it
   renders downscaled (sharp) rather than stretched. */
.demo-frame {
  margin-top: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.demo-device {
  width: min(300px, 72vw);
  border-radius: 24px;
  overflow: hidden;
  line-height: 0;                       /* kills the inline-video baseline gap */
  background: #191225;                  /* app canvas — matches the video's own bg */
  border: 1px solid var(--border);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
}
.demo-device video { width: 100%; height: auto; display: block; }
.demo-caption {
  font-size: 0.95rem; color: var(--text-dim); text-align: center; max-width: 34em;
  text-wrap: balance;
}

/* cta */
.cta-section { text-align: center; }
.cta-inner { max-width: 620px; }
.cta-section .section-lead { margin-left: auto; margin-right: auto; margin-bottom: 28px; }
/* The contact CTA is a mailto, not a form. Slightly wider padding and a tabular-ish
   feel so a bare address still reads as the primary button on the page. */
.btn-email { font-size: 1.05rem; padding: 15px 30px; }

/* footer */
.site-footer { border-top: 1px solid var(--hairline); padding: 40px 0 48px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer-meta { text-align: right; }
.footer-meta a { color: var(--brand); text-decoration: none; }
.footer-meta p { color: var(--text-dim); font-size: 0.88rem; margin-top: 4px; }
.footer-sources {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--hairline);
  color: var(--text-mute); font-size: 0.8rem; line-height: 1.7;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .stat-grid, .feature-grid, .step-list { grid-template-columns: 1fr; }
  .who-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .section { padding: 72px 0; }
  .hero { padding: 80px 0 72px; min-height: 0; }
  /* The nav scrolls sideways instead of disappearing — six sections is too many to hide. */
  .header-inner { gap: 12px; }
  .nav {
    gap: 16px; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding: 4px 0;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: 0.86rem; }
  .nav-cta { padding: 7px 13px; }
  .who-list { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-meta { text-align: center; }
}
