/* Document pages: project write-ups, journals, notes. Shares the frame and header with style.css.
   Blocks: .title (+ optional .meta strip), .block (margin label + content), .fig, .pair, .facts,
   .pipeline, .entry. See docs/design.md. */

.top nav a[aria-current="page"] { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* title block: kicker, title, dek. Always these three, nothing else. */
.title { padding-block: 34px 30px; border-bottom: 1px solid var(--rule); display: grid; gap: 12px; }
.kicker { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.title h1 { margin: 0; font-family: var(--body); font-weight: 500; font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.1; letter-spacing: -0.01em; max-width: 24ch; text-wrap: balance; }
.dek { margin: 2px 0 0; font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.45; max-width: 60ch; }

/* optional meta strip: only the cells that apply, never an empty one */
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-bottom: 1px solid var(--rule); padding-inline: 0; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; }
.meta > div { padding: 12px 14px; border-right: 1px solid var(--rule); border-top: 1px solid var(--rule); margin-top: -1px; display: grid; gap: 2px; min-width: 0; }
.meta > div:first-child { padding-left: var(--pad); }
.meta > div:last-child { border-right: 0; }
.meta small { color: var(--ink-2); font-size: 0.66rem; letter-spacing: 0.08em; }
.meta a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.meta a:hover { border-bottom-color: var(--ink); }

/* body: a margin column for labels and dates, a reading column, room on the right */
.body { display: grid; grid-template-columns: 170px minmax(0, 1fr); column-gap: 36px; padding-block: 4px 40px; }
/* The labels hang in the left margin; the reading column is centred in the frame by leaving the same
   width free on its right (label column + gap) as the labels take on its left. */
.page > .body { padding-right: calc(var(--pad) + 170px + 36px); }
/* The dek runs out to the same right edge as the reading column below it. */
.page:has(> .body) > .title { padding-right: calc(var(--pad) + 170px + 36px); }
.page:has(> .body) > .title .dek { max-width: none; }
.block, .entry { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; padding-block: 30px; border-top: 1px solid var(--rule); }
.body > :first-child { border-top: 0; }
.block > .m, .entry > time { grid-column: 1; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); padding-top: 5px; }
.block > .c, .entry > .c { grid-column: 2; min-width: 0; }


/* prose */
.c p { margin: 0 0 1em; font-size: 1.02rem; line-height: 1.6; }
/* Body text is set flush on both edges; hyphenation keeps the word gaps even, most of all on phones. */
.c p, .c li { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.c p:last-child { margin-bottom: 0; }
.c h3 { margin: 1.6em 0 0.4em; font-size: 1.05rem; font-weight: 500; }
.c h3:first-child { margin-top: 0; }
.c a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.c a:hover { border-bottom-color: var(--ink); }
.c .tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-left: 8px; }
.c ul { padding-left: 1.2em; margin: 0 0 1em; }
.c li { margin-bottom: 0.3em; }

/* figures: a frame, a slot, a title-block caption */
.fig { margin: 0; border: 1px solid var(--rule); display: grid; }
.fig .ph { aspect-ratio: 16 / 9; max-width: 100%; display: grid; place-items: center; background: repeating-linear-gradient(135deg, transparent 0 12px, var(--bg-2) 12px 13px); }
.fig .ph.tall { aspect-ratio: 4 / 3; }
.fig .ph span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); background: var(--bg); border: 1px dashed var(--rule); padding: 6px 10px; }
.fig img, .fig video { display: block; width: 100%; height: auto; }
.fig figcaption { display: flex; gap: 14px; align-items: baseline; border-top: 1px solid var(--rule); padding: 10px 14px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.fig figcaption b { color: var(--ink-2); font-weight: 400; white-space: nowrap; }
.fig figcaption > span:nth-child(3) { margin-left: auto; color: var(--ink-2); white-space: nowrap; }
.c > .fig, .c > .pair, .c > .facts, .c > .pipeline { margin-top: 20px; }
.c > .fig:first-child, .c > .pair:first-child, .c > .facts:first-child, .c > .pipeline:first-child { margin-top: 0; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
/* .pair.level: two images of different shapes at one height. Each column is as wide as its image's
   aspect ratio (--l, --r as width/height in fr), so the images meet the same baseline; the frames
   stretch to match and the caption takes up any slack. */
.pair.level { grid-template-columns: minmax(0, var(--l)) minmax(0, var(--r)); align-items: stretch; }
.pair.level > .fig { grid-template-rows: auto 1fr; }
/* prose that follows a figure gets the same gap a figure gets from the prose before it */
.c > .fig + p, .c > .pair + p, .c > .facts + p, .c > .pipeline + p, .c > .code + p, .c > .tbl + p { margin-top: 20px; }

/* a row of facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--rule); }
.facts > div { padding: 12px 14px; border-right: 1px solid var(--rule); border-top: 1px solid var(--rule); margin-top: -1px; display: grid; gap: 4px; min-width: 0; }
.facts > div:last-child { border-right: 0; }
.facts small { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.facts b { font-weight: 500; font-size: 1.15rem; line-height: 1.2; }

/* the toolchain */
/* any number of stages: one row on wide screens, a column with down arrows under 900 px */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--rule); }
.pipeline > div { position: relative; padding: 12px 14px 14px; border-right: 1px solid var(--rule); display: grid; gap: 4px; align-content: start; min-width: 0; }
.pipeline > div:last-child { border-right: 0; }
.pipeline > div + div::before { content: "\2192"; position: absolute; left: -7px; top: 10px; background: var(--bg); color: var(--ink-2); font-family: var(--mono); font-size: 0.8rem; line-height: 1; padding: 2px 1px; }
.pipeline small { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.pipeline small.mine { color: var(--ink); }
.pipeline b { font-weight: 500; font-size: 0.95rem; line-height: 1.25; }
.pipeline p { margin: 2px 0 0; font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); }

/* dated entries */
.entry { padding-block: 22px; }
.entry h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 500; }

@media (max-width: 900px) {
  .pair, .pair.level { grid-template-columns: 1fr; }
  .pipeline { grid-auto-flow: row; grid-template-columns: 1fr; }
  .pipeline > div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .pipeline > div:last-child { border-bottom: 0; }
  .pipeline > div + div::before { content: "\2193"; left: 14px; top: -9px; }
}
@media (max-width: 720px) {
  .body { grid-template-columns: 1fr; column-gap: 0; }
  .page > .body, .page:has(> .body) > .title { padding-right: var(--pad); }
  .block, .entry { grid-template-columns: 1fr; padding-block: 24px; }
  .block > .m, .entry > time { grid-column: 1; padding-top: 0; margin-bottom: 10px; }
  .block > .c, .entry > .c { grid-column: 1; }
}
@media (max-width: 560px) {
  .meta { grid-template-columns: 1fr 1fr; }
  .meta > div:nth-child(2n) { border-right: 0; }
  .meta > div:nth-child(2n + 1) { padding-left: var(--pad); }
}

/* kicker as a path: ancestors are links, then the date */
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { color: var(--ink); text-decoration: underline; }
.kicker .sep { margin: 0 8px; color: var(--rule); }

/* folder view: tiles, each a link to a child */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-block: 28px 40px; }
.tile { border: 1px solid var(--rule); display: grid; text-decoration: none; color: inherit; transition: border-color .15s; min-width: 0; }
.tile:hover { border-color: var(--ink); }
.tile .img { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--bg); }
.tile .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .cap { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--rule); }
.tile .cap > div { padding: 10px 14px; border-right: 1px solid var(--rule); display: grid; gap: 2px; min-width: 0; }
.tile .cap > div:last-child { border-right: 0; align-self: center; color: var(--ink-2); }
.tile .cap small { color: var(--ink-2); font-size: 0.64rem; letter-spacing: 0.08em; }
.tile .cap .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile p { margin: 0; padding: 14px 14px 16px; font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); }
.tile:hover .cap > div:last-child { color: var(--ink); }
/* a text-only tile: no image, the caption strip is the header */
.tiles.small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 20px; }
.tiles.small .tile .cap { grid-template-columns: 1fr auto; }
.tiles.small .tile .cap .v { white-space: normal; }
.tiles.small .tile p { font-size: 0.9rem; }
/* a labelled row inside a folder page, e.g. "Also built" */
.folder-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-block: 18px 0; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.folder-head span { color: var(--ink-2); }

/* contents: a document's children */
.contents { border: 1px solid var(--rule); }
.contents a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.contents a:last-child { border-bottom: 0; }
.contents a:hover { background: var(--bg-2); }
.contents b { font-weight: 500; }
.contents small, .contents .arr { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.contents a:hover .arr { color: var(--ink); }

/* pager: up to the parent, previous and next siblings */
.pager { display: flex; justify-content: space-between; gap: 16px; padding-block: 16px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.pager a { text-decoration: none; color: var(--ink); }
.pager a:hover { text-decoration: underline; }
.pager .right { margin-left: auto; display: flex; gap: 20px; }

@media (max-width: 900px) { .tiles { grid-template-columns: 1fr; } .tiles.small { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .tiles.small { grid-template-columns: 1fr; }
  .tile .cap { grid-template-columns: 1fr 1fr auto; }
  .tile .cap > div:nth-child(3) { display: none; }
  .tile .cap .v { white-space: normal; }
  .folder-head span { display: none; }
}

/* folder view for dated text children (build logs, notes): year rows, one linked row per entry */
.list { display: grid; grid-template-columns: 170px minmax(0, 1fr); column-gap: 36px; padding-block: 4px 40px; }
.list .year { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; padding-block: 24px 4px; border-top: 1px solid var(--ink-2); }
.list .year:first-child { border-top: 0; }
.list .year b, .list .year span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400; }
.list .year b { grid-column: 1; }
.list .year span { grid-column: 2; color: var(--ink-2); }
.list .row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; padding-block: 18px; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.list .year + .row { border-top: 0; }
.list .row time { grid-column: 1; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 4px; }
.list .row .c { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; column-gap: 24px; row-gap: 4px; align-items: start; }
.list .row h2 { grid-column: 1; margin: 0; font-size: 1.1rem; font-weight: 500; line-height: 1.3; }
.list .row:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.list .row p { grid-column: 1; margin: 0; color: var(--ink-2); font-size: 0.95rem; line-height: 1.5; max-width: 68ch; }
.list .row .side { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 18px; }
.list .row .th { width: 132px; aspect-ratio: 4 / 3; border: 1px solid var(--rule); background: repeating-linear-gradient(135deg, transparent 0 9px, var(--bg-2) 9px 10px); display: grid; place-items: center; }
.list .row .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.list .row .th span { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); background: var(--bg); padding: 3px 6px; border: 1px dashed var(--rule); }
.list .row .arr { font-family: var(--mono); color: var(--ink-2); }
.list .row:hover .arr { color: var(--ink); }
@media (max-width: 720px) {
  .list { grid-template-columns: 1fr; column-gap: 0; }
  .list .year, .list .row { grid-template-columns: 1fr; }
  .list .year b, .list .year span, .list .row time, .list .row .c { grid-column: 1; }
  .list .year span { display: none; }
  .list .row time { padding-top: 0; margin-bottom: 6px; }
  .list .row .side { grid-column: 1; grid-row: auto; margin-top: 10px; }
  .list .row .arr { display: none; }
  .list .row .side:not(:has(.th)) { display: none; }
}

/* focus on block-level links stays inside their border */
.tile:focus-visible, .list .row:focus-visible, .gal .row:focus-visible, .contents a:focus-visible { outline-offset: -2px; }

/* gallery: the dated list with one image per row (model, tool, what was new) */
.gal { display: grid; grid-template-columns: 170px minmax(0, 1fr); column-gap: 36px; padding-block: 4px 40px; }
.gal .year { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; padding-block: 24px 4px; border-top: 1px solid var(--ink-2); }
.gal .year:first-child { border-top: 0; }
.gal .year b, .gal .year span { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400; }
.gal .year b { grid-column: 1; }
.gal .year span { grid-column: 2; color: var(--ink-2); }
.gal .row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; padding-block: 20px; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.gal .year + .row { border-top: 0; }
.gal .row time { grid-column: 1; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 4px; }
.gal .row .c { grid-column: 2; display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; column-gap: 24px; row-gap: 4px; align-items: start; }
.gal .row .img { grid-column: 1; grid-row: 1 / span 3; aspect-ratio: 4 / 3; max-width: 100%; border: 1px solid var(--rule); overflow: hidden; display: grid; place-items: center; background: repeating-linear-gradient(135deg, transparent 0 10px, var(--bg-2) 10px 11px); }
.gal .row .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal .row .img span { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); background: var(--bg); padding: 4px 8px; border: 1px dashed var(--rule); }
.gal .row h2 { grid-column: 2; margin: 0; font-size: 1.1rem; font-weight: 500; line-height: 1.3; }
.gal .row .tool { grid-column: 2; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.gal .row p { grid-column: 2; margin: 2px 0 0; color: var(--ink); font-size: 0.95rem; line-height: 1.5; max-width: 52ch; }
.gal .row p small { display: block; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px; }
.gal .row .arr { grid-column: 3; grid-row: 1 / span 3; align-self: center; font-family: var(--mono); color: var(--ink-2); }
.gal a.row:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gal a.row:hover .arr { color: var(--ink); }

/* definition list: term column, definitions beside */
.dl { display: grid; grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr); border: 1px solid var(--rule); margin: 0; }
.dl dt, .dl dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--rule); min-width: 0; }
.dl dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); border-right: 1px solid var(--rule); padding-top: 13px; }
.dl dd { font-size: 0.95rem; line-height: 1.5; }
.dl dt:nth-last-child(2), .dl dd:last-child { border-bottom: 0; }

/* table: mono headers, hairlines, scrolls sideways on its own if wide */
.tbl { margin: 0; border: 1px solid var(--rule); }
.tbl .scroll { overflow-x: auto; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.tbl th { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-weight: 400; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; line-height: 1.45; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl figcaption, .code figcaption { display: flex; gap: 14px; align-items: baseline; border-top: 1px solid var(--rule); padding: 10px 14px; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.tbl figcaption b, .code figcaption b { color: var(--ink-2); font-weight: 400; white-space: nowrap; }

/* code: the mono face, a frame, a caption like a figure */
.code { margin: 0; border: 1px solid var(--rule); }
/* side by side, code blocks match heights: the shorter one's code area grows, its caption stays at the foot */
.pair > .code { align-self: stretch; display: flex; flex-direction: column; min-width: 0; }
.pair > .code pre { flex: 1; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 0.8rem; line-height: 1.55; tab-size: 2; }
.code code { font-family: inherit; }
.c code { font-family: var(--mono); font-size: 0.86em; background: var(--bg-2); padding: 1px 5px; border-radius: 2px; }
.code code, .code pre code { background: none; padding: 0; }

/* aside: a note in the margin column, under the block label */
.block > .c { grid-row: 1 / span 2; }
.block > aside { grid-column: 1; grid-row: 2; margin: 14px 0 0; padding-right: 12px; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em; line-height: 1.6; color: var(--ink-2); text-transform: none; }
.block > aside b { color: var(--ink); font-weight: 400; }
.block > aside p { margin: 0 0 0.6em; font: inherit; }
.block > aside p:last-child { margin-bottom: 0; }

/* video in a figure */
.fig video { display: block; width: 100%; height: auto; background: var(--bg); }

/* YouTube in a figure (js/site.js): a poster and a play button until clicked, then the player. */
.fig.yt .play, .fig.yt iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; margin: 0; padding: 0; }
.fig.yt .play { position: relative; background: var(--bg-2); cursor: pointer; overflow: hidden; }
.fig.yt .play img { width: 100%; height: 100%; object-fit: cover; }
.fig.yt .play .icon { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); background: var(--bg); border: 1.5px solid var(--ink); }
.fig.yt .play .icon::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent var(--ink); }
.fig.yt .play:hover .icon, .fig.yt .play:focus-visible .icon { background: var(--ink); }
.fig.yt .play:hover .icon::after, .fig.yt .play:focus-visible .icon::after { border-left-color: var(--bg); }
.fig.yt .play:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; }
.fig.yt .play .via { position: absolute; left: 10px; bottom: 10px; background: var(--bg); padding: 4px 8px; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }

/* enlarge: a figure opened full-window, on the same paper, in the same frame */
.fig[data-enlarge] img, .fig[data-enlarge] video { cursor: zoom-in; }
.fig .zoom { margin-left: auto; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.fig .zoom:hover { color: var(--ink); text-decoration: underline; }
.fig figcaption > span:nth-child(3) ~ .zoom { margin-left: 14px; }
dialog.enlarge { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: var(--bg-2); color: var(--ink); }
dialog.enlarge::backdrop { background: var(--bg-2); }
.enlarge .frame { position: absolute; inset: clamp(12px, 2.5vw, 28px); border: 1px solid var(--ink); background: var(--bg); display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.enlarge .view { position: relative; display: grid; place-items: center; overflow: hidden; padding: clamp(20px, 3vw, 40px); }
.enlarge .view img, .enlarge .view video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.enlarge .cap { display: flex; gap: 14px; align-items: baseline; border-top: 1px solid var(--rule); padding: 12px var(--pad); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.enlarge .cap b { color: var(--ink-2); font-weight: 400; }
.enlarge .close { margin-left: auto; font: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 1px solid var(--rule); color: var(--ink); padding: 6px 10px; border-radius: 2px; cursor: pointer; }
.enlarge .close:hover { border-color: var(--ink); }

@media (max-width: 720px) {
  .gal { grid-template-columns: 1fr; column-gap: 0; }
  .gal .year, .gal .row { grid-template-columns: 1fr; }
  .gal .year b, .gal .row time, .gal .row .c { grid-column: 1; }
  .gal .year span { display: none; }
  .gal .row time { padding-top: 0; margin-bottom: 8px; }
  .gal .row .c { grid-template-columns: 1fr; grid-template-rows: auto; }
  .gal .row .img { grid-column: 1; grid-row: auto; margin-bottom: 8px; }
  .gal .row h2, .gal .row .tool, .gal .row p { grid-column: 1; }
  .gal .row .arr { display: none; }
  .block > .c { grid-row: auto; }
  .block > aside { grid-row: auto; margin-top: 12px; padding-right: 0; }
  .dl { grid-template-columns: 1fr; }
  .dl dt { border-right: 0; border-bottom: 0; padding-bottom: 0; }
}

/* section viewer (js/section-viewer.js): a top view that is also the slider, the section drawn as a
   cut with the wall shaded, two details, and a readout. Ink and rule only; the wall is the one fill. */
.viewer .plan { position: relative; padding: 14px 16px 6px; border-bottom: 1px solid var(--rule); }
.viewer .plan svg { display: block; width: 100%; height: auto; overflow: visible; }
/* the slider: a hairline track from root to tip and a square handle, in ink. The input is
   widened by half a handle each side so the handle's centre reaches the root and tip lines. */
.viewer .slide { position: relative; height: 28px; margin-inline: calc(var(--inset) - 7px); }
.viewer .slide input { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 0; background: none; cursor: pointer; }
.viewer .slide input::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right, transparent 7px, var(--ink-2) 7px, var(--ink-2) calc(100% - 7px), transparent calc(100% - 7px)); }
.viewer .slide input::-moz-range-track { height: 1px; background: linear-gradient(to right, transparent 7px, var(--ink-2) 7px, var(--ink-2) calc(100% - 7px), transparent calc(100% - 7px)); }
.viewer .slide input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6.5px; background: var(--bg); border: 1.5px solid var(--ink); border-radius: 0; }
.viewer .slide input::-moz-range-thumb { width: 11px; height: 11px; background: var(--bg); border: 1.5px solid var(--ink); border-radius: 0; }
.viewer .slide input:hover::-webkit-slider-thumb, .viewer .slide input:active::-webkit-slider-thumb { background: var(--ink); }
.viewer .slide input:hover::-moz-range-thumb, .viewer .slide input:active::-moz-range-thumb { background: var(--ink); }
.viewer .slide input:focus { outline: none; }
.viewer .slide input:focus-visible::-webkit-slider-thumb { outline: 1px solid var(--ink); outline-offset: 3px; }
.viewer .slide input:focus-visible::-moz-range-thumb { outline: 1px solid var(--ink); outline-offset: 3px; }
.viewer .plan .ends { display: flex; justify-content: space-between; padding-top: 0; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.viewer .skin { fill: var(--bg-2); stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viewer .rib { stroke: var(--ink-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viewer .mark { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.viewer .sec { padding: 18px 16px; }
.viewer .sec svg, .viewer .detail svg { display: block; width: 100%; height: auto; }
.viewer .wall { fill: var(--ink); fill-opacity: 0.14; stroke: none; }
.viewer .out { fill: none; stroke: var(--ink); stroke-width: 1.25; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.viewer .in { fill: none; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.viewer .box { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.viewer .sec .draw { position: relative; }
.viewer .sec .tag { position: absolute; margin: 0; white-space: nowrap; transform: translateY(-100%); background: var(--bg); padding-bottom: 3px; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); line-height: 1; pointer-events: none; }
.viewer .sec .tag.end { transform: translate(-100%, -100%); }
.viewer .details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.viewer .detail { padding: 10px 16px 16px; min-width: 0; }
.viewer .detail + .detail { border-left: 1px solid var(--rule); }
.viewer .detail svg { aspect-ratio: 2.4; }
.viewer .lbl { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.viewer .read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; }
.viewer .read > div { padding: 10px 14px; display: grid; gap: 2px; min-width: 0; align-content: start; }
.viewer .read > div + div { border-left: 1px solid var(--rule); }
.viewer .read small { color: var(--ink-2); font-size: 0.62rem; letter-spacing: 0.08em; }
.viewer .dot path { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.viewer .dot .ring { stroke: var(--ink); stroke-width: 9; }
.viewer .dot .core { stroke: var(--ink); stroke-width: 9; }
.viewer .dot.hi .core { stroke: var(--bg); stroke-width: 5.5; }
.viewer .read .note { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.viewer .read .key { display: inline-flex; align-items: center; gap: 6px; }
.viewer .read .key svg { width: 9px; height: 9px; overflow: visible; }
.viewer .read .key circle.lo { fill: var(--ink); stroke: var(--ink); stroke-width: 1.5; }
.viewer .read .key circle.hi { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.viewer .read.dist { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); }
.viewer .histbox { position: relative; margin: 6px 0 16px; }
.viewer .hist { display: block; width: 100%; height: 34px; }
.viewer .hist .bar { fill: var(--ink); }
.viewer .hist .band { fill: var(--ink); fill-opacity: 0.08; }
.viewer .hist .nom { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.viewer .histbox .axis { position: absolute; left: 0; right: 0; top: 100%; height: 0; }
.viewer .histbox .axis span { position: absolute; top: 3px; transform: translateX(-50%); font-size: 0.58rem; color: var(--ink-2); letter-spacing: 0.04em; }
.viewer .read .note { text-transform: none; letter-spacing: 0.02em; }
@media (max-width: 560px) {
  .viewer .details { grid-template-columns: 1fr; }
  .viewer .detail + .detail { border-left: 0; border-top: 1px solid var(--rule); }
  .viewer .read, .viewer .read.dist { grid-template-columns: 1fr 1fr; }
  .viewer .read > div:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); }
  .viewer .sec .tag { display: none; } /* too big for the drawing here; the details below carry the names */
}
