/* chrisrapp.com. Two faces, both served from this site: IBM Plex Sans for the development side and everything
   around it, EB Garamond for the name and the fiction. Nothing is loaded from anywhere else. Type and rules on
   the page; no boxes, fills or rounded corners. */

@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 600; font-display: swap;
             src: url("/fonts/EBGaramond-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap;
             src: url("/fonts/EBGaramond-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap;
             src: url("/fonts/IBMPlexSans-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap;
             src: url("/fonts/IBMPlexSans-italic.woff2") format("woff2"); }

/* Three colours from Chris's own picture, Code to World (sampled 2026-11-12 by tools\sample_palette.py; the
   picture itself is not on the site): terracotta #bd6a4d, sage #708474, slate #334047. Terracotta draws the
   rules over the items and the underlines of links (3.8:1 on the cream, 4.6:1 on the dark: lines, never text).
   Slate sets the headings and link words (10:1). Sage tints the fiction, at a tenth of its strength. */
:root {
    --paper: #fbfaf7; --ink: #1c1c1e; --muted: #5d6067; --rule: #d8d4cc; --field: #8f8a80;
    --terracotta: #bd6a4d; --sage: #708474; --slate: #334047;
    --heading: var(--slate); --link: var(--slate);
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --serif: "EB Garamond", Garamond, Georgia, serif;
    --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
    --gutter: 56px;
}
/* With scripts off the page follows the device. With theme.js it sets data-theme, which wins either way.
   In the dark the slate is lifted to a pale slate (#dfe5e8, 14:1), level with the body text. */
@media (prefers-color-scheme: dark) {
    :root { --paper: #15171c; --ink: #e8e6e1; --muted: #a4a8b3; --rule: #353943; --field: #6b707c; --heading: #dfe5e8; --link: #dfe5e8; }
}
:root[data-theme="light"] { --paper: #fbfaf7; --ink: #1c1c1e; --muted: #5d6067; --rule: #d8d4cc; --field: #8f8a80; --heading: var(--slate); --link: var(--slate); }
:root[data-theme="dark"] { --paper: #15171c; --ink: #e8e6e1; --muted: #a4a8b3; --rule: #353943; --field: #6b707c; --heading: #dfe5e8; --link: #dfe5e8; }
/* The fiction's paper: the page's own colour with 18% of the sage in it, in either mode (#e2e5df on the light
   page; the muted notes on it are 5.1:1). A browser without color-mix keeps the plain page. */
:root { --fiction-paper: var(--paper); --fiction-paper: color-mix(in srgb, var(--sage) 18%, var(--paper)); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink);
       font-family: var(--sans); font-size: 17px; line-height: 1.6; }
button, input, textarea { font: inherit; }
a { color: var(--link); text-decoration-color: var(--terracotta); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
/* A link inside running text differs from it by a shade only, so its terracotta underline carries it. */
main p a, .site-footer a { text-decoration-thickness: 1.5px; }
main p a:hover, .site-footer a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; }

/* One frame per page: wide on the landing, which has a grid to fill; the width of the text everywhere else,
   so the masthead, the text and the footer share their edges. */
.masthead, main, .site-footer { width: 100%; max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto;
                                 padding-left: var(--gutter); padding-right: var(--gutter); }
.landing .masthead, .landing main, .landing .site-footer,
.door .masthead, .door main, .door .site-footer { max-width: calc(1120px + 2 * var(--gutter)); }
.door main > .lede { max-width: 34em; margin-bottom: 56px; }
.door main > .small { margin-top: 48px; }
.landing .row h2 a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.landing .row h2 a:hover { text-decoration-color: var(--terracotta); }
main { flex: 1 0 auto; padding-top: 40px; padding-bottom: 64px; }

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; }
.masthead .site { font-family: var(--serif); font-size: 24px; line-height: 1; color: var(--ink); text-decoration: none; }
.landing .masthead { justify-content: flex-end; }

/* The toggle from padevgroup.com and the articles site: a moon while dark, a sun while light. */
.theme-toggle { flex: none; width: 36px; height: 36px; padding: 0; border-radius: 50%; display: flex; align-items: center;
                justify-content: center; background: none; border: 1px solid var(--rule); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-icon-dark { display: none; color: #ddd; }
.theme-icon-light { display: inline; color: #f90; }
:root[data-theme="dark"] .theme-icon-dark { display: inline; }
:root[data-theme="dark"] .theme-icon-light { display: none; }

h1, h2, h3 { color: var(--heading); }
h1 { font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1.05; letter-spacing: -0.01em; margin: 0 0 12px; }
h2 { font-size: 21px; line-height: 1.3; font-weight: 600; margin: 44px 0 10px; }
p { margin: 0 0 16px; }
main > p, .contact { max-width: 660px; }
.lede, .bio { font-size: 20px; line-height: 1.55; color: var(--ink); }
.subtitle { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.3; color: var(--muted); margin: 0 0 28px; }
.small { font-size: 15px; color: var(--muted); }

/* Landing: the name first and largest, then the two doors. */
.landing h1 { font-size: clamp(52px, 7.4vw, 88px); line-height: 1; letter-spacing: -0.015em; margin: 24px 0 24px; }
.bio { max-width: 34em; margin-bottom: 72px; }
/* The welcome over the first two columns of the card grid, the photo of Chris over the third, on the same
   columns and gap as the rows below (Chris, 2026-11-12). One column on a phone, the photo under the words. */
.hello { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; margin-bottom: 72px; }
.hello .words { grid-column: 1 / span 2; }
.hello .bio { margin-bottom: 0; }
/* The photo's top edge sits on the cap line of the heading (the W's top is 0.19 of its size below the line box),
   not on the box, where it floated above the words. A hairline in the rule colour keeps its pale wall from
   melting into the cream, as the card pictures have; no shadow, no rounding, no tilt. The caption is balanced
   so Chris's punchline never ends on a word alone. */
.portrait { grid-column: 3; margin: calc(24px + 0.19 * clamp(52px, 7.4vw, 88px)) 0 0; }
.portrait img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.portrait figcaption { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--muted); text-wrap: balance; }
.row { margin: 0 0 64px; }
.row h2 { margin: 0 0 20px; font-size: 26px; line-height: 1.2; font-weight: 600; }
.row.fiction h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; }
/* Each item is four rows of one shared grid (title, words, note, the piece of the work), so across a row the
   titles, the words and the notes line up whatever their lengths, and a drawing or map hangs below. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 40px; row-gap: 36px; }
.card { border-top: 2px solid var(--terracotta); padding-top: 16px; }
@media (min-width: 901px) {
    .card { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
}
.card h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.25; font-weight: 600; }
.card h3 a { color: var(--heading); text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 2px; }
.card h3 a:hover { text-decoration-color: var(--terracotta); }
.card p { margin: 0 0 10px; }
.card .note { font-size: 14px; color: var(--muted); margin: 0; }
.card .note a { color: inherit; text-decoration: underline; text-decoration-color: var(--terracotta); text-underline-offset: 3px; }
.card .note a:hover { color: var(--link); }
/* The Building Rogue room, drawn in text as the series draws it: the hero in the doorway is the one mark of
   colour. Its type is sized to the item's width (20 characters; a monospace character is 0.55 to 0.6 of its
   size), so the walls run edge to edge in a column on a desk and on a phone, up to 30 px on a wide column.
   Worked from the window's width, not a size container: containing an item of the shared grid collapses it. */
.card .art { margin: 22px 0 0; font-family: var(--mono); font-size: min(30px, calc((100vw - 2 * var(--gutter)) / 12.2)); line-height: 1.08;
             color: var(--heading); white-space: pre; overflow: hidden; }
@media (min-width: 901px) {
    .card .art { font-size: calc((min(1120px, 100vw - 2 * var(--gutter)) - 80px) / 3 / 12.2); }
}
.card .art .you { color: var(--terracotta); font-weight: 700; }
.card .art .foe { font-weight: 700; }
/* Post 1's two rooms are twelve lines deep; at the item's full width they would stand taller than the rest of
   the row, so they are set small (Chris, 2026-11-12), at the size of the guide's code beside them: one size
   for both pieces of monospace. 15 px, or less on a phone narrow enough that the code's longest line (38
   characters) would not fit. */
.card .art.small, .card .code pre { font-size: min(15px, calc((100vw - 2 * var(--gutter)) / 23.5)); }
.card .art.small { line-height: 1.08; }
/* On a desk the three columns are always equal (2026-11-12, for the photo over the third: below about 1200 px
   the code's longest line used to widen the middle column, and the photo and the two rows stopped lining up).
   So the code and the small room shrink with the column instead, to the same 23.5 characters to the font size
   (14.75 px at full width, 10 to 12 px between 901 and 1100). */
@media (min-width: 901px) {
    .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card .art.small, .card .code pre { font-size: min(15px, calc((min(1120px, 100vw - 2 * var(--gutter)) - 80px) / 3 / 23.5)); }
}

/* The Articles item: one sentence from a published piece, named by its title. The development side's own
   face, upright: an italic serif here would read as the fiction, or as a testimonial box. The opening mark
   hangs in the gutter so the words keep the edge the title and the note share. */
.card .quote { margin: 22px 0 0; }
.card .quote blockquote { margin: 0; }
.card .quote p { margin: 0; font-size: 19px; line-height: 1.4; color: var(--heading); text-indent: -0.42em; }
.card .quote figcaption, .card .code figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.card .quote cite { font-style: normal; }
/* The guide item: five real lines from section 4.1, in the room's monospace, one colour. */
.card .code { margin: 22px 0 0; }
.card .code pre { margin: 0; font-family: var(--mono); line-height: 1.4; color: var(--heading); white-space: pre; overflow: hidden; }
.card .picture { display: block; width: 100%; height: auto; margin: 22px 0 0; border: 1px solid var(--rule); }
.fiction .card h3 { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.15; }
.fiction .card p:not(.note) { font-family: var(--serif); font-size: 19px; line-height: 1.45; }
/* Not out yet: the same rule at half the weight. */
.card.soon { border-top-width: 1px; padding-top: 17px; }
.row .also { margin: 32px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 16px; color: var(--muted); max-width: 40em; }
.row.fiction .also { font-family: var(--serif); font-size: 18px; }

/* The fiction is on the sage paper: a panel only slightly wider than the text column (Chris, 2026-11-12,
   12:49 AM: "the sage band should only be slightly wider than the actual text column"), on the landing's
   Fiction row and behind the main column of the fiction pages. --band is how far it reaches past the text. */
:root { --band: min(28px, var(--gutter)); }
.landing .row.fiction { background: var(--fiction-paper); margin-left: calc(-1 * var(--band)); margin-right: calc(-1 * var(--band));
                        padding: 44px var(--band) 52px; }
body.fiction main { background: linear-gradient(var(--fiction-paper), var(--fiction-paper));
                    background-origin: padding-box; background-clip: padding-box; background-repeat: no-repeat;
                    background-size: calc(100% - 2 * var(--gutter) + 2 * var(--band)) 100%; background-position: center top;
                    margin-top: 12px; margin-bottom: 32px; }

/* The fiction pages read in the book face. */
body.fiction main h2 { font-family: var(--serif); font-weight: 600; font-size: 28px; }
body.fiction main > p:not(.subtitle):not(.buy):not(.small) { font-family: var(--serif); font-size: 21px; line-height: 1.45; max-width: 31em; }
.buy { margin-top: 28px; font-weight: 600; }

.contact { margin: 28px 0 24px; }
.field { margin: 0 0 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea { width: 100%; color: var(--ink); background: transparent; border: 1px solid var(--field); border-radius: 0; padding: 10px 12px; }
.field textarea { resize: vertical; }
.contact button { font-weight: 600; padding: 11px 28px; background: var(--ink); color: var(--paper); border: 0; border-radius: 0; cursor: pointer; }
.contact button:hover { background: var(--link); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.site-footer { padding-bottom: 40px; font-size: 15px; }
.site-footer ul { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-footer a { color: var(--muted); }

@media (max-width: 900px) {
    .cards { grid-template-columns: 1fr; }
    .hello { grid-template-columns: 1fr; }
    .hello .words, .portrait { grid-column: 1; }
    .portrait { margin-top: 36px; max-width: 420px; }
}
@media (max-width: 600px) {
    :root { --gutter: 20px; }
    body { font-size: 16px; }
    h1 { font-size: 40px; }
    .landing h1 { margin-top: 8px; }
    .lede, .bio { font-size: 18px; }
    .bio { margin-bottom: 52px; }
    .hello { margin-bottom: 52px; }
    .portrait { margin-top: 28px; }
    .subtitle { font-size: 21px; }
    .row h2 { font-size: 23px; }
    .row.fiction h2 { font-size: 28px; }
    body.fiction main > p:not(.subtitle):not(.buy):not(.small) { font-size: 19px; }
    body.fiction main h2 { font-size: 25px; }
    .masthead { padding-top: 20px; }
    main { padding-top: 28px; }
}
