/* Repzo — shared styles. Brand mirrors the mobile app's `midnight` theme
   (mobile/src/theme/themes.ts). No JS anywhere: the CSP in _headers sets
   script-src 'none', so every interaction here is pure CSS. */

:root {
  /* brand — 1:1 with THEMES.midnight */
  --bg: #0b0f14;
  --surface: #151b23;
  --surface-alt: #1f2630;
  --text: #f5f7fa;
  --text-muted: #9aa7b4;
  --border: #2a323d;
  --accent: #22c55e;
  --accent-soft: #4ade80;
  --accent-text: #06210f;
  --danger: #ef4444;
  --warn: #f59e0b;

  --maxw: 1120px;
  --radius: 18px;
  --radius-sm: 12px;

  --glow: 0 0 0 1px rgba(34, 197, 94, .18), 0 18px 50px -18px rgba(34, 197, 94, .45);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .9);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* sticky header shouldn't cover anchor targets */
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 50;
}
.skip-link:focus { left: 16px; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 20, .72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav a {
  color: var(--text-muted);
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); text-decoration: none; }
.nav a.btn { color: var(--accent-text); }
.nav a.btn:hover { background: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s var(--ease), filter .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover {
  filter: brightness(1.07);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -12px rgba(34, 197, 94, .7);
}
.btn:active { transform: translateY(0); }
.btn.secondary {
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.secondary:hover { background: rgba(255, 255, 255, .08); box-shadow: none; }

/* ---------- eyebrow pill ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent-soft);
  background: rgba(34, 197, 94, .1);
  border: 1px solid rgba(34, 197, 94, .25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 84px;
  overflow: hidden;
}
/* soft accent glow + faint grid, both decorative */
.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: 900px;
  height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(34, 197, 94, .16), transparent 62%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000, transparent 75%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.04;
  margin: 0 0 20px;
  letter-spacing: -.03em;
  font-weight: 750;
}
.grad {
  background: linear-gradient(110deg, var(--accent), var(--accent-soft) 60%, #a7f3d0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 0 30px;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-note { margin-top: 16px; font-size: 13.5px; color: var(--text-muted); }

/* ---------- phone mockup (pure CSS + inline SVG) ---------- */
.phone-stage { display: grid; place-items: center; }
.phone {
  position: relative;
  width: 280px;
  aspect-ratio: 9 / 19.5;
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(160deg, #2c3542, #11161d);
  box-shadow: var(--shadow), var(--glow);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  50% { transform: translateY(-12px); }
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 35px;
  overflow: hidden;
  background: linear-gradient(180deg, #1b2430, #0d1219 60%, #0a0e13);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 14px 14px;
}
.notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 20px;
  border-radius: 999px;
  background: #05080c;
}
/* the skeleton fills the middle of the "camera feed" */
.phone-figure {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: .95;
}
.phone-figure svg { width: 78%; height: auto; }
.joint { fill: var(--accent); }
.bone { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; fill: none; opacity: .85; }
.bone.scan { animation: trace 3s var(--ease) infinite; }
@keyframes trace {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

.hud {
  position: relative;
  display: flex;
  gap: 6px;
  align-items: center;
  align-self: flex-start;
  background: rgba(10, 14, 19, .78);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.hud .count { color: var(--accent); font-size: 15px; }

.hud-card {
  position: relative;
  background: rgba(21, 27, 35, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
  display: grid;
  gap: 7px;
}
.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #d8dee6;
}
.hud-row .mark {
  width: 16px;
  height: 16px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
.mark.ok { background: rgba(34, 197, 94, .18); color: var(--accent); }
.mark.warn { background: rgba(245, 158, 11, .18); color: var(--warn); }
.hud-row .val { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------- stat strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 72px;
}
.stat { background: var(--bg); padding: 26px 20px; text-align: center; }
.stat b {
  display: block;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--text);
}
.stat span { font-size: 13.5px; color: var(--text-muted); }

/* ---------- sections ---------- */
.section { padding: 84px 0; }
.section.alt {
  background: linear-gradient(180deg, transparent, rgba(31, 38, 48, .5) 12%, rgba(31, 38, 48, .5) 88%, transparent);
}
.section h2 {
  font-size: clamp(27px, 3.6vw, 40px);
  text-align: center;
  margin: 0 0 14px;
  letter-spacing: -.03em;
  font-weight: 720;
}
.section .sub {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 52px;
  font-size: 17px;
}

/* ---------- cards ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), rgba(21, 27, 35, .55));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 197, 94, .38);
  box-shadow: 0 20px 44px -26px rgba(34, 197, 94, .6);
}
.card .ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .2);
  margin-bottom: 18px;
  font-weight: 700;
  color: var(--accent);
}
.card h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* numbered step cards share .card but get a connecting rail on desktop */
.steps .card .ico { font-size: 18px; }

/* ---------- exercise marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 6px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee + .marquee { margin-top: 12px; }
.marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: slide 46s linear infinite;
}
.marquee.reverse .marquee-track { animation-direction: reverse; }
@keyframes slide {
  to { transform: translateX(-50%); }
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14.5px;
  white-space: nowrap;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- split feature (privacy) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split h2 { text-align: left; margin-bottom: 16px; }
.split .sub { text-align: left; margin: 0 0 24px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 15.5px;
}
.checklist svg { flex: none; margin-top: 3px; }
.checklist b { color: var(--text); font-weight: 600; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(34, 197, 94, .25);
  border-radius: 28px;
  padding: 60px 28px;
  background:
    radial-gradient(ellipse 70% 130% at 50% 0%, rgba(34, 197, 94, .16), transparent 70%),
    var(--surface);
}
.cta-band h2 { margin-bottom: 12px; }
.cta-band .cta-row { justify-content: center; }

/* ---------- signup form ---------- */
.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;
}
/* honeypot — off-screen rather than display:none, which some bots skip */
.hp {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.signup {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 520px;
  margin: 0 auto;
}
.signup input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  background: rgba(11, 15, 20, .7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 13px 20px;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.signup input[type="email"]::placeholder { color: var(--text-muted); }
.signup input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}
/* only scold once they've actually typed something wrong */
.signup input[type="email"]:not(:placeholder-shown):invalid {
  border-color: var(--danger);
}
.signup .btn { flex: 0 0 auto; }

/* ---------- store badges ---------- */
.store-badges { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 14px;
  cursor: default;
}
.badge small { display: block; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.badge strong { font-size: 15px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-footer .links { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- legal / doc pages ---------- */
.doc { padding: 64px 0 80px; }
.doc .wrap { max-width: 780px; }
.doc h1 { font-size: clamp(30px, 5vw, 42px); margin: 0 0 8px; letter-spacing: -.03em; }
.doc .meta { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.doc h2 { font-size: 22px; margin: 40px 0 12px; letter-spacing: -.01em; }
.doc h3 { font-size: 17px; margin: 24px 0 8px; }
.doc p, .doc li { color: #d8dee6; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.notice {
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #f3b6b6;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin: 24px 0;
}
.placeholder {
  background: rgba(34, 197, 94, .12);
  border-bottom: 1px dashed var(--accent);
  padding: 0 4px;
  border-radius: 3px;
}
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 24px 0 8px;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc ul { margin: 0; padding-left: 20px; }
.toc a { color: var(--text-muted); }

/* ---------- faq (CSS-only accordion) ---------- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 20px;
  margin-bottom: 12px;
  transition: border-color .2s var(--ease);
}
.faq details[open] { border-color: rgba(34, 197, 94, .32); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 16px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-left: auto;
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  transition: transform .2s var(--ease);
}
.faq details[open] summary::after { content: "\2212"; }
.faq p { color: var(--text-muted); margin: 0 0 16px; }

/* ---------- scroll reveal (progressive; no JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 26%;
    }
    @keyframes reveal-in {
      from { opacity: 0; transform: translateY(22px); }
      to { opacity: 1; transform: none; }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .hero p.lead { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split h2, .split .sub { text-align: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .features { grid-template-columns: 1fr; }
  .nav a:not(.btn) { display: none; }
  .hero { padding: 56px 0 60px; }
  .phone { width: 244px; }
  .cta-band { padding: 44px 20px; border-radius: 22px; }
}
