/* Parks Planner: the plan as a survey map sheet.
   Pale cool sheet, slate ink, one survey-blue accent. Brown appears only
   in the hero's contour lines. Colour in the cost chart means "where this
   number came from", the same way a map legend does. */

/* Fonts are self-hosted (SIL Open Font License): Bricolage Grotesque by
   Mathieu Triay, Source Sans 3 by Adobe. */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap;
  font-weight: 200 800; font-stretch: 75% 100%;
  src: url("fonts/bricolage-grotesque-wdth.woff2") format("woff2");
}
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-400.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-sans-3-600.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/source-sans-3-700.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-400-italic.woff2") format("woff2"); }

:root {
  --sheet: #f1f4ee;
  --sheet-deep: #e4eadf;
  --ink: #17262b;
  --ink-soft: #4a5e63;
  --rule: #c6d1c8;
  --water: #2a6f8e;
  --water-deep: #1d5470;
  --leaf: #dce8d4;
  --contour: #9c7549;
  --alert: #b3361f;
  --alert-wash: #f7e4df;
  --amber: #a86f00;
  --amber-wash: #f6ebd0;

  --src-nps: #2c5e46;
  --src-eia: #3a8c93;
  --src-gsa: #8dbf9b;
  --src-assumption: #8e9a9e;
  --src-estimate: #d49a1e;

  --display: "Bricolage Grotesque", "Avenir Next Condensed", "Arial Narrow", system-ui, sans-serif;
  --text: "Source Sans 3", "Frutiger", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 40rem;
}

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

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

body {
  margin: 0;
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
}

h1, h2, h3 { font-family: var(--display); margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--water-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--water); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 10;
  background: var(--ink); color: var(--sheet); padding: 0.6rem 1rem;
}
.skip:focus { left: 0; }

/* ---------- Hero: a contour sheet with the route on it ---------- */

.hero {
  position: relative;
  min-height: clamp(26rem, 64vh, 36rem);
  overflow: hidden;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
}
.hero-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hero-copy {
  position: relative; z-index: 1;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 0;
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(3.5rem, 11vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-weight: 800;
  font-variation-settings: "wdth" 76;
}
.lede {
  margin: 1.25rem 0 0;
  max-width: 28em;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.4;
  color: var(--ink);
}
.hero-note {
  position: absolute; right: max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter))); bottom: 0.9rem; z-index: 1;
  margin: 0; font-size: 0.875rem; color: var(--ink-soft);
}

/* SVG route pieces */
.contour-minor { fill: none; stroke: var(--contour); stroke-width: 0.8; opacity: 0.32; stroke-linecap: round; }
.contour-index { fill: none; stroke: var(--contour); stroke-width: 1.5; opacity: 0.5; stroke-linecap: round; }
.route-line {
  fill: none; stroke: var(--water); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.route-line.draw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.8s cubic-bezier(0.5, 0, 0.2, 1); }
.route-stop { opacity: 0; }
.route-stop.draw { opacity: 1; transition: opacity 0.4s ease; }
.route-dot { fill: var(--sheet); stroke: var(--ink); stroke-width: 3; }
.route-name {
  font-family: var(--display); font-weight: 700; font-size: 1.35rem;
  fill: var(--ink); paint-order: stroke; stroke: var(--sheet); stroke-width: 6px; stroke-linejoin: round;
}
.route-days {
  font-family: var(--text); font-weight: 600; font-size: 0.95rem;
  fill: var(--ink-soft); paint-order: stroke; stroke: var(--sheet); stroke-width: 5px; stroke-linejoin: round;
}

/* ---------- Saved plans picker ---------- */

.sheets { background: var(--sheet-deep); border-bottom: 1px solid var(--rule); }
.sheets-inner { max-width: 1240px; margin: 0 auto; padding: 1.5rem var(--gutter) 1.25rem; }
.sheets-intro { margin: 0 0 0.75rem; color: var(--ink-soft); font-size: 1rem; }

.sheet-list { display: grid; gap: 0; }
.sheet-tab {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 1.5rem; align-items: baseline;
  width: 100%; text-align: left; cursor: pointer;
  background: transparent; color: inherit; font: inherit;
  border: 0; border-top: 1px solid var(--rule); border-left: 5px solid transparent;
  padding: 0.85rem 0.75rem 0.85rem 0.9rem;
}
.sheet-tab:hover { background: rgba(255, 255, 255, 0.45); }
.sheet-tab[aria-selected="true"] { background: var(--sheet); border-left-color: var(--water); }
.sheet-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; font-variation-settings: "wdth" 88; }
.sheet-blurb { grid-column: 1; font-size: 1rem; color: var(--ink-soft); }
.sheet-status { grid-row: 1; grid-column: 2; font-weight: 600; font-size: 1rem; }
.status-pass { color: var(--water-deep); }
.status-fail { color: var(--alert); }

.sample-flag {
  background: var(--amber-wash); color: #5d3d00; text-align: center;
  padding: 0.6rem var(--gutter); font-size: 1rem; border-bottom: 1px solid #e3cf9a;
}
.sample-flag[hidden] { display: none; }

/* ---------- Plan sections ---------- */

main { outline: none; }
.loading, .load-error { max-width: var(--measure); margin: 3rem auto; padding: 0 var(--gutter); }

.lead { max-width: 1240px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(2rem, 4vw, 3rem); }
.lead h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 82; margin-bottom: 1.25rem; max-width: 18em;
}
.lead-text { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.45; max-width: 34em; margin-bottom: 0.75rem; }
.lead-text strong { font-weight: 700; }
.lead-verdict { margin: 0; font-weight: 600; }
.lead-verdict a { font-weight: 600; }
.lead-note { margin: 0.75rem 0 0; color: var(--ink-soft); font-style: italic; max-width: 34em; }

.sec {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 1.25rem 4rem;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
  /* A rule that stops at the content edge instead of the section edge. */
  background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.rail h2 { font-size: clamp(1.7rem, 3vw, 2.1rem); line-height: 1.05; font-variation-settings: "wdth" 85; margin-bottom: 0.5rem; }
.rail p { color: var(--ink-soft); font-size: 1rem; margin: 0; max-width: 18em; }
.sec-body { min-width: 0; }

/* The trail: days along a line, parks as signposts */
.trail { list-style: none; margin: 0; padding: 0; position: relative; }
.trail::before { content: ""; position: absolute; left: 8px; top: 1.2rem; bottom: 1rem; width: 2px; background: var(--water); }

.park-sign {
  position: relative; margin: 2rem 0 1.1rem; padding: 0.45rem 1rem 0.45rem 2.1rem;
  background: var(--leaf); border: 2px solid var(--src-nps); border-radius: 3px;
  font-family: var(--display); font-weight: 700; font-size: 1.45rem; font-variation-settings: "wdth" 88;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 1rem;
}
.park-sign:first-child { margin-top: 0; }
.park-sign small { font-family: var(--text); font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }
.park-sign::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 0;
  background: var(--src-nps); border: 3px solid var(--sheet); border-radius: 50%; transform: translateX(-1px);
  box-shadow: 0 0 0 2px var(--src-nps);
}

.day {
  position: relative; display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 0 1.25rem;
  padding-left: 2.1rem; margin-bottom: 1.9rem;
}
.day::before {
  content: ""; position: absolute; left: 0; top: 0.45rem; width: 18px; height: 18px;
  background: var(--sheet); border: 2px solid var(--water); border-radius: 50%;
}
.day-date { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.1; font-variation-settings: "wdth" 88; }
.day-date small { display: block; margin-top: 0.2rem; font-family: var(--text); font-weight: 600; font-size: 0.9rem; color: var(--ink-soft); }
.activities { list-style: none; margin: 0 0 0.6rem; padding: 0; max-width: var(--measure); }
.activities li { margin-bottom: 0.35rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.2rem 1.75rem; margin: 0; font-size: 1rem; }
.facts div { display: flex; gap: 0.5rem; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 600; }

/* Money */
.money-lede { max-width: var(--measure); margin-bottom: 1.25rem; }
.bar { display: flex; height: 2.5rem; border-radius: 3px; overflow: hidden; border: 1px solid var(--ink); background: var(--sheet-deep); }
.bar-seg { min-width: 2px; border-right: 2px solid var(--sheet); }
.bar-seg:last-child { border-right: 0; }

.legend { list-style: none; margin: 1.1rem 0 2rem; padding: 0; display: grid; gap: 0.1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.legend li { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto; gap: 0.15rem 0.7rem; align-items: baseline; padding: 0.55rem 0; border-top: 1px solid var(--rule); }
.swatch { width: 1.1rem; height: 1.1rem; border-radius: 2px; display: inline-block; align-self: center; }
.legend .what { font-weight: 600; }
.legend .src-how { grid-column: 2 / 4; font-size: 0.95rem; color: var(--ink-soft); }
.amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }

.ledger { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ledger th, .ledger td { text-align: left; padding: 0.65rem 0.75rem 0.65rem 0; border-top: 1px solid var(--rule); vertical-align: top; }
.ledger thead th { border-top: 0; border-bottom: 2px solid var(--ink); font-weight: 600; color: var(--ink-soft); font-size: 0.95rem; }
.ledger .num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger .item { font-weight: 600; }
.ledger .item small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.95rem; }
.ledger .src { white-space: nowrap; }
.src-inline { display: none; }
.ledger .src .swatch { margin-right: 0.45rem; vertical-align: -0.12em; }
.ledger tfoot td { border-top: 2px solid var(--ink); font-weight: 700; }

/* Inspection */
.check-group { margin: 0 0 2.25rem; max-width: 46rem; }
.check-group h3 { font-size: 1.35rem; font-variation-settings: "wdth" 88; margin-bottom: 0.2rem; }
.check-group > p { color: var(--ink-soft); font-size: 1rem; margin-bottom: 0.75rem; }
.checks { list-style: none; margin: 0; padding: 0; }
.check { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0 0.85rem; padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.check .name { font-weight: 700; }
.check .detail { color: var(--ink-soft); font-size: 1rem; }
.glyph { width: 1.6rem; height: 1.6rem; margin-top: 0.12rem; }
.glyph-pass { color: var(--water-deep); }
.glyph-fail { color: var(--alert); }
.glyph-warn { color: var(--amber); }

.flags { list-style: none; margin: 0; padding: 0; }
.flag { padding: 0.75rem 0 0.75rem 1rem; border-top: 1px solid var(--rule); border-left: 5px solid var(--amber); margin-bottom: 0; background: linear-gradient(90deg, var(--amber-wash), transparent 60%); }
.flag.hard { border-left-color: var(--alert); background: linear-gradient(90deg, var(--alert-wash), transparent 60%); }
.flag b { font-weight: 700; }
.flag .sev { font-weight: 600; margin-right: 0.5rem; }
.flag.hard .sev { color: var(--alert); }
.flag:not(.hard) .sev { color: var(--amber); }

.unchecked { margin: 0; padding-left: 1.2rem; max-width: 42rem; }
.unchecked li { margin-bottom: 0.5rem; }
.fresh { max-width: 42rem; }

/* Rejected */
.rejected { max-width: 44rem; margin-bottom: 2.5rem; }
.rejected h3 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); color: var(--alert); margin-bottom: 0.6rem; font-variation-settings: "wdth" 85; }
.asked { margin: 1.25rem 0 0; font-size: 1rem; color: var(--ink-soft); }

/* ---------- How it works ---------- */

.how { background: var(--sheet-deep); border-top: 1px solid var(--rule); margin-top: 2rem; }
.how-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 1.25rem 4rem; max-width: 1240px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter); }
.how-body { min-width: 0; }
.how h2 { font-size: clamp(1.7rem, 3vw, 2.1rem); line-height: 1.05; font-variation-settings: "wdth" 85; }
.how-lede { max-width: 36em; font-size: 1.25rem; line-height: 1.45; margin-bottom: 0; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem 2.5rem; margin: 2rem 0 2.5rem; max-width: 62rem; }
.rules p { margin: 0; padding-top: 0.9rem; border-top: 3px solid var(--ink); }
.rules strong { font-family: var(--display); font-size: 1.25rem; font-variation-settings: "wdth" 88; display: block; margin-bottom: 0.25rem; }

.key { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.5rem; color: var(--ink-soft); font-size: 1rem; margin-bottom: 1.5rem; }
.key .mark + .mark, .key .mark-code { margin-left: 1.25rem; }
.mark { display: inline-block; width: 1.05rem; height: 1.05rem; }
.mark-model { border: 3px solid var(--ink); border-radius: 50%; background: var(--sheet-deep); }
.mark-code { background: var(--ink); border-radius: 1px; }

.route-list { list-style: none; margin: 0; padding: 0; position: relative; max-width: 46rem; }
.route-list::before { content: ""; position: absolute; left: 0.5rem; top: 0.7rem; bottom: 0.7rem; width: 2px; background: var(--ink); }
.stop { position: relative; padding: 0 0 1.75rem 2.6rem; }
.stop:last-child { padding-bottom: 0; }
.stop::before { content: ""; position: absolute; left: 0; top: 0.35rem; width: 1.05rem; height: 1.05rem; }
.stop[data-kind="model"]::before { border: 3px solid var(--ink); border-radius: 50%; background: var(--sheet-deep); }
.stop[data-kind="code"]::before { background: var(--ink); border-radius: 1px; }
.stop h3 { font-size: 1.45rem; font-variation-settings: "wdth" 88; margin-bottom: 0.15rem; }
.stop p { margin-bottom: 0.25rem; max-width: 36em; }
.stop .returns { color: var(--ink-soft); font-size: 1rem; }

.foot { max-width: 1240px; margin: 0 auto; padding: 2.5rem var(--gutter) 3.5rem; color: var(--ink-soft); font-size: 1rem; }
.foot p { max-width: 40em; margin-bottom: 0.5rem; }

/* ---------- Small screens ---------- */

@media (max-width: 820px) {
  .sec, .how-inner { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
  .rail p { max-width: 32em; }
  .hero-note { left: var(--gutter); right: auto; }
}
@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .day { grid-template-columns: minmax(0, 1fr); padding-left: 1.9rem; }
  .day-date { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.3rem; }
  .day-date small { display: inline; margin: 0; }
  .ledger .src-col, .ledger td.src { display: none; }
  .src-inline { display: block; margin-top: 0.15rem; font-weight: 400; font-size: 0.95rem; color: var(--ink-soft); }
  .src-inline .swatch { margin-right: 0.45rem; width: 0.8rem; height: 0.8rem; vertical-align: -0.05em; }
  .sheet-tab { grid-template-columns: minmax(0, 1fr); }
  .sheet-status { grid-row: auto; grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-line, .route-line.draw, .route-stop, .route-stop.draw { transition: none; }
}
.back {
  display: inline-block; margin-bottom: 1.25rem;
  font-size: 0.95rem; font-weight: 600; text-decoration: none;
  pointer-events: auto;
}
.back:hover { text-decoration: underline; }
.site-foot p { max-width: none; }
