/*
  Northlight Practice: therapy practice website (Screenery template, slug "therapy")
  A quiet letterpress pamphlet. One ink on plain stock, one sheet of sage, generous margins,
  and type sized for a reader who is tired. Change --paper, --ink, --sage and --ochre and the page follows.

  Contents
   1. Tokens
   2. Base and browser surfaces
   3. Masthead
   4. The spread (title page + finder)
   5. Leaves (the pamphlet's further pages) and their contents:
      first session, people, fees, confidentiality, questions, finding us, urgent help
   6. Components: buttons, fields, drawn radios and checks, .select (register listbox),
      .slip (errata notices), .plate (bookplate dialog), .alert
   7. Request form and its states
   8. Colophon
   9. Motion
  10. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
:root {
  /* Palette */
  --paper: #f3f0ea;
  --ink: #2f3e46;
  --sage: #84a59d;
  --ochre: #c08552;

  /* Derived tones */
  --ink-deep: color-mix(in srgb, var(--ink) 76%, #000);          /* text on the sage sheet */
  --ink-soft: color-mix(in srgb, var(--ink) 82%, var(--paper));  /* secondary text on paper */
  --rule: color-mix(in srgb, var(--ink) 26%, var(--paper));      /* hairlines */
  --rule-sage: color-mix(in srgb, var(--ink-deep) 38%, var(--sage));
  --paper-shade: color-mix(in srgb, var(--ink) 6%, var(--paper));
  --paper-bright: color-mix(in srgb, #fff 45%, var(--paper));
  --sage-wash: color-mix(in srgb, var(--sage) 26%, var(--paper));
  --ochre-deep: color-mix(in srgb, var(--ochre) 48%, var(--ink)); /* ochre that passes AA as text */
  --on-ink-soft: color-mix(in srgb, var(--paper) 80%, var(--ink));
  --shadow: 0 14px 30px -12px color-mix(in srgb, var(--ink) 38%, transparent), 0 2px 5px color-mix(in srgb, var(--ink) 12%, transparent);

  /* Type */
  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Atkinson Hyperlegible", "Verdana", system-ui, sans-serif;
  --fs-small: 0.9375rem;                                   /* 15 */
  --fs-body: 1.125rem;                                     /* 18: the reading size */
  --fs-lede: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem);
  --fs-h3: clamp(1.3125rem, 1.2rem + 0.4vw, 1.5rem);
  --fs-h2: clamp(2rem, 1.2rem + 3vw, 3.5rem);
  --fs-q: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);            /* the finder's question */
  --fs-h1: clamp(2.75rem, 1rem + 6.2vw, 5.75rem);

  /* Space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 36px;
  --s-7: 56px;
  --s-8: 88px;
  --s-9: 136px;
  --margin: clamp(20px, 6vw, 96px);   /* the pamphlet's outer margin */
  --measure: 34rem;                   /* about 62 characters of body text */

  /* Shape */
  --r: 3px;
  --hair: 1px;
  --bar: 3px;
  --mast-h: 60px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
  --t-turn: 520ms;
}

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--mast-h) + 20px);
  scrollbar-color: var(--ink) var(--paper-shade);
  -webkit-text-size-adjust: 100%;
}
html:has(dialog[open]) { overflow: hidden; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-shade); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 3px solid var(--paper-shade); border-radius: 6px; }

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* paper tooth: a very faint grain so the flat colour reads as stock, not as a screen */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .18 0 0 0 0 .24 0 0 0 0 .27 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  accent-color: var(--ink);
  caret-color: var(--ochre-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  overflow-x: clip;
}

::selection { background: var(--ink); color: var(--paper); }

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.02em; }
h3 { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.005em; }
p { text-wrap: pretty; }
small { font-size: var(--fs-small); }

a {
  color: inherit;
  text-decoration-thickness: var(--hair);
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: var(--bar) solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--r);
}
.leaf--ink :focus-visible { outline-color: var(--paper); }

.ic {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}
.defs { position: absolute; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 50;
  background: var(--ink); color: var(--paper); padding: var(--s-3) var(--s-4); border-radius: var(--r);
}
.skip:focus { top: var(--s-2); }

/* ---------- 3. Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-5);
  height: var(--mast-h);
  padding: 0 var(--margin);
  background: var(--paper);
  border-bottom: var(--hair) solid var(--rule);
  font-size: var(--fs-small);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--serif); font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  min-height: 44px;
}
.brand__mark { width: 24px; height: 24px; }
.masthead__nav { display: flex; gap: var(--s-5); margin-left: auto; }
.masthead__nav a { text-decoration: none; padding: var(--s-3) 0; white-space: nowrap; }
.masthead__nav a:hover { text-decoration: underline; }
.masthead__actions { display: flex; align-items: center; gap: var(--s-4); margin-left: var(--s-4); }
.link-urgent {
  font-weight: 700; white-space: nowrap; color: var(--ochre-deep);
  padding: var(--s-3) 0;
}

/* ---------- 4. The spread ---------- */
.spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: calc(100svh - var(--mast-h));
}
.page {
  position: relative;
  padding: clamp(40px, 6.5vh, 72px) var(--margin) clamp(32px, 5vh, 56px);
  display: flex; flex-direction: column;
}
.page--title { padding-right: clamp(28px, 4.5vw, 72px); }
.page--title h1 { max-width: 9.5em; }
.lede {
  font-size: var(--fs-lede); line-height: 1.5;
  max-width: 31em; margin-top: var(--s-6);
}

/* contents list: titles, dot leaders and a plain note where a page number would be */
.contents { margin-top: auto; padding-top: var(--s-7); }
.contents ul { border-top: var(--bar) solid var(--ink); }
.contents a {
  display: flex; align-items: baseline; gap: var(--s-3);
  padding: 11px 0;
  border-bottom: var(--hair) solid var(--rule);
  text-decoration: none;
}
.contents a > span:first-child { font-family: var(--serif); font-size: 1.1875rem; font-weight: 500; white-space: nowrap; }
.leader { flex: 1; min-width: 20px; border-bottom: 2px dotted var(--rule); transform: translateY(-4px); }
.contents__note { font-size: var(--fs-small); color: var(--ink-soft); text-align: right; }
.contents a:hover > span:first-child { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.contents a:hover .leader { border-bottom-color: var(--ink); }

/* the right-hand page, printed on sage stock */
.page--finder {
  background: var(--sage);
  color: var(--ink-deep);
  padding-left: clamp(28px, 4.5vw, 72px);
}
/* the fold: a soft shadow where the two pages meet */
.page--finder::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 44px; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ink-deep) 22%, transparent), transparent);
}
.page--finder :focus-visible { outline-color: var(--ink-deep); }

.finder { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.finder__panel { display: flex; flex-direction: column; flex: 1; }
.finder__q { font-size: var(--fs-q); line-height: 1.08; letter-spacing: -0.02em; outline-offset: 8px; }
.finder__hint { margin-top: var(--s-4); max-width: 30em; }

.answers { margin-top: var(--s-6); border-top: var(--bar) solid var(--ink-deep); }
.answer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  width: 100%; min-height: 58px; padding: var(--s-3) var(--s-4) var(--s-3) 0;
  background: none; border: 0; border-bottom: var(--hair) solid var(--rule-sage);
  font-family: var(--serif); font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem); line-height: 1.25;
  text-align: left; color: inherit;
  transition: background-color var(--t-fast) var(--ease-out), padding-left var(--t-fast) var(--ease-out);
}
.answer .ic { opacity: 0; transform: translateX(-8px); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease-out); }
.answer:hover, .answer:focus-visible { background: var(--paper); padding-left: var(--s-4); }
.answer:hover .ic, .answer:focus-visible .ic { opacity: 1; transform: none; }
.answer:focus-visible { outline-offset: -3px; }
.answer[aria-pressed="true"] { font-weight: 600; }
.answer[aria-pressed="true"] .ic { opacity: 1; transform: none; }

.finder__foot {
  margin-top: auto; padding-top: var(--s-6);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5);
  font-size: var(--fs-small);
}
.finder__count { margin-right: auto; }
.said { margin-top: var(--s-5); font-size: var(--fs-small); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.said__item {
  background: color-mix(in srgb, var(--paper) 55%, var(--sage)); border: 0; border-radius: var(--r);
  padding: 6px 10px; min-height: 32px; color: inherit;
}
.said__item:hover { background: var(--paper); }
.linkbtn {
  background: none; border: 0; padding: var(--s-3) 0; min-height: 44px;
  text-decoration: underline; text-decoration-thickness: var(--hair); text-underline-offset: 0.2em;
  display: inline-flex; align-items: center; gap: var(--s-2); color: inherit;
}
.linkbtn:hover { text-decoration-thickness: 2px; }

/* the result */
.result__lead { font-size: var(--fs-small); }
.result__name { font-size: var(--fs-q); line-height: 1.05; letter-spacing: -0.02em; margin-top: var(--s-2); outline-offset: 8px; }
.result__why { margin-top: var(--s-4); max-width: 32em; }
.result__facts {
  margin-top: var(--s-5); border-top: var(--bar) solid var(--ink-deep);
  display: grid; grid-template-columns: 1fr 1fr;
}
.result__facts > div { padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: var(--hair) solid var(--rule-sage); }
.result__facts dt { font-size: var(--fs-small); }
.result__facts dd { font-family: var(--serif); font-size: 1.3125rem; font-weight: 500; line-height: 1.25; }
.result__facts .wide { grid-column: 1 / -1; }
.result__note { margin-top: var(--s-4); font-size: var(--fs-small); max-width: 34em; }
.result__actions { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: center; }

/* ---------- 5. Leaves ---------- */
.leaf {
  padding: var(--s-9) var(--margin);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 6vw, 96px);
  row-gap: var(--s-7);
  border-top: var(--hair) solid var(--rule);
  align-items: start;
}
.leaf__head { position: sticky; top: calc(var(--mast-h) + var(--s-6)); }
.leaf__head h2 { max-width: 11em; }
.leaf__intro { margin-top: var(--s-5); max-width: 27em; color: var(--ink-soft); }
.leaf > :not(.leaf__head) { grid-column: 2; max-width: var(--measure); }
#fees > .leaf__head { grid-row: span 3; } /* seg, table and small print stack beside the head */
.leaf--wide { grid-template-columns: minmax(0, 1fr); }
.leaf--wide .leaf__head { position: static; }
.leaf--wide .leaf__head h2 { max-width: none; }
.leaf--wide > :not(.leaf__head) { grid-column: 1; max-width: none; }
.leaf--tint { background-color: var(--paper-shade); }
.leaf--sage { background: var(--sage-wash); border-top: 0; }
.leaf--ink { background: var(--ink); color: var(--paper); border-top: 0; }
.leaf--ink .leaf__intro { color: var(--on-ink-soft); }

/* first session: the drawing, then the hour set out against its clock */
.room { max-width: var(--measure); }
.room svg { width: 100%; height: auto; }
.room figcaption, .map figcaption { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--ink-soft); font-style: italic; font-family: var(--serif); }
.d-ink { fill: var(--ink); }
.d-line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.d-rule { fill: none; stroke: var(--ink); stroke-width: 3; }
.d-pane { fill: var(--paper-bright); }
.d-light { fill: var(--sage); opacity: 0.5; }
.d-sage { fill: var(--sage); }
.d-ochre { fill: var(--ochre); }

.hour { border-top: var(--bar) solid var(--ink); }
.hour li {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--s-5);
  padding: var(--s-5) 0 var(--s-6);
  border-bottom: var(--hair) solid var(--rule);
}
.hour__when { font-family: var(--serif); font-style: italic; color: var(--ochre-deep); padding-top: 3px; }
.hour h3 { margin-bottom: var(--s-2); }

/* people: three columns of a directory, ruled like a register */
.people { --gutter: clamp(40px, 6vw, 88px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); border-top: var(--bar) solid var(--ink); }
.person { position: relative; padding: var(--s-6) 0; display: flex; flex-direction: column; }
/* the register's column rule sits in the middle of the gutter, so all three columns keep the same measure */
.person + .person::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) / -2); border-left: var(--hair) solid var(--rule); }
.person h3 { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); line-height: 1.05; letter-spacing: -0.02em; }
.person__role { margin: var(--s-3) 0 var(--s-4); font-family: var(--serif); font-style: italic; color: var(--ink-soft); }
.facts { margin: var(--s-5) 0; border-top: var(--hair) solid var(--rule); }
.facts > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s-3); padding: 10px 0; border-bottom: var(--hair) solid var(--rule); font-size: var(--fs-small); }
.facts dt { color: var(--ink-soft); }
.facts dd[data-next] { font-weight: 700; }
.textlink { margin-top: auto; align-self: flex-start; display: inline-block; font-weight: 700; padding: var(--s-3) 0; min-height: 44px; text-wrap: balance; }
.textlink .ic { display: inline-block; vertical-align: -0.15em; margin-left: 0.35em; transition: transform var(--t-fast) var(--ease-out); }
.textlink:hover .ic { transform: translateX(4px); }

/* fees */
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.seg legend { float: left; width: 100%; padding: 0 0 var(--s-1); }
.seg__opt { position: relative; }
.seg__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg__opt span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4);
  border: var(--hair) solid var(--ink); border-radius: var(--r);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.seg__opt input:checked + span { background: var(--ink); color: var(--paper); }
.seg__opt input:focus-visible + span { outline: var(--bar) solid var(--ink); outline-offset: 3px; }
.seg__opt:hover input:not(:checked) + span { background: var(--paper); }

.leaf > .tablewrap { max-width: none; overflow-x: auto; scrollbar-width: thin; }
.fees { width: 100%; border-collapse: collapse; border-top: var(--bar) solid var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.fees th, .fees td { text-align: left; vertical-align: top; padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: var(--hair) solid var(--rule); }
.fees thead th { white-space: nowrap; font-weight: 400; font-size: var(--fs-small); color: var(--ink-soft); padding-block: var(--s-3); }
.fees tbody th { font-family: var(--serif); font-weight: 500; font-size: 1.1875rem; }
.fees small { display: block; font-family: var(--sans); font-weight: 400; color: var(--ink-soft); }
.fees td:nth-child(2) { font-family: var(--serif); font-size: 1.1875rem; font-weight: 600; }
.fees td[data-month] { transition: color var(--t-fast); }
.smallprint { display: grid; gap: var(--s-3); font-size: var(--fs-small); color: var(--ink-soft); }
.smallprint li { padding-left: 1.4em; position: relative; }
.smallprint li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.7em; border-top: var(--hair) solid var(--ink); }

/* confidentiality */
.prose h3 { margin-top: var(--s-6); margin-bottom: var(--s-2); }
.prose h3:first-child { margin-top: 0; }

/* questions: details with a drawn plus that turns to a minus */
.qa { border-top: var(--bar) solid var(--ink); }
.qa details { border-bottom: var(--hair) solid var(--rule); }
.qa summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  min-height: 64px; padding: var(--s-4) 0;
  font-family: var(--serif); font-size: var(--fs-h3); font-weight: 500; line-height: 1.25;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; flex: none; width: 16px; height: 16px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 100% 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.5px 100% no-repeat;
  transition: transform var(--t-turn) var(--ease-out), background-size var(--t-fast);
}
.qa details[open] summary::after { background-size: 100% 1.5px, 1.5px 0; transform: rotate(180deg); }
.qa summary:hover { text-decoration: underline; text-decoration-thickness: var(--hair); text-underline-offset: 0.2em; }
.qa details p { padding: 0 var(--s-7) var(--s-5) 0; }

/* finding us */
.find { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.map svg { width: 100%; height: auto; background: var(--paper-shade); border: var(--hair) solid var(--rule); }
.m-water { fill: none; stroke: var(--sage); stroke-width: 26; stroke-linecap: round; opacity: 0.75; }
.m-street { fill: none; stroke: var(--paper-bright); stroke-width: 20; }
.m-street--minor { stroke-width: 11; }
.m-pin { fill: var(--paper-bright); stroke: var(--ink); stroke-width: 3; }
.m-pin-dot { fill: var(--ochre); }
.m-stop { fill: var(--ink); }
.m-label { font-family: var(--sans); font-size: 14px; fill: var(--ink); }
.m-label--it { font-family: var(--serif); font-style: italic; font-size: 16px; }
.m-label--sm { font-size: 13px; }
.m-label--strong { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.find__text h3 { margin-top: var(--s-6); margin-bottom: var(--s-2); }
.find__text h3:first-child { margin-top: 0; }
.phone { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.phone a { font-family: var(--serif); font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.25rem); font-weight: 500; letter-spacing: -0.01em; text-decoration: none; }
.phone a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.chip {
  background: none; border: var(--hair) solid var(--ink); border-radius: var(--r);
  font-size: var(--fs-small); padding: 0 var(--s-3); min-height: 36px;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.chip:hover { background: var(--ink); color: var(--paper); }
.linestate { margin-top: var(--s-2); color: var(--ink-soft); }
.linestate strong { color: var(--ink); }
.hours { border-top: var(--hair) solid var(--rule); font-variant-numeric: tabular-nums lining-nums; }
.hours > div { display: flex; justify-content: space-between; gap: var(--s-4); padding: 9px 0; border-bottom: var(--hair) solid var(--rule); }
.hours .is-today { font-weight: 700; }
.hours .is-today dt::after { content: " (today)"; font-weight: 400; color: var(--ink-soft); }

/* urgent help */
.lines { border-top: var(--bar) solid var(--paper); }
.lines a {
  display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: var(--s-2) var(--s-5); align-items: baseline;
  padding: var(--s-4) 0; min-height: 64px;
  border-bottom: var(--hair) solid color-mix(in srgb, var(--paper) 30%, var(--ink));
  text-decoration: none;
}
.lines__num { font-family: var(--serif); font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.375rem); font-weight: 500; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.lines a:hover .lines__num { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; }
.lines__who { color: var(--on-ink-soft); }
.lines__note { color: var(--on-ink-soft); }

/* ---------- 6. Components ---------- */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 52px; padding: 0 var(--s-5);
  background: var(--ink); color: var(--paper);
  border: var(--hair) solid var(--ink); border-radius: var(--r);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.btn:hover { background: var(--ink-deep); }
.btn:active { transform: translateY(1px); }
.btn--small { min-height: 40px; padding: 0 var(--s-4); }
.btn--quiet { background: transparent; color: inherit; border-color: currentColor; font-weight: 400; }
.btn--quiet:hover { background: var(--paper); color: var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.7; cursor: progress; }
.page--finder .btn { background: var(--ink-deep); border-color: var(--ink-deep); }
/* a row of three dots that inks in while the form sends */
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dot 1.1s infinite both; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* Fields */
.field { display: grid; gap: var(--s-2); }
.field > label, .field > legend, .select__label { font-family: var(--serif); font-size: var(--fs-h3); font-weight: 500; line-height: 1.25; }
.field__hint { font-size: var(--fs-small); color: var(--ink-soft); margin-top: -4px; }
.field__hint--after { margin-top: 0; text-align: right; }
.optional { white-space: nowrap; font-family: var(--sans); font-size: var(--fs-small); font-weight: 400; color: var(--ink-soft); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  width: 100%; min-height: 54px; padding: var(--s-3) var(--s-4);
  background: var(--paper-bright); color: var(--ink);
  border: var(--hair) solid var(--ink); border-radius: var(--r);
  transition: box-shadow var(--t-fast), background-color var(--t-fast);
}
.field textarea { resize: none; line-height: 1.5; display: block; field-sizing: content; min-height: 7.5em; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: 0 0 0 var(--bar) var(--ink); background: #fff; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-soft); opacity: 1; }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 100px var(--paper-bright) inset; }
.field [aria-invalid="true"] { border-color: var(--ochre-deep); box-shadow: 0 0 0 2px var(--ochre); }
.field__err { font-size: var(--fs-small); font-weight: 700; color: var(--ochre-deep); display: flex; gap: var(--s-2); align-items: baseline; }
.field__err::before { content: ""; flex: none; width: 9px; height: 9px; background: var(--ochre); transform: rotate(45deg) translateY(-1px); }
[hidden] { display: none !important; }

/* Drawn radios and checks: the real input stays focusable underneath */
.choices { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.pick { position: relative; display: inline-flex; align-items: center; gap: var(--s-3); min-height: 44px; cursor: pointer; }
.pick input { position: absolute; left: 0; top: 50%; width: 26px; height: 26px; margin: -13px 0 0; opacity: 0; cursor: pointer; }
.pick__mark {
  flex: none; width: 26px; height: 26px; border: 1.5px solid var(--ink); border-radius: 50%;
  background: var(--paper-bright); display: grid; place-items: center;
  transition: box-shadow var(--t-fast);
}
.pick__mark::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform var(--t-fast) var(--ease-out); }
.pick input:checked + .pick__mark::after { transform: scale(1); }
.pick input:focus-visible + .pick__mark { box-shadow: 0 0 0 3px var(--sage-wash), 0 0 0 6px var(--ink); }
.pick--check { align-items: flex-start; }
.pick--check input { top: 13px; }
.pick--check .pick__mark { border-radius: var(--r); margin-top: 1px; }
.pick--check .pick__mark::after { content: none; }
.pick--check .ic { width: 18px; height: 18px; stroke-width: 2; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset 220ms var(--ease-out); }
.pick--check input:checked + .pick__mark { background: var(--ink); color: var(--paper); }
.pick--check input:checked + .pick__mark .ic { stroke-dashoffset: 0; }

/* .select: a register listbox. A ruled button opens a ruled list, like an index at the back of the pamphlet */
.select { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
.select__button {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; min-width: 0; min-height: 54px; padding: 0 var(--s-4);
  background: var(--paper-bright); border: var(--hair) solid var(--ink); border-radius: var(--r);
  text-align: left;
}
.select__button [data-select-value] { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select__button .ic { transition: transform var(--t-fast) var(--ease-out); }
.select__button[aria-expanded="true"] .ic { transform: rotate(180deg); }
.select__button:focus-visible { outline: none; box-shadow: 0 0 0 var(--bar) var(--ink); }
.select__list {
  position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 6px);
  max-height: min(300px, 50vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper-bright); border: var(--hair) solid var(--ink); border-top-width: var(--bar); border-radius: var(--r);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  outline: none;
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease-out);
}
@starting-style { .select__list { opacity: 0; transform: translateY(-6px); } }
.select--up .select__list { top: auto; bottom: 62px; }
.select__list li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 48px; padding: var(--s-2) var(--s-4);
  border-bottom: var(--hair) solid var(--rule); cursor: pointer;
}
.select__list li:last-child { border-bottom: 0; }
.select__list li.is-active { background: var(--ink); color: var(--paper); }
.select__list li[aria-selected="true"] { font-weight: 700; }
.select__list li[aria-selected="true"]::after {
  content: ""; width: 14px; height: 8px; flex: none;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translateY(-2px);
}

/* .slip: errata slips. Small printed notices tucked into the corner of the page */
.slips {
  position: fixed; z-index: 40; left: var(--s-5); bottom: var(--s-5);
  display: grid; gap: var(--s-3); width: min(380px, calc(100vw - 2 * var(--s-4)));
  pointer-events: none;
}
.slip {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  background: var(--paper-bright); color: var(--ink);
  border: var(--hair) solid var(--ink); border-top: var(--bar) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--shadow);
  font-size: var(--fs-small);
  transition: opacity 240ms, transform 320ms var(--ease-out);
}
@starting-style { .slip { opacity: 0; transform: translateY(14px) rotate(-1deg); } }
.slip.is-leaving { opacity: 0; transform: translateY(8px); }
.slip__text { flex: 1; }
.slip__text b { font-family: var(--serif); font-weight: 600; font-size: 1.0625rem; display: block; }
.slip__action { background: none; border: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; padding: var(--s-2); min-height: 40px; }
.slip__close { background: none; border: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); }
.slip__close:hover { background: var(--paper-shade); }

/* .plate: the bookplate dialog. A slip pasted to the page, double ruled */
.plate {
  width: min(460px, calc(100vw - 32px)); padding: var(--s-6) var(--s-6) var(--s-5);
  background: var(--paper-bright); color: var(--ink);
  border: var(--hair) solid var(--ink); border-radius: var(--r);
  outline: var(--hair) solid var(--ink); outline-offset: -7px;
  box-shadow: var(--shadow);
  transition: opacity 220ms, transform 360ms var(--ease-out), overlay 360ms allow-discrete, display 360ms allow-discrete;
}
.plate:not([open]) { opacity: 0; transform: translateY(10px); }
@starting-style { .plate[open] { opacity: 0; transform: translateY(16px); } }
.plate::backdrop { background: color-mix(in srgb, var(--ink-deep) 55%, transparent); transition: opacity 300ms; }
@starting-style { .plate[open]::backdrop { opacity: 0; } }
.plate h2 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.01em; }
.plate p { margin-top: var(--s-3); }
.plate__actions { margin-top: var(--s-5); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-3); }
.plate .btn--quiet:hover { background: var(--paper-shade); }

/* .alert: an inline notice for things that went wrong */
.alert {
  padding: var(--s-4) var(--s-5);
  background: var(--paper-bright); border: 1.5px solid var(--ochre-deep); border-radius: var(--r);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ochre) 35%, transparent);
}

/* ---------- 7. Request form and its states ---------- */
.form { display: grid; gap: var(--s-6); }
.field--half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4); align-items: end; }
.form__actions { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: center; }
.form__foot { font-size: var(--fs-small); color: var(--ink-soft); }
.form.is-sending { pointer-events: none; }
.form.is-sending .field, .form.is-sending .pick { opacity: 0.6; }
.sent { display: grid; gap: var(--s-4); padding: var(--s-6); background: var(--paper-bright); border: var(--hair) solid var(--ink); border-top: var(--bar) solid var(--ink); border-radius: var(--r); outline: none; }
.sent h3 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.25rem); line-height: 1.1; letter-spacing: -0.015em; }
.sent__ref { font-size: var(--fs-small); color: var(--ink-soft); }
.sent .btn--quiet:hover { background: var(--paper-shade); }

/* ---------- 8. Colophon ---------- */
.colophon { padding: var(--s-8) var(--margin) var(--s-7); border-top: var(--hair) solid var(--rule); font-size: var(--fs-small); color: var(--ink-soft); }
.colophon__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6) clamp(32px, 6vw, 96px); }
.colophon p + p { margin-top: var(--s-4); }
.colophon__brand { font-family: var(--serif); font-size: 1.375rem; font-weight: 600; color: var(--ink); }
.colophon__set { font-family: var(--serif); font-style: italic; }
.colophon a { display: inline-block; padding: 3px 0; }

/* ---------- 9. Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* The one entrance: the title is set, then the sage page is laid down from the fold */
  .page--title h1, .page--title .lede, .page--title .contents { animation: set 900ms var(--ease-out) both; }
  .page--title .lede { animation-delay: 120ms; }
  .page--title .contents { animation-delay: 220ms; }
  .page--finder { animation: lay 1100ms var(--ease-out) 150ms both; }
  @keyframes set { from { opacity: 0; transform: translateY(14px); } }
  @keyframes lay { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

  /* Each new question turns in like a page */
  .finder__panel.is-turning { animation: turn var(--t-turn) var(--ease-out) both; }
  .finder__panel.is-turning .answer { animation: set 600ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 80ms); }
  @keyframes turn { from { opacity: 0; transform: translateX(18px); } }

  /* The heavy rule above each list is drawn as it scrolls into view */
  @supports (animation-timeline: view()) {
    .hour, .people, .qa, .fees, .lines {
      border-image: linear-gradient(90deg, currentColor var(--draw, 100%), transparent 0) 1;
      animation: draw linear both; animation-timeline: view(); animation-range: entry 0% entry 60%;
    }
    @property --draw { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
    @keyframes draw { from { --draw: 0%; } to { --draw: 100%; } }
  }
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .dots i { opacity: 1; }
}

/* ---------- 10. Narrow screens ---------- */
@media (max-width: 1180px) {
  .masthead__nav { display: none; }
  .masthead__actions { margin-left: auto; }
}
@media (max-width: 900px) {
  /* the pamphlet closes: the title page, then the sage page beneath it */
  .spread { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .page--title { padding-right: var(--margin); padding-bottom: var(--s-6); }
  .page--title .contents { display: none; } /* the masthead and the page itself do this job on a phone */
  .page--finder { padding-left: var(--margin); min-height: 560px; }
  .page--finder::before { inset: 0 0 auto 0; width: auto; height: 28px; background: linear-gradient(180deg, color-mix(in srgb, var(--ink-deep) 18%, transparent), transparent); }
  @keyframes lay { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

  .leaf { grid-template-columns: minmax(0, 1fr); padding-block: var(--s-8); row-gap: var(--s-6); }
  .leaf__head { position: static; }
  .leaf > :not(.leaf__head) { grid-column: 1; }
  .people { grid-template-columns: minmax(0, 1fr); }
  .person, .person + .person { padding: var(--s-6) 0; }
  .person + .person::before { content: none; }
  .person + .person { border-top: var(--hair) solid var(--rule); }
  .find { grid-template-columns: minmax(0, 1fr); }
  .colophon__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  :root { --s-9: 96px; --s-8: 64px; --mast-h: 56px; }
  .brand__rest { display: none; }
  .masthead { gap: var(--s-2); }
  .masthead__actions { gap: var(--s-3); }
  .masthead .btn--small { padding: 0 var(--s-3); }
  .page { padding-top: var(--s-6); }
  .lede { margin-top: var(--s-5); }
  .hour li { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .field--half { grid-template-columns: minmax(0, 1fr); }
  .result__facts { grid-template-columns: minmax(0, 1fr); }
  .lines a { grid-template-columns: minmax(0, 1fr); }
  .qa details p { padding-right: 0; }
  .fees { min-width: 520px; }
  .slips { left: var(--s-4); bottom: var(--s-4); }
  .form__actions .btn { flex: 1 1 100%; }
  .plate { padding: var(--s-5); }
  .plate__actions .btn { flex: 1 1 auto; }
  .sent { padding: var(--s-5); }
}
@media (max-width: 420px) {
  /* the wordmark alone, so the urgent link and the button keep their room */
  .brand__mark { display: none; }
}
