/* Colours mirror the app's asset catalogue: the page is the tertiary background, cards SurfaceCard, accent AccentColor. */
:root {
  --page: #E5DFD4;
  --card: #FFFFFF;
  /* The large feature panels sit a shade recessed into the page rather than raised on it. */
  --panel: rgba(0, 0, 0, 0.02);
  --nav: rgba(229, 223, 212, 0.78);
  --line: rgba(0, 0, 0, 0.08);
  --ink: #1A1A1A;
  --muted: #6B6862;
  --accent: #FF5E00;
  /* The brand's dark green (DarkGreen in the asset catalogue), used for the main call to action. */
  --cta: #2C7F29;
  --feed: #A173B8;
  --sleep: #E58135;
  --change: #60B8C7;
  --pump: #83C177;
  --shadow: rgba(40, 30, 10, 0.18);
  /* The gap between the page's main sections, widened on larger screens below. */
  --section-gap: 40px;
  color-scheme: light;
}
/* Black vanishes on a near-black page, so dark mode lifts the panels with a faint white instead. */
:root[data-theme="dark"] {
  --page: #0D0C0B;
  --cta: #397E36;
  --card: #2D2C28;
  --panel: rgba(255, 255, 255, 0.03);
  --nav: rgba(13, 12, 11, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --ink: #F5F5F5;
  --muted: #A19E97;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
/* Without JavaScript the theme attribute never gets set, so fall back to the system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --page: #0D0C0B; --cta: #397E36; --card: #2D2C28; --panel: rgba(255, 255, 255, 0.03);
    --nav: rgba(13, 12, 11, 0.78); --line: rgba(255, 255, 255, 0.08);
    --ink: #F5F5F5; --muted: #A19E97; --shadow: rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* Light and dark artwork are both in the page; only the one for the current theme shows. */
.only-dark { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .only-dark { display: block !important; }
  :root:not([data-theme]) .only-light { display: none !important; }
}

* { box-sizing: border-box; }
/* Every size below is in rem, so raising the root scales the whole page together. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; font-size: 112.5%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-block; line-height: 0; flex-shrink: 0; }
.brand img { height: 28px; width: auto; }
.links { display: flex; align-items: center; gap: 4px; }
.links a {
  color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 8px 10px; border-radius: 10px;
}
.links a:hover { background: var(--line); }
.links a[aria-current="page"] { color: var(--accent); }
.theme-toggle {
  display: grid; place-items: center; width: 36px; height: 36px; margin-left: 4px;
  border: 0; border-radius: 50%; background: var(--line); color: var(--ink); cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center;
  padding: 32px 0 var(--section-gap); text-align: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 6.5vw, 4rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800;
  margin: 0 0 16px;
}
.hero h1 span { color: var(--accent); }
.hero p.lede { font-size: 1.2rem; color: var(--muted); margin: 0 auto 28px; max-width: 32ch; }
.phones { position: relative; width: min(100%, 440px); margin: 0 auto; aspect-ratio: 440 / 560; }
.phones .shot { position: absolute; width: 58%; }
.phones .shot.front { left: 0; top: 0; z-index: 2; }
.phones .shot.back { right: 0; top: 9%; }
.shot img { width: 100%; filter: drop-shadow(0 24px 40px var(--shadow)); }

.cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cta); color: #FFFFFF;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
}
.support { margin: 24px 0 0; font-size: 0.9rem; color: var(--muted); }
.devices {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.devices li {
  font-size: 0.85rem; font-weight: 500; color: var(--muted);
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
}

/* Feature panels */
.feature {
  background: var(--panel); border-radius: 32px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center;
  padding: 32px 24px 0; margin-bottom: var(--section-gap); overflow: hidden;
}
.feature .copy { text-align: center; }
.feature .tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--dot); margin-bottom: 10px;
}
.feature .tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.feature h2 { font-size: clamp(1.75rem, 3.8vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 12px; }
.feature p { margin: 0 auto; color: var(--muted); font-size: 1.1rem; max-width: 36ch; }
/* The phone runs off the panel's bottom edge, as if rising out of it. */
.feature .shot { width: min(78%, 300px); margin: 0 auto -18%; }
/* The watch is shown whole, strap and all, rather than rising out of the panel like the phones. */
.feature .shot.watch { width: min(70%, 260px); margin: 0 auto 32px; }

.extras {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin: 0 0 var(--section-gap);
}
.extra { background: var(--card); border-radius: 20px; padding: 18px; }
.extra img { height: 72px; width: auto; margin-bottom: 10px; }
.extra h3 { margin: 0 0 4px; font-size: 1rem; letter-spacing: -0.02em; }
.extra p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.promise { margin: var(--section-gap) 0 48px; }
.promise img { width: min(100%, 420px); margin: 0 auto; }

.plus-badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0;
  color: #FFFFFF; background: var(--accent); padding: 3px 10px; border-radius: 999px;
}

/* Plus inverts the page's colours so it reads as its own thing: dark on light, light on dark. */
.plus {
  background: var(--ink); color: var(--page);
  border-radius: 32px; padding: 32px 24px; margin: 0 0 var(--section-gap);
}
.plus .plus-badge { margin: 0 0 12px; }
.plus-head { display: grid; gap: 20px; text-align: center; justify-items: center; }
.plus-head img { width: 150px; }
.plus-head h2 { font-size: clamp(1.75rem, 3.8vw, 2.5rem); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 12px; }
.plus-head p { margin: 0 auto; opacity: 0.72; font-size: 1.1rem; max-width: 46ch; }
.plus-grid {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
}
.plus-grid li { border: 1px solid color-mix(in srgb, var(--page) 16%, transparent); border-radius: 20px; padding: 18px 20px; }
.plus-grid h3 { margin: 0 0 4px; font-size: 1rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plus-grid p { margin: 0; font-size: 0.9rem; opacity: 0.72; }
.soon {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent);
}

.pricing {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  margin-top: 32px;
}
.price {
  border-radius: 20px; padding: 18px 20px;
  background: color-mix(in srgb, var(--page) 8%, transparent);
}
.price.best { box-shadow: inset 0 0 0 2px var(--accent); }
.price h3 { margin: 0; font-size: 0.95rem; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; opacity: 0.85; }
.price .amount { margin: 6px 0 6px; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; opacity: 1; }
.price .amount span { display: inline-block; font-size: 0.85rem; font-weight: 500; letter-spacing: 0; opacity: 0.6; margin-left: 4px; }
.price p { margin: 0; font-size: 0.88rem; opacity: 0.72; }
.price p.amount { opacity: 1; }
.plus-foot { margin: 20px 0 0; font-size: 0.9rem; opacity: 0.72; text-align: center; }

/* Long-form pages such as the privacy policy */
.prose { max-width: 680px; margin: 0 auto; padding: 40px 0 64px; }
.prose h1 { font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.035em; line-height: 1.1; margin: 0 0 8px; }
.prose .updated { color: var(--muted); margin: 0 0 32px; }
.prose h2 { font-size: 1.3rem; letter-spacing: -0.02em; margin: 36px 0 8px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--ink); }
.prose ul { padding-left: 1.2em; }

/* Footer */
.foot { border-top: 1px solid var(--line); }
.foot .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-top: 24px; padding-bottom: 40px; color: var(--muted); font-size: 0.9rem;
}
.foot nav { display: flex; gap: 20px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

@media (min-width: 760px) {
  :root { --section-gap: 64px; }
  .brand img { height: 32px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); text-align: left; padding: 56px 0 96px; }
  .hero p.lede { margin-left: 0; }
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0 56px; gap: 48px; min-height: 460px; }
  .feature .copy { text-align: left; }
  .feature p { margin-left: 0; }
  .feature .shot { margin: 48px auto -90px; }
  .feature .shot.watch { margin: 40px auto; }
  .devices { justify-content: flex-start; }
  .plus { padding: 56px; }
  .plus-head { grid-template-columns: auto minmax(0, 1fr); text-align: left; justify-items: start; gap: 40px; align-items: center; }
  .plus-head img { width: 200px; }
  .plus-head p { margin-left: 0; }
  .plus-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .pricing { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .feature.flip .copy { order: 2; }
  .extras { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}
