/* Atlas. The front page is a survey sheet of a field that is not anywhere.

   Palette: one map ink on buff paper, plus one red. The buff is the colour of
   an old printed survey sheet. It is yellower than the cream-and-clay pairing
   generators reach for, and the accent is a surveyor's red pencil, used only
   for station numbers. Contours and grid are tints of the same ink.

   Type: Barlow Condensed for labels and headings. It was drawn from road signs
   and plates, and that lettering already reads as map annotation. Literata for
   reading, a book face made for long screen text; its italic names the water on
   the map, the old convention of lettering water in italics.

   Fallback faces are metric-adjusted so the swap does not move the layout. */

@font-face {
  font-family: "Literata fallback";
  src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif");
  size-adjust: 115.79%;
  ascent-override: 101.91%;
  descent-override: 26.77%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Barlow Condensed fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans");
  size-adjust: 78.4%;
  ascent-override: 127.5%;
  descent-override: 25.5%;
  line-gap-override: 0%;
}

:root {
  --paper: #efe6cc;
  --ink: #1f3140;      /* 10.7:1 on paper */
  --ink-2: #535e63;    /* 5.35:1, secondary text */
  --contour: #91958d;  /* lines only, never text */
  --grid: #cac5b3;
  --rule: #a9aba0;
  --acc: #b23a1c;      /* 4.8:1 on paper, both ways */
  --serif: "Literata", "Literata fallback", Georgia, serif;
  --sans: "Barlow Condensed", "Barlow Condensed fallback", "Arial Narrow", sans-serif;
}

html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); font-family: var(--serif); font-size: 1.1875rem; line-height: 1.55; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--acc); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.wrap { box-sizing: border-box; max-width: 1440px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 40px); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- sheet collar */
.collar {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 6px 32px; padding-top: 26px; padding-bottom: 12px; border-bottom: 1.5px solid var(--ink);
}
.titleblock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; }
h1 { margin: 0; font: 600 clamp(3rem, 2.2rem + 2.6vw, 4.5rem)/0.95 var(--sans); letter-spacing: 0.005em; }
.sub { margin: 0; font: 500 1.1875rem/1.3 var(--sans); color: var(--ink-2); }
.sheetno { margin: 0; display: flex; gap: 22px; font: 500 1.0625rem/1.3 var(--sans); color: var(--ink-2); }
.sheetno a { color: var(--ink); }

/* ---------- map and legend */
.sheet {
  display: grid; grid-template-columns: minmax(0, 1fr) 16.5rem; gap: 28px;
  align-items: start; padding-top: 20px; padding-bottom: 36px;
}
.map-frame { min-width: 0; }
.map { display: block; width: 100%; height: auto; }

.legend { border: 1.5px solid var(--ink); padding: 14px 18px 18px; font-family: var(--sans); }
.legend h2 { margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font: 600 1.375rem/1 var(--sans); }
.stations { list-style: none; margin: 0; padding: 0; }
.stations a {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--grid); text-decoration: none;
}
.stations .nm { font-weight: 600; font-size: 1.3125rem; line-height: 1.1; }
.stations a:hover .nm, .stations a:focus-visible .nm { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.stations .gr { font-weight: 500; font-size: 1.0625rem; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.dot {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--acc); color: var(--paper); font: 600 1.0625rem/1 var(--sans);
}
.stations a:hover .dot, .stations a:focus-visible .dot { outline: 1.5px solid var(--acc); outline-offset: 2px; }
.hint { margin: 10px 0 0; font: 400 1rem/1.45 var(--serif); color: var(--ink-2); }
.key-h { margin: 18px 0 8px; font: 600 1.125rem/1 var(--sans); }
.key { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font: 500 1.0625rem/1.2 var(--sans); }
.key li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; }
.key svg { display: block; width: 44px; height: 18px; overflow: visible; }
.k-abbr { font-weight: 600; text-align: center; }
.gridnote { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font: 400 0.9375rem/1.45 var(--serif); color: var(--ink-2); }

/* ---------- map drawing (user units inside the SVG) */
.m-grid { fill: none; stroke: var(--grid); stroke-width: 1; }
.m-c { fill: none; stroke: var(--contour); stroke-width: 1; }
.m-ci { fill: none; stroke: var(--contour); stroke-width: 1.9; }
.m-wood { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-dasharray: 0.1 5.5; stroke-linecap: round; }
.m-trees { fill: var(--paper); stroke: var(--ink); stroke-width: 1.15; }
.m-fence { fill: none; stroke: var(--ink); stroke-width: 1.1; }
.m-fence-t { fill: none; stroke: var(--ink); stroke-width: 7; stroke-dasharray: 1.1 12; }
.m-wfill { fill: var(--paper); }
.m-water { fill: url(#hatch); stroke: var(--ink); stroke-width: 1.4; }
.m-hl { stroke: var(--ink); stroke-width: 0.85; }
.m-creek-a, .m-creek-b { fill: none; stroke: var(--ink); stroke-linecap: round; }
.m-creek-a { stroke-width: 1.5; }
.m-creek-b { stroke-width: 2.4; }
.m-track-a { fill: none; stroke: var(--ink); stroke-width: 7; stroke-dasharray: 10 5; }
.m-track-b { fill: none; stroke: var(--paper); stroke-width: 4; }
.m-fb { fill: var(--paper); }
.m-rail { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.m-dot { fill: var(--ink); }
.m-neat { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.m-tick { stroke: var(--ink); stroke-width: 1.2; }
.m-sb-k { fill: var(--ink); stroke: var(--ink); stroke-width: 1; }
.m-sb-p { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.m-n-line { stroke: var(--ink); stroke-width: 1.4; }
.m-n-k { fill: var(--ink); }
.m-n-p { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }

.map text { font-family: var(--sans); font-weight: 500; fill: var(--ink); }
.map .m-cl, .map .m-major, .map .m-minor, .map .m-name {
  paint-order: stroke; stroke: var(--paper); stroke-width: 0.28em; stroke-linejoin: round;
}
.map .m-cl { font-size: 16px; fill: var(--ink-2); text-anchor: middle; }
.map .m-water-l { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 21px; }
.map .m-land { font-size: 21px; letter-spacing: 0.14em; }
.map .m-small, .map .m-sp { font-size: 16px; }
.map .m-edge { font-size: 16px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.map .m-st, .map .m-note { font-size: 16px; }
.map .m-note { fill: var(--ink-2); }
.map .m-nt { font-size: 22px; font-weight: 600; }

/* stations: the markers are links, same targets as the legend */
.stn { cursor: pointer; }
.stn:focus { outline: none; }
.stn-b { transform-box: fill-box; transform-origin: center; }
.stn-c { fill: var(--acc); stroke: var(--paper); stroke-width: 2.5; }
.stn-r { fill: none; stroke: none; stroke-width: 3; }
.map .stn-n { font-size: 17px; font-weight: 600; fill: var(--paper); }
.map .m-name { font-size: 17px; font-weight: 600; }
.stn:hover .stn-r, .stn:focus-visible .stn-r { stroke: var(--acc); }
.stn:hover .m-name, .stn:focus-visible .m-name { fill: var(--acc); }
/* after a visit, the station you came from keeps a ring */
body:has(#about:target) .stn-1 .stn-r,
body:has(#work:target) .stn-2 .stn-r,
body:has(#writing:target) .stn-3 .stn-r,
body:has(#contact:target) .stn-4 .stn-r { stroke: var(--ink); }

/* ---------- survey log */
.log {
  display: grid; grid-template-columns: minmax(0, 1fr) 16.5rem; gap: 0 28px;
  align-items: start; padding-top: 8px; padding-bottom: 44px;
}
.log-head, .entries { grid-column: 1; }
.traverse { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 16px; font: 500 1.0625rem/1.3 var(--sans); }
.log-title { margin: 0 0 8px; font: 600 2.75rem/1 var(--sans); }
.log-intro { max-width: 36rem; margin: 0 0 30px; color: var(--ink-2); }

.traverse h3 { margin: 6px 0 8px; font: 600 1.375rem/1 var(--sans); }
.traverse table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.traverse th, .traverse td { padding: 6px 8px 6px 0; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.traverse thead th { font-weight: 500; color: var(--ink-2); border-bottom: 1.5px solid var(--ink); }
.traverse tbody th { font-weight: 600; }
.traverse tbody th a { color: var(--acc); text-decoration: none; }
.traverse tbody th a:hover { text-decoration: underline; }
.traverse td:last-child, .traverse th:last-child { padding-right: 0; }
.trav-note { margin: 10px 0 0; font: 400 0.9375rem/1.45 var(--serif); color: var(--ink-2); }

.entry {
  display: grid; grid-template-columns: 10rem minmax(0, 36rem); gap: 0 2.5rem;
  padding: 24px 0 30px; border-top: 1.5px solid var(--ink); scroll-margin-top: 12px;
}
.entry-side .no { display: block; font: 600 5rem/0.8 var(--sans); color: var(--acc); }
.obs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; margin: 18px 0 0; font: 500 1.0625rem/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; }
.obs dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.entry-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px;
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.entry h3 { margin: 0; font: 600 2.375rem/1 var(--sans); }
.entry-head .gr { margin: 0; font: 500 1.125rem/1 var(--sans); color: var(--ink-2); }
.entry-head .gr span { margin-left: 4px; color: var(--ink); font-weight: 600; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
.entry-main > p { margin: 0 0 0.85em; }

.rows { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  grid-template-areas: "yr ttl kind" ". desc desc"; gap: 0 14px;
  padding: 9px 0 10px; border-bottom: 1px solid var(--rule);
}
.rows-w li { grid-template-columns: 6.4rem minmax(0, 1fr); grid-template-areas: "yr ttl" ". desc"; }
.yr { grid-area: yr; font: 500 1.0625rem/1.55 var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ttl { grid-area: ttl; font: 600 1.3125rem/1.25 var(--sans); }
.kind { grid-area: kind; font: 500 1.0625rem/1.55 var(--sans); color: var(--ink-2); }
.desc { grid-area: desc; margin: 2px 0 0; font-size: 1.0625rem; line-height: 1.5; color: var(--ink-2); }
.back { margin: 20px 0 0; font: 500 1.0625rem/1 var(--sans); }

/* ---------- foot */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 32px;
  padding-top: 14px; padding-bottom: 40px; border-top: 1.5px solid var(--ink);
  font: 500 1.0625rem/1.45 var(--sans); color: var(--ink-2);
}
.foot p { margin: 0; max-width: 44rem; }

/* ---------- widths. Map text sizes are in user units, so each step
   resizes them to stay readable as the whole sheet scales down. */
@media (min-width: 1080px) and (max-width: 1279px) {
  .map .m-cl, .map .m-small, .map .m-sp, .map .m-edge, .map .m-st, .map .m-note { font-size: 18px; }
  .map .m-name { font-size: 19px; }
}
@media (max-width: 1079px) {
  .sheet { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .legend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 36px; }
  .key-h { margin-top: 0; }
  .log { grid-template-columns: minmax(0, 1fr); }
  .traverse { grid-column: 1; grid-row: auto; position: static; max-width: 30rem; margin-bottom: 34px; }
  .map .m-cl, .map .m-small, .map .m-sp, .map .m-edge, .map .m-st, .map .m-note { font-size: 18px; }
  .map .m-water-l, .map .m-land { font-size: 24px; }
  .map .m-name { font-size: 19px; }
  .stn-b { transform: scale(1.2); }
}
@media (max-width: 699px) {
  .legend { display: block; }
  .key-h { margin-top: 18px; }
  .map .m-minor, .map .m-cl { display: none; }
  .map .m-water-l, .map .m-land { font-size: 32px; }
  .map .m-land { letter-spacing: 0.08em; }
  .map .m-edge, .map .m-st { font-size: 27px; }
  .map .m-nt { font-size: 34px; }
  .stn-b { transform: scale(1.7); }
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry-side { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 14px; }
  .entry-side .no { font-size: 3.75rem; }
  .obs { margin: 0; }
  .rows li, .rows-w li {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "yr kind" "ttl ttl" "desc desc";
  }
  .log-title { font-size: 2.25rem; }
  .entry h3 { font-size: 2rem; }
}
@media (max-width: 479px) {
  .map .m-water-l, .map .m-land { font-size: 40px; }
  .map .m-edge, .map .m-st { font-size: 33px; }
  .map .m-nt { font-size: 40px; }
  .stn-b { transform: scale(2.3); }
  .sub { font-size: 1.0625rem; }
}
