/* Tred public home page (/), in Tred's Book look: an open book like the one
   at the end of setup (public/setup.css, public/setup-book.js), with vellum,
   red rubrics, gold hairlines and IM Fell English. Each spread (left and
   right page) is a <section class="spread">; the one in the address shows
   (or the first), and the page turns with CSS alone (:target), so links
   such as /#wheel work and the back button turns back. Fonts are bundled
   (SIL OFL, see fonts/OFL.txt). No scripts. */
@font-face { font-family: "IM Fell English"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/im-fell-english-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/im-fell-english-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English SC"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/im-fell-english-sc-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/alegreya-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/alegreya-latin-400-italic.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --desk: #e4d9bd; --vellum: #f5ecd7; --edge: #e2d3b0; --edge-2: #d4c299;
  --ink: #2b2318; --quiet: #6f5f45; --rubric: #a8321e; --gold: #b08622; --on-rubric: #fbf5e6;
  /* Illuminator's pigments for the figures. */
  --azure: #2f4f9a; --verdigris: #3d7a5c; --vermilion: #c0442a; --leaf: #c99a2e;
  --spine: rgb(70 45 10 / .30); --shadow: rgb(40 26 8 / .45);
  --book: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --book-sc: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --text: "Alegreya", "Iowan Old Style", Georgia, serif;
  --pad: clamp(14px, 3vh, 36px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #141518; --vellum: #2a241a; --edge: #3a3122; --edge-2: #4a3f2b;
    --ink: #f1e6cc; --quiet: #c4b490; --rubric: #f08a5c; --gold: #e2b65a; --on-rubric: #1a140c;
    --azure: #7d9be0; --verdigris: #6fbf94; --vermilion: #f08a5c; --leaf: #e8bf5c;
    --spine: rgb(0 0 0 / .45); --shadow: rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  --desk: #141518; --vellum: #2a241a; --edge: #3a3122; --edge-2: #4a3f2b;
  --ink: #f1e6cc; --quiet: #c4b490; --rubric: #f08a5c; --gold: #e2b65a; --on-rubric: #1a140c;
  --azure: #7d9be0; --verdigris: #6fbf94; --vermilion: #f08a5c; --leaf: #e8bf5c;
  --spine: rgb(0 0 0 / .45); --shadow: rgb(0 0 0 / .6);
}
:root[data-theme="dark"] { color-scheme: dark; } :root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; background: var(--desk); color: var(--ink); font: clamp(15px, 1.9vh, 18px)/1.55 var(--text); padding: var(--pad) 16px; display: grid; place-items: center; }
.defs { position: absolute; }
a { color: var(--rubric); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* The open book: vellum, a shaded spine, page edges below; one screen high. */
.book { position: relative; width: 100%; max-width: 1200px; height: calc(100svh - 2 * var(--pad) - 44px); max-height: 900px; display: grid; background: var(--vellum); border-radius: 4px; perspective: 2400px;
  box-shadow: -3px 3px 0 -1px var(--edge), 3px 3px 0 -1px var(--edge), -6px 6px 0 -2px var(--edge-2), 6px 6px 0 -2px var(--edge-2), 0 34px 60px -24px var(--shadow); }
.book::before { content: ""; position: absolute; z-index: 2; top: 0; bottom: 0; left: 50%; width: 90px; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--spine) 33%, transparent) 38%, var(--spine) 50%, color-mix(in srgb, var(--spine) 33%, transparent) 62%, transparent); }

/* One spread at a time: the one in the address, or the first. */
.spread { grid-area: 1 / 1; display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; scroll-margin-top: 200vh; }
.spread:target, .book:not(:has(.spread:target)) #start { display: grid; }
@supports not selector(:has(a)) { .spread { display: grid; } .book { height: auto; max-height: none; gap: 24px; } }
/* The turn: the new left page swings down from the spine like a leaf
   coming over, while the right page settles in. */
.spread:target .verso { animation: leaf-over .7s cubic-bezier(.3, .7, .2, 1) both; transform-origin: right center; backface-visibility: hidden; }
.spread:target .recto { animation: settle .5s .15s ease-out both; }
@keyframes leaf-over { from { transform: rotateY(-100deg); box-shadow: 30px 0 40px -20px var(--shadow); } 60% { box-shadow: 10px 0 30px -20px var(--shadow); } to { transform: none; box-shadow: none; } }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .spread .verso, .spread .recto { animation: none !important; } }

.leaf { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: clamp(8px, 1.6vh, 16px); padding: clamp(18px, 3.2vh, 32px) 60px clamp(12px, 2vh, 20px) 52px; min-width: 0; min-height: 0; overflow: hidden; background: var(--vellum); border-radius: 4px 0 0 4px; }
.recto { padding-left: 60px; padding-right: 52px; border-radius: 0 4px 4px 0; }
.runhead { display: flex; justify-content: space-between; gap: 16px; margin: 0; font: 15px var(--book-sc); letter-spacing: .12em; color: var(--rubric); border-bottom: 1px solid var(--gold); padding-bottom: 8px; }
.runhead a { color: inherit; }
.runhead span:last-child { white-space: nowrap; text-align: right; }
.body { display: grid; align-content: start; min-height: 0; }
.body p { margin: 0 0 .8em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: italic 16px var(--book); }
.foot a { color: var(--rubric); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.folio { color: var(--quiet); font: italic 15px var(--book); }

h1 { font: 400 clamp(34px, 6vh, 60px)/1.04 var(--book); margin: clamp(6px, 2vh, 20px) 0 clamp(14px, 2.6vh, 26px); text-wrap: balance; }
.leaf-title { font: 400 clamp(28px, 4.4vh, 42px)/1.08 var(--book); margin: clamp(4px, 1.4vh, 14px) 0 clamp(10px, 2vh, 18px); text-wrap: balance; }
.leaf-title .num { color: var(--rubric); }
/* An illuminated initial: red letter in a gold-ruled, gold-washed box. */
.drop::first-letter { font-family: var(--book); float: left; font-size: 4.2em; line-height: .78; margin: 6px 12px 0 0; padding: 8px 10px 6px; color: var(--rubric);
  border: 1px solid var(--gold); outline: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 3px;
  background: color-mix(in srgb, var(--gold) 13%, transparent); }
.later { font: italic 1.02em/1.5 var(--book); color: var(--ink); border-left: 2px solid var(--rubric); padding-left: 12px; text-align: left !important; }
.later span { font: normal .85em var(--book-sc); letter-spacing: .1em; color: var(--rubric); margin-right: 4px; }
.caption { font: italic 1em/1.5 var(--book); color: var(--quiet); text-align: center !important; max-width: 46ch; margin: 10px auto 0 !important; }
.caption em { color: var(--rubric); }

/* The waitlist, at the foot of the page like setup's writing line. */
.ask { display: grid; gap: 6px; border-top: 1px solid var(--gold); padding-top: clamp(10px, 1.8vh, 16px); margin-top: clamp(6px, 1.4vh, 16px); }
.ask-head { margin: 0 !important; font: 15px var(--book-sc); letter-spacing: .12em; color: var(--rubric); }
.ask form { display: flex; gap: 14px; align-items: end; margin: 0; }
.ask input { flex: 1; min-width: 0; font: italic 19px var(--book); color: var(--ink); background: transparent; border: 0; border-bottom: 1px dotted var(--quiet); border-radius: 0; padding: 6px 2px; }
.ask input::placeholder { color: var(--quiet); opacity: .85; }
.ask input:focus { outline: none; border-bottom: 1px solid var(--rubric); }
.ask button { font: italic 18px var(--book); color: var(--on-rubric); background: var(--rubric); border: 0; border-radius: 2px; padding: 7px 20px; cursor: pointer; }
.ask button:hover { filter: brightness(1.08); }
.write { margin: 2px 0 0 !important; font-size: .88em; color: var(--quiet); text-align: left !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Personal AI: nested spheres, as in a medieval diagram of the heavens. */
.spheres { display: block; width: 100%; max-height: 47vh; margin: 0 auto; overflow: visible; }
.sph { fill: none; stroke-opacity: .2; }
.sph-model { stroke: var(--azure); } .sph-harness { stroke: var(--verdigris); } .sph-agent { stroke: var(--vermilion); }
.sph-rule { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.sun { fill: color-mix(in srgb, var(--leaf) 30%, var(--vellum)); stroke: var(--gold); stroke-width: 1.6; }
.sun-core { fill: color-mix(in srgb, var(--leaf) 55%, var(--vellum)); stroke: var(--gold); stroke-width: 1.2; }
.ray { stroke: var(--gold); stroke-width: 1.1; opacity: .8; }
.star { fill: var(--leaf); }
.sph-name { font: 13.5px var(--book-sc); letter-spacing: .12em; text-anchor: middle; fill: var(--ink); }
.sph-name .sph-sub { font-family: var(--book); font-style: italic; letter-spacing: 0; text-transform: none; fill: var(--quiet); }
.sph-ex { font: italic 12.5px var(--book); text-anchor: middle; fill: var(--quiet); }
.core-t { font: italic 15px var(--book); text-anchor: middle; fill: var(--ink); }

/* The wheel: four stations in four pigments around thy folios. */
.wheel { display: block; width: 100%; max-height: 62vh; margin: auto; overflow: visible; }
.body:has(> .wheel) { align-content: center; }
.w-ring { fill: none; stroke: var(--gold); stroke-width: 1.6; }
.w-ring.thin { stroke: var(--edge-2); stroke-width: 1; stroke-dasharray: 2 5; }
.w-arrow { fill: none; stroke: var(--rubric); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.w-node { stroke: var(--ink); stroke-width: 1.2; }
.n1 { fill: color-mix(in srgb, var(--azure) 30%, var(--vellum)); } .n2 { fill: color-mix(in srgb, var(--verdigris) 30%, var(--vellum)); }
.n3 { fill: color-mix(in srgb, var(--vermilion) 26%, var(--vellum)); } .n4 { fill: color-mix(in srgb, var(--leaf) 34%, var(--vellum)); }
.w-hub { fill: color-mix(in srgb, var(--leaf) 30%, var(--vellum)); stroke: var(--gold); stroke-width: 1.6; }
.wheel text { font-family: var(--book); fill: var(--ink); text-anchor: middle; }
.w-num { font-size: 13px; fill: var(--ink); }
.w-t { font-size: 16px; font-style: italic; }
.w-hub-t { font-size: 15px; font-style: italic; fill: var(--quiet) !important; }

/* Thy commandments, as a contents page: each opens its own spread. */
.cm { list-style: none; margin: 0; padding: 0; display: grid; }
.cm li + li { border-top: 1px solid var(--edge); }
.cm a { display: grid; grid-template-columns: 52px minmax(0, 1fr) clamp(44px, 6.4vh, 60px); gap: 4px 16px; padding: clamp(8px, 1.5vh, 14px) 8px; margin: 0 -8px; align-items: center; color: inherit; text-decoration: none; border-radius: 3px; transition: background .2s; }
.cm a:hover, .cm a:focus-visible { background: color-mix(in srgb, var(--gold) 12%, transparent); outline: none; }
.cm a:hover .cm-h, .cm a:focus-visible .cm-h { color: var(--rubric); }
.cm-text { display: grid; }
.versal { font: clamp(34px, 5vh, 46px)/.9 var(--book); color: var(--rubric); text-align: center; }
.cm-h { font: 400 clamp(19px, 2.7vh, 24px)/1.15 var(--book); margin: 0 0 3px; }
.cm-h::after { content: " ›"; color: var(--rubric); opacity: 0; transition: opacity .2s; }
.cm a:hover .cm-h::after, .cm a:focus-visible .cm-h::after { opacity: 1; }
.cm-p { font-size: .9em; color: var(--quiet); }
.vig { width: 100%; height: auto; overflow: visible; }
.vig path, .vig circle, .vig rect { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.vig .vw1 { fill: color-mix(in srgb, var(--vermilion) 22%, transparent); stroke: none; }
.vig .vw2 { fill: color-mix(in srgb, var(--azure) 22%, transparent); stroke: none; }
.vig .vw3 { fill: color-mix(in srgb, var(--leaf) 30%, transparent); stroke: none; }
.vig .vw4 { fill: color-mix(in srgb, var(--verdigris) 24%, transparent); stroke: none; }
.big-vig { width: clamp(90px, 18vh, 170px); margin: clamp(8px, 3vh, 30px) auto 0; }

/* Worked examples on the right page, set like a specimen page. */
.specimen { margin-top: 4px; padding: 14px 18px 8px; border: 1px solid var(--edge-2); outline: 1px solid var(--gold); outline-offset: -5px; border-radius: 2px; background: color-mix(in srgb, var(--gold) 5%, transparent); }
.query { margin: 0 0 6px !important; font: 15px var(--book-sc) !important; letter-spacing: .1em; color: var(--rubric); text-align: left !important; }
.hits, .entries, .keeps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.hits li, .entries li, .keeps li { display: grid; gap: 1px; }
.hits strong { font-weight: 400; font-family: var(--book); font-size: 1.08em; }
.hits small, .entries small, blockquote small { display: block; font: italic 13px var(--book); color: var(--quiet); }
.hits q { font-style: italic; color: var(--ink); }
.hits q::before { content: "“"; } .hits q::after { content: "”"; }
.entries { counter-reset: e; }
.entries li { counter-increment: e; padding-left: 26px; position: relative; }
.entries li::before { content: counter(e, upper-roman) "."; position: absolute; left: 0; color: var(--rubric); font-family: var(--book); }
blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 1px solid var(--gold); font: italic 1.02em/1.45 var(--book); }
.ask-a { border-left-color: var(--rubric); }
.keeps li { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.keeps em { font: italic 14px var(--book); color: var(--rubric); white-space: nowrap; }

.colophon { font: italic 1.15em/1.5 var(--book); text-align: center !important; max-width: 36ch; margin: 18vh auto 1em !important; }
.colophon.small { font-size: .9em; color: var(--quiet); margin-top: 0 !important; }
.drollery { display: block; width: clamp(110px, 16vh, 160px); margin: 10px auto 0; overflow: visible; }
.drollery path, .drollery circle { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; }
.drollery .dr-rubric { stroke: var(--rubric); }
.drollery .dr-shell { fill: color-mix(in srgb, var(--leaf) 30%, transparent); stroke: none; }

/* Short screens and phones: the book grows with its text and scrolls. */
@media (max-height: 640px), (max-width: 900px) {
  body { display: block; }
  .book { height: auto; max-height: none; margin: 0 auto; }
  .leaf { overflow: visible; }
}
@media (max-width: 900px) {
  body { padding: 12px 10px; font-size: 17px; }
  .spread { grid-template-columns: minmax(0, 1fr); }
  .book::before { display: none; }
  .leaf, .recto { padding: 22px 20px 16px; border-radius: 4px; }
  .recto { border-top: 1px dashed var(--edge-2); }
  .spread:target .verso { animation: settle .4s ease-out both; }
  h1 { font-size: 40px; }
  .spheres, .wheel { max-height: none; }
  .colophon { margin-top: 2em !important; }
}
@media (max-width: 600px) { .body p { text-align: left; hyphens: manual; -webkit-hyphens: manual; } }
@media (max-width: 480px) {
  .cm a { grid-template-columns: 40px minmax(0, 1fr); }
  .cm .vig { display: none; }
  .ask form { flex-direction: column; align-items: stretch; }
}

/* Additions: sphere hatching, beads, the opening page's foot. */
.sph { stroke-opacity: 1; }
.hw-model { fill: color-mix(in srgb, var(--azure) 20%, var(--vellum)); } .hl-model { stroke: color-mix(in srgb, var(--azure) 38%, transparent); stroke-width: 1; }
.hw-harness { fill: color-mix(in srgb, var(--verdigris) 20%, var(--vellum)); } .hl-harness { stroke: color-mix(in srgb, var(--verdigris) 38%, transparent); stroke-width: 1; }
.hw-agent { fill: color-mix(in srgb, var(--vermilion) 18%, var(--vellum)); } .hl-agent { stroke: color-mix(in srgb, var(--vermilion) 34%, transparent); stroke-width: 1; }
.bead { fill: var(--gold); }
.sph-name, .sph-ex { paint-order: stroke; stroke: var(--vellum); stroke-width: 3.5px; stroke-linejoin: round; }
.turn { font: italic 1.05em var(--book); color: var(--rubric); text-align: left !important; }
.turn::before { content: "¶ "; }
.narrow { display: none; }
@media (max-width: 900px) { .wide { display: none; } .narrow { display: inline; } }
#start .verso .body { display: flex; flex-direction: column; }
#start .verso .ask { margin-top: auto; }
.wheel text[text-anchor="start"] { text-anchor: start; }
.wheel text[text-anchor="end"] { text-anchor: end; }
.wheel .w-t { font-size: 17px; }
.wheel .w-num { font-size: 14px; }

/* Interaction (home.js). */
.leaf { position: relative; }
/* A folded corner that lifts on hover: click it to turn. */
.corner { position: absolute; z-index: 3; bottom: 0; width: 34px; height: 34px; transition: width .25s, height .25s, filter .25s; }
.corner.next { right: 0; background: linear-gradient(315deg, var(--desk) 49%, var(--edge-2) 50%, var(--vellum) 72%); border-top-left-radius: 2px; box-shadow: -2px -2px 4px -2px var(--shadow); }
.corner.prev { left: 0; background: linear-gradient(45deg, var(--desk) 49%, var(--edge-2) 50%, var(--vellum) 72%); border-top-right-radius: 2px; box-shadow: 2px -2px 4px -2px var(--shadow); }
.corner:hover { width: 58px; height: 58px; }
.spread:not(:last-child) .recto .foot a:last-child, .verso .foot a { position: relative; z-index: 4; }
/* Spheres: the one pointed at stays bright, the others fade. */
.sph, .sun { cursor: pointer; transition: opacity .3s; }
.spheres[data-focus="model"] [data-layer]:not([data-layer="model"]),
.spheres[data-focus="harness"] [data-layer]:not([data-layer="harness"]),
.spheres[data-focus="agent"] [data-layer]:not([data-layer="agent"]),
.spheres[data-focus="core"] [data-layer]:not([data-layer="core"]) { opacity: .35; }
.sph:focus-visible, .sun:focus-visible, .w-node:focus-visible { outline: none; stroke-dasharray: 4 3; }
.sph-ex { transition: opacity .35s; }
.sph-ex.swap { opacity: 0; }
.caption strong { font-weight: 400; font-family: var(--book-sc); letter-spacing: .06em; color: var(--rubric); font-style: normal; }
.sun { animation: breathe 5s ease-in-out infinite; transform-origin: 210px 210px; }
@keyframes breathe { 50% { filter: brightness(1.06); } }
/* The wheel. */
.w-node { cursor: pointer; transition: transform .3s, stroke-width .3s; transform-box: fill-box; transform-origin: center; }
.w-node.lit { transform: scale(1.35); stroke: var(--rubric); stroke-width: 1.8; }
.w-bead { fill: var(--leaf); stroke: var(--gold); stroke-width: 1; filter: drop-shadow(0 0 4px var(--leaf)); }
.w-hub { transition: r .8s ease-out; }
.w-count { font: italic 12px var(--book); fill: var(--rubric) !important; text-anchor: middle; }
[data-wheel-caption] { min-height: 3em; }
/* Examples play when their spread opens. */
.typed.typing::after { content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 2px; vertical-align: -.12em; background: var(--rubric); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.play .specimen :is(li, blockquote, .query + .hits, .ask-a) { animation: ink-in .6s ease-out both; }
.play .specimen li:nth-child(1), .play .specimen blockquote:nth-of-type(1) { animation-delay: .9s; }
.play .specimen li:nth-child(2), .play .specimen blockquote:nth-of-type(2) { animation-delay: 1.4s; }
.play .specimen li:nth-child(3), .play .specimen blockquote:nth-of-type(3) { animation-delay: 1.9s; }
.play .specimen .ask-a { animation-delay: 2.6s; }
@keyframes ink-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .play .specimen * { animation: none !important; } .sun { animation: none; } }
/* The day's Keep and Skip. */
.ks button { font: inherit; color: var(--rubric); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.keeps li { transition: opacity .4s, max-height .5s; max-height: 6em; overflow: hidden; }
.keeps li.gone { opacity: 0; max-height: 0; }
.kept-into { border-top: 1px solid var(--gold); padding-top: 10px; margin-top: 4px; }
.kept-into li { animation: ink-in .6s ease-out both; }

/* Stories: one per page, an illuminated picture, before and after. */
.story { display: grid; align-content: start; gap: 4px; }
.story-art { width: clamp(70px, 13vh, 120px); margin: 0 auto clamp(4px, 1.5vh, 14px); padding: 10px; border: 1px solid var(--gold); outline: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); outline-offset: 3px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--leaf) 18%, var(--vellum)) 0%, var(--vellum) 75%); }
.story-vig path, .story-vig circle, .story-vig rect { stroke-width: 1.8; }
.story-vig .vw1 { fill: color-mix(in srgb, var(--vermilion) 40%, transparent); } .story-vig .vw2 { fill: color-mix(in srgb, var(--azure) 40%, transparent); }
.story-vig .vw3 { fill: color-mix(in srgb, var(--leaf) 55%, transparent); } .story-vig .vw4 { fill: color-mix(in srgb, var(--verdigris) 45%, transparent); }
.story-kicker { margin: 0 !important; text-align: center !important; font: 14px var(--book-sc); letter-spacing: .14em; color: var(--rubric); }
.story-title { font: 400 clamp(24px, 3.6vh, 34px)/1.1 var(--book); text-align: center; margin: 0 0 clamp(6px, 1.4vh, 12px); text-wrap: balance; }
.story-setting { font: italic 1.05em/1.45 var(--book); text-align: center !important; color: var(--quiet); }
.bw { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 4px 0 10px; }
.bw dt { font: 14px var(--book-sc); letter-spacing: .1em; color: var(--quiet); padding-top: 2px; }
.bw dt:nth-of-type(2) { color: var(--rubric); }
.bw dd { margin: 0; }
.impact { border-top: 1px solid var(--gold); padding-top: 8px; font: italic 1.08em/1.4 var(--book); text-align: left !important; }
.impact span { font: normal .8em var(--book-sc); letter-spacing: .12em; color: var(--rubric); margin-right: 6px; }
.cm-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) clamp(44px, 6.4vh, 60px); gap: 4px 16px; padding: clamp(8px, 1.5vh, 14px) 0; align-items: center; }
@media (max-width: 480px) { .cm-row { grid-template-columns: 40px minmax(0, 1fr); } .cm-row .vig { display: none; } }

/* Story pictures: illuminated diagrams of how it works. */
.pic { display: block; width: 100%; max-width: 380px; max-height: 15.5vh; margin: 2px auto clamp(6px, 1.4vh, 12px); overflow: visible; }
.pic .ink, .pic .ink * { stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.pic .ink path:not([fill]), .pic .ink line { fill: none; }
.pic .gilt { stroke: var(--gold) !important; stroke-width: 2.4 !important; }
.pic .gilt-fill { fill: var(--leaf); stroke: var(--gold) !important; }
.pic .page { fill: var(--vellum); }
.pic .arrow, .pic .ribbon { fill: none; stroke: var(--rubric); stroke-width: 2; stroke-linecap: round; }
.pic .ribbon { stroke-width: 3; opacity: .75; }
.pic .tick { stroke: var(--rubric) !important; stroke-width: 2.2 !important; fill: none; }
.pic .hand { stroke: var(--rubric) !important; fill: none; }
.pic .star-i { fill: var(--leaf); stroke: none !important; }
.pic .dots { fill: none; stroke: var(--quiet); stroke-width: 1.4; stroke-dasharray: 2 4; }
.pic-t { font: italic 12px var(--book); fill: var(--quiet); text-anchor: middle; }
.story-title { margin-bottom: 4px; }
.story-setting { margin-bottom: .5em !important; }
.pain { margin: 2px auto 6px; padding: 0; border: 0; max-width: 40ch; text-align: center; font: italic 1.02em/1.4 var(--book); color: var(--quiet); }
.pain::after { content: "from the maker's notes"; display: block; margin-top: 2px; font: normal 11px var(--book-sc); letter-spacing: .12em; color: var(--gold); }

/* The road: three stations on an illuminated path. */
.road { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: clamp(10px, 2.4vh, 22px); position: relative; }
.road::before { content: ""; position: absolute; left: 25px; top: 20px; bottom: 20px; border-left: 2px dotted var(--gold); }
.road li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; align-items: start; position: relative; }
.medal { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font: 22px var(--book); color: var(--ink); border: 1.5px solid var(--gold); outline: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); outline-offset: 3px; }
.st-1 .medal { background: repeating-linear-gradient(40deg, color-mix(in srgb, var(--azure) 22%, var(--vellum)) 0 3px, color-mix(in srgb, var(--azure) 38%, var(--vellum)) 3px 4px); }
.st-2 .medal { background: repeating-linear-gradient(-40deg, color-mix(in srgb, var(--verdigris) 22%, var(--vellum)) 0 3px, color-mix(in srgb, var(--verdigris) 38%, var(--vellum)) 3px 4px); }
.st-3 .medal { background: radial-gradient(circle, color-mix(in srgb, var(--leaf) 55%, var(--vellum)), color-mix(in srgb, var(--leaf) 25%, var(--vellum))); }
.road-when { margin: 0 !important; font: 13px var(--book-sc); letter-spacing: .12em; color: var(--rubric); text-align: left !important; }
.road h3 { font: 400 clamp(20px, 2.9vh, 26px)/1.15 var(--book); margin: 0 0 4px; }
.road p { text-align: left !important; margin: 0 !important; }
.road p:not(.road-when) { color: var(--quiet); }


/* Reading options, under the book on the desk. */
.bar { display: flex; justify-content: center; gap: 18px; margin: 14px auto 0; font: italic 15px var(--book); }
.bar a, .bar button { font: inherit; color: var(--quiet); background: none; border: 0; padding: 4px 2px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.bar a:hover, .bar button:hover { color: var(--rubric); }
body:not(.plain-doc) { grid-template-rows: auto auto; align-content: center; }

/* The plain page (/home/plain.html): an ordinary accessible document. */
.plain-doc { display: block; padding: 0 20px 40px; font: 19px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--vellum); --quiet: var(--ink); }
.plain-doc main, .plain-doc .bar, .plain-doc .p-foot { max-width: 680px; margin: 0 auto; }
.plain-doc .bar { justify-content: flex-start; padding: 14px 0; border-bottom: 1px solid var(--edge-2); margin-bottom: 24px; font: 16px/1.4 inherit; font-family: inherit; font-style: normal; }
.plain-doc .bar a, .plain-doc .bar button { color: var(--rubric); font-size: 16px; }
.plain-doc h1 { font: 700 clamp(32px, 6vw, 44px)/1.15 inherit; font-family: inherit; margin: 4px 0 20px; }
.plain-doc h2 { font: 700 28px/1.25 inherit; font-family: inherit; margin: 56px 0 14px; padding-top: 20px; border-top: 2px solid var(--gold); }
.plain-doc h3 { font: 700 22px/1.3 inherit; font-family: inherit; margin: 36px 0 10px; }
.plain-doc p { margin: 0 0 1em; }
.plain-doc .p-brand { font-size: 15px; color: var(--rubric); margin: 0; }
.plain-doc .p-kicker { color: var(--rubric); }
.plain-doc .p-pain { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 3px solid var(--rubric); font-style: italic; }
.plain-doc .p-pain p { margin: 0; }
.plain-doc .p-pain footer { font-size: 15px; font-style: normal; margin-top: 4px; }
.plain-doc figure { margin: 18px 0 22px; }
.plain-doc figure svg { display: block; width: 100%; max-width: 440px; height: auto; max-height: none; margin: 0; }
.plain-doc figcaption { font-size: 17px; margin-top: 8px; }
.plain-doc .p-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.plain-doc .p-dl dt { font-weight: 700; }
.plain-doc .p-dl dd { margin: 0; }
.plain-doc .road::before { display: none; }
.plain-doc .road { gap: 18px; }
.plain-doc .road h3 { font: 700 20px/1.3 inherit; font-family: inherit; margin: 0 0 4px; }
.plain-doc .road-when { font: 700 15px/1.3 inherit; font-family: inherit; letter-spacing: 0; text-transform: none; }
.plain-doc .medal { width: 40px; height: 40px; font-size: 17px; }
.plain-doc .road li { grid-template-columns: 40px 1fr; }
.plain-doc .p-form { display: grid; gap: 8px; margin: 0 0 18px; background: none; border: 0; padding: 0; }
.plain-doc .p-form label { font-weight: 700; font-size: 17px; }
.plain-doc .p-row { display: flex; gap: 10px; flex-wrap: wrap; }
.plain-doc .p-row input { flex: 1 1 240px; font: inherit; padding: 10px 12px; border: 2px solid var(--quiet); border-radius: 4px; background: var(--field, #fff); color: var(--ink); }
.plain-doc .p-row button { font: inherit; font-weight: 700; padding: 10px 18px; border: 0; border-radius: 4px; background: var(--rubric); color: var(--on-rubric); cursor: pointer; }
.plain-doc a:focus-visible, .plain-doc button:focus-visible, .plain-doc input:focus-visible { outline: 3px solid var(--rubric); outline-offset: 2px; }
.plain-doc .p-skip { position: absolute; left: -9999px; } .plain-doc .p-skip:focus { left: 12px; top: 12px; background: var(--vellum); padding: 6px 10px; }
.plain-doc .p-foot { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--edge-2); font-size: 16px; }
.plain-doc .pic-t, .plain-doc .sph-name, .plain-doc .sph-ex, .plain-doc .w-t { font-family: Georgia, serif; }
.plain-doc blockquote, .plain-doc .p-pain { font-family: inherit; font-size: 1em; }
@media (max-width: 600px) { .plain-doc .p-dl { grid-template-columns: 1fr; gap: 2px; } .plain-doc .p-dl dd { margin-bottom: 10px; } }

/* Three words: conversations, context, folios. */
.words { margin: 0; display: grid; gap: clamp(10px, 2.2vh, 20px); }
.words div { display: grid; gap: 2px; }
.words dt { display: flex; align-items: center; gap: 12px; font: 400 clamp(20px, 2.9vh, 26px)/1.1 var(--book); color: var(--ink); }
.words dt span::first-letter { color: var(--rubric); }
.words dd { margin: 0 0 0 60px; color: var(--quiet); }
.w-ic { width: 48px; height: 40px; flex: none; overflow: visible; }
.w-ic .ink, .w-ic .ink * { stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.w-ic .ink path:not([fill]) { fill: none; }
.w-ic .page { fill: var(--vellum); } .w-ic .gilt { stroke: var(--gold) !important; stroke-width: 2.2 !important; } .w-ic .hand { stroke: var(--rubric) !important; }
/* One sentence, followed: three cards with red steps between them. */
.trace { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; justify-items: center; }
.trace > li:not(.tr-step):not(.tr-agents) { width: 100%; max-width: 420px; padding: 10px 16px 8px; border: 1px solid var(--edge-2); outline: 1px solid var(--gold); outline-offset: -5px; border-radius: 2px; }
.tr-conv { background: color-mix(in srgb, var(--azure) 9%, var(--vellum)); }
.tr-ctx { background: var(--vellum); }
.tr-fol { background: color-mix(in srgb, var(--vermilion) 9%, var(--vellum)); }
.tr-step { font: italic 15px var(--book); color: var(--rubric); padding: 6px 0 6px 18px; position: relative; }
.tr-step::before { content: "↓"; position: absolute; left: 0; font-style: normal; }
.tr-agents { font: 15px var(--book-sc); letter-spacing: .1em; color: var(--ink); padding-top: 2px; }
.trace p { margin: 0 !important; text-align: left !important; }
.tr-kind { font: 13px var(--book-sc) !important; letter-spacing: .12em; color: var(--rubric); }
.tr-meta { font: italic 13px var(--book) !important; color: var(--quiet); }
.tr-line { font: 1.1em/1.35 var(--book) !important; color: var(--ink); }
.tr-line .num { color: var(--rubric); }
.trace blockquote { margin: 2px 0 0; padding: 0; border: 0; font: italic 1em/1.4 var(--book); color: var(--ink); }
.plain-doc .words dt { font: 700 20px/1.3 inherit; font-family: inherit; }
.plain-doc .words dd { margin-left: 0; }
.plain-doc .words .w-ic { display: none; }
.plain-doc .trace { justify-items: start; }
.plain-doc .trace blockquote, .plain-doc .tr-line, .plain-doc .tr-meta, .plain-doc .tr-step, .plain-doc .tr-kind, .plain-doc .tr-agents { font-family: inherit !important; letter-spacing: 0; }
.plain-doc .words dt { font-family: inherit; font-size: 20px; font-weight: 700; line-height: 1.3; }
.plain-doc .words dt span::first-letter { color: inherit; }

/* Logo: an illuminated initial in a gold frame, with the name in small capitals. */
.brand { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.logo { width: 42px; height: 42px; overflow: visible; filter: drop-shadow(0 1px 1px var(--shadow)); }
.lg-wash { fill: color-mix(in srgb, var(--azure) 22%, var(--vellum)); } .lg-line { stroke: color-mix(in srgb, var(--azure) 45%, transparent); stroke-width: .8; }
.lg-frame { stroke: var(--gold); stroke-width: 2.4; } .lg-inner { fill: none; stroke: var(--gold); stroke-width: .8; }
.lg-vine path, .lg-vine circle { fill: none; stroke: var(--verdigris); stroke-width: 1.2; stroke-linecap: round; } .lg-vine circle { fill: var(--vermilion); stroke: none; }
.lg-t { font: 30px var(--book); fill: var(--rubric); text-anchor: middle; paint-order: stroke; stroke: var(--vellum); stroke-width: 2px; }
.brand-word { font: 23px var(--book-sc); letter-spacing: .14em; color: var(--ink); }
.runhead:has(.brand) { align-items: center; }
.plain-doc .brand-word { font-family: inherit; font-size: 15px; letter-spacing: 0; color: var(--rubric); }
.plain-doc .logo { width: 24px; height: 24px; }

/* Bookiness: vellum vignette, a double gold frame, a fleuron under each head, a ribbon. */
.leaf { background: radial-gradient(ellipse 120% 100% at 50% 45%, var(--vellum) 60%, color-mix(in srgb, var(--edge-2) 55%, var(--vellum)) 100%); }
.leaf::after { content: ""; position: absolute; inset: 12px 18px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); outline: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); outline-offset: 3px; pointer-events: none; }
.runhead { position: relative; }
.runhead::after { content: "❦"; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 0 6px; font-size: 12px; line-height: 1; color: var(--gold); background: var(--vellum); }
.book::after { content: ""; position: absolute; z-index: 4; top: -6px; right: 14%; width: 14px; height: 84px; background: linear-gradient(90deg, #8f2414, #b8361f 45%, #8f2414); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%); box-shadow: 0 2px 4px var(--shadow); pointer-events: none; }
.sph-name { font-size: 15px !important; }
.sph-ex { font-size: 14px !important; }
/* More drolleries. */
.drollery .dr-thin { stroke-width: 1.1; }
.drollery .dr-head { fill: color-mix(in srgb, var(--azure) 25%, var(--vellum)); }
.drollery .dr-flame { fill: color-mix(in srgb, var(--leaf) 70%, var(--vermilion)); stroke: var(--rubric); }
.drol-bird { width: clamp(90px, 13vh, 130px); margin: auto 0 0 auto; }
.drol-candle { width: clamp(36px, 6vh, 56px); margin: auto auto 0 0; }
@media (max-width: 900px) { .book::after { display: none; } .leaf::after { inset: 8px; } }
.plain-doc .leaf::after, .plain-doc .runhead::after { display: none; }
.runhead:has(.brand) { padding-bottom: 6px; }
/* The illuminated T is the name's first letter: [T]red. */
.brand { gap: 1px; }
.brand-word { font-size: 25px; letter-spacing: .06em; transform: translateY(5px); }
.plain-doc .brand-word { transform: translateY(3px); font-size: 17px; }
.brand-word { font: 30px/1 var(--book); letter-spacing: .01em; color: var(--ink); transform: translateY(6px); }
.plain-doc .brand-word { font: 700 18px/1 inherit; font-family: inherit; transform: translateY(4px); }
/* Wordmark: one drawn "Tred", a red initial T with a gold edge and a gold swash. */
.wordmark { width: 112px; height: 50px; overflow: visible; }
.wm-T { font: 46px var(--book); fill: var(--rubric); stroke: var(--gold); stroke-width: .9px; paint-order: stroke; }
.wm-red { font: 32px var(--book); fill: var(--ink); letter-spacing: .5px; }
.wm-swash { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; }
.wm-berry { fill: var(--vermilion); }
.wm-leaf { fill: color-mix(in srgb, var(--verdigris) 60%, transparent); stroke: var(--verdigris); stroke-width: .8; }
.wm-diamond { fill: var(--gold); }
.runhead .brand { margin: -6px 0 -4px; }
.plain-doc .wordmark { width: 78px; height: 28px; vertical-align: middle; }
.plain-doc .wm-T, .plain-doc .wm-red { font-family: Georgia, serif; }

/* Scribes: a nun copying (the chore), a monk and a nun at work (the colophon). */
.scribes { display: block; overflow: visible; }
.scribes .ink, .scribes .ink * { stroke: var(--ink); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.scribes .skin { fill: color-mix(in srgb, var(--leaf) 18%, var(--vellum)); }
.scribes .wimple { fill: var(--vellum); }
.scribes .tonsure { fill: none; }
.scribes .arm, .scribes .stool { fill: none; }
.scribes .quill { fill: none; stroke: var(--rubric) !important; stroke-width: 1.6 !important; }
.scribes .feather { fill: color-mix(in srgb, var(--leaf) 40%, var(--vellum)); }
.scribes .desk { fill: color-mix(in srgb, var(--leaf) 35%, var(--vellum)); }
.scribes .page { fill: var(--vellum); }
.scribes .pic-t { stroke: none !important; }
.scribe-one { width: clamp(150px, 26vh, 240px); margin: auto auto 0; }
.scribe-pair { width: clamp(170px, 28vh, 260px); margin: 14px auto 0; }
.plain-doc .scribes { max-width: 320px; }
.scribes .hand, .scribes .nose, .scribes .lines, .scribes .veil-top { fill: none; }
.scribes .lines { stroke-width: .8 !important; }
/* The way in for testers, under each waitlist form. */
.testers { margin: 12px 0 0; }
.testers a { display: inline-block; font: 16px var(--book-sc); letter-spacing: .06em; color: var(--rubric); text-decoration: none; border: 1.5px solid var(--rubric); border-radius: 4px; padding: 6px 14px; }
.testers a:hover, .testers a:focus-visible { background: var(--rubric); color: var(--vellum); }
/* Phones: the whole book as one scroll, no page turning. */
@media (max-width: 900px) {
  .book { display: block; }
  .spread, .spread:target { display: grid; scroll-margin-top: 12px; }
  .spread + .spread { margin-top: 14px; }
  .spread:target .verso, .spread:target .recto { animation: none; }
  .corner, .foot { display: none; }
}
/* The logo: the illuminated T alone (same mark as the app and tester pages). */
.tred-wordmark { height: 50px; aspect-ratio: 30 / 48; overflow: visible; vertical-align: middle; }
.plain-doc .tred-wordmark { height: 34px; }
.tagline { font: italic 1.15em/1.35 var(--book); color: var(--ink); margin: -.3em 0 .7em; text-align: left !important; }
.plain-doc .tagline { font-family: inherit; font-size: 1.2em; }
.hook { font-weight: 400; font-style: italic; font-size: 1.12em; color: var(--rubric); }
.plain-doc .hook { font-family: inherit; font-weight: 700; }
/* Page one: Jean Miélot at his desk (Jean Le Tavernier, c. 1450, public domain). */
.monk { margin: .4em 0 .8em; text-align: center; }
.monk img { display: block; margin: 0 auto; max-width: 100%; height: auto; max-height: 21vh; width: auto; border: 1px solid var(--gold); padding: 3px; background: var(--vellum); }
.monk figcaption { font: italic 1.05em var(--book); color: var(--rubric); margin-top: .3em; }
.plain-doc .monk img { max-height: 320px; }
.plain-doc .monk figcaption { font-family: inherit; }
.book .monk { float: right; width: 42%; margin: .2em 0 .4em 1.1em; }
.book .monk img { max-height: none; width: 100%; }
.book .monk figcaption { font-size: .95em; line-height: 1.25; }
#start .verso .ask { clear: both; }
.book .monk-page { float: none; width: auto; margin: 1.2em 0 .6em; }
.book .monk-page img { width: 100%; max-height: 52vh; object-fit: contain; }
.book .monk-page figcaption { font-size: 1.5em; margin-top: .4em; }
#words .spheres { max-height: 30vh; display: block; margin: .2em auto 0; }
.sph-title { font: 400 1.2em var(--book); margin: .6em 0 0; text-align: center; color: var(--rubric); }
.sph-fig { float: right; width: 52%; margin: 0 0 .4em 1.1em; }
.sph-fig .caption { font-size: .85em; line-height: 1.3; margin: .2em 0 0; }
@media (max-width: 600px) { .sph-fig { float: none; width: auto; margin: 0 0 1em; } }
.runhead .tred-wordmark { height: 1.5em; margin: -.35em 0 -.25em; display: block; }
.payoff { font: italic 1.12em/1.4 var(--book); color: var(--rubric); text-align: left !important; }
.plain-doc .payoff { font-family: inherit; font-weight: 600; }
