/* ============================================================
   Running Tracker Partner (PacePilot) — marketing site
   Dark theme · Golden (#00D4AA) primary · Royal purple (#3B82F6) accent
   ============================================================ */

:root {
  --bg: #06090b;
  --bg-2: #071419;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.16);

  --text: #ffffff;
  --muted: #b3bfc3;
  --faint: #7d8a8f;

  --primary: #00D4AA;
  --primary-deep: #00A887;
  --accent: #3B82F6;
  --accent-soft: #60A5FA;

  --glow-primary: rgba(0, 212, 170, 0.28);
  --glow-accent: rgba(59, 130, 246, 0.22);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --maxw: 1140px;
  --gutter: clamp(20px, 5vw, 48px);
  --nav-h: 70px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Ambient background: two brand glows over a dark gradient + faint dot grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(700px 500px at 85% -5%, var(--glow-primary), transparent 65%),
    radial-gradient(650px 520px at -10% 45%, var(--glow-accent), transparent 65%),
    linear-gradient(160deg, var(--bg-2), var(--bg) 55%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 60%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 60%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

section { padding-block: clamp(64px, 9vw, 120px); }

/* ---------- Typography ---------- */
h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 14px;
}
h3 { font-size: 1.12rem; font-weight: 700; }
.lead {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--muted);
  max-width: 640px;
}
.grad {
  background: linear-gradient(100deg, var(--primary), var(--accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-soft);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.section-head { max-width: 720px; margin-bottom: clamp(28px, 5vw, 56px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(6, 10, 12, 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.06rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav-links {
  display: flex;
  gap: clamp(14px, 2.4vw, 30px);
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
}
.btn-primary {
  background: linear-gradient(100deg, var(--primary), var(--primary-deep));
  color: #03170f;
  box-shadow: 0 6px 26px var(--glow-primary);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 212, 170, 0.42);
}
.btn-ghost {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--card-hover); border-color: var(--border-hover); }
.btn-sm { padding: 9px 20px; font-size: 0.9rem; }

.store-badges { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.store-badges img { height: 56px; width: auto; transition: transform 0.25s var(--ease); }
.store-badges a:hover img { transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(56px, 8vw, 110px) clamp(70px, 9vw, 130px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero-copy .app-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px 7px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 24px;
}
.hero-copy .app-badge img { width: 26px; height: 26px; border-radius: 7px; }
.hero-copy .lead { margin: 22px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 38px; }

.stats {
  display: flex;
  gap: clamp(22px, 4vw, 48px);
  flex-wrap: wrap;
}
.stat b {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.stat span { font-size: 0.85rem; color: var(--faint); }

/* Phone mockups */
.hero-visual { position: relative; display: flex; justify-content: center; min-height: 420px; }
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 8% 4%;
  background: radial-gradient(closest-side, var(--glow-primary), transparent 72%);
  filter: blur(30px);
  z-index: -1;
}
.phone {
  width: clamp(190px, 22vw, 260px);
  border-radius: 30px;
  border: 1px solid var(--border-hover);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  background: #000;
  overflow: hidden;
}
.phone img { width: 100%; height: auto; }
.phone.front {
  position: relative;
  z-index: 2;
  animation: float 6s ease-in-out infinite;
}
.phone.behind {
  position: absolute;
  top: 7%;
  opacity: 0.55;
  filter: saturate(0.85) brightness(0.8);
}
.phone.behind.left { transform: rotate(-9deg) translateX(-72%); }
.phone.behind.right { transform: rotate(9deg) translateX(72%); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ---------- Feature cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: background 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.card:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
}
.card .icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.22), rgba(0, 168, 135, 0.1));
  color: var(--primary);
}
.card:nth-child(even) .icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.05));
  color: var(--accent-soft);
}
.card .icon svg { width: 24px; height: 24px; }
.card p { color: var(--muted); font-size: 0.95rem; margin-top: 8px; }

/* ---------- Workflow ---------- */
.steps { counter-reset: step; display: grid; gap: 16px; max-width: 780px; }
.step {
  counter-increment: step;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.step::before {
  content: counter(step, decimal-leading-zero);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.07);
  border-radius: 11px;
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.step p { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* ---------- Benefits ---------- */
.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px 28px;
}
.benefit {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 4px;
}
.benefit .check {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-soft);
}
.benefit .check svg { width: 15px; height: 15px; }
.benefit p { color: var(--muted); font-size: 0.94rem; margin-top: 2px; }

/* ---------- Screenshots carousel ---------- */
.carousel-wrap { position: relative; }
.carousel {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 4px 26px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-deep) transparent;
}
.shot {
  flex: 0 0 auto;
  width: clamp(220px, 26vw, 290px);
  scroll-snap-align: start;
}
.shot .phone { width: 100%; animation: none; }
.shot figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--faint);
}
.car-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.car-btn {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.car-btn:hover { background: var(--card-hover); border-color: var(--border-hover); }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; }
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq .plus {
  flex: none;
  position: relative;
  width: 18px;
  height: 18px;
  color: var(--primary);
}
.faq .plus::before,
.faq .plus::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease);
}
.faq .plus::before { width: 16px; height: 2px; }
.faq .plus::after { width: 2px; height: 16px; }
.faq details[open] .plus::after { transform: rotate(90deg); }
.faq details p { padding: 0 20px 20px; color: var(--muted); font-size: 0.95rem; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 212, 170, 0.3);
  background: linear-gradient(120deg, rgba(0, 212, 170, 0.13), rgba(59, 130, 246, 0.07));
  padding: clamp(44px, 7vw, 80px) clamp(24px, 6vw, 72px);
  text-align: center;
}
.cta-band::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(closest-side, var(--glow-primary), transparent 70%);
  filter: blur(48px);
  z-index: -1;
}
.cta-band .lead { margin: 12px auto 30px; }
.cta-band .store-badges { justify-content: center; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: clamp(44px, 6vw, 72px) 0 0;
  background: rgba(0, 0, 0, 0.25);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  padding-bottom: 44px;
}
.foot-grid h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 16px;
}
.foot-grid ul { list-style: none; display: grid; gap: 10px; }
.foot-grid a { color: var(--muted); font-size: 0.94rem; }
.foot-grid a:hover { color: var(--text); }
.foot-brand p { color: var(--faint); font-size: 0.92rem; max-width: 320px; margin: 14px 0 20px; }
.foot-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.85rem;
}

/* ---------- Legal pages ---------- */
.page-hero { padding-block: clamp(48px, 7vw, 90px) clamp(24px, 4vw, 40px); }
.legal-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-bottom: clamp(64px, 9vw, 110px);
}
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 18px;
}
.toc h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 12px;
}
.toc ul { list-style: none; display: grid; gap: 9px; }
.toc a { color: var(--muted); font-size: 0.88rem; }
.toc a:hover { color: var(--primary); }
.prose { max-width: 820px; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 12px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.prose h2:first-of-type { margin-top: 8px; }
.prose p, .prose li { color: var(--muted); font-size: 0.98rem; }
.prose ul { padding-left: 22px; margin: 10px 0 18px; }
.prose li { margin-bottom: 7px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.callout {
  border-left: 3px solid var(--accent);
  background: rgba(59, 130, 246, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 18px 0 26px;
}
.callout p { color: var(--text); }
.updated { color: var(--faint); font-size: 0.88rem; }

/* ---------- Changelog ---------- */
.log-search {
  width: 100%;
  max-width: 420px;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 40px;
}
.log-search::placeholder { color: var(--faint); }
.log-search:focus { outline: 2px solid var(--primary-deep); }

.timeline { position: relative; max-width: 820px; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), rgba(59, 130, 246, 0.35));
  border-radius: 2px;
}
.release { position: relative; margin-bottom: 38px; }
.release::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(0, 212, 170, 0.14);
}
.release.feature::before {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.14);
}
.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.release-head h3 { font-size: 1.25rem; }
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
}
.tag.new { background: rgba(59, 130, 246, 0.12); color: var(--accent-soft); }
.tag.improved { background: rgba(0, 212, 170, 0.14); color: var(--primary); }
.tag.fixed { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.release-date { color: var(--faint); font-size: 0.88rem; }
.release-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.release-body ul { list-style: disc; padding-left: 20px; display: grid; gap: 8px; }
.release-body li { color: var(--muted); font-size: 0.95rem; }
.release-body li b { color: var(--text); font-weight: 600; }
.no-results { display: none; color: var(--faint); padding: 18px 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .phone.front { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 380px; margin-top: 14px; }
  .phone.behind.left { transform: rotate(-9deg) translateX(-58%); }
  .phone.behind.right { transform: rotate(9deg) translateX(58%); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(6, 10, 12, 0.97);
    border-bottom: 1px solid var(--border);
    display: none;
    padding: 10px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 13px var(--gutter); }
  .nav-toggle { display: block; }
  .legal-grid { grid-template-columns: 1fr; }
  .toc { display: none; }
}

@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
  .stats { gap: 18px; }
  .store-badges img { height: 50px; }
}

/* ---------- In-app WebView mode (?inapp=1): the app supplies its own top bar ---------- */
.inapp .nav,
.inapp footer { display: none; }
.inapp .page-hero { padding-top: 28px; }
.inapp .toc { top: 24px; }

/* ---------- Forms (account deletion) ---------- */
.form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 30px);
}
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .opt { color: var(--faint); font-weight: 400; }
.field input,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus,
.field textarea:focus { outline: 2px solid var(--primary-deep); border-color: transparent; }
.field input[aria-invalid="true"] { border-color: #f87171; }
.field-error { color: #f87171; font-size: 0.88rem; }
.prose .field-error { color: #f87171; font-size: 0.88rem; }
.check-field { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check-field input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--primary); }
.check-field span { color: var(--text); font-size: 0.95rem; }
.prose .form-note { color: var(--faint); font-size: 0.88rem; }
.form .btn { justify-self: start; }
.form .btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.95rem;
}
.form-status.ok { background: rgba(0, 212, 170, 0.1); border: 1px solid rgba(0, 212, 170, 0.35); color: var(--text); }
.form-status.error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.4); color: var(--text); }
