:root {
  --bg: #080b0f;
  --bg-alt: #0e1319;
  --card: #141b22;
  --card-alt: #1d2530;
  --line: #26303b;
  --text: #edf2f6;
  --dim: #8a97a3;
  --dimmer: #5c6873;
  --accent: #2fe6b8;
  --accent2: #3e7bfa;
  --purple: #9b4dff;
  --danger: #ff6b5e;
  --radius: 16px;
  --radius-lg: 22px;
  --max-width: 1080px;

  /* Brand gradient — the territory-capture spectrum (teal → blue → violet) */
  --grad-brand: linear-gradient(120deg, #2fe6b8 0%, #3e7bfa 55%, #9b4dff 110%);
  --grad-brand-soft: linear-gradient(120deg, rgba(47, 230, 184, 0.16), rgba(62, 123, 250, 0.14) 55%, rgba(155, 77, 255, 0.14));

  /* Elevation */
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 40px -22px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 24px 60px -28px rgba(47, 230, 184, 0.45);

  /* Frosted surface tint used on cards + sticky chrome */
  --surface: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Ambient atmosphere — a fixed aurora wash plus a faint topographic contour
   grid that nods to the territory-mapping theme without ever competing with
   content. Purely decorative, sits behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 78% -5%, rgba(62, 123, 250, 0.14), transparent 70%),
    radial-gradient(50% 40% at 12% 4%, rgba(47, 230, 184, 0.12), transparent 68%),
    radial-gradient(45% 55% at 92% 82%, rgba(155, 77, 255, 0.10), transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(139, 160, 178, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 160, 178, 0.05) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
}

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

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 11, 15, 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

nav.wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

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

.brand svg {
  display: block;
}

nav .links {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav .links a {
  color: var(--dim);
  font-size: 14px;
  font-weight: 500;
}

nav .links a:hover {
  color: var(--text);
  text-decoration: none;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navcta {
  padding: 9px 18px;
  font-size: 14px;
}

/* Hero */

.hero {
  padding: 96px 0 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -20% auto -20%;
  height: 70%;
  background:
    radial-gradient(closest-side at 50% 0%, rgba(47, 230, 184, 0.18), transparent 70%),
    radial-gradient(closest-side at 30% 20%, rgba(62, 123, 250, 0.14), transparent 70%),
    radial-gradient(closest-side at 72% 24%, rgba(155, 77, 255, 0.12), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

.hero .mark {
  margin: 0 auto 28px;
  width: 120px;
  height: 120px;
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.06;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero h1 .accent {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero p.lede {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--dim);
  font-size: clamp(16px, 2vw, 19px);
}

.cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
}

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

.btn.primary {
  background: var(--accent);
  background-image: linear-gradient(120deg, #38ecc0, #2fe6b8 42%, #37c9e6);
  color: #05201a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 26px -14px rgba(47, 230, 184, 0.7);
}

.btn.primary:hover {
  background-image: linear-gradient(120deg, #5cf0cd, #38ecc0 42%, #4fd6ee);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--card);
  border-color: var(--card-alt);
}

.store-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--dimmer);
}

.store-note a {
  color: var(--dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

/* Hero availability chip */

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 22px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-pill:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.hero-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-pill-dot {
    animation: pill-pulse 2.4s ease-out infinite;
  }
  @keyframes pill-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
    70% { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
}

/* App store badges */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 176px;
  padding: 9px 18px;
  border-radius: 13px;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.store-badge:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: #555;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.8);
}

.store-badge-icon {
  width: 26px;
  height: 26px;
  flex: none;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.store-badge-text small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.store-badge-text strong {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.store-badge.soon {
  background: var(--card);
  border-color: var(--line);
  color: var(--dim);
  cursor: default;
}

.store-badge.soon:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

/* Sections */

section {
  padding: 64px 0;
}

section + section {
  border-top: 1px solid var(--line);
}

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 40px;
}

.section-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
}

.section-head h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.section-head p {
  color: var(--dim);
  margin: 0;
}

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

.card {
  position: relative;
  background: var(--card);
  background-image: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* Feature-card icon tiles get the brand gradient wash + a soft glow so the
   grid reads as a set of premium capability chips. */
.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(47, 230, 184, 0.16), rgba(62, 123, 250, 0.12));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.card p {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}

/* Screenshots */

.shots {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 4px 20px;
  margin: 0;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.shots::-webkit-scrollbar {
  height: 8px;
}

.shots::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.shot {
  flex: 0 0 auto;
  width: 200px;
  margin: 0;
  scroll-snap-align: start;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6);
  background: var(--card);
}

.shot figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

/* Get TerraLoop */

.get-grid .card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.get-grid .icon {
  margin-left: auto;
  margin-right: auto;
}

.get-grid .card p {
  margin-bottom: 18px;
}

.get-btn {
  margin-top: auto;
}

.get-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

.get-actions .get-btn {
  margin-top: 0;
}

.get-actions .store-badge {
  justify-content: center;
  align-self: stretch;
}

/* Availability tag on the platform cards */

.get-card-featured {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 24px 60px -30px color-mix(in srgb, var(--accent) 40%, transparent);
}

.get-tag {
  align-self: center;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.get-tag.live {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
}

.get-tag.soon {
  color: var(--dim);
  background: var(--card-alt);
  border: 1px solid var(--line);
}

/* How it works */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  counter-reset: step;
}

.step {
  position: relative;
  padding-left: 44px;
}

.step {
  padding-top: 4px;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #05201a;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -10px rgba(47, 230, 184, 0.6);
}

.step h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.step p {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
}

/* Modes */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.mode {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  background: var(--card);
  background-image: var(--surface);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.25s ease;
}
.mode:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.mode.walk:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.mode.bike:hover { border-color: color-mix(in srgb, var(--accent2) 45%, var(--line)); }
.mode.drive:hover { border-color: color-mix(in srgb, var(--purple) 45%, var(--line)); }
.mode .dot {
  box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 12%, transparent);
}
.mode.walk .dot { color: var(--accent); }
.mode.bike .dot { color: var(--accent2); }
.mode.drive .dot { color: var(--purple); }

.mode .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 auto 10px;
}

.mode.walk .dot { background: var(--accent); }
.mode.bike .dot { background: var(--accent2); }
.mode.drive .dot { background: #9b4dff; }

.mode h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.mode p {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
}

/* Support / contact */

.support {
  text-align: center;
}

.support .email {
  display: inline-block;
  margin-top: 8px;
  font-size: 18px;
  font-weight: 600;
}

/* Footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 40px 0;
}

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

footer.site .fbrand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 14px;
}

footer.site .flinks {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

footer.site .flinks a {
  color: var(--dim);
}

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

/* Legal pages */

.legal {
  padding: 56px 0 80px;
}

.legal .wrap {
  max-width: 720px;
}

.legal h1 {
  font-size: 32px;
  margin-bottom: 4px;
}

.legal .updated {
  color: var(--dimmer);
  font-size: 14px;
  margin-bottom: 40px;
}

.legal h2 {
  font-size: 20px;
  margin-top: 40px;
  margin-bottom: 12px;
}

.legal p, .legal li {
  color: var(--dim);
  font-size: 15px;
}

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

.legal a {
  color: var(--accent2);
}

/* Hero stats bar */

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  list-style: none;
  padding: 22px;
  margin: 44px auto 0;
  max-width: 740px;
  background: var(--card);
  background-image: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
}
.hero-stats::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 40%, transparent), transparent 40%, color-mix(in srgb, var(--purple) 34%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
}

.hero-stats li + li {
  border-left: 1px solid var(--line);
}

.hero-stats b {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.2s ease;
}
.hero-stats b[data-empty] {
  opacity: 0.35;
}

.hero-stats span {
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

@media (max-width: 640px) {
  .hero-stats li + li {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

/* Feature card polish */

.card {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
}

.card .icon {
  transition: transform 0.2s ease, color 0.2s ease;
}

.card .icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.card:hover .icon {
  transform: translateY(-1px);
  color: var(--text);
}

/* Button polish */

.btn {
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary:hover {
  box-shadow: 0 6px 24px -6px rgba(47, 230, 184, 0.4);
  transform: translateY(-1px);
}

.btn.primary:active {
  transform: translateY(0);
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 16px 24px 24px;
  background: rgba(11, 15, 19, 0.98);
  border-bottom: 1px solid var(--line);
}

.mobile-menu[data-open="true"] {
  display: flex;
}

.mobile-menu a {
  color: var(--text);
  font-weight: 600;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.mobile-menu a.btn {
  border-bottom: none;
  margin-top: 8px;
  justify-content: center;
}

@media (max-width: 720px) {
  nav .links {
    display: none;
  }
  .nav-actions {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
}

/* FAQ */

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--card);
  background-image: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.18s ease;
}
.faq-item:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
}
.faq-item[open] {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  flex: none;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq-item p {
  margin: 0;
  padding: 16px 22px 20px;
  color: var(--dim);
  font-size: 14.5px;
}

/* Section reveal animation on scroll */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.in-view {
    opacity: 1;
    transform: none;
  }
}

/* Section head accent underline */

.section-head h2 {
  position: relative;
}

/* Account pages (verify-email / forgot-password / reset-password) */

.auth-shell {
  padding: 72px 0 100px;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Was an inline style="display:flex; justify-content:center;" on this .wrap
   in each auth page — moved here so the pages can run a strict CSP
   (style-src 'self', no 'unsafe-inline'). */
.auth-shell .wrap {
  display: flex;
  justify-content: center;
}

.authcard {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.authcard h1 {
  font-size: 24px;
  margin: 0 0 8px;
}

.authcard p.lede {
  color: var(--dim);
  font-size: 14.5px;
  margin: 0 0 24px;
}

.authcard .field {
  margin-bottom: 14px;
  text-align: left;
}

.authcard .field label {
  display: block;
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 6px;
  font-weight: 600;
}

.authcard .field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
}

.authcard .field input:focus {
  outline: none;
  border-color: var(--accent2);
}

.authcard .btn {
  width: 100%;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.authcard .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.alert {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
  font-size: 13.5px;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

/* Status icon drawn in the alert's own color (replaces emoji prefixes). */
.alert.success::before,
.alert.error::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  background: currentColor;
  -webkit-mask: var(--alert-icon) center / contain no-repeat;
  mask: var(--alert-icon) center / contain no-repeat;
}

.alert.success {
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='m8 12.2 2.8 2.8L16.2 9.5'/%3E%3C/svg%3E");
}

.alert.error {
  --alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5'/%3E%3Cpath d='M12 16.5h.01'/%3E%3C/svg%3E");
}

.alert.success {
  color: var(--accent);
  background: rgba(47, 230, 184, 0.08);
  border: 1px solid rgba(47, 230, 184, 0.3);
}

.alert.error {
  color: var(--danger);
  background: rgba(255, 107, 94, 0.1);
  border: 1px solid rgba(255, 107, 94, 0.3);
}

.alert.info {
  color: var(--dim);
  background: var(--card-alt);
  border: 1px solid var(--line);
}

.alert .invite-app {
  margin-top: 10px;
  line-height: 2;
}

.alert .invite-app .btn {
  display: inline-flex;
  width: auto;
  margin: 0 4px;
  vertical-align: middle;
}

.btn.small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}


.authcard .spinner {
  width: 22px;
  height: 22px;
  margin: 8px auto 20px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.authcard .back-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13.5px;
}

/* Shared replay viewer (landing/replay.html) — wider than the auth cards
   since it needs room for the route canvas, otherwise the same shell. */
.replaycard {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.replaycard h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

.replaycard .sub {
  color: var(--dim);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.replay-canvas-wrap {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 18px;
}

.replay-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.replay-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.replay-stat {
  flex: 1 1 120px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.replay-stat .label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.replay-stat .value {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

/* Public share-card viewer (card.html / card.js) — a recap or territory
   snapshot minted by its owner. Reuses .replay-stats/.replay-stat tiles for
   its secondary stat tiles, but adds a full trophy chrome on top so the
   shared link reads as a keepsake rather than a stat table. */
.sharecard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.sharecard .lede {
  text-align: center;
  margin: 0;
}

.sharecard .btn.primary {
  align-self: center;
}

/* Trophy variant — the recap redesign. Wider chrome, brand-colored banner,
   avatar/emblem lockup, big hero stat, then the tile row underneath. The
   parent .replaycard already caps width at 560px so the trophy stays a
   phone-portrait-friendly aspect and screenshots cleanly. */
.trophy {
  --trophy-tint: var(--accent);
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.55);
  text-align: left;
}

/* Premium card themes (landing/js/card.js CARD_THEMES) repaint the card body. */
.trophy.trophy-themed {
  background: var(--trophy-bg);
  color: var(--trophy-ink);
}
.trophy.trophy-themed .trophy-hero-sub,
.trophy.trophy-themed .trophy-byline,
.trophy.trophy-themed .replay-stat span {
  color: var(--trophy-dim);
}
.trophy-player-title {
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.9);
}
.trophy-banner {
  position: relative;
  padding: 26px 28px 68px;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 255, 255, 0.14), transparent 60%),
    radial-gradient(120% 100% at 0% 100%, rgba(0, 0, 0, 0.28), transparent 55%),
    linear-gradient(135deg, var(--trophy-tint), color-mix(in srgb, var(--trophy-tint) 55%, #000));
  color: #fff;
}

.trophy-eyebrow {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 6px;
  font-weight: 700;
}

.trophy-title {
  font-size: 26px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.3px;
}

.trophy-emblem {
  position: absolute;
  right: 20px;
  top: 18px;
  font-size: 42px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  line-height: 1;
}

.trophy-avatar {
  position: absolute;
  left: 24px;
  bottom: -32px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid var(--card);
  background: var(--card-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 900;
  font-size: 26px;
  overflow: hidden;
}

.trophy-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trophy-body {
  padding: 46px 24px 24px;
}

.trophy-hero {
  margin: 0 0 20px;
  padding: 18px 20px;
  background: color-mix(in srgb, var(--trophy-tint) 8%, var(--bg-alt));
  border: 1px solid color-mix(in srgb, var(--trophy-tint) 25%, var(--line));
  border-radius: 14px;
  text-align: center;
}

.trophy-hero-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
  font-weight: 700;
}

.trophy-hero-value {
  display: block;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.1;
}

.trophy-hero-sub {
  display: block;
  font-size: 12px;
  color: var(--dim);
  margin-top: 6px;
}

.trophy .replay-stats {
  justify-content: stretch;
}

.trophy .replay-stat {
  background: var(--bg-alt);
}

/* Route/territory outline panel drawn from the snapshotted shape (activity
   cards draw an open route line; territory cards a filled polygon). */
.trophy-map {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 20px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* Pro-gated stat tile (e.g. pace on a free-tier run) — the value is replaced
   by a "Pro" pill in the card's team tint. */
.trophy .replay-stat.locked {
  border-color: color-mix(in srgb, var(--trophy-tint) 40%, var(--line));
}

.replay-stat .value.pro-pill {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--trophy-tint);
  border: 1px solid var(--trophy-tint);
  background: color-mix(in srgb, var(--trophy-tint) 14%, transparent);
  border-radius: 6px;
  padding: 2px 7px;
}

.trophy-footer {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
}

.trophy-footer .btn {
  flex: 1;
  text-align: center;
}

.trophy-byline {
  padding: 0 24px 22px;
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

/* Live-stats counters — the same hero-stats box; when data lands each <b>
   fades in gently rather than flickering the number. */
.hero-stats[data-live] b {
  transition: opacity 0.4s ease;
}
.hero-stats[data-live] b[data-empty] {
  opacity: 0.35;
}
.hero-stats-fallback {
  max-width: 720px;
  margin: 8px auto 0;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

/* Pricing */
#pricing {
  padding: 80px 0;
  background: var(--bg-alt);
}
.price-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 900px;
  margin: 0 auto;
}
.price-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  position: relative;
}
.price-card-featured {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}
.price-card-featured::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
}
.price-card-featured::after {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 60%;
  height: 60%;
  background: radial-gradient(closest-side, rgba(47, 230, 184, 0.16), transparent 70%);
  pointer-events: none;
}
.section-head .price-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text);
}
.price-fineprint {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--dim);
  text-align: center;
}
.price-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  padding: 4px 8px;
  border-radius: 6px;
}
.price-tier {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}
.price-amount {
  font-size: 38px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.price-amount span {
  font-size: 15px;
  font-weight: 600;
  color: var(--dim);
  margin-left: 2px;
  -webkit-text-fill-color: var(--dim);
}
.price-card-featured .price-amount {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.price-tagline {
  color: var(--dim);
  margin-bottom: 16px;
}
.price-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  flex: 1;
}
.price-list li {
  padding: 7px 0 7px 22px;
  position: relative;
}
.price-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 900;
}
.price-card .btn {
  align-self: stretch;
  text-align: center;
}
.price-tiers {
  list-style: none;
  padding: 12px 14px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  font-size: 14px;
  color: var(--text);
}
.price-tiers li {
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.price-tiers li + li {
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.price-tiers li strong {
  font-weight: 800;
  color: var(--text);
}
.price-tiers li span {
  color: var(--dim);
  font-size: 13px;
  text-align: right;
}
.price-tiers .price-tier-anchor strong {
  color: var(--accent);
}

/* Changelog page */
.changelog-list {
  max-width: 780px;
  margin: 0 auto;
}
.changelog-entry {
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.changelog-entry h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}
.changelog-entry .meta {
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  font-weight: 700;
}
.changelog-entry p {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* Mobile refinements — the layout is already fluid; these tighten spacing
   and prevent a few wide blocks from forcing horizontal scroll on phones. */
@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }
  section {
    padding: 48px 0;
  }
  .hero {
    padding: 56px 0 40px;
  }
  .hero .mark {
    width: 88px;
    height: 88px;
    margin-bottom: 20px;
  }
  .cta-row .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .hero-stats {
    padding: 16px;
    margin-top: 28px;
  }
  #pricing {
    padding: 56px 0;
  }
  .price-card {
    padding: 22px 18px;
  }
  .authcard,
  .replaycard {
    padding: 24px 20px;
  }
  .authcard h1 {
    font-size: 22px;
  }
  .auth-shell {
    padding: 40px 0 60px;
  }
  .legal {
    padding: 40px 0 60px;
  }
  .legal h1 {
    font-size: 26px;
  }
  footer.site .wrap {
    justify-content: center;
    text-align: center;
  }
  .trophy-footer {
    flex-direction: column;
  }
  .trophy-banner {
    padding: 22px 22px 60px;
  }
  .trophy-body {
    padding: 42px 20px 20px;
  }
  .trophy-title {
    font-size: 22px;
  }
  .trophy-hero-value {
    font-size: 28px;
  }
}

/* Guest session invite (session.html) */
.invite-actions { margin-top: 20px; }
.invite-gap { margin-top: 24px; }
.invite-stores { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.invite-small { font-size: 14px; }

/* User manual (guide.html) — a long reference page: sticky contents rail on
   wide screens, single column with the contents list up top on phones. */
.manual {
  padding: 56px 0 80px;
}
.manual .manual-head {
  max-width: 640px;
}
.manual .manual-head h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.manual-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.manual-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 18px 16px;
  background: var(--card);
  background-image: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.manual-toc-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.manual-toc ol {
  margin: 0;
  padding-left: 22px;
  color: var(--dimmer);
  font-size: 13.5px;
}
.manual-toc li {
  padding: 3px 0;
}
.manual-toc a {
  color: var(--dim);
}
.manual-toc a:hover {
  color: var(--text);
  text-decoration: none;
}
.manual-body {
  max-width: 760px;
  min-width: 0;
}
.manual-body section {
  padding: 0 0 36px;
  margin-bottom: 36px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}
.manual-body section:last-of-type {
  border-bottom: 0;
}
.manual-body h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.manual-body h2 .num {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--bg);
  background: var(--grad-brand);
}
.manual-body h3 {
  font-size: 16.5px;
  margin: 26px 0 8px;
  scroll-margin-top: 88px;
}
.manual-body p,
.manual-body li {
  color: var(--dim);
  font-size: 15px;
  line-height: 1.65;
}
.manual-body strong {
  color: var(--text);
}
.manual-body em {
  color: var(--text);
  font-style: normal;
  font-weight: 500;
}
.manual-body ul,
.manual-body ol {
  padding-left: 22px;
}
.manual-body li + li {
  margin-top: 4px;
}
.manual-body a {
  color: var(--accent2);
}
.manual-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--card-alt);
  color: var(--text);
}
.manual-body ul.cols {
  columns: 2;
  column-gap: 32px;
}
.manual-body ul.cols li {
  break-inside: avoid;
}
.manual-body .callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--dim);
  font-size: 14.5px;
  line-height: 1.6;
}
.manual-body .table-wrap {
  margin: 14px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.manual-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.manual-body th,
.manual-body td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  line-height: 1.5;
}
.manual-body th {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--card-alt);
}
.manual-body tbody tr:last-child td {
  border-bottom: 0;
}
.manual-body td:first-child {
  min-width: 140px;
}
.manual-body .faq-list {
  max-width: none;
}
.manual-foot {
  color: var(--dimmer);
  font-size: 13px;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .manual-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .manual-toc {
    position: static;
    max-height: none;
  }
  .manual-toc ol {
    columns: 2;
    column-gap: 24px;
  }
  .manual-toc li {
    break-inside: avoid;
  }
}
@media (max-width: 640px) {
  .manual {
    padding: 40px 0 60px;
  }
  .manual-toc ol,
  .manual-body ul.cols {
    columns: 1;
  }
  .manual-body h2 {
    font-size: 21px;
  }
  .manual-body th,
  .manual-body td {
    padding: 9px 10px;
  }
  .manual-body td:first-child {
    min-width: 110px;
  }
}
