/* Layout: the site opens as a dictionary entry for an invented word. One drawn motif recurs:
   a dashed migration route from "stuck" to "started". Left-aligned editorial columns throughout. */
:root {
  --paper: #F1F5F0;
  --raise: #E2EBE4;
  --ink: #0F2B27;
  --ink-soft: #44605A;
  --line: #C2D0C8;
  --sun: #F4B81F;
  --sun-ink: #1B1500;
  --link: #0A5E52;
  --band: #0F2B27;
  --band-ink: #EEF4F0;
  --band-soft: #A9BFB7;

  --display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --step--1: 0.94rem;
  --step-0: 1.19rem;
  --step-1: 1.45rem;
  --step-2: clamp(1.7rem, 1.2rem + 2vw, 2.4rem);
  --step-3: clamp(2.1rem, 1.3rem + 3.6vw, 3.7rem);

  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --section: clamp(3.25rem, 8vw, 6.5rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0A1D1A; --raise: #122C28; --ink: #E8F0EB; --ink-soft: #A2B8B0; --line: #27463F;
    --sun: #F6C033; --sun-ink: #1B1500; --link: #8AD7C4;
    --band: #16362F; --band-ink: #EEF4F0; --band-soft: #A9BFB7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0A1D1A; --raise: #122C28; --ink: #E8F0EB; --ink-soft: #A2B8B0; --line: #27463F;
  --sun: #F6C033; --sun-ink: #1B1500; --link: #8AD7C4;
  --band: #16362F; --band-ink: #EEF4F0; --band-soft: #A9BFB7;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.58;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
p, h1, h2, h3, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.06; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: var(--step-3); font-weight: 800; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.005em; line-height: 1.18; }

.wrap { max-width: 72rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.measure { max-width: 38rem; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.stack-lg { display: flex; flex-direction: column; gap: var(--gap); }
.soft { color: var(--ink-soft); }
.small { font-size: var(--step--1); }
.lead { font-size: var(--step-1); line-height: 1.42; }

/* Header */
.site-head { padding-block: 1.25rem; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.5rem; font-family: var(--display); font-weight: 500; font-size: 1rem; }
.site-nav a { color: var(--ink); text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--sun); }

/* Buttons */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.2;
  padding: 0.85em 1.35em; border-radius: 999px; text-decoration: none; border: 2px solid transparent;
}
.btn-sun { background: var(--sun); color: var(--sun-ink); border-color: var(--sun); }
.btn-sun:hover { filter: brightness(1.06); }
.btn-line { color: var(--ink); border-color: var(--ink); }
.btn-line:hover { background: var(--raise); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Sections */
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }
.part { font-style: italic; color: var(--ink-soft); font-size: var(--step-0); }
.split { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
.split > * { min-width: 0; }
.cols-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 > *, .cols-3 > * { min-width: 0; }

/* Hero: the dictionary entry */
.entry { padding-block: clamp(2rem, 6vw, 4.5rem) var(--section); }
.entry-syll { font-size: var(--step-1); color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; align-items: baseline; }
.entry-syll em { font-style: italic; }
.entry-word {
  font-size: clamp(2.5rem, 10.4vw, 8rem); font-weight: 800; letter-spacing: -0.045em; line-height: 0.95;
  margin-block: 0.12em 0.3em; overflow-wrap: anywhere;
}
.entry-def { font-size: var(--step-2); line-height: 1.22; font-style: italic; max-width: 24em; text-wrap: balance; }
.entry-def q { quotes: "\201C" "\201D"; font-style: normal; }
.entry-body { margin-top: var(--gap); }

/* The route: a gentle S-curve that draws itself, left to right, when scrolled into view */
.route { position: relative; height: 7rem; margin-top: clamp(2.5rem, 6vw, 4.5rem); margin-inline: 0.55rem; }
.route svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.route .dots { fill: none; stroke: var(--ink-soft); stroke-width: 2.5; stroke-dasharray: 0.1 9; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.route .reveal { fill: none; stroke: #fff; stroke-width: 60; stroke-dasharray: 1; stroke-dashoffset: 0; }
.route .stop { position: absolute; width: 1.05rem; height: 1.05rem; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--ink); }
.route .stop-a { left: 0; top: 76%; background: var(--paper); }
.route .stop-b { left: 100%; top: 22%; background: var(--sun); }
.route .tag { position: absolute; font-style: italic; font-size: var(--step--1); color: var(--ink-soft); white-space: nowrap; }
.route .tag-a { left: -0.55rem; top: 76%; transform: translateY(70%); }
.route .tag-b { right: -0.55rem; top: 22%; transform: translateY(-170%); }
.route-note { margin-top: 2.75rem; padding-top: 1rem; border-top: 1px solid var(--line); max-width: 34rem; font-size: var(--step--1); color: var(--ink-soft); font-style: italic; }
.route-wait .reveal { stroke-dashoffset: 1; }
.route-wait .stop-b { transform: translate(-50%, -50%) scale(0); }
.route-wait .tag-b { opacity: 0; }
.route-go .reveal { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s cubic-bezier(.45,0,.3,1); }
.route-go .stop-b { transform: translate(-50%, -50%) scale(1); transition: transform .45s cubic-bezier(.3,1.6,.5,1) 2.3s; }
.route-go .tag-b { opacity: 1; transition: opacity .4s ease 2.5s; }

/* Voices: what people say when they're stuck */
.voices { display: flex; flex-direction: column; }
.voices li { padding-block: 0.7rem; border-top: 1px solid var(--line); font-size: var(--step-0); }
.voices li::before { content: "\201C"; }
.voices li::after { content: "\201D"; }

/* A sample issue, set like the email it is */
.letter { background: var(--raise); padding: clamp(1.25rem, 3.5vw, 2.25rem); }
.letter-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.15rem 1rem; padding-bottom: 1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.letter-head dt { color: var(--ink-soft); font-style: italic; }
.letter-head dd { font-family: var(--display); font-weight: 500; }
.letter p + p { margin-top: 0.85rem; }
.letter strong { font-family: var(--display); font-weight: 700; }
.letter .quote { background: var(--paper); padding: 0.9rem 1.1rem; font-style: italic; }
.letter .close { font-family: var(--display); font-weight: 700; font-size: var(--step-1); line-height: 1.2; }

/* Facts: term and description rows */
.facts { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(0, 3fr); }
.facts dt, .facts dd { padding-block: 0.85rem; border-top: 1px solid var(--line); }
.facts dt { font-style: italic; color: var(--ink-soft); padding-right: 1rem; }

/* Link lists */
.reads li { border-top: 1px solid var(--line); }
.reads a { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.25rem 1.25rem; padding-block: 0.9rem; color: var(--ink); text-decoration: none; }
.reads a:hover .t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.reads .y { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.reads .t { font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.25; }
.reads .o { grid-column: 2; color: var(--ink-soft); font-size: var(--step--1); }

/* Band */
.band { background: var(--band); color: var(--band-ink); padding-block: var(--section); }
.band h2 { font-size: var(--step-3); font-weight: 800; max-width: 16em; }
.band p { color: var(--band-soft); }
.band .wrap { display: flex; flex-direction: column; gap: 1.4rem; align-items: flex-start; }

/* Page intro (inner pages) */
.intro { padding-block: clamp(2rem, 6vw, 4.5rem) var(--section); }
.intro h1 { max-width: 14em; }

/* Steps: a real sequence */
.steps { counter-reset: s; display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps li { counter-increment: s; border-top: 2px solid var(--ink); padding-top: 0.9rem; min-width: 0; }
.steps li::before { content: counter(s); font-family: var(--display); font-weight: 800; font-size: var(--step-2); line-height: 1; display: block; margin-bottom: 0.5rem; }
.steps h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }

/* Plain panels */
.panel { border-top: 2px solid var(--ink); padding-top: 1rem; }
.panel h3 { margin-bottom: 0.5rem; }

/* Portrait slot */
.portrait { aspect-ratio: 4 / 5; max-width: 100%; background: var(--raise); display: flex; align-items: flex-end; padding: 1.1rem; font-style: italic; color: var(--ink-soft); font-size: var(--step--1); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-photo { padding: 0; }

/* Vertical route (About) */
.journey { border-left: 2px dashed var(--ink-soft); margin-left: 0.5rem; display: flex; flex-direction: column; gap: 1.5rem; padding-block: 0.25rem; }
.journey li { position: relative; padding-left: 1.75rem; }
.journey li::before { content: ""; position: absolute; left: -0.6rem; top: 0.45rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
.journey li:last-child::before { background: var(--sun); }
.journey h3 { font-size: 1.2rem; }

/* Writing index */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font: inherit; font-family: var(--display); font-weight: 500; font-size: 0.98rem; padding: 0.45em 0.95em; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.index li { border-top: 1px solid var(--line); padding-block: 1.1rem; display: grid; grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 14rem); gap: 0.3rem 1.5rem; align-items: baseline; }
.index .d { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-size: var(--step--1); }
.index .t { font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1.25; color: var(--ink); }
.index .n { display: block; margin-top: 0.3rem; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.45; }
.index .o { color: var(--ink-soft); font-size: var(--step--1); font-style: italic; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 2.5rem; font-size: var(--step--1); color: var(--ink-soft); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; justify-content: space-between; align-items: flex-start; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.site-foot a { color: var(--ink); }
.site-foot p { max-width: 34rem; }

/* Skip link: off screen until a keyboard user tabs to it */
.skip { position: absolute; left: -9999px; }
.skip:focus { position: fixed; left: 0.75rem; top: 0.75rem; z-index: 20; padding: 0.65rem 1rem;
  background: var(--sun); color: var(--sun-ink); font-family: var(--display); font-weight: 700;
  font-size: var(--step--1); text-decoration: none; }

/* Legal pages. Same type, colour and rhythm as the rest of the site, with the list
   markers and paragraph spacing that long prose needs put back. */
.site-foot .foot-legal { flex-basis: 100%; padding-top: 1.15rem; border-top: 1px solid var(--line); }

.legal-toc ol { list-style: decimal; padding-left: 1.4rem; margin-top: 0.6rem; }
.legal-toc li { margin-block: 0.3rem; }
.legal-note { border-left: 3px solid var(--sun); background: var(--raise); padding: 0.9rem 1.1rem; }
.legal-note p { font-size: var(--step--1); }

.legal { max-width: 44rem; }
.legal section { scroll-margin-top: 1.5rem; }
.legal > section + section { margin-top: var(--gap); padding-top: var(--gap); border-top: 1px solid var(--line); }
.legal h2 { font-size: var(--step-1); }
.legal h3 { font-size: 1.1rem; margin-top: 1.2rem; }
.legal p, .legal ul, .legal ol { margin-block: 0.85rem; }
.legal ul { list-style: disc; padding-left: 1.35rem; }
.legal ol { list-style: decimal; padding-left: 1.45rem; }
.legal li { margin-block: 0.45rem; }
.legal strong { font-family: var(--display); font-weight: 700; }
.legal cite { font-style: italic; }
.legal code { font-size: 0.9em; background: var(--raise); padding: 0.1em 0.35em; border-radius: 2px; }

/* Highlights a fact the owner still has to confirm. Disappears when legal.DRAFT is False. */
mark.todo { background: var(--sun); color: var(--sun-ink); padding: 0.05em 0.3em; }

/* Notice under a booking or subscribe button. Needs the light ink when it sits
   on the dark band, so these two rules must stay in this order. */
.book-note { color: var(--ink-soft); }
.band .book-note { color: var(--band-soft); }
.band a:not(.btn) { color: var(--band-ink); }

@media (max-width: 52rem) {
  .split, .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index li { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { padding-bottom: 0; }
  .facts dd { border-top: 0; padding-top: 0.15rem; }
}
@media (max-width: 30rem) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .reads a { grid-template-columns: 3.6rem minmax(0, 1fr); }
}

/* The hidden attribute must win over layout display rules (topic filter) */
[hidden] { display: none !important; }
