/* GlanceVitals marketing site.
 *
 * Every colour below is ported verbatim from the app's single source of
 * truth, GlanceVitals/SharedUI/DesignTokens.swift, so the site and the app
 * read as the same product. Two of those values are load-bearing and must
 * not be "tidied up":
 *
 *   --brand-violet-button (#694ED9) exists because raw #7C5CFF gives white
 *   text only ~4.35:1, under the 4.5:1 AA floor (DesignTokens.swift:54-58).
 *   Use --brand-violet for icons and accents; never for a filled button
 *   carrying white text.
 *
 *   --text-secondary is #A7B0BA / #55606E, not a generic grey. Softer values
 *   were repeatedly flagged by the app's XCUITest accessibility audit
 *   (DesignTokens.swift:41-48).
 */

/* Dark first: the blue-green ground is the app's identity
   (DesignTokens.swift:11-14). */
:root {
  --canvas: #001117;
  --surface: #161b22;
  --surface-elevated: #1f2937;
  --text: #ffffff;
  --text-secondary: #a7b0ba;
  --divider: #2b3440;
  --hairline: rgba(255, 255, 255, 0.08);
  --shadow: rgba(0, 0, 0, 0.35);

  --brand-violet: #7c5cff;
  --brand-violet-button: #694ed9;
  --brand-mint: #22d3a6;

  /* Text-safe variants of the two brand colours. The brand values above are
     tuned for graphics and fail AA as text on one ground or the other:
     #7C5CFF is 4.42:1 on the dark canvas and 4.06:1 on the light one, and
     #22D3A6 is only 1.79:1 on the light canvas. Anything that renders as
     words uses these instead, per theme. */
  --link: #9b85ff; /* 6.58:1 on canvas, 5.92:1 on surface */
  --accent-text: #22d3a6; /* 10.01:1 on the dark canvas */

  /* Metric category colours, from GVWidgetUI/WidgetPalette.swift. */
  --cat-activity: #22d3a6;
  --cat-sleep: #8b5cf6;
  --cat-heart: #ff5b68;
  --cat-recovery: #66d266;
  --cat-body: #56b4e9;

  --radius: 22px; /* every card in the app is widget-shaped */
  --measure: 1100px;
  --prose: 68ch;

  --badge-filter: invert(1); /* black badge -> Apple's white variant */
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --canvas: #f6f7fb;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text: #111827;
    --text-secondary: #55606e;
    --divider: #e5e7eb;
    --hairline: rgba(0, 0, 0, 0.06);
    --shadow: rgba(0, 0, 0, 0.16);
    --link: #694ed9; /* 5.31:1 on canvas, 5.69:1 on white */
    /* Deep enough to clear 4.5:1 on the violet end of the privacy band's
       gradient (#E5DEFF), not only on the page canvas. */
    --accent-text: #116b5b; /* 5.98:1 canvas, 6.41:1 white, 4.95:1 band */
    --badge-filter: none;
    color-scheme: light;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 650;
}

h3 {
  font-size: 1.15rem;
  font-weight: 620;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--canvas); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 660;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.wordmark:hover {
  text-decoration: none;
}

/* The app icon itself, served at 3x (78px) so it stays crisp on retina, and
   drawn as a background rather than an <img> so the six pages sharing this
   header need no markup change. The radius is the 22.37% of the side that
   iOS uses for its squircle, so the header mark reads as the same object the
   user taps on their Home Screen. */
.wordmark__mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: url("/assets/icon-78.png") center / cover no-repeat;
  flex: none;
}

.nav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px clamp(10px, 2.4vw, 24px);
  font-size: 0.95rem;
}

/* Five links plus the wordmark do not fit one line on a small phone. Shrink
   before wrapping, so the bar stays a single row wherever it can. */
@media (max-width: 560px) {
  .nav__links {
    font-size: 0.84rem;
  }
}

.nav__links a {
  color: var(--text-secondary);
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--text);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  background: var(--brand-violet-button);
  color: #ffffff;
  border: 0;
}

.btn__glyph {
  flex: 0 0 auto;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

/* Secondary CTA. Deliberately quieter than .btn so the App Store badge stays
   the single primary call to action on every screen. */
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--divider);
}

.btn--ghost:hover {
  filter: none;
  border-color: var(--link);
}

/* ---------- Waitlist form ---------- */

.waitlist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  max-width: 470px;
}

.waitlist--center {
  margin-inline: auto;
  justify-content: center;
}

.waitlist__input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.waitlist__input::placeholder {
  color: var(--text-secondary);
}

.waitlist__input:focus-visible {
  outline: 2px solid var(--brand-mint);
  outline-offset: 2px;
  border-color: transparent;
}

.waitlist__btn {
  flex: 0 0 auto;
  cursor: pointer;
}

/* Honeypot: hidden from people, still submitted by naive bots. Kept out of
   the accessibility tree and the tab order rather than display:none, which
   some bots specifically check for. */
.waitlist__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist__note {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.section--cta .waitlist__note {
  text-align: center;
}

.badge-link {
  display: inline-block;
  line-height: 0;
}

.badge-link:hover {
  text-decoration: none;
}

.badge-link img {
  height: 54px;
  width: auto;
  filter: var(--badge-filter);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(48px, 9vw, 104px) clamp(40px, 7vw, 80px);
}

/* The violet -> mint wash echoes the screenshot backdrop. Kept behind the
   content and clipped so it never introduces a horizontal scrollbar. */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -20% auto -20%;
  height: 130%;
  background: radial-gradient(
      60% 55% at 22% 12%,
      color-mix(in srgb, var(--brand-violet) 34%, transparent),
      transparent 70%
    ),
    radial-gradient(
      55% 50% at 82% 30%,
      color-mix(in srgb, var(--brand-mint) 24%, transparent),
      transparent 68%
    );
  pointer-events: none;
  z-index: 0;
}

.hero > .wrap {
  position: relative;
  z-index: 1;
}

.hero__grid {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero__lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 34ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
}

.hero__note {
  margin-top: 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.trustline {
  margin-top: 18px;
  font-size: 0.95rem;
  font-weight: 560;
  color: var(--accent-text);
}

.hero__shot {
  justify-self: center;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px -20px var(--shadow);
  max-width: 380px;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(52px, 8vw, 92px);
  border-top: 1px solid var(--hairline);
}

.section__head {
  max-width: 60ch;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section__head p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.76rem;
  font-weight: 680;
  color: var(--accent-text);
  margin: 0 0 10px;
}

/* ---------- Multi-metric feature block ---------- */

.section--feature {
  background: var(--surface);
}

.feature__grid {
  display: grid;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 820px) {
  .feature__grid {
    grid-template-columns: 1fr 0.8fr;
  }
}

.feature__grid p {
  color: var(--text-secondary);
  max-width: 52ch;
}

/* The metric formula is the headline's proof. Sized between h2 and body so it
   reads as a claim rather than a caption. */
.feature__grid .feature__metrics {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 620;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 1em;
}

.feature__shot {
  justify-self: center;
  border-radius: var(--radius);
  box-shadow: 0 26px 60px -22px var(--shadow);
  max-width: 300px;
}

/* ---------- Feature cards ---------- */

.cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.97rem;
}

.card__dot {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  margin-bottom: 16px;
  background: var(--surface-elevated); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--accent, var(--brand-mint)) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, var(--brand-mint)) 55%, transparent);
}

/* ---------- Screenshot strip ---------- */

.shots {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.shots figure {
  margin: 0;
  flex: none;
  width: 300px;
  scroll-snap-align: start;
}

.shots img {
  border-radius: 18px;
  box-shadow: 0 18px 40px -18px var(--shadow);
  width: 100%;
}

.shots figcaption {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.shots figcaption strong {
  display: block;
  color: var(--text);
  font-weight: 620;
  margin-bottom: 2px;
}

/* ---------- Metrics ---------- */

.tiers {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.tier {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.tier--pro {
  border-color: color-mix(in srgb, var(--brand-violet) 45%, transparent);
}

.tier h3 {
  margin-bottom: 4px;
}

.tier > p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.chips {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  font-size: 0.87rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
}

@media (prefers-color-scheme: light) {
  .chips li {
    background: #f3f4f8;
  }
}

/* ---------- Privacy band ---------- */

.band {
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 56px);
  background: var(--surface); /* fallback where color-mix is unsupported */
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand-violet) 20%, var(--surface)),
    color-mix(in srgb, var(--brand-mint) 14%, var(--surface))
  );
  border: 1px solid var(--hairline);
}

.band h2 {
  max-width: 20ch;
}

.band .band__lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 600;
  color: var(--text);
  max-width: 30ch;
}

.band p {
  color: var(--text-secondary);
  max-width: 60ch;
}

.band__list {
  list-style: none;
  padding: 0;
  margin: 22px 0 26px;
  display: grid;
  gap: 10px;
  max-width: 60ch;
}

.band__list li {
  padding-left: 28px;
  position: relative;
  color: var(--text-secondary);
}

.band__list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-mint);
}

/* ---------- Comparison table ---------- */

/* The table scrolls inside its own container so a narrow viewport never
   forces the page body to scroll sideways. */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
}

.compare {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.97rem;
}

.compare th,
.compare td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
}

.compare tbody tr:last-child th,
.compare tbody tr:last-child td {
  border-bottom: 0;
}

.compare thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  font-weight: 680;
}

/* The right-hand column is the answer, so it carries the accent border and
   full-strength text; the left column stays secondary. */
.compare td:first-child {
  color: var(--text-secondary);
  width: 50%;
}

.compare th:last-child,
.compare td:last-child {
  border-left: 1px solid var(--hairline);
  color: var(--text);
  font-weight: 560;
}

.compare thead th:last-child {
  color: var(--accent-text);
}

/* ---------- Final CTA ---------- */

.section--cta {
  text-align: center;
}

.section--cta p {
  color: var(--text-secondary);
}

.cta__badge {
  margin-top: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Legal pages ---------- */

.legal {
  padding-block: clamp(40px, 6vw, 72px);
}

.legal .wrap {
  max-width: calc(var(--prose) + 40px);
}

.legal h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.legal h2 {
  font-size: 1.35rem;
  margin-top: 2.2em;
}

.legal h3 {
  font-size: 1.05rem;
  margin-top: 1.8em;
}

.legal p,
.legal li {
  color: var(--text-secondary);
}

.legal strong {
  color: var(--text);
  font-weight: 620;
}

.legal ul {
  padding-left: 22px;
}

.legal li {
  margin-bottom: 0.5em;
}

.legal__meta {
  color: var(--text-secondary);
  font-size: 0.92rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 20px;
  margin-bottom: 8px;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--brand-mint);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 24px 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--hairline);
  padding-block: 40px 56px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--text);
}

/* ---------- 404 ---------- */

.notfound {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 80px;
}
