/* Trod — shared stylesheet for every page.
 *
 * trod.uk is the company, not a service, so it does not borrow a service's
 * look. It is set like a pamphlet: one serif, ink on paper, and one colour —
 * the red earth a Devon footpath is worn down to — for the path itself.
 *
 * The serif is EB Garamond, served from /fonts rather than a font CDN, so a
 * visit to trod.uk asks nothing of anyone else's servers. OFL; see
 * fonts/OFL.txt. Latin and Latin Extended only: Latin Extended carries the
 * ɒ, ā and ł the pages use, and loads only on a page that has one.
 */

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/eb-garamond-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/eb-garamond-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/eb-garamond-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/eb-garamond-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The name, wherever it appears. Four letters cut from EB Garamond at the
   homepage's weight into a font of their own (tools/wordmark.py), so the
   service sites can set the mark exactly without loading Garamond. */
@font-face {
  font-family: "trod wordmark";
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/trod-wordmark.woff2) format("woff2");
}

:root {
  --paper: #F4EFE6;
  --ink: #1F1B16;
  --ink-soft: #675F55;
  --earth: #A3442A;
  --rule: rgba(31, 27, 22, 0.16);
  --todo: #B8791E;

  --serif: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;

  --path-w: 120px;   /* the column the path walks down */
  --mark: 13px;      /* half a label's line: where each waymark sits */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16130F; --ink: #EEE7DB; --ink-soft: #ADA497; --earth: #E2876A;
    --rule: rgba(238, 231, 219, 0.16); --todo: #E0AE63;
  }
}
:root[data-theme="dark"] {
  --paper: #16130F; --ink: #EEE7DB; --ink-soft: #ADA497; --earth: #E2876A;
  --rule: rgba(238, 231, 219, 0.16); --todo: #E0AE63;
}
@media (max-width: 600px) {
  :root { --path-w: 44px; }
}

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

body {
  margin: 0;
  font: 20px/1.55 var(--serif);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: oldstyle-nums;
}

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 56px;
}
.shell.wide { max-width: 900px; }
@media (max-width: 600px) {
  body { font-size: 19px; }
  .shell { padding: 0 16px 40px; }
}

a {
  color: var(--earth);
  text-decoration-color: color-mix(in srgb, var(--earth) 40%, transparent);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

/* trod, the company, in running text and headings alike: lowercase, upright
   even in italic, at the wordmark's weight. TROD CIC, the registered name,
   is left as it is wherever a line means the legal entity. */
.trod {
  font-family: "trod wordmark", var(--serif);
  font-weight: 500;
  font-style: normal;
  letter-spacing: -0.01em;
}

/* Small capitals carry every label: nav, waymarks, status, footer */
.sc {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  font-variant-numeric: lining-nums;
}

/* ── Masthead ─────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding: 22px 0 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 56px;
}
/* The homepage is wider than the other pages, but its menu sits where theirs
   does, so it does not jump when you move between them */
.home .masthead { border-bottom: 0; margin: 0 auto; max-width: 712px; }

.wordmark {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 19px;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}
.masthead nav a { color: var(--ink-soft); text-decoration: none; }
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--ink); }
.masthead nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--earth);
  text-underline-offset: 6px;
}

/* ── Prose (the inner pages) ──────────────────────────────────────────── */

h1, h2 { font-weight: 500; letter-spacing: -0.01em; }

h1 {
  font-size: clamp(40px, 6vw, 54px);
  line-height: 1.08;
  margin: 0 0 20px;
  text-wrap: balance;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
  margin: 48px 0 10px;
}

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

/* An opening paragraph too long to sit well in the italic lede */
.intro { font-size: 21px; line-height: 1.5; max-width: 32em; margin: 0; }

.lede {
  font-size: 24px;
  line-height: 1.4;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

/* A section's theme, in the red small capitals of the homepage's waymarks,
   above its heading */
.section-label {
  font-size: 17px;
  color: var(--earth);
  margin: 56px 0 2px;
}
.section-label + h2 { margin-top: 0; }

/* Commitments, each led by the commitment itself */
.pledges { list-style: none; margin: 0 0 16px; padding: 0; }
.pledges li { margin: 0 0 14px; }
.pledges strong { font-weight: 600; }

/* The projects at a glance, each on a waymark: filled where the path is
   walked, dashed where it is not yet */
.index { list-style: none; margin: 4px 0 18px; padding: 0; }
.index li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
  padding-left: 28px;
  margin: 0 0 10px;
}
.index li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.72em;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--earth);
}
.index li.unbuilt::before { background: transparent; border: 1.5px dashed var(--earth); }
.index .name { font-size: 24px; font-weight: 500; color: var(--ink); text-decoration: none; }
.index a.name:hover { color: var(--earth); }
.index .status { font-size: 16px; color: var(--earth); }
.index .gloss { color: var(--ink-soft); }
.onward a::after { content: " \2192"; }

/* Plain lists in prose, About's and the notice's */
ul:not([class]) { margin: 0 0 16px; padding-left: 1.1em; }
ul:not([class]) > li { margin: 0 0 10px; padding-left: 0.2em; }
ul:not([class]) > li::marker { color: var(--earth); }

/* A formal notice to the people the company serves, set apart from the prose
   so it reads as an announcement with a date on it, not as more of the story */
.notice {
  margin: 20px 0;
  padding: 18px 22px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--earth);
  background: color-mix(in srgb, var(--ink) 3%, var(--paper));
}
.notice p { margin: 0 0 12px; }
.notice p:last-child { margin-bottom: 0; }
.notice strong { font-weight: 600; }

/* ── Home: the name ───────────────────────────────────────────────────── */

.hero { padding: 48px 0 72px var(--path-w); }

.hero-kicker { font-size: 18px; color: var(--ink-soft); margin: 0; }

.hero-word {
  font-size: clamp(112px, 22vw, 200px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin: 0 0 18px -0.04em;
}

/* Set like a dictionary entry, the same as democracy further down */
.entry { font-size: 21px; color: var(--ink-soft); margin: 0; }
.entry b { color: var(--ink); font-weight: 600; }

/* The name's entry, set as an etymological dictionary prints one: headword,
   pronunciation, part of speech, sense, then the derivation in brackets */
.dict { max-width: 31em; }
.dict p { margin: 0; }
.dict .ipa { font-variant-numeric: normal; }
.dict abbr { text-decoration: none; }

/* The derivation folds open into the entry read token by token, and that
   into the word's history and its sources — for anyone who wants to check,
   out of the way of anyone who doesn't. <details> rather than script: it
   needs none, and works from the keyboard and with a screen reader as it
   comes. */
.note { margin-top: 6px; }
.note > summary,
.more > summary {
  list-style: none;
  cursor: pointer;
  width: fit-content;
}
.note > summary::-webkit-details-marker,
.more > summary::-webkit-details-marker { display: none; }
.note > summary { font-size: 18px; }
.note > summary::after,
.more > summary::after {
  content: "+";
  display: inline-block;
  margin-left: 0.4em;
  color: var(--earth);
  font-weight: 600;
  transition: transform 200ms ease;
}
.note[open] > summary::after,
.more[open] > summary::after { transform: rotate(45deg); }
.note > summary:hover .etym {
  text-decoration: underline dotted var(--earth);
  text-underline-offset: 4px;
}
.note > summary:focus-visible,
.more > summary:focus-visible { outline: 2px solid var(--earth); outline-offset: 3px; }

.note-body {
  margin: 18px 0 4px;
  padding-left: 18px;
  border-left: 2px solid color-mix(in srgb, var(--earth) 45%, transparent);
  font-size: 18px;
  line-height: 1.55;
  max-width: 34em;
}
.note-body p { margin: 0 0 12px; }

/* The entry as a token stream: each token with its type bracketed under it,
   the way a parser would label a line of code */
.tokens {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 6px;
}
.tok { display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.tok .tx {
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  padding: 0 3px;
  white-space: nowrap;
}
.tok.wrap .tx { white-space: normal; }
.tok .ty {
  position: relative;
  align-self: stretch;
  margin-top: 3px;
  padding: 7px 2px 0;
  text-align: center;
  font-size: 15px;
  line-height: 1;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  color: var(--earth);
  white-space: nowrap;
}
.tok .ty::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1px;
  right: 1px;
  height: 4px;
  border: 1px solid currentColor;
  border-top: 0;
}

/* What each type of token means: the grammar the entry is written in */
.legend {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0 0 14px;
  font-size: 17px;
}
.legend dt {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  color: var(--earth);
}
.legend dd { margin: 0; }
@media (max-width: 600px) {
  .legend { grid-template-columns: 1fr; gap: 0; }
  .legend dd { margin-bottom: 10px; }
}

.more { margin-top: 6px; }
.more > summary { font-size: 17px; color: var(--earth); }
.more-body { padding-top: 10px; }
.sources { list-style: none; margin: 8px 0 0; padding: 0; font-size: 16px; }
.sources li { margin: 0 0 8px; padding-left: 1em; text-indent: -1em; }

@supports selector(::details-content) {
  @media (prefers-reduced-motion: no-preference) {
    :root { interpolate-size: allow-keywords; }
    .note::details-content,
    .more::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size 300ms ease, content-visibility 300ms allow-discrete;
    }
    .note[open]::details-content,
    .more[open]::details-content { block-size: auto; }
  }
}

/* ── Home: the walk ───────────────────────────────────────────────────── */

/* Each stage is one stop on the path. Its stretch of path runs from its own
   waymark to the next one's, so the stage after it must start straight after
   it: space stages with padding, never margin. */
.stage {
  position: relative;
  padding: 0 0 80px var(--path-w);
}
.stage.place { padding-bottom: 48px; }

.trail {
  position: absolute;
  left: 0;
  width: var(--path-w);
  top: var(--mark);
  bottom: calc(-1 * var(--mark));
  background: var(--earth);
  -webkit-mask: var(--trail) 0 0 / 100% 100% no-repeat;
  mask: var(--trail) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.trail.path   { --trail: url(/img/trail/path.svg); }
.trail.people { --trail: url(/img/trail/people.svg); }
.trail.us     { --trail: url(/img/trail/us.svg); }
.trail.mission { --trail: url(/img/trail/mission.svg); }
.trail.onward { --trail: url(/img/trail/onward.svg); }
.trail.arrive { --trail: url(/img/trail/arrive.svg); }
.trail.places { --trail: url(/img/trail/places.svg); }
.trail.bus    { --trail: url(/img/trail/bus.svg); }
.trail.park   { --trail: url(/img/trail/park.svg); }
.trail.unworn { --trail: url(/img/trail/unworn.svg); }
.trail.end    { --trail: url(/img/trail/end.svg); }

/* Where the path comes in at the top of a page: from the masthead's rule down
   to the first waymark, rather than from the waymark down */
.trail.arrive {
  top: calc(var(--mark) - 56px);
  bottom: calc(100% - var(--mark));
}

/* The waymark: drawn over both stretches that meet at it */
.stage::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: calc(var(--path-w) / 2);
  top: var(--mark);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--earth);
  box-shadow: 0 0 0 4px var(--paper);
  transform: translate(-50%, -50%);
}
/* The first one is a door, not a waymark: the path starts here */
.stage.door::before { background: var(--paper); border: 2px solid var(--earth); }
.stage.unbuilt::before { background: var(--paper); border: 1.5px dashed var(--earth); }

.mark {
  display: block;
  font-size: 19px;
  line-height: calc(var(--mark) * 2);
  color: var(--earth);
  margin: 0 0 14px;
}

.epigraph { margin: 0; }
/* Every waymark says its piece at the same size — the quote, "us", the
   mission, the promise — so the walk reads as one voice. The etymology keeps
   its dictionary setting: it is an entry, not a statement. */
.epigraph p,
.slogan,
.mission,
.promise {
  font-size: clamp(22px, 2.9vw, 28px);
  line-height: 1.42;
  font-weight: 400;
  max-width: 26em;
  margin: 0;
  text-wrap: pretty;
}
.epigraph p { margin-bottom: 18px; }
/* The quote is set upright like every other waymark; only its marks are
   italic. The opening one hangs just outside the text edge, so the first
   line starts where the rest do. */
.epigraph .q { font-style: italic; color: var(--earth); }
.epigraph .q.open { position: absolute; transform: translateX(-100%); padding-right: 0.06em; }
.promise { margin-bottom: 24px; }

.epigraph em { font-style: normal; color: var(--earth); }
.epigraph cite { display: block; font-style: normal; font-size: 18px; color: var(--ink-soft); }
.epigraph cite i { font-style: italic; }

.slogan em { color: var(--earth); }


/* ── Home: the places the path goes ───────────────────────────────────── */

.place-name {
  display: block;
  font-size: 36px;
  line-height: 1.05;
  font-weight: 500;
  margin: 0 0 6px;
}
.place-what { color: var(--ink-soft); margin: 0 0 8px; max-width: 34em; }
.place-host { font-size: 18px; letter-spacing: 0.01em; color: var(--earth); }

a.place-link { color: inherit; text-decoration: none; display: block; }
a.place-link .place-name { transition: color 150ms ease; }
a.place-link:hover .place-name { color: var(--earth); }
a.place-link .place-host::after { content: " \2192"; }
.unbuilt .place-host { color: var(--ink-soft); }

/* ── Footer ───────────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 17px;
  color: var(--ink-soft);
}
.walking .site-footer { margin-top: 24px; margin-left: var(--path-w); }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--ink-soft); }
/* How to write, where a card puts it: above the small print */
.site-footer .write { font-size: 21px; margin-bottom: 10px; }
.site-footer .write a { color: var(--earth); }
.site-footer .legal { font-variant-caps: all-small-caps; letter-spacing: 0.06em; font-size: 17px; }
.site-footer .legal a { font-variant-numeric: lining-nums; }

/* Anything still carrying a PLACEHOLDER is flagged loudly on the page itself.
   A placeholder you cannot see is a placeholder you ship. Delete the wrapper,
   not just the text, when you fill one in. Set in a plain sans on purpose,
   so it can never be mistaken for the page's own voice. */
.todo {
  background: color-mix(in srgb, var(--todo) 14%, var(--paper));
  border-left: 3px solid var(--todo);
  padding: 12px 14px;
  font: 14px/1.55 system-ui, sans-serif;
  color: var(--ink);
  margin: 0 0 24px;
}
.todo code { font-family: ui-monospace, monospace; background: var(--rule); padding: 1px 4px; }
