/*
  Site colours. Every page, toys included, reads these variables.
  Light values on :root. Dark values apply with data-theme="dark" on <html>
  (set by theme.js), or with no stored choice when the OS asks for dark.
  doodles.css follows the same rule.
*/
:root {
  color-scheme: light;
  --paper: #f5f0e7;          /* page */
  --paper-deep: #ebe3d5;     /* tinted panels */
  --surface: #fbf8f2;        /* raised cards */
  --ink: #1d2627;            /* body text */
  --ink-soft: #435051;       /* secondary text, captions */
  --muted: #5d6869;          /* labels, dates, credits */
  --rule: #cfc6b7;           /* hairlines */
  --rule-soft: #e0d8ca;      /* hairlines inside cards and lists */
  --teal: #2e6665;
  --teal-pale: #d7e5e0;
  --rust: #a2472c;
  --rust-pale: #f0ddd4;
  --amber: #8f5716;          /* warm accent that reads on the page colour */
  --dot: rgba(91, 94, 83, .10);                  /* dotted page background */
  --shadow: 0 18px 48px rgba(47, 42, 34, .09);
  --play-shadow: 0 34px 90px rgba(38, 32, 22, .26), 0 6px 18px rgba(38, 32, 22, .12);
  --screen-edge: transparent;                    /* outline for dark screens on a dark page */
  /* Paper figures are drawn on white. In dark mode they get a matted frame and
     are dimmed a little so they do not glare. */
  --figure-bg: #fff;
  --figure-pad: 0px;
  --figure-filter: none;

  /* Screens: the always-dark instrument panels (toys, the homepage play strip
     and data card). The same in both themes. */
  --inst-bg: #0b1013;
  --inst-bg-2: #10171b;
  --inst-raised: #151c20;
  --inst-stage: #040607;       /* behind every 3D view before and around the canvas */
  --inst-edge: rgba(0, 0, 0, .55);
  --inst-line: rgba(214, 228, 226, .085);
  --inst-line-faint: rgba(214, 228, 226, .055);
  --inst-line-strong: rgba(214, 228, 226, .16);
  --inst-bright: #f1ece2;
  --inst-text: #ebe6dc;
  --inst-soft: #c9c4b8;
  --inst-muted: #93a0a0;
  --inst-faint: #5f6c6d;
  --inst-amber: #eba862;

  --serif: Iowan Old Style, Baskerville, "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 50rem;
  --wide: 76rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121618;
    --paper-deep: #191e20;
    --surface: #192023;
    --ink: #e8e3d9;
    --ink-soft: #b9bfba;
    --muted: #9aa4a3;
    --rule: #2c3335;
    --rule-soft: #242b2d;
    --teal: #8cc8c0;
    --teal-pale: #1c2b2a;
    --rust: #e6936d;
    --rust-pale: #33231d;
    --amber: #eba862;
    --dot: rgba(230, 225, 212, .045);
    --shadow: 0 18px 48px rgba(0, 0, 0, .35);
    --play-shadow: 0 34px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04);
    --screen-edge: rgba(214, 228, 226, .09);
    --inst-edge: var(--rule);   /* the dark card needs a visible edge on a dark page */
    --figure-bg: #fff;
    --figure-pad: .5rem;
    --figure-filter: brightness(.86);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121618;
  --paper-deep: #191e20;
  --surface: #192023;
  --ink: #e8e3d9;
  --ink-soft: #b9bfba;
  --muted: #9aa4a3;
  --rule: #2c3335;
  --rule-soft: #242b2d;
  --teal: #8cc8c0;
  --teal-pale: #1c2b2a;
  --rust: #e6936d;
  --rust-pale: #33231d;
  --amber: #eba862;
  --dot: rgba(230, 225, 212, .045);
  --shadow: 0 18px 48px rgba(0, 0, 0, .35);
  --play-shadow: 0 34px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04);
  --screen-edge: rgba(214, 228, 226, .09);
  --inst-edge: var(--rule);   /* the dark card needs a visible edge on a dark page */
  --figure-bg: #fff;
  --figure-pad: .5rem;
  --figure-filter: brightness(.86);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.15px);
  background-size: 19px 19px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .16em; }
a:hover { color: var(--teal); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--rust); outline-offset: 4px; }
img { max-width: 100%; height: auto; }
.figure-link { display:block; cursor:zoom-in; }

.skip-link {
  position: fixed; z-index: 10; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--paper); padding: .45rem .7rem;
  font: 700 .78rem/1 var(--sans); letter-spacing: .06em;
}
.skip-link:focus { top: 1rem; }

.shell { width: min(calc(100% - 3rem), var(--wide)); margin-inline: auto; }
.reading-width { width: min(100%, var(--measure)); }
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-inner {
  min-height: 5.1rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.wordmark { text-decoration: none; display: inline-flex; align-items: baseline; gap: .6rem; }
.wordmark-mark { color: var(--rust); font: 700 1.34rem/1 var(--serif); }
.wordmark-name { font: 700 .83rem/1 var(--sans); letter-spacing: .095em; text-transform: uppercase; }
.nav-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: inline-flex; align-items: center; min-height: 2.25rem; padding: .25rem 0; font: 600 .73rem/1 var(--sans); letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.nav-list a[aria-current="page"] { color: var(--rust); }

.eyebrow, .section-label, .meta, .kicker {
  font-family: var(--sans); font-size: .72rem; line-height: 1.3; font-weight: 700;
  letter-spacing: .115em; text-transform: uppercase;
}
.eyebrow { color: var(--teal); }
.section-label { color: var(--rust); }
.meta, .kicker { color: var(--muted); }
.hero { padding: clamp(4.5rem, 10vw, 9.5rem) 0 clamp(4rem, 8vw, 7rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, .36fr); gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.hero-main { min-width: 0; }
.hero h1 {
  max-width: none; margin: .65rem 0 1.45rem; font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 400; letter-spacing: -.065em; line-height: .82;
}
.hero-intro { max-width: 50rem; margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.8rem); line-height: 1.42; }
.hero-intro a { color: var(--teal); }
.hero-note { max-width: 35rem; margin: 1.4rem 0 0; color: var(--muted); font-size: 1.02rem; }
.margin-note { position: relative; align-self: center; margin: 1rem 0 1.5rem; padding: 1.15rem 1.1rem 1.25rem; background: #f1df9f; color: #344143; box-shadow: 5px 6px 0 rgba(47, 42, 34, .14); transform: rotate(1.1deg); }
.margin-note::before { content: "✳"; position: absolute; right: .7rem; top: .55rem; color: var(--rust); font: 1.2rem/1 var(--sans); }
.margin-note .note-label { display: block; margin-bottom: .65rem; color: var(--rust); font-family: "Segoe Print", "Bradley Hand", cursive; font-size: 1rem; font-weight: 700; }
.margin-note p { margin: 0; font-size: .95rem; line-height: 1.42; }
.margin-note h3 { max-width: 15rem; margin: 0 1.45rem .5rem 0; font-size: 1.2rem; font-weight: 400; letter-spacing: -.025em; line-height: 1.08; }
.margin-note--sage { background: #dce8d8; color: #30473d; transform: rotate(-.8deg); }
.margin-note--sage .note-label { color: #3e6d59; }
.margin-note--rose { background: #efd7d3; color: #563c3a; transform: rotate(.7deg); }
.margin-note--rose .note-label { color: #9a493d; }

.rule-section { border-top: 1px solid var(--rule); padding: clamp(3.4rem, 7vw, 6rem) 0; }
.section-heading { display: grid; grid-template-columns: minmax(9rem, .58fr) 2fr; gap: 2rem; }
.section-heading h2 { margin: -.2rem 0 0; font-size: clamp(2.3rem, 4vw, 3.75rem); font-weight: 400; letter-spacing: -.05em; line-height: .98; }
.section-heading p { margin: .2rem 0 0; max-width: 33rem; }

.work-list { margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--rule); }
.featured-project { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(17rem, .96fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; margin-top: clamp(2.8rem, 5vw, 4.5rem); }
.featured-project .feature-copy { padding: clamp(1.5rem, 4vw, 3.2rem) 0; }
.featured-project h3 { max-width: none; margin: .55rem 0 1rem; font-size: clamp(2.4rem, 4.8vw, 4.6rem); font-weight: 400; letter-spacing: -.06em; line-height: .93; }
.featured-project h3 a { text-decoration: none; }
.featured-project p { max-width: 33rem; margin: 0 0 1.4rem; }
.feature-figure { margin: 0; background: var(--paper-deep); box-shadow: var(--shadow); }
.feature-figure img { display: block; width: 100%; }
.feature-figure figcaption { padding: .75rem .9rem .9rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .78rem; line-height: 1.4; }
.work-item { display: grid; grid-template-columns: minmax(7rem, .62fr) 2fr auto; gap: 1.5rem; align-items: baseline; padding: 1.6rem 0 1.7rem; border-bottom: 1px solid var(--rule); }
.work-item time { color: var(--muted); font: .76rem/1.3 var(--sans); letter-spacing: .08em; }
.work-item h3 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.6rem); font-weight: 400; letter-spacing: -.045em; line-height: 1.05; }
.work-item h3 a { text-decoration: none; }
.work-item p { grid-column: 2 / 3; max-width: 35rem; margin: .35rem 0 0; color: var(--ink-soft); font-size: 1rem; }
.work-item .project-status { margin-top: .55rem; color: var(--rust); font: 700 .69rem/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.work-item .report-links { margin-top: .65rem; }
.work-item .report-links a { color: var(--teal); font: 700 .76rem/1.3 var(--sans); letter-spacing: .04em; }
.arrow-link { font: 600 .78rem/1 var(--sans); color: var(--teal); letter-spacing: .06em; text-decoration: none; white-space: nowrap; }
.arrow-link::after { content: " ↗"; }
.work-item .arrow-link { grid-column: 3; grid-row: 1 / span 2; }

.statement { background: var(--ink); color: var(--paper); }
.statement .shell { padding: clamp(4rem, 8vw, 7.5rem) 0; }
.statement .eyebrow { color: #a6cfca; }
.statement blockquote { max-width: 51rem; margin: 1rem 0 0; font-size: clamp(2rem, 4.5vw, 4rem); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; }
.about-copy { max-width: 42rem; margin-top: 2.3rem; color: #d9dbd4; }
.about-copy p { margin: 0 0 1rem; }
.notebook-section { position: relative; background: color-mix(in srgb, var(--paper) 82%, transparent); }
.notebook-section[data-note]::before { content: attr(data-note); position: absolute; top: 2.2rem; left: max(1rem, calc((100% - var(--wide)) / 2)); color: var(--rust); font-family: "Segoe Print", "Bradley Hand", cursive; font-size: .93rem; transform: rotate(-5deg); }
.notebook-section .shell { padding-top: clamp(5rem, 9vw, 7rem); }
.interests-grid { display: grid; grid-template-columns: minmax(12rem, .47fr) minmax(0, 1fr); gap: clamp(1.5rem, 6vw, 5rem); }
.interests-grid h2 { margin: -.2rem 0 0; font-size: clamp(2.4rem, 4vw, 3.8rem); font-weight: 400; letter-spacing: -.055em; line-height: .98; }
.interests-grid p { max-width: 39rem; margin: 0 0 1rem; }
.notebook-details { margin-top: 1.55rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.notebook-details summary { cursor: pointer; padding: .8rem 0; color: var(--teal); font: 700 .78rem/1.35 var(--sans); letter-spacing: .085em; text-transform: uppercase; }
.notebook-details summary::marker { color: var(--rust); }
.notebook-details[open] summary { color: var(--rust); }
.notebook-details .details-inner { padding: .35rem 0 1.2rem; }
.notebook-details ul { padding-left: 1.1rem; margin: .65rem 0 0; }
.notebook-details li { margin-bottom: .45rem; }

.publication-list { list-style: none; padding: 0; margin: 2.1rem 0 0; max-width: 57rem; }
.publication-list li { padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.publication-list li:last-child { border-bottom: 1px solid var(--rule); }
.publication-list p { margin: .32rem 0 0; color: var(--muted); font-size: .93rem; }
.publication-list cite { font-style: normal; }
.text-link { color: var(--teal); font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .06em; }
.contact-line { margin: 0; font-size: clamp(1.65rem, 3vw, 2.5rem); letter-spacing: -.04em; }

.literary-note { position: relative; max-width: 38rem; margin: 1.8rem 0 0; padding: 1.25rem 1.35rem 1.2rem; border: 1px solid var(--rule); border-left: 3px solid var(--rust); background: color-mix(in srgb, var(--rust-pale) 36%, transparent); }
.literary-note::before { content: "reading note"; display: block; margin-bottom: .65rem; color: var(--rust); font: 700 .67rem/1.2 var(--sans); letter-spacing: .11em; text-transform: uppercase; }
.literary-note blockquote { margin: 0 0 .6rem; font-size: 1.5rem; font-style: italic; line-height: 1.35; }
.literary-note figcaption { color: var(--muted); font-size: .85rem; }

/* research page parts */
.reading-guide { max-width: 56rem; margin: 2.25rem 0 0; padding: 1rem 1.15rem 1.15rem; border-top: 2px solid var(--teal); border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--teal-pale) 35%, transparent); }
.reading-guide h2 { margin: 0 0 .5rem; color: var(--teal); font: 700 .72rem/1.25 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.reading-guide .eyebrow { margin: 0 0 .5rem; }
.reading-guide p { max-width: 44rem; margin: 0; color: var(--ink-soft); font-size: .95rem; }
.reading-guide ul, .reading-guide ol { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; list-style: none; padding: 0; margin: .9rem 0 0; }
.reading-guide a { color: var(--teal); font: 700 .76rem/1.35 var(--sans); letter-spacing: .025em; }
.notebook-entry { position: relative; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem 1.4rem; padding: 1.5rem 0 1.6rem 1.2rem; border-bottom: 1px solid var(--rule); }
.notebook-entry:first-child { border-top: 1px solid var(--rule); }
.notebook-entry::before { content: ""; position: absolute; top: 1.15rem; bottom: 1.15rem; left: 0; width: 2px; background: color-mix(in srgb, var(--rust) 55%, transparent); }
.entry-number { color: var(--rust); font: 700 .75rem/1.4 var(--sans); letter-spacing: .1em; }
.notebook-entry > .entry-number { grid-column: 1; grid-row: 1; align-self: start; margin: 0; }
.notebook-entry > :not(.entry-number) { grid-column: 2; }
.notebook-entry h3 { margin: 0 0 .35rem; font-size: clamp(1.45rem, 2.6vw, 2.25rem); font-weight: 400; letter-spacing: -.04em; line-height: 1.05; }
.notebook-entry h3 a { text-decoration: none; }
.notebook-entry p { max-width: 42rem; margin: 0; color: var(--ink-soft); font-size: .98rem; }
.notebook-entry p + p { margin-top: .7rem; }
.figure-reading { max-width: 34rem; margin: 1.25rem 0 1.75rem; padding: .9rem 1rem 1rem; border-top: 1px solid var(--teal); background: color-mix(in srgb, var(--teal-pale) 45%, transparent); color: var(--ink-soft); }
.figure-reading h3 { margin: 0 0 .35rem; color: var(--teal); font: 700 .7rem/1.25 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.figure-reading p { margin: 0; font-size: .9rem; line-height: 1.45; }
.related-notes { margin: 2.5rem 0 0; padding: 1.2rem 0 0; border-top: 1px solid var(--rule); }
.related-notes h2, .related-notes h3 { margin: 0 0 .7rem; color: var(--rust); font: 700 .72rem/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.related-notes p { max-width: 42rem; margin: 0 0 .7rem; color: var(--ink-soft); font-size: .94rem; }
.related-notes ul { display: flex; flex-wrap: wrap; gap: .55rem 1.25rem; list-style: none; padding: 0; margin: 0; }
.related-notes a { color: var(--teal); font: 700 .78rem/1.3 var(--sans); }
.experiment-flow { margin: 2rem 0; padding: 1.2rem; border-top: 2px solid var(--teal); background: color-mix(in srgb, var(--teal-pale) 24%, transparent); }
.experiment-flow > h3 { margin: 0 0 .9rem; font-size: 1.28rem; font-weight: 400; letter-spacing: -.025em; line-height: 1.05; }
.experiment-flow > ol { counter-reset: experiment; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem; list-style: none; padding: 0; margin: 0; border: 0; }
.experiment-flow > ol > li { counter-increment: experiment; display: block; position: relative; min-width: 0; padding: 1rem 1rem 1.1rem; border: 0; border-top: 2px solid var(--teal); background: color-mix(in srgb, var(--paper) 78%, transparent); }
.experiment-flow > ol > li::before { content: counter(experiment, decimal-leading-zero); display: block; margin-bottom: .7rem; color: var(--rust); font: 700 .7rem/1 var(--sans); letter-spacing: .1em; }
.experiment-flow > ol > li:not(:last-child)::after { content: "→"; position: absolute; z-index: 1; top: 1.05rem; right: -1.15rem; color: var(--rust); font: 1.2rem/1 var(--sans); }
.experiment-flow > ol > li:nth-child(2)::after { content: "↓"; top: auto; right: auto; bottom: -1.35rem; left: calc(50% - .4rem); }
.experiment-flow h3 { margin: 0 0 .35rem; font-size: 1.22rem; font-weight: 400; letter-spacing: -.025em; line-height: 1.05; }
.experiment-flow p { margin: .8rem 0 0; color: var(--ink-soft); font-size: .9rem; line-height: 1.42; }
.experiment-flow > ol > li p { margin: 0; }
.site-footer { color: var(--muted); font: .72rem/1.4 var(--sans); letter-spacing: .055em; }
.site-footer .shell { padding: 2rem 0 2.4rem; display: flex; justify-content: space-between; gap: 1rem; }

/* Project pages */
.project-hero { padding: clamp(3.6rem, 7vw, 6.5rem) 0 3.4rem; }
.project-hero .breadcrumb { margin-bottom: 2.7rem; font: .73rem/1 var(--sans); letter-spacing: .07em; }
.project-hero h1 { max-width: none; margin: .7rem 0 1.5rem; font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 400; letter-spacing: -.07em; line-height: .88; }
.project-dek { max-width: 50rem; margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.75rem); line-height: 1.45; }
.project-meta { display: flex; flex-wrap: wrap; gap: .65rem 1.7rem; margin-top: 2.2rem; color: var(--muted); }
.project-meta span { font: 600 .72rem/1.4 var(--sans); letter-spacing: .07em; text-transform: uppercase; }
.project-meta strong { color: var(--ink); }

.paper-figure { margin: 0; border: 1px solid var(--rule); background: var(--paper-deep); box-shadow: var(--shadow); }
.paper-figure img { display: block; width: 100%; }
.paper-figure figcaption { padding: .85rem 1rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .8rem; }
.project-article .paper-figure { margin-bottom: 1.5rem; }

.project-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, .44fr); gap: clamp(3rem, 9vw, 9rem); align-items: start; padding: clamp(4rem, 8vw, 7rem) 0; }
.project-article { max-width: var(--measure); }
.project-article h2 { margin: 3.25rem 0 1rem; font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 400; letter-spacing: -.048em; line-height: 1; }
.project-article h2:first-child { margin-top: 0; }
.project-article p { margin: 0 0 1.35rem; }
.project-article .figure-reading p { margin: 0; }
.project-article .notebook-entry p { margin: 0; }
.project-article .notebook-entry p + p { margin-top: .7rem; }
.project-article .notebook-entry > .entry-number { color: var(--rust); font: 700 .75rem/1.4 var(--sans); letter-spacing: .1em; }
.project-article .experiment-flow > p { margin: .8rem 0 0; }
.project-article .lede { font-size: 1.22rem; line-height: 1.5; }
.project-aside { position: static; border-top: 2px solid var(--teal); padding-top: 1rem; }
.project-aside h2 { margin: 0 0 1rem; font: 700 .72rem/1.3 var(--sans); color: var(--teal); letter-spacing: .11em; text-transform: uppercase; }
.project-aside dl { margin: 0; }
.project-aside dt { margin-top: 1rem; color: var(--muted); font: 700 .68rem/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.project-aside dd { margin: .25rem 0 0; font-size: .94rem; line-height: 1.38; }
.project-aside a { color: var(--teal); }
.method-steps { counter-reset: method; list-style: none; padding: 0; margin: 1.7rem 0; border-top: 1px solid var(--rule); }
.method-steps li { counter-increment: method; display: grid; grid-template-columns: 2.5rem 1fr; gap: .8rem; padding: 1.15rem 0; border-bottom: 1px solid var(--rule); }
.method-steps li::before { content: counter(method, decimal-leading-zero); color: var(--rust); font: 700 .74rem/1.5 var(--sans); letter-spacing: .07em; }
.project-article .notebook-details { background: color-mix(in srgb, var(--rust-pale) 48%, transparent); padding: 0 1.1rem; border: 1px solid var(--rule); }
.project-article .notebook-details summary { font-family: "Segoe Print", "Bradley Hand", cursive; font-size: 1.02rem; letter-spacing: 0; text-transform: none; }
.citation { border-left: 3px solid var(--rust); margin: 2.1rem 0; padding: .25rem 0 .25rem 1.3rem; color: var(--ink-soft); font-size: .96rem; }
.citation p { margin: 0; }

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 2rem), var(--wide)); }
  .masthead-inner { min-height: auto; padding: 1.1rem 0; align-items: flex-start; gap: 1rem; }
  .wordmark-name { font-size: .7rem; }
  .nav-list { gap: .3rem 1rem; padding-top: .15rem; }
  .nav-list a { font-size: .66rem; min-height: 1.75rem; }
  .hero h1 { max-width: none; }
  .hero-grid { display: block; }
  .margin-note { max-width: 21rem; margin-top: 2.2rem; }
  .section-heading { display: block; }
  .section-heading h2 { margin-top: .7rem; }
  .section-heading p { margin-top: 1.35rem; }
  .work-item { grid-template-columns: 1fr auto; gap: .5rem 1rem; }
  .featured-project { display: block; }
  .featured-project .feature-copy { padding: 0 0 1.8rem; }
  .work-item time { grid-column: 1; }
  .work-item h3, .work-item p { grid-column: 1 / -1; }
  .work-item .arrow-link { grid-column: 2; grid-row: 1; }
  .project-layout { display: block; }
  .interests-grid { display: block; }
  .interests-grid > div { margin-top: 1.6rem; }
  .project-aside { position: static; margin-top: 4rem; }
  .notebook-entry { grid-template-columns: 3.4rem minmax(0, 1fr); gap: .7rem; padding-left: .9rem; }
  .reading-guide { margin-top: 1.75rem; }
  .literary-note { padding: 1.05rem 1.1rem; }
  .experiment-flow { padding: 1rem; }
  .experiment-flow > ol { grid-template-columns: 1fr; gap: .7rem; }
  .experiment-flow > ol > li { padding: .9rem 1rem; }
  .experiment-flow > ol > li:not(:last-child)::after { top: auto; right: auto; bottom: -.7rem; left: 1rem; transform: rotate(90deg); }
  .experiment-flow > ol > li:nth-child(2)::after { content: "↓"; transform: none; }
  .site-footer .shell { display: block; }
  .site-footer p + p { margin-top: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* narrow screens: wordmark on its own row, nav on one line */
@media (max-width: 720px) {
  .masthead-inner { flex-direction: column; align-items: flex-start; gap: .35rem; padding: .9rem 0 .5rem; }
  .masthead nav { width: 100%; }
  .masthead .nav-list { flex-wrap: nowrap; justify-content: flex-start; gap: 0 1.05rem; padding-top: 0; }
  .masthead .nav-list a { min-height: 2rem; white-space: nowrap; }
}
@media (max-width: 400px) {
  .masthead .nav-list { gap: 0 .8rem; }
  .masthead .nav-list a { letter-spacing: .07em; }
}

/* theme switch, last item in the nav; hidden until the <head> script adds .theme-js */
.nav-list .nav-theme { display: none; }
.theme-js .nav-list .nav-theme { display: flex; align-items: center; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; margin: 0 -.5rem 0 -.35rem; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.theme-toggle:hover { color: var(--teal); }
.theme-toggle:focus-visible { outline: 3px solid var(--rust); outline-offset: 1px; }
.theme-toggle svg { display: block; width: 1.05rem; height: 1.05rem; }
@media (max-width: 720px) {
  .theme-toggle { width: 2rem; height: 2rem; margin: 0 -.4rem 0 -.3rem; }
  .theme-toggle svg { width: .95rem; height: .95rem; }
}
