/* One stylesheet for every page: one grotesque, small type, labels in the left
   margin, hairlines instead of boxes.

   Set in Söhne (Buch for text, Kräftig for emphasis) and measured for it. Its
   x-height is 0.523 of its size and its capitals 0.718; its letters average
   half an em and its word space a fifth; its figures are proportional unless
   asked to be tabular. So:
   - text is 15px on a 24px line, and every vertical measure is a multiple of
     12px. The line is open (1.6) for a face this large on its body, which is
     what lets the type be small;
   - the measure is 32rem: about 72 characters of Söhne at 15px, where a line is
     still easy to find the start of. (It was 36rem: 83.)
   - no letterspacing at text size, where the face is spaced as drawn; titles
     are drawn in a little (-0.02em at 30px), quotations less;
   - figures are proportional in running text and tabular only in columns;
   - a quotation's opening mark hangs in the margin, so its first line starts
     on the same edge as the rest. */

@font-face {
    font-family: 'Söhne';
    src: url('/fonts/soehne-buch.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Söhne';
    src: url('/fonts/soehne-kraftig.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #e9efe1;      /* sage paper */
    --fg: #0c3a29;      /* green ink, used for everything */
    --muted: color-mix(in srgb, var(--fg) 58%, var(--bg));
    --rule: color-mix(in srgb, var(--fg) 16%, var(--bg));
    --font: 'Söhne', -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --font-big: var(--font);
    --medium: 500;      /* the weight used for emphasis */
    --size: 15px;
    --title: clamp(1.375rem, 0.9rem + 1.9vw, 1.875rem);   /* article titles: 22 to 30px */
    --bio: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem);     /* home statement: 17 to 20px */
    --bio-leading: 1.35;
    --label: 0rem;      /* width of the margin column; set on wide screens */
    --measure: 32rem;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Söhne is here in two upright weights and nothing else. Asked for a bold or an italic
       it has not got, a browser makes one up (smeared, or slanted by machine): better the
       face as it is. Nothing on the site asks for either now; this keeps it so. */
    font-synthesis: none;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: calc(var(--size) * var(--face-scale, 1));   /* (a typeface chosen in the picker may want to be a little larger or smaller) */
    line-height: 1.6; /* 24px: all vertical spacing below is a multiple of 0.75rem */
    font-kerning: normal;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Top-left, not centred */
.page {
    box-sizing: content-box;
    max-width: var(--measure);
    padding: 1.25rem 1.25rem 6rem calc(1.25rem + var(--label));
}

/* Text */

h1, h2, h3 {
    font-size: inherit; /* hierarchy comes from weight and colour, not size */
    font-weight: var(--medium);
    line-height: inherit;
    margin: 0;
}

h2 {
    font-weight: 400;
    color: var(--muted);
    margin: 3rem 0 0.75rem;
}

.section-desc {
    margin-top: -0.75rem;
}

p {
    margin: 0 0 0.75rem;
    text-wrap: pretty;
    overflow-wrap: break-word;      /* (a long address does not push the column wider on a phone) */
}

/* figures line up only where they stand in a column: the dates down the right
   of a list, the fields at the head of an email */
.entries .when,
.email-header {
    font-variant-numeric: tabular-nums;
}

a {
    color: inherit;
    text-decoration: none;
}

p a,
.desc a,
.link-list a,
cite a {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--fg) 40%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:hover {
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 3px;
}

::selection {
    background: var(--fg);
    color: var(--bg);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.date,
.published-note,
.section-desc,
.intro-blurb,
.callout,
figcaption,
cite {
    color: var(--muted);
}

.back-link {
    display: block;
    margin-bottom: 3rem;
    font-feature-settings: "case";  /* (the arrow sits at the height of the capital beside it) */
}

.date,
.published-note {
    margin: 0;
}

header {
    margin-bottom: 3rem;
}

/* Larger text: article titles, and a quieter step up for the home statement */
.page > h1,
header > .back-link ~ h1 {
    font-family: var(--font-big);
    font-size: var(--title);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 400;
    text-wrap: balance;
    margin-bottom: 0.75rem;
}

.home .intro p {
    font-family: var(--font-big);
    font-size: var(--bio);
    line-height: var(--bio-leading);
    letter-spacing: -0.01em;
    margin-bottom: 0.6em;
}

/* Home */

.intro {
    margin-top: 3rem;
}

.links {
    display: flex;
    gap: 1.25em;
    margin: 1.5rem 0 0;
}

.sketch {
    width: 96px;
    margin-top: 3rem;
}

.entries {
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--rule);
}

/* (the hairline over a row is taken out of the space under it, so a row is a whole
   number of 24px lines tall and every line of every list sits on one grid) */
.entries > li {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title when"
        "desc  desc";
    column-gap: 1.25em;
    padding: calc(var(--row-pad, 0.75rem) - 1px) 0 var(--row-pad, 0.75rem);
    border-top: 1px solid var(--rule);
}

/* (and the rule that closes the list out of the last row's) */
.entries > li:last-child {
    padding-bottom: calc(var(--row-pad, 0.75rem) - 1px);
}

.entries h3 {
    grid-area: title;
    font-weight: 400;
}

.entries .when {
    grid-area: when;
    color: var(--muted);
    white-space: nowrap;
}

.entries .desc {
    grid-area: desc;
    color: var(--muted);
    margin: 0;
    padding: 0;
    list-style: none;
}

.aside {
    display: block;
    margin-top: 4.5rem;
    color: var(--muted);
}

/* Articles */

.intro-blurb {
    margin-bottom: 3rem;
}

.speaker-label,
.question {
    font-weight: var(--medium);
    margin: 1.5rem 0 0;
}

h2 + .speaker-label,
h2 + .question {
    margin-top: 0;
}

.speaker-content,
.answer {
    margin-bottom: 0.75rem;
}

.oral-history-section,
.interview-section {
    margin-top: 3rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
}

.oral-history-section h2,
.interview-section h2 {
    margin-top: 0;
}

figure {
    margin: 3rem 0;
}

figcaption {
    margin-top: 0.75rem;
}

/* A quotation: 22px on a 30px line (it was on a 24px one, and its lines
   touched). Its opening mark, 0.366em wide in Söhne, hangs outside the measure. */
blockquote {
    margin: 2.25rem 0;
    padding: 0;
    font-size: 1.375rem;
    line-height: 1.875rem;
    letter-spacing: -0.012em;
    text-indent: -0.37em;
    text-wrap: pretty;
}

cite {
    display: block;
    margin-top: 0.75rem;
    font-size: calc(var(--size) * var(--face-scale, 1));
    line-height: 1.5rem;
    font-style: normal;
    letter-spacing: 0;
    text-indent: 0;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Mouse cursor */

.interactive-cursor {
    position: relative;
    height: 200px;
    margin: 0 0 2.5rem;
    overflow: hidden;
    cursor: none;
    background: color-mix(in srgb, var(--bg) 55%, #ffffff);
    color: var(--muted);
    border: 1px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
}

#custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: none;
}

.desktop-instructions {
    transition: opacity 0.3s ease;
}

.mobile-cursor-showcase {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* The three cursors lie one over another, and one of them is seen (.is-on). The one
   going out and the one coming in change together, over the same time and along the
   same curve, so between them there is always exactly one cursor's worth to see: no
   blink. The names change in turn instead, the old one first: two lines of words
   dissolving through each other cannot be read. */
.mobile-cursor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.7s ease;
}

.mobile-cursor.is-on {
    opacity: 1;
}

.mobile-cursor-showcase .cursor-label {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-cursor-showcase .cursor-label.is-on {
    opacity: 1;
    transition: opacity 0.35s ease 0.3s;
}

.cursor-label {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    transition: opacity 0.5s ease-in-out;
}

.desktop-cursor-label {
    opacity: 0;
}

@media (max-width: 768px), (hover: none) {
    .interactive-cursor {
        cursor: default;
    }

    #custom-cursor {
        display: none !important;
    }

    .mobile-cursor-showcase {
        display: flex;
    }

    .desktop-instructions,
    .desktop-cursor-label {
        display: none;
    }
}

.email-container {
    margin: 1.5rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.email-header {
    color: var(--muted);
    margin-bottom: 0.75rem;
}

/* Field names in one column so the values line up */
.email-header p {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    margin: 0;
}

.email-header strong {
    font-weight: 400;
}

.email-body p:last-child {
    margin-bottom: 0;
}

/* Research and stickies */

.callout {
    margin: 1.5rem 0 3rem;
}

.callout p {
    margin: 0;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 3rem 0 0;
}

.image-grid figure {
    margin: 0;
}

.link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.link-list li {
    margin-bottom: 0;
    color: var(--muted);
}

.link-list li a {
    color: var(--fg);
}

.link-list li.plain {
    color: var(--fg);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* Wide screens: section labels, the name and the back link move into a left margin column */
@media (min-width: 820px) {
    :root {
        --label: 13rem;
    }

    .page {
        padding-top: 2.5rem;
        padding-left: calc(2.5rem + var(--label));
    }

    h2,
    .back-link,
    .home h1 {
        float: left;
        clear: left;
        width: calc(var(--label) - 2rem);
        margin: 0 0 0 calc(-1 * var(--label));
    }

    .home .intro {
        margin-top: 0;
    }

    section {
        margin-top: 3rem;
    }

    /* Line the label up with the first hairline row beside it */
    .home section > h2 {
        padding-top: 0.75rem;
    }

    .section-desc {
        margin-top: 0;
    }

    /* The sketch sits under the name instead of trailing the links */
    .home header {
        position: relative;
    }

    .home .sketch {
        position: absolute;
        left: calc(-1 * var(--label));
        top: 3rem;
        margin: 0;
    }

    /* Small labels sit on the first baseline of the larger text beside them:
       an empty inline box at that text's size gives the label the same line box */
    .home h1::before,
    .back-link::before {
        content: "";
        font-family: var(--font-big);
    }

    .home h1::before {
        font-size: var(--bio);
        line-height: var(--bio-leading);
    }

    .back-link::before {
        font-size: var(--title);
        line-height: 1.2;
    }

    /* The sticky-notes title is body-sized, so its back link needs no taller line */
    .page:has(> .notes) .back-link::before {
        content: none;
    }
}

/* Anything larger than a phone (a tablet, a laptop, a desk): everything a step smaller,
   so more is in sight at once. Text is 14px on a 22px line where it is 15 on 24, and every
   measure given in rem comes down with it: the root is 14.667px, so that the half
   line all the spacing is counted in (0.75rem) is 11px exactly, as it is 12 on a phone.
   About a twelfth smaller in all: half way to how the page looks with a laptop's
   display set to give more space. A phone is as it was, upright or on its side (which
   is as wide as a small tablet, but not as tall: hence the height): there the size is
   for a small screen and a thumb. */
@media (min-width: 720px) and (min-height: 600px), (min-width: 1280px) and (hover: hover) and (pointer: fine) {
    html {
        font-size: 91.667%;
    }

    :root {
        --size: 14px;
    }

    body {
        line-height: calc(22 / 14);
    }
}

@media (max-width: 480px) {
    /* Phones: titles keep the full width; the date leads the description line */
    .entries > li {
        display: block;
    }

    .entries p.desc {
        display: inline;
    }

    .entries .when::after {
        content: "·";
        margin: 0 0.15em 0 0.4em;
    }

    .entries > li:has(ul.desc) .when,
    .notes .when {
        display: block;
        white-space: normal;
    }

    .entries > li:has(ul.desc) .when::after,
    .notes .when::after {
        content: none;
    }

    .notes p.desc {
        display: block;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- The layout: three columns, and the picture across the head of the home page ---------- */

/* Home statement size */

[data-bio="sm"]    { --bio: calc(var(--size) * var(--face-scale, 1)); --bio-leading: 1.6; }

[data-bio="sm"] .home .intro p {
    letter-spacing: 0;
    margin-bottom: 0.75rem;
}

/* ---------- Three columns, refined ----------
   One system across the site, in one ink:
   Home      phone 1 column; tablet bio above writing | projects; desktop bio | writing | projects
   Articles  phone 1 column; tablet labels | text; desktop labels | text | intro note
   Research  phone 1 column; tablet labels | links; desktop labels | links in two columns
   Stickies  phone 1 column; tablet 2 columns of notes; desktop 3 */

/* Grey paper. Secondary text is mixed darker than usual so it stays readable:
   measured 14.8:1 for body text and 6.6:1 for secondary text on the grey,
   11.5:1 and 7.4:1 on the darker grey (WCAG AA asks for 4.5:1) */
[data-palette="mono"] {
    --bg: #ebebe9;
    --fg: #141414;
    --muted: color-mix(in srgb, var(--fg) 72%, var(--bg));
    --rule: color-mix(in srgb, var(--fg) 22%, var(--bg));
}

/* One column (phones, and the outer screen of a folding one). The sketch stands
   beside the name, at the right, small; the statement begins under it. (Of seven
   places tried for it on a phone, this was the one kept. On a wide screen it
   stands after the links, larger.) The drawing has a blank margin down its right
   side, a tenth of its width: it is set out by that much, so that its line, not
   its edge, ends where the text and the rules end. */
@media (max-width: 719px) {
    [data-layout="columns3"] .home header {
        position: relative;
        --sketch: 56px;                     /* its width; it is 420 by 467 */
    }

    /* (The drawing is as it was made, a fine grey pencil line; at this size the line is
       under a point of the screen wide and too pale to see, so its grey is deepened.
       Nothing is redrawn: made heavier and black it could be seen, and was ugly.) */
    [data-layout="columns3"] .home .sketch {
        position: absolute;
        top: -0.5rem;
        right: calc(var(--sketch) * -0.1);
        width: var(--sketch);
        margin: 0;
        filter: brightness(0.45);
    }

    [data-layout="columns3"] .home .intro {
        margin-top: 2.25rem;
    }

    /* (two lines of space over a section: its heading has none of its own) */
    [data-layout="columns3"] .home section {
        margin-top: 3rem;
    }
}

/* Between a phone and a tablet: a folding phone opened out, a small phone on its side
   (560 to 719 wide). Still one column, in the phone's type, for it is still held in the
   hand; but a phone's column on a screen half as wide again left a quarter of it empty
   down the right, with the drawing a thumbnail in a corner of the rest. So here the
   column is the screen's whole width. The rows of the lists run right across, a title at
   one side and its date at the other. The drawing stands at twice the size beside the
   name and the first paragraph, with air between; the rest of the statement runs the
   whole width under it. The margins are a tablet's.

   The sizes together:
     under 560      one column; the drawing small, beside the name          15px on 24
     560 to 719     one column the width of the screen; the drawing beside
                    the statement                                           15px on 24
     720 to 1279    three columns, swiped sideways                          14px on 22
     1280 and over  three columns                                           14px on 22
   One column is read in the hand and keeps the larger type; columns side by side are a
   page laid out to be looked over, and take the smaller. (A screen under 600 tall keeps
   the larger whatever its width: that is a phone on its side.) */
@media (min-width: 560px) and (max-width: 719px) {
    [data-layout="columns3"] .page {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    [data-layout="columns3"] .page.home {
        max-width: none;
    }

    /* The name and the first paragraph stand beside the drawing; what follows runs the
       whole width under it. (Set out as a grid, so the two can never meet: a drawing
       taller than the name and paragraph beside it makes room for itself.) */
    [data-layout="columns3"] .home header {
        --sketch: clamp(6rem, 17vw, 7.5rem);
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 2rem;
    }

    /* (anything else that stands in the header, a window or a row of controls, has the whole width) */
    [data-layout="columns3"] .home header > * {
        grid-column: 1 / -1;
    }

    [data-layout="columns3"] .home h1 {
        grid-column: 1;
        grid-row: 1;
    }

    [data-layout="columns3"] .home .intro {
        display: contents;
    }

    [data-layout="columns3"] .home .intro p:first-child {
        grid-column: 1;
        grid-row: 2;
        margin-top: 2.25rem;
    }

    [data-layout="columns3"] .home .intro p:nth-child(n + 2),
    [data-layout="columns3"] .home .links {
        grid-column: 1 / -1;
    }

    /* (in a grid the space under the last paragraph and the space over the links would
       add, where one above another they are one: the links keep their own) */
    [data-layout="columns3"] .home .intro p:last-child {
        margin-bottom: 0;
    }

    [data-layout="columns3"] .home header > a:has(> .sketch) {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: start;
        margin: -0.25rem calc(var(--sketch) * -0.1) 0 0;
        line-height: 0;
    }

    [data-layout="columns3"] .home .sketch {
        position: static;
        display: block;
        filter: brightness(0.6);            /* (larger, its line is nearer a point wide: it wants less deepening) */
    }
}

/* The line at the foot of the page ("We must build the most beautiful things") is not
   shown in this layout. (It was a line of text; then a small pale dot in the bottom
   corner, which said nothing to anyone who did not already know what it was.) */
[data-layout="columns3"] .home .aside {
    display: none;
}

/* Rows. A title stands a little apart from what is under it (6px more than a line), so
   that a description running on to a second or third line reads as one thing and the
   title as its heading: with every line the same distance apart, the three ran
   together and the row looked wedged between its rules. The rules stand a little
   further off too (15px of padding, where it was 12). A row is then 60px and a whole
   number of lines tall, so every rule is still on the 12px grid. And the words in a
   row are set in lines of even length, so a description does not end in a word alone. */
[data-layout="columns3"] {
    --row-pad: 0.9375rem;
    --title-gap: 0.375rem;
}

[data-layout="columns3"] .home .entries > li,
[data-layout="columns3"] .home .entries .desc {
    text-wrap: balance;
}

[data-layout="columns3"] .home .entries h3 {
    margin-bottom: var(--title-gap, 0px);
}

/* Fingers: what is to be tapped is made larger to the touch without anything moving.
   A row with a linked title is tappable all over; links inside it stay their own.
   Links that stand one under another (a row's list of them) keep the text's own
   24px line between them: given 40px each they stood apart like separate rows.
   The first reaches up and the last down by 8px to the touch, into the row's own
   space, so each of a pair is 32px tall to a finger. */
@media (pointer: coarse) {
    [data-layout="columns3"] .home .links a {
        padding: 0.625rem 0.5em;
        margin: -0.625rem -0.5em;
    }

    [data-layout="columns3"] .home .entries > li {
        position: relative;
    }

    [data-layout="columns3"] .home .entries h3 a::after {
        content: "";
        position: absolute;
        inset: 0;
    }

    [data-layout="columns3"] .home .entries .desc a {
        position: relative;
        z-index: 1;
        display: inline-block;
        padding: 0.5rem 0;
        margin: -0.5rem 0;
    }

    [data-layout="columns3"] .home .entries ul.desc a {
        padding: 0;
        margin: 0;
    }

    [data-layout="columns3"] .home .entries ul.desc li:first-child a {
        padding-top: 0.5rem;
        margin-top: -0.5rem;
    }

    [data-layout="columns3"] .home .entries ul.desc li:last-child a {
        padding-bottom: 0.5rem;
        margin-bottom: -0.5rem;
    }
}

/* The name and the headings of the sections: a little larger than the text they
   stand over (17px to its 15), on the same 24px line, and drawn in a touch as
   Kräftig wants at that size. At the text's own size they read as text. */
[data-layout="columns3"] .home h1,
[data-layout="columns3"] .home section > h2 {
    font-size: 1.0625rem;
    line-height: 1.5rem;        /* (said outright: inherited, it would be 1.6 of the larger size, off the grid) */
    letter-spacing: -0.006em;
}

/* Every section opens the same way, at every width: its heading on a solid rule, and
   hairlines between its rows only. Nothing closes a list; the next heading's rule does,
   or the end of the page. (In one column a list was once closed by a rule and the next
   heading stood on another, so that each heading sat between two lines, while side by
   side, as columns, there was only the one: turn a phone and the lines changed. Now
   there is one everywhere.) */
[data-layout="columns3"] .home section > h2 {
    float: none;
    width: auto;
    margin: 0;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid var(--fg);
    color: var(--fg);
    font-weight: var(--medium);
}

[data-layout="columns3"] .home .entries {
    border-bottom: 0;
}

[data-layout="columns3"] .home .entries > li:first-child {
    border-top: 0;
}

[data-layout="columns3"] .home .entries > li:last-child {
    padding-bottom: var(--row-pad, 0.75rem);        /* (no rule closes the list, so none is taken out of it) */
}

@media (min-width: 720px) {
    [data-layout="columns3"] .home {
        box-sizing: border-box;
        max-width: 84rem;
        padding: 2.5rem 1.5rem 2.5rem;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 2rem;
        row-gap: 3rem;
        align-items: start;
    }

    [data-layout="columns3"] .home header {
        grid-column: 1 / -1;
        position: static;
        margin: 0;
    }

    /* The name opens its column as the sections open theirs: a label on a solid rule.
       (Not in one column, where the drawing stands beside the name.) */
    [data-layout="columns3"] .home h1 {
        float: none;
        width: auto;
        margin: 0;
        padding: 0 0 0.75rem;
        border-bottom: 1px solid var(--fg);
        color: var(--fg);
        font-weight: var(--medium);
    }

    [data-layout="columns3"] .home h1::before {
        content: none;
    }

    /* (a point less than the space under the other columns' headings: their rule is in
       that space, this one's is over it. So the first line of all three columns is level.) */
    [data-layout="columns3"] .home .intro {
        margin-top: calc(var(--row-pad, 0.75rem) - 1px);
        max-width: var(--measure);
    }

    /* (a line's space over the links: they are not another paragraph of the statement) */
    [data-layout="columns3"] .home .links {
        margin-top: 1.5rem;
    }

    [data-layout="columns3"] .home .sketch {
        position: static;
        width: 96px;
        margin: 2.25rem 0 0;
    }

    [data-layout="columns3"] .home section {
        margin: 0;
    }

    /* Stickies: notes flow in columns */
    [data-layout="columns3"] .page:has(> .notes) {
        max-width: 72rem;
    }

    [data-layout="columns3"] .page:has(> .notes) > header {
        max-width: var(--measure);
    }

    [data-layout="columns3"] .notes {
        column-count: 2;
        column-gap: 2.5rem;
        border-bottom: 0;
        border-top: 1px solid var(--fg);
    }

    [data-layout="columns3"] .notes > li {
        break-inside: avoid;
        border-top: 0;
        border-bottom: 1px solid var(--rule);
    }

    /* Authors can be long: under the title, not beside it */
    [data-layout="columns3"] .notes > li {
        display: block;
    }

    [data-layout="columns3"] .notes .when {
        display: block;
        white-space: normal;
    }
}

@media (min-width: 820px) {
    /* Section rules in the same solid ink as the home columns */
    [data-layout="columns3"] :is(.oral-history-section, .interview-section) {
        border-top-color: var(--fg);
    }

    [data-layout="columns3"] .page:has(.link-list) section {
        padding-top: 0.75rem;
        border-top: 1px solid var(--fg);
    }
}

@media (min-width: 1280px) {
    [data-layout="columns3"] .home {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 3rem;
        padding: 2.5rem;
    }

    [data-layout="columns3"] .home header {
        grid-column: 1;
    }

    [data-layout="columns3"] .notes {
        column-count: 3;
        column-gap: 3rem;
    }

    /* Articles: the intro note becomes a third column, opening on the same rule as the text */
    [data-layout="columns3"] .intro-blurb {
        float: right;
        clear: right;
        width: 16rem;
        margin: 0 -19rem 0 0;
        padding-top: 0.75rem;
        border-top: 1px solid var(--fg);
    }

    [data-layout="columns3"] .intro-blurb + :is(.oral-history-section, .interview-section) {
        margin-top: 0;
    }

    /* Research: links in two columns under a wider page */
    [data-layout="columns3"] .page:has(.link-list) {
        max-width: 62rem;
    }

    [data-layout="columns3"] .page:has(.link-list) > :not(section, .back-link),
    [data-layout="columns3"] .page:has(.link-list) .section-desc {
        max-width: var(--measure);
    }

    [data-layout="columns3"] .link-list {
        column-count: 2;
        column-gap: 3rem;
    }

    [data-layout="columns3"] .link-list li {
        break-inside: avoid;
    }
}

/* Tablets: all three columns, swiped sideways between.
   Columns are sized so two fit and the third peeks in, to show there is more. */
@media (min-width: 720px) and (max-width: 1279px) {
    [data-tablet="scroll"][data-layout="columns3"] .home {
        max-width: none;
        grid-template-columns: none;
        grid-template-rows: auto auto;
        grid-auto-flow: column;
        grid-auto-columns: max(22.5rem, calc((100vw - 5.5rem) / 2.25));
        overflow-x: auto;
        /* (sideways only. Left to itself a box that scrolls one way may scroll the other, and
           this one had two points to spare under its last row: enough for a finger moving up
           or down to take hold of the columns and pull them over the picture, where it should
           move the page.) */
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scroll-padding-left: 1.5rem;
        scrollbar-width: none;
    }

    [data-tablet="scroll"][data-layout="columns3"] .home::-webkit-scrollbar {
        display: none;
    }

    [data-tablet="scroll"][data-layout="columns3"] .home > :is(header, section) {
        grid-column: auto;
        grid-row: 1;
        scroll-snap-align: start;
    }
}

/* ---------- The picture across the head of the home page (drawn by sky.js) ---------- */

[data-bg="weather"] {
    min-height: 100%;
}

[data-bg="weather"] body {
    background: transparent;
}

/* The home page is a plain wall with black text: the site's grey, which sky.js keeps (as
   --wall) at the tone the hour and the weather give it */
[data-bg="weather"][data-sky-place]:not([data-sky-place="full"]) {
    --wall: #ebebe9;
    --fg: #141414;
    --bg: var(--wall);
    --muted: color-mix(in srgb, var(--fg) 72%, var(--bg));
    --rule: color-mix(in srgb, var(--fg) 22%, var(--bg));
    --col-gap: 0px;
    background: var(--wall);
    transition: background-color 2s ease;
}

@media (min-width: 720px) {
    [data-bg="weather"][data-sky-place]:not([data-sky-place="full"]) {
        --col-gap: 2rem;
    }
}

@media (min-width: 1280px) {
    [data-bg="weather"][data-sky-place]:not([data-sky-place="full"]) {
        --col-gap: 3rem;
    }
}

/* The picture's canvas */
.sky-vista {
    /* As tall as the screen with the browser's bars away. On a phone they
       cover its foot while they show, rather than the picture being resized
       (and jumping) every time they come and go. */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    z-index: -1;
    pointer-events: none;
}

/* The view across the head of the page: a wide picture above the text, which
   begins where the picture dies away. It scrolls off with the page. */
html[data-view-fit="head"] {
    --mh: 44;                 /* its height, as a share of the screen's, and its limits */
    --mh-min: 220px;
    --mh-max: 520px;
    --masthead-text: 0.93;    /* how far down the picture the text begins: just above its foot, or (below) part of the way down it, or 0, at its top */
    --page-top: 1.25rem;      /* the page's own top margin */
    --mh-wide: 0px;           /* the least it may be on a very wide screen, so that it still holds the nearest house */
    --masthead: max(clamp(var(--mh-min), calc(var(--mh) * 1vh), var(--mh-max)), var(--mh-wide));
}

@supports (height: 1svh) {
    html[data-view-fit="head"] {
        --masthead: max(clamp(var(--mh-min), calc(var(--mh) * 1svh), var(--mh-max)), var(--mh-wide));
    }
}

/* (the picture is as wide as the page, so on a very wide screen a shallow one shows only a
   sliver of the view: there it is made deep enough for the house at the view's foot) */
html[data-view-fit="head"]:not([data-view-head]) {
    --mh-wide: 18vw;
}

/* ... or all of it, the text beginning only below */

@media (min-width: 720px) {
    html[data-view-fit="head"][data-layout="columns3"] {
        --page-top: 2.5rem;
    }
}

@media (max-width: 719px) {
    html[data-view-fit="head"] {
        --mh: 34;
        --mh-min: 200px;
        --mh-max: 340px;
    }
}

/* (only the headings of the text over the foot of the picture) */

html[data-view-fit="head"] .sky-vista {
    position: absolute;
    inset: 0 0 auto 0;
    height: var(--masthead);
}

/* (it can be set in from the edges of the page, with rounded corners: --mh-inset, --mh-radius) */
html[data-view-fit="head"] .sky-vista {
    top: var(--mh-inset, 0px);
    left: var(--mh-left, var(--mh-inset, 0px));
    width: var(--mh-width, calc(100% - 2 * var(--mh-inset, 0px)));
    border-radius: var(--mh-radius, 0px);
}

/* A phone on its side: the screen is short, so the picture takes less of it */
@media (max-height: 500px) and (orientation: landscape) {
    html[data-view-fit="head"]:not([data-view-head]) {
        --mh: 40;
        --mh-min: 130px;
        --mh-wide: 0px;
    }
}

/* Nothing is shown of it until the picture is in (an empty band would be), and if the
   picture never comes the page closes up over its place */
html[data-sky-view="view"][data-view-fit="head"] .sky-vista {
    opacity: 0;
    transition: opacity 0.4s ease;
}

html[data-sky-view="view"][data-view-fit="head"] .sky-vista.is-ready {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    html[data-sky-view="view"][data-view-fit="head"] .sky-vista {
        transition: none;
    }
}

html.view-failed[data-view-fit="head"] {
    --masthead: 0px !important;
    --mh-inset: 0px !important;
}

html.view-failed[data-view-fit="head"] .sky-vista {
    display: none;
}

html[data-view-fit="head"][data-bg="weather"] .page.home {
    padding-top: calc(var(--page-top) + var(--mh-inset, 0px) + var(--masthead) * var(--masthead-text));
}

/* Where everything is a step smaller (style.css: anything larger than a phone): the lines
   that were worked out for a 24px line are worked out for the 22px one. */
@media (min-width: 720px) and (min-height: 600px), (min-width: 1280px) and (hover: hover) and (pointer: fine) {
    [data-bio="sm"] {
        --bio-leading: calc(22 / 14);
    }
}

/* On a desk or a laptop the three columns keep the width they had before the text came
   down a step, so a line holds more words, with the page's side margin a whole 40px as it
   was. */
@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
    [data-layout="columns3"] .home {
        max-width: 1344px;
        padding-left: 40px;
        padding-right: 40px;
    }
}
