/* The visual system, from docs/design.md in the specification repository.
   The token names are the system's own words and match the app's, so --paper
   and --ink mean the same thing on every surface. A value design.md does not
   define is added there first, never here. */

/* Self-hosted, never from a font CDN: a third-party font request is a third
   party seeing every reader's address (design.md section 4). Latin subset,
   swap, so a face enhances and never blocks the first paint. */
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/literata-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: Literata;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/literata-latin-400-italic.woff2") format("woff2");
}
/* For the wordmark alone, the one stated exception to a serif never bold. */
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/literata-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}

:root {
  --paper: #ffffff;
  --paper-band: #faf9f7;
  --card: #f4f2ef;
  --raised: #ffffff;
  --accent: #f2e3d2;
  --accent-ink: #381f1a;
  --line: #e8e3dd;
  --line-strong: #a5927a;
  --ink: #2a201a;
  --muted: #6f6258;
  --disabled: #9c9188;
  --attention: #8f2f22;
  --waiting: #80621d;
  --settled: #3d6146;
  --settled-tint: #dbe8de;
  --olive: #6f7a2e;
  --oxblood: #7e2f3a;
  --ochre-tint: #f3e7cf;

  --display: Literata, Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

  color-scheme: light;
}

/* The desk, not the inverted page (D438): at night the lit thing is the work. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141210;
    --paper-band: #1b1714;
    --card: #211c17;
    --raised: #211c17;
    --accent: #3f2c1f;
    --accent-ink: #f2e3d2;
    --line: #332d26;
    --line-strong: #7a6d5e;
    --ink: #ece7dc;
    --muted: #b0a79a;
    --disabled: #7d7469;
    --attention: #e8907f;
    --waiting: #d9b25c;
    --settled: #8fbf9e;
    --settled-tint: #1e2f24;
    --olive: #a3ad62;
    --oxblood: #c76d7a;
    --ochre-tint: #3a2f16;
    color-scheme: dark;
  }
}
/* Repeated so an explicit choice beats the operating system both ways. */
:root[data-theme="dark"] {
  --paper: #141210;
  --paper-band: #1b1714;
  --card: #211c17;
  --raised: #211c17;
  --accent: #3f2c1f;
  --accent-ink: #f2e3d2;
  --line: #332d26;
  --line-strong: #7a6d5e;
  --ink: #ece7dc;
  --muted: #b0a79a;
  --disabled: #7d7469;
  --attention: #e8907f;
  --waiting: #d9b25c;
  --settled: #8fbf9e;
  --settled-tint: #1e2f24;
  --olive: #a3ad62;
  --oxblood: #c76d7a;
  --ochre-tint: #3a2f16;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 41rem; margin: 0 auto; padding: 0 1.25rem; }

/* Links do not underline at rest; an arrow carries the affordance. A link
   inside a sentence keeps its underline, because colour alone cannot tell it
   from the words around it (WCAG 1.4.1, a floor under X7). */
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
p a, li a { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.75rem 1.25rem; z-index: 10;
}
.skip:focus { left: 0; }

header.site {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
/* currentColor, so one asset carries both themes. */
.wordmark .mark {
  height: 1.75rem;
  width: auto;
  flex: none;
}

main section { padding: 3.5rem 0; border-bottom: 1px solid var(--line); }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* The serif stays at 400 at every size and is never bold, with tracking
   tightening as it grows (design.md section 4). */
h1, h2 {
  font-family: var(--display);
  font-weight: 400;
}
h1 {
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}
h2 {
  font-size: clamp(1.4375rem, 4.5vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
}
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
/* The mixed headline: emphasis set in the sans italic rather than in colour
   or weight. Once per page, in the largest thing on it. */
h1 .turn {
  font-family: var(--sans);
  font-style: italic;
  letter-spacing: -0.03em;
}
strong { font-weight: 600; }
p + p, .prose > * + * { margin-top: 1rem; }
.lede { font-size: 1.1875rem; line-height: 1.45; color: var(--ink); }
.muted { color: var(--muted); }
.note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* Buttons are fully round: filled in ink, or a ghost with an ink hairline. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  padding: 0 1.5rem;
  border-radius: 999px;
  min-height: 48px;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn-row { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.btn-quiet {
  font-size: 1rem;
  padding: 0.875rem 0;
  display: inline-block;
}

ul.plain { list-style: none; }
ul.plain > li + li { margin-top: 1.25rem; }

/* Hairlines do the separating; a content card never casts a shadow. */
.cards { display: grid; gap: 1rem; margin-top: 1.5rem; }
.card {
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  padding: 1.5rem;
}
.card p { margin-top: 0.25rem; color: var(--muted); line-height: 1.5; }
@media (min-width: 700px) {
  .cards { grid-template-columns: 1fr 1fr; }
  main section { padding: 5rem 0; }
}
.callout {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
  font-size: 1.0625rem;
}
ol.principles { list-style: none; counter-reset: pr; margin-top: 1.5rem; }
ol.principles > li {
  counter-increment: pr;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1rem;
}
ol.principles > li::before {
  content: counter(pr);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
  min-width: 1.25rem;
  padding-top: 0.125rem;
}
ol.principles strong { display: block; }
ol.principles span { color: var(--muted); }
footer.site {
  padding: 2.5rem 0 3.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}
footer.site p + p { margin-top: 0.5rem; }

/* The header nav, from the second page onward. */
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-nav {
  font-size: 0.875rem;
  display: flex;
  gap: 1.25rem;
}
.site-nav a {
  text-decoration: none;
  padding: 0.75rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* Updates entries. Dated, newest first, no cadence implied. */
.entries { list-style: none; margin-top: 2.5rem; }
.entry { padding: 2.25rem 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry time {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.625rem;
}
.entry h2 {
  font-size: clamp(1.1875rem, 3.5vw, 1.4375rem);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

/* Guides. The editorial density at a wider measure, as drawn: 80px between
   sections, numbered badges in ink, hairline cards, nothing that casts a
   shadow. */
.guide-wrap {
  max-width: 65rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}
.guide section { padding: 0; border: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.guide h2 { margin: 0; }
.guide-intro { max-width: 47.5rem; gap: 1rem; }
.guide-intro h1, .guide-intro .lede { margin: 0; }
.guide .eyebrow { margin: 0; }
.measure { max-width: 45rem; line-height: 1.55; }
.small { font-size: 0.875rem; line-height: 1.4; }
.ink { color: var(--ink); }
.num {
  width: 24px; height: 24px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 0.8125rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.parts { display: flex; flex-wrap: wrap; gap: 2.5rem; align-items: flex-start; }
.parts-map {
  flex: 1 1 26rem; min-width: 0; height: 320px;
  border: 1px solid var(--line-strong); border-radius: 1rem; overflow: hidden;
  display: grid;
  grid-template-columns: 52px 120px minmax(0, 1fr) 110px;
  grid-template-rows: 56px minmax(0, 1fr);
}
.pm-bar {
  grid-column: 1 / 5; background: var(--card);
  border-bottom: 1px solid var(--line-strong);
  display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem;
  font-size: 0.8125rem; color: var(--muted);
}
.pm-rail { border-right: 1px solid var(--line-strong); display: flex; justify-content: center; padding-top: 0.75rem; background: var(--paper-band); }
.pm-side { border-right: 1px solid var(--line-strong); padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.pm-page { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 0.625rem; }
.pm-panel { border-left: 1px solid var(--line-strong); padding: 0.75rem; background: var(--paper-band); }
.pm-side i, .pm-page i { display: block; height: 6px; border-radius: 3px; background: var(--line); }
.pm-page i { height: 8px; border-radius: 4px; background: var(--card); }
.pm-side i.short { width: 70%; }
.pm-page i.short { width: 80%; }
.parts-list { flex: 1 1 22.5rem; min-width: 0; list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.parts-list li { display: flex; gap: 0.75rem; }

.rooms { list-style: none; }
.room {
  display: grid; grid-template-columns: 40px 120px minmax(0, 1fr);
  gap: 1rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.room span { color: var(--muted); }
@media (max-width: 559px) {
  .room { grid-template-columns: 32px minmax(0, 1fr); }
  .room span { grid-column: 2; }
}

.shapes { display: grid; grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr); align-items: stretch; }
.shape {
  border: 1px solid var(--line-strong); border-radius: 1.5rem; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.625rem;
}
.shape strong { font-weight: 600; }
.level { padding: 0.625rem 0.875rem; border-radius: 0.75rem; background: var(--card); }
.level:first-of-type { margin-top: 0.5rem; }
.level.l1 { margin-left: 1.5rem; }
.level.this { background: none; border: 1.5px solid var(--ink); font-weight: 500; }
.shapes-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; padding: 0 0.5rem; text-align: center; }
@media (max-width: 699px) {
  .shapes { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .shapes-join svg { transform: rotate(90deg); width: 40px; }
}

.terms { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17.5rem, 100%), 1fr)); gap: 1rem; }
.term { display: flex; flex-direction: column; gap: 0.375rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; }
.term span { color: var(--muted); }
.term .more { font-size: 0.875rem; }

.three { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 1rem; }
.card3, .fate {
  display: flex; flex-direction: column; gap: 0.625rem;
  padding: 1.5rem; border: 1px solid var(--line); border-radius: 1.5rem; line-height: 1.55;
}
.card3 > strong { font-size: 1.0625rem; line-height: 1.4; }
.step { font-size: 0.75rem; font-weight: 600; color: var(--muted); }

.views { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1rem; }
.view { border: 1px solid var(--line); border-radius: 1rem; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.view figcaption { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.prose-sample { font-family: var(--display); font-size: 1.1875rem; line-height: 1.6; }
/* The marks the editor draws (design.md section 3: a proofreader's, never
   git's): added words in olive underlined, removed in oxblood struck. */
.guide ins { color: var(--olive); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.guide del { color: var(--oxblood); text-decoration: line-through; }
.guide mark { background: var(--ochre-tint); color: inherit; border-radius: 3px; padding: 0 1px; }
.prose-sample.flagged { border-left: 2px solid var(--line-strong); padding-left: 0.75rem; }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 1rem; }
.guide table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: 0.875rem; }
.guide th, .guide td { text-align: left; padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.guide tbody tr:last-child > * { border-bottom: 0; }
.guide thead th { font-weight: 600; color: var(--muted); font-size: 0.8125rem; }
.guide tbody th { font-weight: 600; }

.fates { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); gap: 1rem; }
.fate strong { display: inline-flex; align-items: center; gap: 0.5rem; }

.kept {
  display: flex; gap: 0.75rem; align-items: flex-start;
  background: var(--card); border-radius: 1.5rem; padding: 1.5rem 1.75rem; line-height: 1.55;
}
.kept svg { flex-shrink: 0; margin-top: 0.1875rem; }

.guide-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1rem; }
.guide-list h2 { font-size: 1.4375rem; margin-bottom: 0.5rem; }
.guide-list p { color: var(--muted); }
@media (min-width: 700px) {
  .guide-wrap { padding: 4rem 1.5rem 5rem; gap: 5rem; }
}

/* The walkthrough. Captures from the app at twice the density, in the
   reader's theme, framed by a hairline as a screen is, never a shadow. */
.walkthrough section { gap: 1.25rem; }
.shot { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.shot-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); gap: 1rem; align-items: start; }
.walk-end { padding-top: 2rem; border-top: 1px solid var(--line) !important; }
