/* ==========================================================================
   FIELDWORKS — design tokens
   Shell brand: racing green + signal amber + technical paper.
   Per-app accent (e.g. TrackMile navy/blue) is scoped via body classes,
   drawn from that app's own real icon so each product keeps its identity
   inside the shared shell.
   ========================================================================== */

:root {
  --ink:        #12241C;
  --green:      #1C4632;
  --green-deep: #0F2E20;
  --paper:      #E9E4D6;
  --paper-high: #F2EEE2;
  --amber:      #E2932E;
  --amber-deep: #B96F1D;
  --slate:      #5B6A61;
  --line:       #C9C2AC;
  --white:      #FBFAF6;

  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body:    'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --max: 1120px;
}

/* App-specific accent overrides — TrackMile carries its real icon's navy/blue */
body.app-trackmile {
  --accent: #2E6BE0;
  --accent-deep: #0E1A38;
}
body { --accent: var(--amber); --accent-deep: var(--amber-deep); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--green-deep); }

h1 { font-weight: 900; letter-spacing: -0.01em; }
h2 { font-weight: 800; letter-spacing: -0.005em; }
h3 { font-weight: 700; }

p { margin: 0 0 1em; color: var(--ink); }
p.lede { color: var(--slate); font-size: 1.05em; }

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

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(233, 228, 214, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.wordmark {
  font-family: var(--font-display); font-weight: 900; font-size: 1.15rem;
  letter-spacing: 0.02em; text-decoration: none; color: var(--green-deep);
  text-transform: uppercase;
}
.wordmark span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  color: var(--ink); border-bottom: 2px solid transparent; padding-bottom: 3px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { border-color: var(--accent); color: var(--green-deep); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { position: fixed; inset: 68px 0 0 0; background: var(--paper-high);
    flex-direction: column; padding: 24px 28px; gap: 18px; transform: translateY(-110%);
    transition: transform 0.2s ease; border-bottom: 1px solid var(--line); }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle {
    display: block; background: none; border: 1px solid var(--line); border-radius: 6px;
    width: 40px; height: 36px; font-size: 1.1rem; cursor: pointer; color: var(--green-deep);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
  padding: 13px 22px; border-radius: 4px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green-deep); color: var(--white); }
.btn-primary:hover { background: var(--ink); }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; color: var(--green-deep); border-color: var(--green-deep); }
.btn-ghost:hover { background: var(--green-deep); color: var(--white); }

/* ---------- Route line divider (signature element) ---------- */
.route {
  display: flex; align-items: center; gap: 18px; margin: 4px 0 30px;
}
.route .marker {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  color: var(--accent-deep); background: var(--paper-high); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 3px; white-space: nowrap; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.route .line {
  flex: 1; height: 0; border-top: 2px dashed var(--line);
  position: relative;
  overflow: hidden;
}
.route .line::after {
  content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 100%;
  border-top: 2px dashed var(--accent);
  transform: scaleX(0); transform-origin: left;
  animation: draw 1.1s ease forwards;
  animation-timeline: view();
}
@keyframes draw { to { transform: scaleX(1); } }
@supports not (animation-timeline: view()) {
  .route .line::after { transform: scaleX(1); }
}

/* ---------- Hero ---------- */
.hero { padding: 76px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 3.4rem); line-height: 1.05; }
.hero .lede { font-size: 1.15rem; max-width: 46ch; margin-top: 18px; }
.hero .cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Odometer signature widget */
.odometer-card {
  background: var(--green-deep); border-radius: 10px; padding: 28px 26px;
  color: var(--white); position: relative; overflow: hidden;
}
.odometer-card::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 26px);
}
.odometer-label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(251,250,246,0.6); margin-bottom: 14px;
}
.odometer-digits {
  font-family: var(--font-mono); font-weight: 600; font-size: 2.6rem;
  letter-spacing: 0.06em; display: flex; gap: 4px;
}
.odometer-digits span {
  background: rgba(0,0,0,0.28); border-radius: 4px; padding: 4px 6px;
  min-width: 1ch; text-align: center;
}
.odometer-digits .sep { background: none; padding: 4px 0; color: rgba(251,250,246,0.4); font-weight: 400; }
.odometer-unit { margin-top: 10px; font-size: 0.85rem; color: rgba(251,250,246,0.75); }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-head { max-width: 62ch; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head p { margin-top: 12px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- App cards ---------- */
.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; } }

.app-card {
  background: var(--paper-high); border: 1px solid var(--line); border-radius: 10px;
  padding: 26px; display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: var(--ink); transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.app-card.live { border-color: var(--accent); }
.app-card.live:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(18,36,28,0.12); }
.app-card.stub { opacity: 0.62; cursor: default; }
.app-card .app-icon { width: 52px; height: 52px; border-radius: 12px; }
.app-card h3 { font-size: 1.15rem; }
.app-card .status {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent-deep); font-weight: 600;
}
.app-card.stub .status { color: var(--slate); }
.app-card p { color: var(--slate); font-size: 0.94rem; margin: 0; flex: 1; }

/* ---------- Feature groups (TrackMile page) ---------- */
.feature-group { margin-bottom: 44px; }
.feature-group h3 {
  font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent-deep); margin-bottom: 18px; font-family: var(--font-mono); font-weight: 600;
}
.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 32px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 700px) { .feature-list { grid-template-columns: 1fr; } }
.feature-list li { padding-left: 22px; position: relative; color: var(--ink); }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 9px; height: 9px;
  background: var(--accent); border-radius: 1px; transform: rotate(45deg);
}
.feature-list strong { display: block; font-weight: 700; margin-bottom: 2px; }
.feature-list span { color: var(--slate); font-size: 0.94rem; }

/* ---------- Status banner ---------- */
.status-banner {
  display: flex; align-items: center; gap: 12px; background: var(--paper-high);
  border: 1px solid var(--accent); border-radius: 8px; padding: 14px 20px; margin-bottom: 40px;
}
.status-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.status-banner strong { color: var(--accent-deep); }

/* ---------- FAQ / accordion ---------- */
.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item summary {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  color: var(--green-deep);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent-deep); font-weight: 400; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: 12px; color: var(--slate); }

/* ---------- Policy / doc pages ---------- */
.doc { max-width: 74ch; }
.doc h2 { font-size: 1.35rem; margin-top: 40px; margin-bottom: 12px; }
.doc h2:first-of-type { margin-top: 0; }
.doc ul { color: var(--ink); padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc .updated {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--slate);
  border: 1px solid var(--line); display: inline-block; padding: 5px 10px; border-radius: 4px; margin-bottom: 30px;
}

/* ---------- Contact card ---------- */
.contact-card {
  background: var(--green-deep); color: var(--white); border-radius: 10px;
  padding: 34px; display: flex; flex-direction: column; gap: 16px;
}
.contact-card a.btn-accent { align-self: flex-start; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0; margin-top: 40px; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer .foot-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
footer .foot-links a { text-decoration: none; font-size: 0.88rem; color: var(--slate); font-weight: 600; }
footer .foot-links a:hover { color: var(--green-deep); }
footer .copy { font-size: 0.82rem; color: var(--slate); font-family: var(--font-mono); }
