/* trailmaps.app landing page — Trail Brief direction (compact). */

/* Self-hosted Inter and Inter Tight (latin subset, fontsource via jsDelivr).
   font-display: swap renders fallback fonts first, then upgrades when the
   woff2 finishes downloading. No third-party requests at runtime. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/inter-tight-500.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/inter-tight-600.woff2") format("woff2");
}

:root {
  --ink: #13201a;
  --green: #2c5840;
  --green-2: #5b7a64;
  --hi: #1f7a52;
  --bg: #fbf8f0;
  --line: rgba(44, 88, 64, 0.13);
  --pad-x: 64px;
  --pad-y: 56px;
  --gutter: 40px;
  --content-max: 1280px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

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

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

a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible {
  outline: 2px solid var(--hi);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3 {
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

strong { font-weight: 600; color: var(--ink); }

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
  border-top: 1px solid var(--line);
}

/* ---------- Hero ---------- */

.hero {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 80px var(--pad-x) var(--pad-y);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--gutter);
  align-items: center;
}
.wordmark {
  font-family: "Inter Tight", "Inter", system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--green);
  letter-spacing: -0.01em;
  margin: 0;
}
.hero-title {
  font-size: 64px;
  line-height: 1;
  margin-top: 18px;
}
.hero-title .accent { color: var(--green); }
.hero-lede {
  margin-top: 28px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--green);
  max-width: 580px;
}
.hero-lede + .hero-lede { margin-top: 16px; }

.hero-cta {
  margin-top: 36px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary {
  padding: 14px 22px;
  background: var(--ink);
  color: var(--bg);
}
.btn-secondary {
  padding: 13px 22px;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(19, 32, 26, 0.2);
}

.stat-strip {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.stat {
  padding: 20px 22px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; }
.stat-num {
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-label {
  margin-top: 6px;
  color: var(--green-2);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Phone bezel hero shot ---------- */

.hero-shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.phone-frame {
  width: 100%;
  max-width: 328px;     /* 300 inner + 28 bezel both sides */
  padding: 14px;
  background: #1a1612;
  border-radius: 38px;
  box-shadow:
    0 24px 50px -20px rgba(20, 30, 20, 0.45),
    inset 0 0 0 1.5px #3a342c;
}
.phone-inner {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: #000;
}
.phone-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  background: #0a0907;
  border-radius: 14px;
  z-index: 2;
}
.phone-inner img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-caption {
  margin-top: 18px;
  font-size: 13px;
  color: var(--green-2);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

/* ---------- Section heading + filters ---------- */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.section-title {
  font-size: 40px;
  margin: 0;
}

/* Map toolbar: search + sort + view toggle. Wraps on narrow viewports. */
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.map-search-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
  max-width: 320px;
}
.map-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--green-2);
  pointer-events: none;
}
.map-search {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid rgba(44, 88, 64, 0.2);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  background: transparent;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.map-search::placeholder { color: var(--green-2); }
.map-search:hover { border-color: var(--ink); }
.map-search:focus-visible {
  outline: 2px solid var(--hi);
  outline-offset: 2px;
  border-color: var(--hi);
}

/* Segmented controls — Grid/List view, A-Z/Newest sort. Each button group
   reads as a single segmented unit. */
.view-toggle,
.sort-toggle {
  display: inline-flex;
  border: 1px solid rgba(44, 88, 64, 0.2);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
/* Push the display-control group (sort + view) to the right so it sits
   visually distinct from the content-control group (search + filter). */
.sort-toggle { margin-left: auto; }
.view-toggle button,
.sort-toggle button {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  background: transparent;
  color: var(--green);
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.view-toggle button.is-active,
.sort-toggle button.is-active {
  background: var(--ink);
  color: var(--bg);
}
.view-toggle svg { width: 14px; height: 14px; }

/* ---------- Maps grid ---------- */

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.map-card { margin: 0; }
.map-card-link { display: block; }

/* List view: thumb on the left, text on the right. Flex layout with a single
   text wrapper avoids the grid-row span quirks and lets the text reflow
   cleanly across viewport widths. */
.map-grid.is-list {
  grid-template-columns: 1fr;
  gap: 10px;
}
.map-grid.is-list .map-card-link {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  transition: border-color 0.15s ease;
}
.map-grid.is-list .map-card-link:hover { border-color: var(--ink); }
.map-grid.is-list .map-frame {
  flex: 0 0 auto;
  width: 64px;
  height: 100px;
  margin-bottom: 0;
}
.map-grid.is-list .map-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.map-grid.is-list .map-card-text {
  flex: 1 1 auto;
  min-width: 0;
}
.map-grid.is-list .map-name {
  margin-top: 0;
  font-size: 15px;
  line-height: 1.25;
}
.map-grid.is-list .map-card-meta { margin-top: 4px; }
.map-grid.is-list .map-updated { margin-top: 2px; }
.map-frame {
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(20, 30, 20, 0.06),
    0 14px 40px -16px rgba(20, 30, 20, 0.25);
}
.map-frame img { width: 100%; }

.map-name {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--green);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.map-card-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  line-height: 1.2;
}
.map-location {
  color: var(--green-2);
}
/* Updated date — own line below the meta row. Smaller and slightly muted
   versus the location: same family, same color, just lower in the
   hierarchy so it reads as a footnote without competing for attention. */
.map-updated {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--green-2);
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

/* ---------- How-to section ---------- */

.howto-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gutter);
  align-items: start;
}
.howto-intro .section-title { font-size: 36px; line-height: 1.05; }
.howto-lede {
  margin-top: 18px;
  font-size: 16px;
  color: var(--green);
  line-height: 1.6;
  max-width: 380px;
}
.howto-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.howto-tip {
  padding: 24px 28px;
  border-top: 1px solid var(--line);
}
.howto-tip:nth-child(2),
.howto-tip:nth-child(4) { border-left: 1px solid var(--line); }
/* Exact replica of the map app's FAB chrome (templates/style.css L2111-L2135).
   48x48 round button, near-white background, 1.5px light-grey border, soft drop
   shadow, dark icon centered. Token values match --sheet-bg / --sheet-border /
   --sheet-text from the map's light theme so the help-doc icons look identical
   to the FABs they describe. */
.howto-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  border: 1.5px solid #d8d8d8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
}
.howto-icon svg { width: 22px; height: 22px; }
.howto-title {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.howto-body {
  margin-top: 8px;
  font-size: 14px;
  color: var(--green-2);
  line-height: 1.6;
}
.howto-body + .howto-body { margin-top: 12px; }

/* ---------- Philosophy ---------- */

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gutter);
}
.philosophy-grid .section-title {
  font-size: 36px;
  line-height: 1.05;
}
.philosophy-body {
  font-size: 18px;
  color: var(--green);
  line-height: 1.6;
}
.philosophy-body + .philosophy-body {
  margin-top: 18px;
}
.philosophy-body--ink { color: var(--ink); }

.principles {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.principle {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.principle-eyebrow {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hi);
}
.principle-body {
  margin-top: 10px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
}

/* ---------- About + Contact (inverse) ---------- */

.invert {
  background: var(--ink);
  color: var(--bg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
  border-top: 0;
}
.about-title {
  color: var(--bg);
  font-size: 36px;
  line-height: 1.05;
}
.about-body {
  font-size: 17px;
  color: #cfe0d2;
  margin-top: 18px;
  line-height: 1.65;
  max-width: 480px;
}
.about-body strong { color: var(--bg); }
.tool-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tool-card {
  display: block;
  padding: 18px;
  border-radius: 12px;
  background: #1d2e26;
  border: 1px solid #2a4034;
}
.tool-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9bb59f;
  font-size: 13px;
}
.tool-name {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--bg);
}
.tool-desc {
  margin-top: 4px;
  font-size: 13px;
  color: #9bb59f;
}

.contact-card {
  background: var(--bg);
  color: var(--ink);
  padding: 32px;
  border-radius: 16px;
  align-self: start;
}
.contact-title {
  font-size: 28px;
  margin: 0;
}
.contact-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
}
.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.contact-row .left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}
.contact-cta {
  background: var(--hi);
  color: var(--bg);
  border: 0;
  padding: 16px 20px;
}
.contact-cta .left { font-weight: 500; }
.contact-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--green-2);
  line-height: 1.6;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  :root {
    --pad-x: 28px;
    --pad-y: 44px;
    --gutter: 32px;
  }
  .hero { padding: 56px var(--pad-x) var(--pad-y); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 48px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .map-grid { grid-template-columns: repeat(2, 1fr); }
  .howto-grid { grid-template-columns: 1fr; }
  .philosophy-grid { grid-template-columns: 1fr; }
  .principles { grid-template-columns: repeat(2, 1fr); }
  .invert { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-title { font-size: 40px; }
  .section-title { font-size: 32px; }
  .map-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .principles { grid-template-columns: 1fr; }
  .howto-tips { grid-template-columns: 1fr; }
  .howto-tip:nth-child(2),
  .howto-tip:nth-child(4) { border-left: 0; }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  /* Toolbar on narrow screens: search takes the full row, sort + view sit
     together on a second row at the start (no auto-margin push). */
  .map-toolbar { gap: 10px; }
  .map-search-wrap {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .sort-toggle { margin-left: 0; }
}
