/*
 * pinthoppers.com - the one stylesheet (T45, D-A30; two themes since T48, D-A35;
 * the landing page since D-A70).
 *
 * THE COLOURS ARE THE APP'S, BY NAME. Each `--color-*` below is a role from
 * `src/ui/tokens.ts`, and `tests/web/site.test.ts` compares the values and the
 * text/background pairs used here with that file's `readablePairs`, so the site
 * cannot drift to a contrast nobody measured. No hex appears outside the two
 * palette blocks. (Lower case because Prettier writes CSS hex that way; the
 * test compares without case.)
 *
 * TWO PALETTES, ONE SET OF RULES. The light palette is the top-level `:root`,
 * the dark one the `:root` in the `prefers-color-scheme: dark` query under it,
 * and the page follows the reader's system theme as the app does. Every rule
 * below is written once, by role, and the dark block does nothing but redefine
 * the palette: that is what lets one pairs check hold in both themes, so the
 * test refuses a dark block that restyles anything. It also refuses one that
 * forgets a role - the role would keep its light value, and the light text on
 * the dark ground is 1.28:1.
 *
 * `color-scheme` tells the browser the page comes in both, so what it draws
 * itself (the policy table's scrollbar, any form control) follows the theme
 * too. It is here and not in a `<meta>` in each page: the stylesheet is
 * render-blocking, so the browser knows it before the first paint, and the
 * declaration sits beside the palettes it describes.
 *
 * ONE FONT FILE, SERVED FROM HERE. Headings are Righteous, the app's heading
 * face (`src/ui/fonts.ts`), so the site reads as the app does. It is the same
 * OFL file the app bundles, served from this origin with its licence beside
 * it (`/fonts/OFL.txt`) - no font service, no request anywhere else; the CSP
 * allows `font-src 'self'` and nothing more. Body text stays on the system
 * face: the policy pages are read, not admired.
 *
 * THE LOOK IS A PASSPORT (D-A70, the owner's choice on 2026-09-27): heavy
 * outlines, hard offset shadows, colour blocks with hard edges, and the app's
 * round Mile stamp (`src/ui/RouteStamp.tsx`) drawn large. The blocks use the
 * pairs the app measured and no others: the warm ground carries `text` and
 * `textMuted`; the amber block carries `onAccent` ONLY. A dark green block with
 * cream text in the light theme would be a pair nobody measured, so there is
 * none.
 *
 * THE AMBER BLOCK SETS THE COLOUR OF EVERYTHING IN IT. A rule written for the
 * whole page (`a`, say) would put `text` on amber, and in the dark theme `text`
 * is the cream: 1.91:1. The pairs check reads a selector's own background or
 * its ancestors', so every rule inside `.rule` names `onAccent` itself, and the
 * block holds no link.
 *
 * THE APP'S OWN DRAWINGS, NOT NEW ONES. The icon, the map pin
 * (`assets/map`), the Mile stamp and the hop mark (`assets/brand/hop.png`) are
 * what the app draws; the site reuses them. The hop appears once, beside the
 * sentence about the name, as it does in the app's About screen (D-A28): it is
 * a signature, not a motif, and is tinted with `visited` as the app tints it.
 */
@font-face {
  font-family: 'Righteous';
  src: url('/fonts/righteous.ttf') format('truetype');
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --color-text: #14342b;
  --color-text-muted: #526860;
  --color-surface: #f3f1eb;
  --color-surface-warm: #f1e0c5;
  --color-border: #72847c;
  --color-accent: #e8a33d;
  --color-on-accent: #14342b;
  --color-visited: #1c6f66;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #f3f1eb;
    --color-text-muted: #89908a;
    --color-surface: #0c1e19;
    --color-surface-warm: #102b23;
    --color-border: #69736d;
    --color-accent: #e8a33d;
    --color-on-accent: #14342b;
    --color-visited: #559a92;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3,
.brand,
.eyebrow,
.num,
.tag,
.manifesto {
  font-family:
    'Righteous',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-weight: 400;
}

a {
  color: var(--color-text);
}

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

.muted {
  color: var(--color-text-muted);
}

.wrap {
  margin: 0 auto;
  max-width: 76rem;
  padding: 0 1.25rem;
}

/* ── Header and footer, on every page ─────────────────────────────────────── */

.bar {
  background: var(--color-surface);
  border-bottom: 3px solid var(--color-text);
}

.bar .wrap {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  padding-top: 0.75rem;
}

.brand {
  align-items: center;
  color: var(--color-text);
  display: inline-flex;
  font-size: 1.6rem;
  gap: 0.75rem;
  text-decoration: none;
}

/*
 * The icon is a dark green tile, and on the dark theme's ground (the same
 * green) its edge disappeared and the pint floated. Framed like a sticker - an
 * outline and a hard shadow in `text` - the tile has an edge in both themes.
 */
.brand img {
  border: 2px solid var(--color-text);
  border-radius: 0.75rem;
  box-shadow: 0.2rem 0.2rem 0 var(--color-text);
  display: block;
  height: 2.75rem;
  width: 2.75rem;
}

.nav {
  align-items: center;
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-text);
  display: none;
  font-weight: 600;
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.lang {
  background: var(--color-surface);
  border: 2px solid var(--color-text);
  border-radius: 999px;
  box-shadow: 0.15rem 0.15rem 0 var(--color-text);
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.3rem 1rem;
  text-decoration: none;
}

.foot {
  border-top: 3px solid var(--color-text);
}

.foot .wrap {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  padding-bottom: 2.5rem;
  padding-top: 1.75rem;
}

.foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot a {
  color: var(--color-text);
  font-weight: 600;
}

.foot p {
  color: var(--color-text-muted);
  margin: 0;
}

/* ── The policy and support pages ─────────────────────────────────────────── */

main {
  margin: 0 auto;
  max-width: 46rem;
  padding: 2.5rem 1.25rem 3rem;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.05;
  margin: 0.5rem 0 1.25rem;
}

main > section {
  border-top: 2px solid var(--color-text);
  margin-top: 2.5rem;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  line-height: 1.2;
  margin: 1rem 0 0.75rem;
}

table {
  border: 2px solid var(--color-text);
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

th {
  background: var(--color-surface-warm);
  color: var(--color-text);
}

th,
td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

/* ── The landing page ─────────────────────────────────────────────────────── */

.landing {
  max-width: none;
  padding: 0;
}

.landing > section {
  border-top: 0;
  margin-top: 0;
  padding: 4.5rem 0;
}

.landing h2 {
  font-size: clamp(2.25rem, 6.5vw, 4.25rem);
  line-height: 1.02;
  margin: 0 0 1.25rem;
}

.eyebrow,
.landing .eyebrow {
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.18em;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

/* A word the sentence turns on, set on amber: the one pair amber carries. */
mark {
  background: var(--color-accent);
  border-radius: 0.2em;
  box-decoration-break: clone;
  color: var(--color-on-accent);
  padding: 0 0.15em;
}

.btn {
  background: var(--color-accent);
  border: 3px solid var(--color-text);
  border-radius: 0.75rem;
  box-shadow: 0.3rem 0.3rem 0 var(--color-text);
  color: var(--color-on-accent);
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.btn:hover {
  box-shadow: 0.45rem 0.45rem 0 var(--color-text);
  transform: translate(-0.15rem, -0.15rem);
}

.btn:active {
  box-shadow: 0 0 0 var(--color-text);
  transform: translate(0.3rem, 0.3rem);
}

/* The hero: the headline, and the stamp of a real Mile. */

.hero {
  background: var(--color-surface);
}

.hero .wrap {
  align-items: center;
  display: grid;
  gap: 3rem;
}

.hero h1 {
  font-size: clamp(3.25rem, 11vw, 7.5rem);
  line-height: 0.95;
  margin: 0 0 1.5rem;
}

.hero h1 mark {
  display: inline-block;
  margin-top: 0.1em;
  padding: 0 0.12em 0.05em;
  transform: rotate(-2.5deg);
}

.lead {
  font-size: 1.3rem;
  line-height: 1.5;
  margin: 0 0 1.75rem;
  max-width: 34rem;
}

.cta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.cta p {
  margin: 0;
}

.stamps {
  justify-self: center;
  margin: 0;
  max-width: 30rem;
  position: relative;
  width: 100%;
}

.stamp {
  display: block;
  height: auto;
  width: 100%;
}

.stamp-ground {
  fill: var(--color-surface-warm);
  stroke: var(--color-text);
  stroke-width: 7;
}

.stamp-line {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 2;
}

.stamp-dash {
  fill: none;
  stroke: var(--color-text);
  stroke-dasharray: 7 7;
  stroke-width: 2;
}

/* The words on the ring sit on the warm ground: `text` on `surfaceWarm`. */
.stamp-words {
  fill: var(--color-text);
  font-family: 'Righteous', sans-serif;
  font-size: 24px;
}

.stamp-route {
  fill: none;
  stroke: var(--color-text);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
}

.stamp-dot {
  fill: var(--color-text);
}

/* The start: an amber dot with an edge, as in the app - amber alone on the
   warm ground is 1.66:1. */
.stamp-start {
  fill: var(--color-accent);
  stroke: var(--color-text);
  stroke-width: 4;
}

.seal-ground {
  fill: var(--color-accent);
  stroke: var(--color-on-accent);
  stroke-width: 5;
}

.seal-dash {
  fill: none;
  stroke: var(--color-on-accent);
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.seal-words {
  fill: var(--color-on-accent);
  font-family: 'Righteous', sans-serif;
  font-size: 21px;
  text-anchor: middle;
}

.stamps figcaption {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 1.25rem;
  text-align: center;
}

/* What it is: one sentence, as large as a heading, on the warm ground. */

.what {
  background: var(--color-surface-warm);
  border-bottom: 3px solid var(--color-text);
  border-top: 3px solid var(--color-text);
}

.what .eyebrow {
  color: var(--color-text-muted);
}

.manifesto {
  color: var(--color-text);
  font-size: clamp(1.75rem, 4.4vw, 3.4rem);
  line-height: 1.2;
  margin: 0;
  max-width: 62rem;
}

/* How it works: three passport pages, stepping down. */

.steps {
  display: grid;
  gap: 1.5rem;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.step {
  background: var(--color-surface);
  border: 3px solid var(--color-text);
  border-radius: 1.25rem;
  box-shadow: 0.5rem 0.5rem 0 var(--color-text);
  color: var(--color-text);
  padding: 1.75rem 1.5rem;
}

.step h3 {
  font-size: 1.6rem;
  line-height: 1.15;
  margin: 1.25rem 0 0.5rem;
}

.step p {
  color: var(--color-text-muted);
  margin: 0;
}

/* A small stamp: the ring, the dashed ring inside it, the number. */
.num {
  background: var(--color-surface-warm);
  border: 3px solid var(--color-text);
  border-radius: 50%;
  color: var(--color-text);
  display: inline-grid;
  font-size: 1.6rem;
  height: 4rem;
  place-items: center;
  position: relative;
  transform: rotate(-10deg);
  width: 4rem;
}

.num::after {
  border: 2px dashed var(--color-text);
  border-radius: 50%;
  content: '';
  inset: 0.25rem;
  position: absolute;
}

/* The map: two screens, framed, with a hard amber shadow. */

.map .wrap {
  align-items: center;
  display: grid;
  gap: 3rem;
}

.map p {
  font-size: 1.2rem;
  margin: 0 0 1.5rem;
  max-width: 32rem;
}

.ticks {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ticks li {
  align-items: center;
  display: flex;
  font-size: 1.1rem;
  font-weight: 600;
  gap: 0.9rem;
}

/* The app's own map pin (`assets/map`), the visited one on the last line. */
.ticks li::before {
  background: url('/img/pin.png') center / contain no-repeat;
  content: '';
  flex: none;
  height: 1.9rem;
  width: 1.5rem;
}

.ticks li:last-child::before {
  background-image: url('/img/pin-visited.png');
}

.screens {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin: 0;
}

.screens img {
  border: 0.45rem solid var(--color-text);
  border-radius: 2rem;
  box-shadow: 0.6rem 0.6rem 0 var(--color-accent);
  display: block;
  height: auto;
  min-width: 0;
  width: 48%;
}

.screens img + img {
  margin-top: 3rem;
}

/* The rule: the one amber block. Everything in it is `onAccent`, by name. */

.rule {
  background: var(--color-accent);
  border-bottom: 3px solid var(--color-on-accent);
  border-top: 3px solid var(--color-on-accent);
  color: var(--color-on-accent);
}

.rule h2 {
  color: var(--color-on-accent);
  font-size: clamp(3.25rem, 13vw, 9.5rem);
  line-height: 0.92;
  margin-bottom: 2rem;
}

.rule .say {
  color: var(--color-on-accent);
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 2.5rem;
  max-width: 48rem;
}

.ledger {
  display: grid;
  gap: 1.25rem;
}

.ledger div {
  border: 3px solid var(--color-on-accent);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
}

.rule .ledger h3 {
  color: var(--color-on-accent);
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

.ledger ul {
  margin: 0;
  padding-left: 1.25rem;
}

.rule .ledger li {
  color: var(--color-on-accent);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.25rem 0;
}

/* Struck through as well as listed apart: the meaning is not in a colour. */
.rule .ledger .no li {
  color: var(--color-on-accent);
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}

/* Where: the two areas, as photographs with a stamped label. */

.areas {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}

.area {
  background: var(--color-surface);
  border: 3px solid var(--color-text);
  border-radius: 1.5rem;
  box-shadow: 0.5rem 0.5rem 0 var(--color-text);
  color: var(--color-text);
  margin: 0;
  overflow: hidden;
  position: relative;
}

.area img {
  aspect-ratio: 4 / 3;
  border-bottom: 3px solid var(--color-text);
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.tag {
  background: var(--color-surface);
  border: 3px solid var(--color-text);
  border-radius: 0.5rem;
  color: var(--color-text);
  font-size: 0.95rem;
  left: 1rem;
  letter-spacing: 0.12em;
  margin: 0;
  padding: 0.25rem 0.75rem;
  position: absolute;
  text-transform: uppercase;
  top: 1rem;
  transform: rotate(-4deg);
}

.area h3 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.05;
  margin: 1.25rem 1.5rem 0.25rem;
}

.area p {
  margin: 0 1.5rem 0.75rem;
}

.area .credit {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.area .credit a {
  color: var(--color-text-muted);
}

/* The name, and where the pubs come from: the app's About screen. */

.columns {
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
}

.about h3 {
  font-size: 1.6rem;
  margin: 0 0 0.75rem;
}

.about p {
  margin: 0 0 1rem;
  max-width: 36rem;
}

.name {
  align-items: flex-start;
  display: flex;
  gap: 1.25rem;
}

/* The hop mark is a one-colour mask, tinted as the app tints it. */
.hop {
  background: var(--color-visited);
  flex: none;
  height: 4.5rem;
  mask: url('/img/hop.png') center / contain no-repeat;
  width: 3.75rem;
}

/* Questions, each a card that opens. */

.faq {
  background: var(--color-surface-warm);
  border-top: 3px solid var(--color-text);
}

.faq .wrap {
  max-width: 52rem;
}

.faq details {
  background: var(--color-surface);
  border: 3px solid var(--color-text);
  border-radius: 1rem;
  box-shadow: 0.3rem 0.3rem 0 var(--color-text);
  color: var(--color-text);
  margin-top: 1rem;
  padding: 1rem 1.25rem;
}

.faq summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 1.15rem;
  font-weight: 700;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

/* A chevron drawn from two borders: no glyph, so no font needs to carry it. */
.faq summary::after {
  border-bottom: 3px solid var(--color-text);
  border-right: 3px solid var(--color-text);
  content: '';
  flex: none;
  height: 0.6rem;
  margin-right: 0.25rem;
  transform: rotate(45deg);
  transition: transform 0.2s;
  width: 0.6rem;
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
}

.faq details p {
  margin: 0.75rem 0 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .faq summary::after {
    transition: none;
  }
}

@media (min-width: 52rem) {
  .nav-link {
    display: inline;
  }

  .landing > section {
    padding: 6.5rem 0;
  }

  .landing > .hero {
    padding: 5rem 0 6rem;
  }

  .hero .wrap {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .step:nth-child(2) {
    margin-top: 2rem;
  }

  .step:nth-child(3) {
    margin-top: 4rem;
  }

  .map .wrap {
    gap: 4rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .ledger {
    grid-template-columns: repeat(2, 1fr);
    max-width: 56rem;
  }

  .areas {
    grid-template-columns: repeat(2, 1fr);
  }

  .area:nth-child(2) {
    margin-top: 3rem;
  }

  .columns {
    grid-template-columns: repeat(2, 1fr);
  }
}
