/* Present - marketing site
   Design tokens are derived from the shipped Calm Sage palette in
   ContractionTrackerPackage/.../DesignSystem/ThemePalette.swift so the site
   and the product read as one brand. Zero JavaScript, zero third-party
   requests. */

/* ---------- tokens ---------- */

:root {
  --sage: #6b9e8a;
  --sage-deep: #578570;
  --sage-soft: #e7efea;
  --rose: #d47d73;
  --rose-deep: #b8635c;
  --rose-soft: #f6e6e3;

  --bg: #f7f5f0;
  --bg-alt: #f2efe8;
  --surface: #ffffff;
  --text: #2b3333;
  --muted: #6f7877;
  --line: rgba(43, 51, 51, 0.1);

  --ink-panel: #223029;
  --on-panel: #eef3ef;
  --on-panel-muted: rgba(238, 243, 239, 0.72);

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-sm: 0 1px 2px rgba(28, 40, 36, 0.05), 0 4px 14px rgba(28, 40, 36, 0.05);
  --shadow-md: 0 2px 6px rgba(28, 40, 36, 0.06), 0 18px 40px -12px rgba(28, 40, 36, 0.16);
  --shadow-lg: 0 4px 12px rgba(28, 40, 36, 0.07), 0 40px 80px -24px rgba(28, 40, 36, 0.28);

  --maxw: 1140px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 10vw, 8.5rem);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sage: #80b5a1;
    --sage-deep: #669985;
    --sage-soft: rgba(128, 181, 161, 0.14);
    --rose: #e0948c;
    --rose-deep: #c97a72;
    --rose-soft: rgba(224, 148, 140, 0.14);

    --bg: #171c29;
    --bg-alt: #131824;
    --surface: #242938;
    --text: #e8e3de;
    --muted: #99a1a8;
    --line: rgba(232, 227, 222, 0.12);

    --ink-panel: #10161a;
    --on-panel: #e8f0ea;
    --on-panel-muted: rgba(232, 240, 234, 0.7);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4), 0 18px 40px -12px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.45), 0 40px 80px -24px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- reset ---------- */

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 700;
  text-wrap: balance;
}

p { margin: 0; }

a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--sage); }

:focus-visible {
  outline: 2.5px solid var(--sage);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(3rem, 7vw, 5rem); }
.section--alt { background: var(--bg-alt); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* ---------- type ---------- */

.kicker {
  display: inline-block;
  font-size: 0.775rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 1rem;
}

.h1 { font-size: clamp(2.6rem, 7.5vw, 4.75rem); letter-spacing: -0.035em; }
.h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); letter-spacing: -0.028em; }
.h3 { font-size: 1.1875rem; letter-spacing: -0.012em; }

.lede {
  font-size: clamp(1.0625rem, 1.7vw, 1.3125rem);
  color: var(--muted);
  line-height: 1.6;
  max-width: 46ch;
}

.section-head { max-width: 40ch; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.section-head .lede { margin-top: 1rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lede { margin-inline: auto; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg); }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  margin-inline-end: auto;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 550;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.nav-hide-sm { display: none; }
@media (min-width: 640px) { .nav-hide-sm { display: inline; } }

/* language switcher - pure CSS, real links, no JS */
.lang { position: relative; }
.lang > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--muted);
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:hover { color: var(--text); }
.lang > summary svg { width: 15px; height: 15px; flex: none; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  display: grid;
  gap: 1px;
  max-height: 70vh;
  overflow-y: auto;
}
.lang-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text);
  text-decoration: none;
}
.lang-menu a:hover { background: var(--sage-soft); }
.lang-menu a[aria-current="true"] { font-weight: 700; color: var(--sage-deep); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn--primary {
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-deep) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(28, 40, 36, 0.14), 0 12px 28px -8px color-mix(in srgb, var(--sage-deep) 55%, transparent);
}
.btn--primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(28, 40, 36, 0.16), 0 18px 36px -10px color-mix(in srgb, var(--sage-deep) 60%, transparent);
}
.btn--soon {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  cursor: default;
}
.btn--ghost {
  background: transparent;
  color: var(--on-panel);
  border-color: rgba(255, 255, 255, 0.28);
}
.btn--ghost:hover { color: var(--on-panel); background: rgba(255, 255, 255, 0.08); }

.cta-note {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 34ch;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3.5rem, 8vw, 6.5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 780px;
  background:
    radial-gradient(48% 42% at 22% 30%, color-mix(in srgb, var(--sage) 26%, transparent) 0%, transparent 70%),
    radial-gradient(42% 38% at 82% 12%, color-mix(in srgb, var(--rose) 20%, transparent) 0%, transparent 72%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
  flex: none;
}

.hero h1 { white-space: pre-line; margin-bottom: 1.5rem; }
.hero .lede { margin-bottom: 2.25rem; }

/* ---------- device frames ---------- */

.device-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.device-stage::before {
  content: "";
  position: absolute;
  width: min(96%, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rose) 34%, transparent) 0%, transparent 68%);
  animation: breathe 7s ease-in-out infinite;
  z-index: 0;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

.device {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  padding: 9px;
  background: linear-gradient(155deg, #3a3d40 0%, #101112 42%, #26282a 100%);
  border-radius: 46px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
.device img { border-radius: 38px; }
.device--lg { width: min(100%, 360px); }
.device--sm { width: min(100%, 250px); }

.device-watch {
  position: relative;
  z-index: 1;
  width: min(100%, 210px);
  padding: 11px;
  background: linear-gradient(155deg, #3a3d40 0%, #101112 45%, #26282a 100%);
  border-radius: 46px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
.device-watch img { border-radius: 34px; }

/* ---------- steps ---------- */

.steps {
  display: grid;
  gap: 1.25rem;
  counter-reset: step;
}
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-deep);
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 1.125rem;
}
.step h3 { margin-bottom: 0.5rem; }
.step p { color: var(--muted); font-size: 0.9688rem; }

/* ---------- feature list ---------- */

.features {
  display: grid;
  gap: 0.875rem 2.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 720px) { .features { grid-template-columns: 1fr 1fr; } }

.features li {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  font-size: 1rem;
}
.check {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--sage-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.check svg { width: 13px; height: 13px; }

/* ---------- split rows ---------- */

.split {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip .split-media { order: -1; }
}
.split-body .lede { margin-block: 1rem 1.75rem; }

.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.ticks li { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 1rem; }

/* ---------- pattern cards ---------- */

.patterns {
  display: grid;
  gap: 1rem;
}
@media (min-width: 560px) { .patterns { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .patterns { grid-template-columns: repeat(4, 1fr); } }

.pattern {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.pattern-label {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.625rem;
}
.pattern p { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }

.note {
  margin-top: 2rem;
  padding: 1.125rem 1.375rem;
  border-radius: var(--radius-md);
  background: var(--rose-soft);
  border: 1px solid color-mix(in srgb, var(--rose) 26%, transparent);
  font-size: 0.9375rem;
  color: var(--text);
  max-width: 68ch;
}

/* ---------- privacy panel ---------- */

.panel {
  background:
    radial-gradient(70% 90% at 12% 8%, rgba(107, 158, 138, 0.28) 0%, transparent 62%),
    linear-gradient(165deg, #2a3a31 0%, var(--ink-panel) 100%);
  color: var(--on-panel);
  border-radius: clamp(24px, 4vw, 40px);
  padding: clamp(2.5rem, 6vw, 4.5rem);
  box-shadow: var(--shadow-md);
}
.panel .kicker { color: color-mix(in srgb, var(--sage) 78%, #fff); }
.panel .h2 { color: var(--on-panel); }
.panel a { color: #fff; }

.panel-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  margin-top: clamp(2.25rem, 5vw, 3rem);
}
@media (min-width: 760px) { .panel-grid { grid-template-columns: 1fr 1fr; } }

.pt h3 { font-size: 1.0625rem; margin-bottom: 0.4rem; color: var(--on-panel); }
.pt p { color: var(--on-panel-muted); font-size: 0.9688rem; }
.pt-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.11);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
  color: color-mix(in srgb, var(--sage) 80%, #fff);
}
.pt-icon svg { width: 16px; height: 16px; }

/* ---------- faq ---------- */

.faq { max-width: 800px; margin-inline: auto; border-top: 1px solid var(--line); }

.qa { border-bottom: 1px solid var(--line); }
.qa > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.375rem 0;
  font-size: 1.0625rem;
  font-weight: 620;
  letter-spacing: -0.012em;
}
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary:hover { color: var(--sage-deep); }
.qa .chev {
  flex: none;
  margin-inline-start: auto;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.22s ease;
}
.qa[open] .chev { transform: rotate(180deg); }
.qa-body {
  padding: 0 0 1.5rem;
  color: var(--muted);
  max-width: 68ch;
  font-size: 1rem;
}

/* ---------- prose (privacy / support) ---------- */

.page-head {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
}
.page-head .h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); margin-bottom: 0.875rem; }
.page-head .lede { max-width: 56ch; }
.stamp {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.prose { max-width: 74ch; }
.prose > section { margin-bottom: clamp(2.25rem, 4vw, 3rem); }
.prose h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.prose p { color: var(--muted); margin-bottom: 0.875rem; }
.prose p:last-child { margin-bottom: 0; }

.callout {
  border-radius: var(--radius-md);
  padding: 1.375rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.callout h2 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.callout--urgent {
  background: var(--rose-soft);
  border-color: color-mix(in srgb, var(--rose) 30%, transparent);
}
.callout--urgent p { color: var(--text); }

.support-group { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.support-group > h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 0.5rem;
}

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
}
.backlink:hover { color: var(--text); }
.backlink svg { width: 15px; height: 15px; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem;
  margin-top: var(--section-y);
}
.footer-top {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) { .footer-top { grid-template-columns: 1.4fr 1fr; align-items: start; } }

.footer-brand { display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.footer-brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--shadow-sm); }
.footer-brand strong { font-size: 1.125rem; letter-spacing: -0.02em; }
.footer-tagline { color: var(--muted); font-size: 0.9688rem; max-width: 40ch; }

.footer-links { display: grid; gap: 0.625rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.footer-links a:hover { color: var(--text); }

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  margin-block: 2rem;
}
.footer-langs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8438rem;
}
.footer-langs a:hover { color: var(--text); }
.footer-langs a[aria-current="true"] { color: var(--text); font-weight: 650; }

.legal { display: grid; gap: 1rem; }
.legal p {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 84ch;
}
.legal .label {
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.6875rem;
  display: block;
  margin-bottom: 0.3rem;
}
