/* TrailSim site styles — mobile-first. Colors per docs/design.md:
   pine #1E5B4A (primary), blaze #E8722A (accent), cream #FAF7F2 (bg),
   ink #26302C (text). Map semantics: green = signal, orange = weak, gray = dead. */

:root {
  --pine: #1E5B4A;
  --pine-dark: #17463A;
  --blaze: #E8722A;
  --blaze-dark: #C55B1C;
  --cream: #FAF7F2;
  --ink: #26302C;
  --muted: #5C6B64;
  --line: #E4DED4;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
}

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

a { color: var(--pine); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header: logo + 2 links, no hamburger at any width. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--pine);
}
.brand em { font-style: normal; color: var(--blaze); }
.brand img { width: 30px; height: 30px; }
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 18px;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 0;
}
.site-nav a[aria-current="page"],
.site-nav a:hover { color: var(--pine); text-decoration: underline; text-underline-offset: 5px; }

/* Buttons: >=44px touch targets. */
.btn {
  display: inline-block;
  padding: 13px 24px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn-primary { background: var(--blaze); color: #fff; }
.btn-primary:hover { background: var(--blaze-dark); }
.btn-secondary { background: transparent; color: var(--pine); border: 2px solid var(--pine); }
.btn-secondary:hover { background: var(--pine); color: var(--cream); }

/* Hero */
.hero { padding: 40px 0 32px; }
.hero h1 { font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.1; letter-spacing: -0.045em; margin: 0 0 12px; }
.hero .sub { color: var(--muted); margin: 0 0 24px; }

/* Route wizard card */
.wizard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: grid;
  gap: 14px;
}
.wizard-hero {
  display: block;
  width: calc(100% + 40px);
  max-width: none;
  height: auto;
  margin: -20px -20px 4px;
  border-radius: 13px 13px 0 0;
}
.wizard label { font-weight: 600; font-size: 0.9rem; }
.wizard select,
.wizard input {
  width: 100%;
  padding: 12px;
  min-height: 44px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
}
/* Sections */
section { padding: 36px 0; }
section h2 { font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.04em; margin: 0 0 8px; }
section .lead { color: var(--muted); margin: 0 0 24px; }
.alt { background: #fff; }
.dark {
  background: var(--pine);
  color: var(--cream);
}
.dark h2 { color: #fff; }
.dark a { color: #fff; }

/* Card grids: single column on mobile, expand on wider screens. */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.card h3 { margin: 0 0 6px; font-size: 1.14rem; letter-spacing: -0.015em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card .meta { display: block; margin-top: 10px; font-size: 0.85rem; color: var(--pine); font-weight: 600; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--pine); }

/* Numbered steps */
.steps { counter-reset: step; display: grid; gap: 14px; }
.steps .card { position: relative; padding-left: 62px; }
.steps .card::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pine);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Coverage bars (sample analysis) */
.coverage-row { margin-bottom: 14px; }
.coverage-row .label { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 4px; }
.coverage-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--line);
}
.coverage-bar .signal { background: var(--pine); }
.coverage-bar .weak { background: var(--blaze); }
.coverage-bar .dead { background: #9AA39E; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}
.legend .l-signal::before { background: var(--pine); }
.legend .l-weak::before { background: var(--blaze); }
.legend .l-dead::before { background: #9AA39E; }

/* Comparison: stacked cards on mobile, no horizontal scroll. */
.compare { display: grid; gap: 14px; }
.compare .card ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.95rem; }
.compare .card.featured { border: 2px solid var(--pine); }

/* Facts list on route pages */
.facts { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin: 0; }
.facts div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.facts dt { font-size: 0.8rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 700; }

/* FAQ */
details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
details summary { font-weight: 600; cursor: pointer; min-height: 28px; }
details p { color: var(--muted); margin: 10px 0 0; }

/* Forms */
.form { display: grid; gap: 14px; max-width: 560px; }
.form label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 4px; }
.form input, .form select, .form textarea {
  width: 100%;
  padding: 12px;
  min-height: 44px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
.form textarea { min-height: 100px; }
.form .hp { position: absolute; left: -9999px; }
.form-note { font-size: 0.85rem; color: var(--muted); }

/* Footer */
.site-footer {
  background: var(--pine-dark);
  color: var(--cream);
  padding: 36px 0 80px;
  font-size: 0.9rem;
}
.site-footer a { color: var(--cream); }
.site-footer .cols { display: grid; gap: 20px; }
.site-footer h3 { font-size: 0.95rem; margin: 0 0 8px; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer .fine { margin-top: 24px; color: #B9CCC4; font-size: 0.8rem; }

/* Mobile sticky bottom CTA (subpages). */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(250, 247, 242, 0.95);
  border-top: 1px solid var(--line);
}
.sticky-cta .btn { width: 100%; display: block; }

/* Desktop */
@media (min-width: 720px) {
  .hero { padding: 64px 0 48px; }
  .hero-cols { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: start; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .compare { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .site-footer { padding-bottom: 36px; }
  .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; }
  .sticky-cta { display: none; }
}
