/* ---------- Fonts (self-hosted, SIL OFL — see assets/fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Archivo";
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/Archivo-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Archivo";
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/Archivo-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Archivo";
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/Archivo-ExtraBold.ttf") format("truetype");
}
@font-face {
  font-family: "Archivo";
  font-weight: 900;
  font-display: swap;
  src: url("assets/fonts/Archivo-Black.ttf") format("truetype");
}

/* ---------- Theme tokens ---------- */
:root,
:root[data-theme="lime"] {
  --accent: #C8F169;
  --on-accent: #10130A;
  --accent-grad-from: #8FBF3F;
  --accent-rgb: 200, 241, 105;
  --page-bg: #0B0C0F;
  --surface: #15171B;
  --text: #F4F5F2;
  --text-rgb: 244, 245, 242;
}
:root[data-theme="punch"] {
  --accent: #FF92C2;
  --on-accent: #20101A;
  --accent-grad-from: #D9689E;
  --accent-rgb: 255, 146, 194;
  --page-bg: #0B0C0F;
  --surface: #15171B;
  --text: #F4F5F2;
  --text-rgb: 244, 245, 242;
}
:root[data-theme="pulse"] {
  --accent: #7BDFF2;
  --on-accent: #08161A;
  --accent-grad-from: #4FA8BF;
  --accent-rgb: 123, 223, 242;
  --page-bg: #0B0C0F;
  --surface: #15171B;
  --text: #F4F5F2;
  --text-rgb: 244, 245, 242;
}
:root[data-theme="ember"] {
  --accent: #FFC65C;
  --on-accent: #1A1206;
  --accent-grad-from: #D99A36;
  --accent-rgb: 255, 198, 92;
  --page-bg: #0B0C0F;
  --surface: #15171B;
  --text: #F4F5F2;
  --text-rgb: 244, 245, 242;
}
:root[data-theme="glacier"] {
  --accent: #0E6BA8;
  --on-accent: #F2F9FF;
  --accent-grad-from: #3D8FC4;
  --accent-rgb: 14, 107, 168;
  --page-bg: #F0F4F7;
  --surface: #FFFFFF;
  --text: #101A22;
  --text-rgb: 16, 26, 34;
}

:root {
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --accent-faint: rgba(var(--accent-rgb), 0.10);
  --accent-line: rgba(var(--accent-rgb), 0.55);
  --accent-glow: rgba(var(--accent-rgb), 0.5);
  --accent-gradient: linear-gradient(to right, var(--accent-grad-from), var(--accent));
  --display: "Archivo", -apple-system, system-ui, sans-serif;
  --phone-tilt: -8deg;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.page { min-height: 100vh; overflow: hidden; }
.section { max-width: 1160px; margin: 0 auto; padding: 90px 32px 30px; }

/* Themed surfaces fade when the accent changes */
.pill-cta, .store-btn, .log-btn, .price-cta, .screen-card, .feature-card,
.mini-card, .widgets-banner, .phone-screen, .streak-pill, .delta-pill,
.theme-tile, .goal-fill, .goal-knob, .swatch {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.accent-stroke { stroke: var(--accent); transition: stroke 0.35s ease; }
.accent-fill { fill: var(--accent); transition: fill 0.35s ease; }
.on-accent-stroke { stroke: var(--on-accent); }
.on-accent-fill { fill: var(--on-accent); }
.noise-stroke { stroke: rgba(var(--text-rgb), 0.22); }
.spark-stop { stop-color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: relative;
  z-index: 3;
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.runner { display: block; height: auto; }
.wordmark { font-family: var(--display); font-weight: 900; font-size: 16px; letter-spacing: 0.16em; }
.wordmark.small { font-size: 14px; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link { font-size: 14px; font-weight: 600; color: rgba(var(--text-rgb), 0.65); }
.nav-link:hover { color: var(--text); }
.pill-cta {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
}
.pill-cta:hover { filter: brightness(1.08); color: var(--on-accent); }

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero-slope {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 560px;
  pointer-events: none;
}
.slope-faint { stroke: var(--accent-faint); transition: stroke 0.35s ease; }
.slope-line { stroke: var(--accent-line); transition: stroke 0.35s ease; }
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 32px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  justify-content: center;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 60px;
  flex: 1 1 480px;
  min-width: min(420px, 100%);
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(52px, 6.5vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.hero-sub { font-size: 20px; line-height: 1.55; color: rgba(var(--text-rgb), 0.6); max-width: 460px; }
.hero-cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: var(--page-bg);
  border-radius: 14px;
  padding: 14px 24px;
  font-size: 17px;
  font-weight: 700;
}
.store-btn:hover { filter: brightness(1.1); color: var(--page-bg); }
.store-btn .apple-mark { fill: var(--page-bg); transition: fill 0.35s ease; }
.hero-note { font-size: 14px; color: rgba(var(--text-rgb), 0.45); }

/* Phone mock */
.phone-wrap { transform: rotate(var(--phone-tilt)); transform-origin: center; }
.phone {
  width: 380px;
  height: 780px;
  border-radius: 56px;
  background: var(--surface);
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.65), 0 0 0 10px #1D2025, 0 0 0 12px #0e0f12;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}
.phone-screen {
  height: 100%;
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  padding: 58px 22px 0;
}
.dynamic-island {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  border-radius: 16px;
  background: #000;
}
.screen-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.screen-date {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(var(--text-rgb), 0.5);
}
.streak-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
}
.streak-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.weight-row { display: flex; align-items: baseline; gap: 9px; }
.weight-big {
  font-family: var(--display);
  font-weight: 800;
  font-size: 68px;
  letter-spacing: -0.035em;
  line-height: 1;
}
.weight-unit { font-family: var(--display); font-weight: 600; font-size: 18px; color: rgba(var(--text-rgb), 0.45); }
.delta-row { display: flex; align-items: center; gap: 8px; margin: 9px 0 20px; }
.delta-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.delta-time { font-size: 12px; color: rgba(var(--text-rgb), 0.45); }
.screen-card { background: var(--surface); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
.goal-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(var(--text-rgb), 0.45);
  margin-bottom: 9px;
}
.goal-status { color: var(--accent); font-weight: 700; }
.goal-track { position: relative; height: 7px; border-radius: 4px; background: rgba(var(--text-rgb), 0.1); }
.goal-track.thick { height: 8px; }
.goal-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent-gradient); }
.goal-knob {
  position: absolute;
  top: -3px;
  width: 13px;
  height: 13px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface);
}
.goal-track.thick .goal-knob { width: 14px; height: 14px; margin-left: -7px; }
.chart-card { padding-bottom: 10px; margin-bottom: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.chart-title { font-size: 12px; font-weight: 600; color: rgba(var(--text-rgb), 0.55); }
.chart-avg { font-size: 12px; color: rgba(var(--text-rgb), 0.45); }
.chart-avg strong { color: var(--text); font-weight: 600; }
.sparkline { width: 100%; display: block; }
.log-btn {
  height: 52px;
  border-radius: 26px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}

/* ---------- Sections ---------- */
.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.section-sub { font-size: 18px; color: rgba(var(--text-rgb), 0.55); max-width: 560px; margin-bottom: 44px; }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-grid.small { margin-top: 20px; }
.feature-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.feature-visual { height: 64px; }
.goal-visual { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.goal-visual .goal-labels { font-weight: 600; margin-bottom: 0; }
.ruler-visual { position: relative; height: 64px; margin: 0 -28px; }
.ruler-minor {
  position: absolute;
  left: 0; right: 0; top: 14px;
  height: 26px;
  background: repeating-linear-gradient(to right, rgba(var(--text-rgb), 0.16) 0 2px, transparent 2px 12px);
}
.ruler-major {
  position: absolute;
  left: 0; right: 0; top: 14px;
  height: 40px;
  background: repeating-linear-gradient(to right, rgba(var(--text-rgb), 0.3) 0 2px, transparent 2px 60px);
}
.ruler-needle {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 3px;
  height: 52px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.ruler-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--surface) 0%, transparent 20%, transparent 80%, var(--surface) 100%);
}
.feature-title { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; }
.feature-body { font-size: 15px; line-height: 1.55; color: rgba(var(--text-rgb), 0.55); }
.mini-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.mini-card svg { flex: none; }
.mini-title { font-weight: 700; font-size: 16px; margin-bottom: 3px; }
.mini-body { font-size: 14px; line-height: 1.45; color: rgba(var(--text-rgb), 0.5); }

/* ---------- Theming ---------- */
.theming-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}
.theming-head .section-sub { max-width: 520px; margin-bottom: 0; }
.swatch-row { display: flex; gap: 14px; }
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
}
.swatch.selected { box-shadow: 0 0 0 3px var(--page-bg), 0 0 0 5px var(--swatch-accent); }
.tile-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.theme-tile {
  border-radius: 20px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(var(--text-rgb), 0.12);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.theme-tile.selected { border-color: var(--tile-accent); }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-name { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; }
.tile-dot { width: 10px; height: 10px; border-radius: 50%; }
.tile-weight { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.03em; }
.tile-btn {
  height: 30px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Widgets ---------- */
.widgets-banner {
  background: var(--accent);
  border-radius: 32px;
  padding: 56px 56px 64px;
  color: var(--on-accent);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}
.section-title.on-accent { color: var(--on-accent); }
.widgets-sub { font-size: 18px; line-height: 1.55; color: color-mix(in srgb, var(--on-accent) 70%, transparent); max-width: 420px; }
.widget-row { display: flex; gap: 16px; align-items: center; }
.widget {
  width: 150px;
  height: 150px;
  border-radius: 26px;
  background: #101216;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  padding: 15px;
  display: flex;
  flex-direction: column;
  color: #F5F5F3;
}
.widget.centered { align-items: center; justify-content: center; gap: 6px; padding: 0; }
.widget-top { display: flex; justify-content: space-between; align-items: center; }
.widget-label { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; color: rgba(245, 245, 243, 0.45); }
.widget-weight { font-family: var(--display); font-weight: 800; font-size: 27px; letter-spacing: -0.03em; margin-top: 5px; }
.widget-delta { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 10px; font-weight: 700; color: var(--accent); }
.widget-spacer { flex: 1; }
.widget-pct {
  font-family: var(--display);
  font-weight: 900;
  font-size: 44px;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(to top, var(--accent) 0%, var(--accent) 66%, rgba(245, 245, 243, 0.14) 66%, rgba(245, 245, 243, 0.14) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.widget-pct-label { font-size: 8px; font-weight: 700; letter-spacing: 0.08em; color: rgba(245, 245, 243, 0.45); }
.widget-pct-left { font-size: 10px; font-weight: 700; color: var(--accent); }

/* ---------- Pricing ---------- */
.pricing { max-width: 1160px; margin: 0 auto; padding: 110px 32px; text-align: center; }
.price {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(64px, 12vw, 96px);
  letter-spacing: -0.04em;
  line-height: 1;
}
.price-once { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; margin-top: 14px; }
.price-sub { font-size: 17px; line-height: 1.6; color: rgba(var(--text-rgb), 0.55); max-width: 440px; margin: 16px auto 34px; }
.price-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 16px;
  padding: 16px 30px;
  font-size: 18px;
  font-weight: 700;
}
.price-cta:hover { filter: brightness(1.08); color: var(--on-accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid rgba(var(--text-rgb), 0.08); }
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.tagline { font-size: 13px; color: rgba(var(--text-rgb), 0.4); margin-left: 8px; }
.footer-links { display: flex; gap: 28px; font-size: 13px; }
.footer-links a { color: rgba(var(--text-rgb), 0.5); }
.footer-links a:hover { color: var(--text); }
.copyright { font-size: 13px; color: rgba(var(--text-rgb), 0.35); }

/* ---------- Subpages (privacy, support) ---------- */
.subpage { max-width: 760px; margin: 0 auto; padding: 48px 32px 90px; }
.subpage-title {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(40px, 6vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 10px;
}
.subpage-meta { font-size: 14px; color: rgba(var(--text-rgb), 0.45); margin-bottom: 40px; }
.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
}
.prose p, .prose li { font-size: 16px; line-height: 1.65; color: rgba(var(--text-rgb), 0.7); }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); font-weight: 700; }
.prose a { font-weight: 600; }
.callout {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 24px;
  margin: 0 0 14px;
}
.callout p { margin: 0; }
.contact-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 30px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 44px;
}
.contact-card .mini-title { font-size: 18px; }
.contact-card .mini-body { margin-top: 4px; }
.faq-item { border-bottom: 1px solid rgba(var(--text-rgb), 0.08); padding: 6px 0; }
.faq-item summary {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  color: var(--accent);
  flex: none;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0 0 18px; font-size: 15px; line-height: 1.65; color: rgba(var(--text-rgb), 0.65); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .widgets-banner { grid-template-columns: 1fr; padding: 40px 32px 48px; }
  .widget-row { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .nav-link { display: none; }
  .section { padding: 64px 20px 24px; }
  .hero-inner { padding: 48px 20px 24px; }
  .section-title { font-size: 34px; }
  .pricing { padding: 80px 20px; }
}
@media (max-width: 480px) {
  .phone { width: min(320px, calc(100vw - 60px)); height: 660px; border-radius: 48px; }
  .phone-screen { padding: 52px 18px 0; }
  .weight-big { font-size: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, .accent-stroke, .accent-fill { transition: none !important; }
}
