/* Forage marketing site.
   Colours mirror lib/theme/tokens.dart and lib/theme/forage_theme.dart:
   "Field Journal" (light) and "Forest Night" (dark, via prefers-color-scheme). */

/* ---------- Fonts (SIL OFL 1.1, see assets/fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/Fraunces-SemiBold.woff2") format("woff2"),
       url("assets/fonts/Fraunces-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("assets/fonts/SourceSans3-Regular.woff2") format("woff2"),
       url("assets/fonts/SourceSans3-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("assets/fonts/SourceSans3-Semibold.woff2") format("woff2"),
       url("assets/fonts/SourceSans3-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  /* Field Journal */
  --paper: #F5ECD7;
  --paper-elevated: #FFF9EE;
  --surface-low: #FAF3E3;
  --surface: #F2E8D0;
  --surface-high: #EEE4CB;
  --ink: #24452D;
  --ink-muted: #4E5D49;
  --primary: #366028;
  --on-primary: #FFF9EE;
  --primary-container: #DCE6CB;
  --on-primary-container: #1B3313;
  --gold: #E2AE4A;
  --on-gold: #24301C;
  --gold-text: #805A12;
  --sage: #9AA985;
  --tan: #CCB995;
  --water: #8FAFB2;
  --outline: #857A60;
  --outline-variant: #D9CAA6;
  --link: #366028;
  --warn-bg: #F6D9CF;
  --warn-ink: #4A140A;
  --warn-border: #A3402F;
  --map-land: #EAE3C8;
  --map-veg: #D3D9B8;
  --map-contour: #CCB995;
  --marker-rim: #FFF9EE;
  --shadow: 0 1px 2px rgb(36 69 45 / 0.08), 0 6px 20px rgb(36 69 45 / 0.08);

  --heading: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --gutter: 20px;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Forest Night */
    --paper: #15382D;
    --paper-elevated: #214B3B;
    --surface-low: #153D31;
    --surface: #1A4335;
    --surface-high: #214B3B;
    --ink: #F5ECD7;
    --ink-muted: #C3D2C4;
    --primary: #E2AE4A;
    --on-primary: #15382D;
    --primary-container: #2E5B48;
    --on-primary-container: #F5ECD7;
    --gold: #E2AE4A;
    --on-gold: #15382D;
    --gold-text: #F2CB7C;
    --outline: #7F9C8A;
    --outline-variant: #3A6352;
    --link: #F2CB7C;
    --warn-bg: #4A2219;
    --warn-ink: #FFDAD2;
    --warn-border: #FFB4A6;
    --map-land: #1B4334;
    --map-veg: #214B3B;
    --map-contour: #3A6352;
    --marker-rim: #F5ECD7;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.25), 0 6px 20px rgb(0 0 0 / 0.2);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

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

h1, h2, h3 {
  font-family: var(--heading);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible, .store-badge:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

strong { font-weight: 600; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  padding: 10px 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-sm);
  z-index: 10;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--outline-variant);
  background: var(--paper-elevated);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;
}
.brand img { width: 44px; height: 44px; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--r-sm);
}
.site-nav a:hover { background: var(--surface); }
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.35em;
}

/* ---------- Buttons & store badges ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  background: var(--primary);
  color: var(--on-primary);
  border: 1.5px solid var(--primary);
}
.button:hover { filter: brightness(1.08); }
.button.outline { background: transparent; color: var(--ink); border-color: var(--primary); }

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 190px;
  min-height: 56px;
  padding: 8px 18px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  line-height: 1.2;
}
.store-badge small { font-size: 0.8rem; opacity: 0.9; letter-spacing: 0.02em; }
.store-badge span { font-weight: 600; font-size: 1.15rem; }
.store-badge[aria-disabled="true"] { cursor: default; }

/* ---------- Hero ---------- */
.hero {
  padding: 48px 0 56px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: center;
}
@media (min-width: 860px) {
  .hero .wrap { grid-template-columns: 1.05fr 1fr; gap: 48px; }
  .hero { padding: 72px 0 80px; }
}
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.lede {
  font-size: 1.2rem;
  color: var(--ink-muted);
  max-width: 34em;
}
.hero .store-badges { margin-top: 24px; }
.hero-note { margin-top: 14px; font-size: 0.95rem; color: var(--ink-muted); }

/* Illustrated "map" panel: CSS contours plus real category illustrations. */
.map-panel {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--map-land);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow);
}
.map-panel svg.contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.map-panel .veg { fill: var(--map-veg); }
.map-panel .contour { fill: none; stroke: var(--map-contour); stroke-width: 1.2; }
.map-panel .stream { fill: none; stroke: var(--water); stroke-width: 5; stroke-linecap: round; }
.map-panel .trail { fill: none; stroke: var(--outline); stroke-width: 1.6; stroke-dasharray: 5 6; }
.map-panel .walked { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 7; }
.map-panel .area { fill: var(--gold); fill-opacity: 0.18; stroke: var(--gold); stroke-width: 2; }

.pin {
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  transform: translate(-50%, -100%);
}
.pin::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--marker-rim);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.18);
  border: 2px solid var(--outline-variant);
}
.pin img {
  position: absolute;
  inset: 14%;
  width: 72%;
  height: 72%;
}
.pin.selected::before { border: 3px solid var(--gold); outline: 2px solid var(--primary); }
.pin.p1 { left: 22%; top: 36%; }
.pin.p2 { left: 52%; top: 30%; width: 18%; }
.pin.p3 { left: 80%; top: 50%; }
.pin.p4 { left: 30%; top: 82%; }
.pin.p5 { left: 70%; top: 88%; }

.you {
  position: absolute;
  left: 50%;
  top: 62%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #3A7BD5;
  border: 3px solid #FFF9EE;
  box-shadow: 0 0 0 10px rgb(58 123 213 / 0.2);
}

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--surface-low); border-top: 1px solid var(--outline-variant); border-bottom: 1px solid var(--outline-variant); }
.section-intro { max-width: 40em; margin-bottom: 32px; color: var(--ink-muted); font-size: 1.1rem; }

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.card {
  background: var(--paper-elevated);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  padding: 22px var(--gutter);
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.feature-card { display: flex; gap: 16px; align-items: flex-start; }
.feature-card img { flex: 0 0 auto; width: 56px; height: 56px; }

/* Season strip, as in the spot sheet: Sep-Oct as a connected gold segment. */
.season-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
  margin: 14px 0 4px;
  list-style: none;
  padding: 0;
  font-size: 0.78rem;
  text-align: center;
  color: var(--ink-muted);
}
.season-strip li { position: relative; padding-top: 18px; }
.season-strip li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--outline-variant);
}
.season-strip li.on { color: var(--ink); font-weight: 600; }
.season-strip li.on::before {
  left: 0;
  right: 0;
  width: auto;
  margin: 0;
  height: 8px;
  border-radius: 0;
  background: var(--gold);
}
.season-strip li.on.start::before { left: 50%; margin-left: -4px; border-radius: 4px 0 0 4px; }
.season-strip li.on.end::before { right: 50%; margin-right: -4px; border-radius: 0 4px 4px 0; }

/* ---------- Tiers ---------- */
.tiers { align-items: stretch; }
.tier { display: flex; flex-direction: column; }
.tier .tier-kind {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.tier.featured { border: 2px solid var(--primary); }
.tier ul { padding-left: 1.2em; margin: 0 0 1em; }
.tier li { margin-bottom: 0.45em; }
.tier .includes { font-weight: 600; }
.tier-footnote { margin-top: 18px; color: var(--ink-muted); font-size: 0.95rem; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--r-md);
  padding: 20px var(--gutter);
  border: 1px solid var(--outline-variant);
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.callout h2, .callout h3 { color: inherit; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.safety {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 2px solid var(--warn-border);
}
.callout.safety a { color: inherit; }

.split {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 0.6em;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 12px;
  height: 7px;
  border-left: 2.5px solid var(--primary);
  border-bottom: 2.5px solid var(--primary);
  transform: rotate(-45deg);
}

.coming-soon { text-align: center; }
.coming-soon .store-badges { justify-content: center; margin-top: 20px; }
.coming-soon img.basket { width: 96px; height: 96px; margin: 0 auto 12px; }

/* ---------- Prose (legal & support pages) ---------- */
.page-head { padding: 44px 0 8px; }
.page-head p { color: var(--ink-muted); }
.prose { max-width: 46rem; padding-bottom: 56px; }
.prose h2 { font-size: 1.55rem; margin-top: 1.8em; padding-top: 0.2em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose .callout { margin: 1.5em 0; }
.prose .callout h2 { margin-top: 0; }

.toc {
  background: var(--paper-elevated);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  padding: 16px var(--gutter);
  margin: 20px 0 8px;
}
.toc h2 { font-family: var(--body); font-size: 1rem; margin: 0 0 6px; padding: 0; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 15rem; column-gap: 28px; }
.toc li { margin-bottom: 0.25em; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--outline-variant); }
th { font-weight: 600; background: var(--surface); }

/* FAQ */
.faq details {
  background: var(--paper-elevated);
  border: 1px solid var(--outline-variant);
  border-radius: var(--r-md);
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  padding: 14px var(--gutter);
  font-weight: 600;
  font-size: 1.08rem;
  min-height: 48px;
  list-style-position: outside;
}
.faq summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: var(--r-md); }
.faq details > div { padding: 0 var(--gutter) 6px; }

.contact-card { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.contact-card .email { font-size: 1.3rem; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--outline-variant);
  padding: 36px 0 44px;
  font-size: 0.95rem;
  color: var(--ink-muted);
}
.site-footer a { color: var(--ink); }
.footer-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1fr 2fr; } }
.site-footer h2 { font-family: var(--body); font-size: 1rem; color: var(--ink); margin-bottom: 8px; }
.footer-links { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { display: inline-block; padding: 6px 0; min-height: 36px; }
.attributions { margin: 0; padding: 0; list-style: none; }
.attributions li { margin-bottom: 0.35em; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 72px 0; }
.not-found img { width: 140px; height: 140px; margin: 0 auto 20px; }
.not-found .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}

/* Stack the services table into cards on narrow screens. */
@media (max-width: 600px) {
  .stack table, .stack tbody, .stack tr, .stack td { display: block; width: 100%; }
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack tr { border: 1px solid var(--outline-variant); border-radius: var(--r-sm); margin-bottom: 10px; background: var(--paper-elevated); }
  .stack td { border-bottom: 0; padding: 6px 14px; }
  .stack td:first-child { font-weight: 600; padding-top: 12px; }
  .stack td:last-child { padding-bottom: 12px; }
  .stack td + td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink-muted); }
}
