/* Homepage: one pixel building a day (see README 2.4). */
/* Layout: the first screen is one pixel building with its caption, past-year thumbnails and a
   `whereis` line right under it. Scrolling up shrinks the building and the page continues as a
   terminal (ls notes/, ls works/). Colours follow the real sun over the current city (default Taipei). */
@font-face { font-family: "iA Writer Quattro"; src: url("../fonts/quattro/iAWriterQuattroS-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "iA Writer Quattro"; src: url("../fonts/quattro/iAWriterQuattroS-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  --bg: #f8f8f5;
  --ink: #262421;
  --ink-soft: #6f6a62;
  --rule: rgba(38, 36, 33, .14);
  --accent: #b5531e;
  --sheet: #ffffff;
  --mono: "JetBrains Mono", "Noto Sans TC", ui-monospace, monospace;
  /* English in iA Writer Quattro (as in the notes), Chinese falls through to Noto Sans TC.
     Both come in 400 and 700 only, so a weight looks the same in either language. */
  --sans: "iA Writer Quattro", "Noto Sans TC", system-ui, sans-serif;
  --p: 0;
  --shrink: 38svh;
  /* One way to press, on the whole site, taken from the terminal's own selection (.ls .lit): what you can press is
     words in the terminal's font, with no box. Pointing at it lays a faint ink block behind it (--press-soft); pressing
     it turns it over, ink ground and sky-coloured words, square corners. Ink is the one colour sky.js keeps readable
     on every sky, so nothing here is tuned per time of day. What you only read (the time) has no box either. */
  --press-soft: color-mix(in srgb, var(--ink) 7%, transparent);
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 var(--mono);
  transition: background-color 1.2s ease, color 1.2s ease;
  -webkit-tap-highlight-color: transparent;
  /* a thin space between Chinese and English or numbers, where the browser supports it */
  text-autospace: ideograph-alpha ideograph-numeric;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.hero-inner { padding-top: calc(var(--card-top) + 64px); }
/* The top: one line, like a terminal's title bar, across the reading column (680px): the way back on the left (a work
   or a note), the time in the middle, the way forward on the right (Timeline / Today on the home page, Home on a work
   or a note). site.css has the same for a note opened from a link. Under it a band of the sky's own colour, fading
   out, so what scrolls under the line never runs into it.
   The time's two lines take the same two sizes on every page (site.css has the same): --card-title on top (the time,
   or in the timeline the date), --card-sub under it (Today, or in the timeline the weekday and how long ago).
   Phones: 12px from the top. Wide screens: lower, by the screen's height (9%, 28–96px), so the page sits towards the
   middle instead of hugging the top edge. */
.top {
  position: fixed; z-index: 7; top: 0; left: 0; right: 0;
  padding-top: var(--card-top); padding-bottom: 18px;
  background: linear-gradient(var(--bg) calc(100% - 18px), color-mix(in srgb, var(--bg) 0%, transparent));
  transition: background .3s ease;
}
/* Over the sky (the top of the home page) the card is on the zenith: no band (nothing has scrolled under it yet) and
   the words in the zenith's colours (sky.js paintSky). Scrolled down to the ground, or with the timeline, a work or a
   note open, it is the page's own card again (day.js updateMore: .on-ground). */
.top:not(.on-ground) { --ink: var(--sky-ink); --ink-soft: var(--sky-faint); --accent: var(--sky-accent); background: none; color: var(--ink); }
/* The sky: from the zenith at the top of the page to the horizon behind the building's base, then --sky-fade into the
   ground (the page colour), eased so the horizon glows into the ground and leaves no line (day.js SKY_FADE). Placed by day.js placeSky; the stars come out after dusk (--stars, sky.js). */
.sky { position: absolute; z-index: 0; top: 0; left: 0; right: 0; height: var(--horizon, 60svh); pointer-events: none;
  background: linear-gradient(var(--sky-top) 0, var(--sky-top) 4%,
    var(--sky-mid) calc((100% - var(--sky-fade, 128px)) * .55), var(--sky-horizon) calc(100% - var(--sky-fade, 128px)),
    color-mix(in oklab, var(--sky-horizon), var(--sky-low)) calc(100% - var(--sky-fade, 128px) * .78),
    var(--sky-low) calc(100% - var(--sky-fade, 128px) * .52),
    color-mix(in oklab, var(--sky-low) 38%, var(--bg)) calc(100% - var(--sky-fade, 128px) * .24), var(--bg));
 }
/* a gradient does not fade by itself: its colours do (registered, so they can move), as fast as the page's own */
@property --sky-top { syntax: '<color>'; inherits: true; initial-value: #b1cde6; }
@property --sky-horizon { syntax: '<color>'; inherits: true; initial-value: #f6f5ee; }
/* between them, kept as colourful as its two ends (sky.js between): the middle of the sky, and of the glow under the horizon */
@property --sky-mid { syntax: '<color>'; inherits: true; initial-value: #d3e1ea; }
@property --sky-low { syntax: '<color>'; inherits: true; initial-value: #f7f6f0; }
:root { transition: --sky-top 1.2s ease, --sky-horizon 1.2s ease, --sky-mid 1.2s ease, --sky-low 1.2s ease; }
:root:has(body.rewinding) { transition-duration: .12s; }
.sky .stars { position: absolute; left: 0; top: 0; opacity: var(--stars, 0); transition: opacity 1.2s ease; image-rendering: pixelated; }
.hero { position: relative; }
.hero-inner { position: relative; z-index: 1; }
.soft { color: var(--ink-soft); }
:root { --card-w: min(360px, calc(100vw - 32px)); --card-top: calc(12px + env(safe-area-inset-top, 0px));
  --card-title: 15px; --card-sub: 12px; }
@media (min-width: 900px) { :root { --card-top: clamp(28px, 9svh, 96px); } }
/* the line is kept short (at most 440px, centred), so on a wide screen the buttons stay close to the time and read as
   one group with it; on a phone it takes the width, 20px inside like the text of a work and a note. The pressed block
   reaches 10px past the words, as on a list row */
.top { padding-left: 0; padding-right: 0; }
.top-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; max-width: 440px; height: 50px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left, 0px)) 0 max(20px, env(safe-area-inset-right, 0px)); }
.when { grid-column: 2; grid-row: 1; }
.when .txt { display: grid; line-height: 1.3; text-align: center; }
.when b { font: 500 var(--card-title)/1.35 var(--mono); letter-spacing: .02em; white-space: nowrap; }
.when .txt > span { color: var(--ink-soft); white-space: nowrap; font-size: var(--card-sub); }
.back-btn { grid-column: 1; grid-row: 1; justify-self: start; margin-left: -10px; }
#tlBtn, .home-btn { grid-column: 3; grid-row: 1; justify-self: end; margin-right: -10px; }
/* a button: words (or an icon) in the terminal's font, no box until you point at it */
.top-btn, .cmdbar button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  height: 34px; padding: 0 10px; border: 0; border-radius: 0; background: transparent;
  color: var(--ink); font: 500 13px/1 var(--mono); white-space: nowrap;
  transition: background-color .12s ease, color .12s ease;
}
/* the faint block only where a pointer can point: on a phone a tapped button would keep it after the tap */
@media (hover: hover) { .top-btn:hover, .cmdbar button:hover { background: var(--press-soft); } }
.top-btn:active, .cmdbar button:active { background: var(--ink); color: var(--bg); transition: none; }
/* the keyboard's mark: the accent ring, square like the button (site.css .post-btn: the same) */
.top-btn:focus-visible, .cmdbar button:focus-visible { border-radius: 0; }
.top-btn svg { width: 12px; height: 12px; flex: none; }
.home-btn svg { width: 15px; height: 15px; }
#date, #clock { transition: color .3s ease; }
/* the time and the date (#date), and the two lines under them (#clock), lie on top of each other and cross-fade (day.js dialTo);
   the one going out also goes soft (a little blur), so for the moment the two overlap they never read as a jumble */
#date, #clock { display: grid; justify-items: center; }
.when .face { grid-area: 1 / 1; opacity: 0; filter: blur(3px); transition: opacity .35s ease, filter .35s ease; }
.when .face.on { opacity: 1; filter: none; }
@media (prefers-reduced-motion: reduce) { .when .face { transition: none; } }
/* the timeline on a past day: the date and its line in the accent, the same colour as the line above a past building */
.when.is-past-day b, .when.is-past-day .txt > span { color: var(--accent); }
/* the colour change fades on the date and the line only; the digit strips inside keep their own roll
   (.dial .strip, .roll .rs) and take the colour from them */
.when .txt b span { color: inherit; font-size: inherit; }
/* the live time in the date card: HH:MM:SS, each digit rolls (sky.js rollClock) */
.roll { display: inline-flex; font-variant-numeric: tabular-nums; vertical-align: bottom; }
.roll .rg { display: inline-block; height: 1.35em; line-height: 1.35em; overflow: hidden; }
.roll .rs { display: grid; transition: transform .42s cubic-bezier(.25, .9, .3, 1); }
.roll .rs span, .roll > span { height: 1.35em; line-height: 1.35em; }
.roll .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .roll .rs { transition: none !important; } }
/* the rewind (day.js "rewind"): on today's home page the time can be dragged back through today. A pointer gets the
   sideways cursor; until the first rewind a faint ‹ beside the time says it moves. Rewound, the time is in the accent,
   as a past day is in the timeline. Under the card while it moves: the day's track (day.js DL), today's own sky from
   00:00 to 24:00 (the hours still to come veiled), a cursor in the accent, and the day's four moments to tap. Left
   rewound it folds to a thin strip (.mini), the trace that the page is not at now. */
.when { position: relative; }
.when[tabindex="0"] { cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
/* a long press on the building or the time is the rewind's: no callout (iOS) */
.stage, .when { -webkit-touch-callout: none; }
.when[tabindex="0"]:focus-visible { outline-offset: 4px; border-radius: 0; }
.when.hint[tabindex="0"]:not(.is-rewound)::before { content: '‹'; position: absolute; left: -16px; top: 0; font: 500 var(--card-title)/1.35 var(--mono); color: var(--ink-soft); opacity: .7; }
.when.is-rewound b, .when.is-rewound .txt > span { color: var(--accent); }
body.rewinding { transition-duration: .12s; }
.dayline { position: absolute; left: 50%; top: calc(var(--card-top) + 50px); transform: translate(-50%, -4px);
  display: grid; justify-items: center; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
.dayline.on, .dayline.mini { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition: opacity .16s ease, transform .16s ease; }
/* scrolled to the ground, or with something open over the page, it steps aside with the sky */
.top.on-ground .dayline { opacity: 0; visibility: hidden; pointer-events: none; }
/* the track: its padding is for the finger; folded, only its last rows show (the sky band and the cursor's head) */
.dl-track { padding: 8px 0; cursor: ew-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.dayline.mini .dl-track { cursor: pointer; }
.dl-clip { position: relative; overflow: hidden; width: calc(144 * var(--dl, 2px)); height: calc(var(--dl-h) * var(--dl, 2px)); transition: height .28s cubic-bezier(.3, .8, .3, 1); }
.dayline.mini .dl-clip { height: calc(var(--dl-mini) * var(--dl, 2px)); }
.dl-clip canvas { position: absolute; left: 0; bottom: 0; display: block; width: 100%; height: calc(var(--dl-h) * var(--dl, 2px)); image-rendering: pixelated; }
/* the day's moments: the site's one button, small; the one the time is on in the accent, those still to come off */
.dl-marks { display: flex; justify-content: space-between; width: calc(144 * var(--dl, 2px) + 16px); max-height: 30px; overflow: hidden; transition: max-height .28s cubic-bezier(.3, .8, .3, 1), opacity .2s ease; }
.dayline.mini .dl-marks { max-height: 0; opacity: 0; visibility: hidden; }
.dl-m { height: 26px; padding: 0 8px; border: 0; border-radius: 0; background: transparent; color: var(--ink-soft); font: 500 11px/1 var(--mono); letter-spacing: .02em; white-space: nowrap; }
@media (hover: hover) { .dl-m:not(:disabled):hover { background: var(--press-soft); color: var(--ink); } }
.dl-m:not(:disabled):active { background: var(--ink); color: var(--bg); }
.dl-m.at { color: var(--accent); }
.dl-m:disabled { opacity: .38; }
/* Now (the rewind's way back) has its own mark, not Today's calendar */
#tlBtn .i-now, #tlBtn.now .i-cal { display: none; }
#tlBtn.now .i-now { display: block; }
@media (prefers-reduced-motion: reduce) { .dayline, .dayline.on, .dayline.mini, .dl-clip, .dl-marks { transition: none; } }

.group { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.stage {
  position: relative; display: grid; place-items: end center; flex: none; cursor: pointer;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  transform-origin: 50% 100%; transform: scale(calc(1 - var(--p) * .35));
}
.stage canvas { image-rendering: pixelated; display: block; transition: transform .2s ease, opacity .2s ease; }
/* the picture is larger than the stage when the shadow is long: it spills over the page, never cut at its own edge.
   It takes no taps (the stage does), and the words sit above it. */
.stage canvas { pointer-events: none; }
/* the platform under the building (day.js placePlate): behind it, placed by script on the same pixel grid */
.stage .plate { position: absolute; z-index: 0; }
.stage .plate[hidden] { display: none; }
.stage canvas.bld { position: relative; z-index: 1; }
.tools, .caption { position: relative; z-index: 1; }
/* the first screen is the building and its words only; the terminal starts below it (the buttons are enough to start) */
.hero { overflow-x: clip; min-height: 100svh; box-sizing: border-box; }
.stage canvas.out { transform: scale(.62); opacity: 0; }
.stage canvas.in { transform: scale(.62); opacity: 0; transition: none; }
.stage canvas.turn-out { transform: scaleX(.08); opacity: .4; }
.stage canvas.turn-in { transform: scaleX(.08); opacity: .4; transition: none; }

.tools { display: flex; align-items: center; justify-content: center; gap: 10px; height: 92px; flex: none; }
/* most days have no other years: then the row folds away so the words sit right under the building */
.tools:has(.thumbs.none) { height: 0; }
.thumbs { display: flex; gap: 6px; }
.thumbs.none { display: none; }
.thumb { display: grid; justify-items: center; gap: 2px; padding: 2px 4px; color: var(--ink-soft); }
.thumb canvas { width: 60px; height: 54px; display: block; }
.thumb span { font-size: 12px; letter-spacing: .04em; }
.thumb[aria-current="true"] { color: var(--ink); }
.thumb[aria-current="true"] span { border-bottom: 1.5px solid var(--accent); }
.thumb:not([aria-current="true"]) canvas { opacity: .72; }

/* padding-top: room for the platform's front corner under the building (day.js placePlate) */
.caption { text-align: center; display: grid; gap: 4px; max-width: 34em; padding-top: 24px; padding-bottom: 8px; }
/* the title and the words under it in one size (the title only bolder), so the first screen stays quiet */
.caption .name { font: 700 21px/1.5 var(--sans); letter-spacing: .01em; text-wrap: balance; }
.caption .meta { font: 14.5px/1.7 var(--mono); color: var(--ink-soft); }
.caption .meta a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px dotted var(--ink-soft); }
.caption .meta a:hover { color: var(--ink); border-bottom-style: solid; }
.caption .note { font: 21px/1.5 var(--sans); color: var(--ink); text-wrap: pretty; margin-top: 10px; }
.caption .note a { text-decoration: none; border-bottom: 1px dotted var(--ink-soft); }
.caption .note a:hover { border-bottom-style: solid; }

/* terminal: same page, same background — not a card */
.term { position: relative; margin-top: 8svh; padding-block: 12px 30svh; }
/* closed until a button (or `/`) opens it: no input line, no room below, so the first screen does not scroll.
   The bar stays (phones: fixed at the bottom; wide screens: under today's words). day.js openTerm / clearTerm */
.term:not(.on) { margin-top: 0; padding-block: 0; }
.term:not(.on) .log, .term:not(.on) .input-row { display: none; }
.term-inner { max-width: 680px; margin: 0 auto; display: grid; gap: 6px; }
.prompt { color: var(--ink-soft); font: 14px/1.7 var(--mono); }
.prompt i { font-style: normal; color: var(--accent); }
.prompt b { font-weight: 400; color: var(--ink); }
/* the typing cursor, and output that comes in a row at a time (day.js run / reveal) */
.cur { display: inline-block; width: .55em; height: 1.1em; margin-left: 1px; vertical-align: -.2em; background: var(--ink); opacity: .7; animation: cur-blink 1s steps(1) infinite; }
@keyframes cur-blink { 50% { opacity: 0; } }
.result { display: contents; }
.rise { opacity: 0; transform: translateY(6px); transition: opacity .26s ease, transform .26s cubic-bezier(.2, .8, .2, 1); }
.rise.in { opacity: 1; transform: none; }
/* a picked row in a list, the way a terminal marks a selection: the whole row turns over, ink ground and page-coloured
   words, square corners. The block reaches 10px past the text on both sides (box-shadow, so nothing moves).
   .was lets it fade back (coming back to the list, it marks the one you just read). */
.ls .lit { background: var(--ink); box-shadow: -10px 0 0 var(--ink), 10px 0 0 var(--ink); border-bottom-color: transparent; }
.ls .lit .d, .ls .lit .t, .ls .lit .r { color: var(--bg); }
.ls .lit .t { text-decoration: none; }
/* pointing at a row: the same block, faint, so the pick reads as the next step of it */
.ls a:not(.lit):hover, .ls button:not(.lit):hover { background: color-mix(in srgb, var(--ink) 7%, transparent); box-shadow: -10px 0 0 color-mix(in srgb, var(--ink) 7%, transparent), 10px 0 0 color-mix(in srgb, var(--ink) 7%, transparent); }
.ls .was { transition: background-color .9s ease, box-shadow .9s ease; }
.ls .was .d, .ls .was .t, .ls .was .r { transition: color .9s ease; }
/* the timeline open: today's words step aside, and come back only after it has gone */
.hero .caption, .hero .tools { transition: opacity .25s ease; }
body.tl-in .hero .caption, body.tl-in .hero .tools { opacity: 0; transition-duration: .15s; }
/* a path in a prompt you can follow back: ~ home, works/ the list (like a breadcrumb) */
.block { display: grid; gap: 2px; padding-bottom: 18px; }
.log { display: grid; }
.out-line { color: var(--ink); white-space: pre-wrap; font: 14.5px/1.85 var(--mono); }
.out-line.mono { font-size: 14px; }
.out-line.err { color: var(--accent); }
/* cat works/<slug>: label | value, like the lists */
.case { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); column-gap: 14px; row-gap: 6px; margin: 8px 0 4px; font: 14px/1.75 var(--mono); }
.case dt { color: var(--ink-soft); font-size: 13px; }
.case dd { margin: 0; }
.input-row { display: flex; align-items: center; gap: .6ch; }
.input-row input { flex: 1; min-width: 0; font: 14px/1.7 var(--mono); color: var(--ink); background: transparent; border: 0; padding: 4px 0; caret-color: var(--accent); }
.input-row input:focus { outline: none; }
.input-row input::placeholder { color: var(--ink-soft); opacity: .75; }
.cmdbar {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  transition: opacity .25s ease, transform .25s ease;
}
.cmdbar::-webkit-scrollbar { display: none; }
.cmdbar.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.cmdbar .arrow { color: var(--accent); }
/* the bar: the same buttons as at the top, on a band of the sky's own colour that fades out upwards, so what scrolls
   under it never runs into the words (the same as the top) */
.term .cmdbar {
  z-index: 6; padding: 18px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 18px);
}
.term .cmdbar.off { opacity: 0; transform: translateY(100%); pointer-events: none; }
.input-row { scroll-margin-bottom: 90px; transition: opacity .25s ease; }
/* a command typing out (day.js run): the input line and the buttons are hidden until its output is in, then fade back.
   Hidden, not removed, so the page keeps its length and nothing moves. */
body.term-busy .input-row, body.term-busy .cmdbar { opacity: 0; visibility: hidden; pointer-events: none; transition: none; }
/* phones: fixed to the bottom from the first screen */
@media (max-width: 899px) {
  .term .cmdbar { position: fixed; left: 0; right: 0; bottom: 0; padding-inline: max(10px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px)); }
  .cmdbar > :first-child { margin-left: auto; }
  .cmdbar > :last-child { margin-right: auto; }
  .cmdbar { gap: 2px; } .cmdbar button { padding: 0 7px; }
  .hero { padding-bottom: 64px; }
}
/* wide screens: under today's words, then inside the terminal, stuck to the bottom while the log is long */
@media (min-width: 900px) {
  .bar-slot .cmdbar { margin-top: 14px; overflow: visible; flex-wrap: wrap; gap: 4px; }
}
/* notes and works: one list. Date | title, a quieter line under the title, a rule between rows. All in the terminal's font. */
.ls { display: grid; }
.ls a, .ls button { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: baseline;
  width: 100%; padding: 12px 0; border-bottom: 1px solid var(--rule); text-align: left; text-decoration: none; }
.ls > :last-child { border-bottom: 0; }
.ls .d { color: var(--ink-soft); font: 13px/1.7 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ls .t { font: 15px/1.6 var(--mono); color: var(--ink); }
.ls .r { grid-column: 2; font: 13.5px/1.7 var(--mono); color: var(--ink-soft); }
.ls a:not(.lit):hover .t, .ls button:not(.lit):hover .t { text-decoration: underline; text-underline-offset: 3px; }
/* Chinese falls back from the coding font to Noto Sans TC: a touch more air, and no letter-squeezing */
.ls :lang(zh) .t, .ls [lang|="zh"] .t { line-height: 1.7; letter-spacing: .02em; }
.ls [lang|="zh"] .r { letter-spacing: .02em; }
/* phones: the date goes above the title, so the title gets the full width */
@media (max-width: 520px) {
  .ls a, .ls button { grid-template-columns: minmax(0, 1fr); }
  .ls .r { grid-column: 1; }
  .case { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .case dd { margin-bottom: 10px; }
}

/* reading view for a work: a whole article, same look as the notes */
.reader { position: fixed; inset: 0; z-index: 5; background: var(--bg); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; transition: background-color .45s ease; }
.reader.clear { background-color: transparent; }
#tl .tl-cap, #tl .ruler, #tl .tl-row { transition: opacity .35s ease; }
#tl.clear .tl-cap, #tl.clear .ruler, #tl.clear .tl-row { opacity: 0; }
.ghost { position: fixed; z-index: 6; pointer-events: none; image-rendering: pixelated; transform-origin: 0 0; }
/* the same column as a note (site.css .post): 680px with 20px inside on each side, so a work and a note line up */
#reader { padding-left: 0; padding-right: 0; }
.reader-inner { max-width: 680px; margin: 0 auto; padding: calc(var(--card-top) + 72px) 20px 20svh; }
/* the title right under the card, with the same room as on a note (site.css .post-title) */
.reader h1 { font: 400 30px/1.4 var(--sans); margin: 18px 0 6px; text-wrap: balance; letter-spacing: -.005em; }
.reader .sub { font: 18px/1.6 var(--sans); color: var(--ink-soft); margin: 0 0 14px; }
.reader .byline { font: 14px/1.6 var(--mono); color: var(--ink-soft); margin: 0 0 34px; }
.reader h2 { font: 500 14px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 34px 0 8px; }
.reader p { font: 17px/1.7 var(--sans); margin: 0 0 14px; }
.reader .out { font: 14.5px/1.7 var(--mono); }
.reader .out a { border-bottom: 1px dotted var(--ink-soft); text-decoration: none; }

/* the homepage as it was on a past day: same look, that day's building is the main one */
/* which day it is: a line of text in the accent colour above the title, not a box */
.past-tag { display: block; margin: 0 0 6px; font: 500 13px/1.5 var(--mono); letter-spacing: .02em; color: var(--accent); }
/* the city, in the same place and size as .past-tag, quieter (day.js geoLine) */
.geo-tag { display: block; margin: 0 0 6px; font: 500 13px/1.5 var(--mono); letter-spacing: .02em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* timeline mode: the building, its name and place, and a time ruler. Nothing else. */
/* The building's box in the timeline: the home page's own box (--stage-top, -w, -h: day.js sizeStage), made a little
   smaller (--tl-k) from the same top, on every screen. So going in, the building shrinks a little towards its top and
   the room under the date card does not grow; its name follows right under it. */
:root { --tl-k: .85; } /* set again from day.js TL_K, which also sizes the building: change it there */
.tlm { min-height: 100%; display: grid; justify-items: center; align-content: start; text-align: center;
  padding-top: var(--stage-top, calc(var(--card-top) + 80px)); padding-bottom: 110px; }
.tl-stage { position: relative; width: min(100%, calc(var(--stage-w, 560px) * var(--tl-k))); height: calc(var(--stage-h, 54svh) * var(--tl-k));
  display: grid; place-items: end center;
  touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.tl-stage canvas { image-rendering: pixelated; will-change: transform; }
.tl-stage #tlc { position: relative; z-index: 1; }
/* wide screens: the other days in a row either side, small and grey; the chosen one is the big canvas (day.js renderRow) */
.tl-row { position: absolute; left: 50%; bottom: 0; width: 0; height: 100%; pointer-events: none; }
.tl-row .tl-nb { position: absolute; bottom: 0; left: 0; transform: translateX(calc(var(--x, 0px) - 50%));
  filter: grayscale(1) brightness(.6); opacity: .42; pointer-events: auto; cursor: pointer;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease; will-change: auto; }
.tl-row .tl-nb:hover { opacity: .7; }
.tl-row .tl-nb.on { opacity: 0; pointer-events: none; }
@media (max-width: 899px) { .tl-row { display: none; } }
.tl-stage:focus-visible, .stage:focus-visible { outline: 1px dashed var(--rule); outline-offset: 6px; }
.tl-stage canvas.snapback { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.tl-cap { margin-top: 18px; display: grid; gap: 4px; transition: opacity .3s ease; }
.tl-cap.hide { opacity: 0; }
.tl-cap .n { font: 700 18px/1.55 var(--sans); }
.tl-cap .p { font: 15px/1.6 var(--mono); color: var(--ink-soft); }
.tl-cap { max-width: 34em; }
.tl-cap .s { font: 15px/1.6 var(--mono); color: var(--ink-soft); }
.tl-cap .s a { text-decoration: none; border-bottom: 1px dotted var(--ink-soft); }
.ruler { position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, var(--bg) 35%); }
.ruler-track { position: relative; height: 40px; max-width: 760px; margin: 0 auto; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
.ruler-track::before { content: ''; position: absolute; left: 0; right: 0; bottom: 12px; height: 1px; background: var(--rule); }
.ruler-track .dot { position: absolute; bottom: 12px; width: 1px; height: 10px; margin-left: -.5px; background: var(--ink-soft); }
.ruler-track .dot.on { background: transparent; }
.ruler-track .needle { position: absolute; bottom: 8px; width: 3px; height: 22px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); transition: left .35s cubic-bezier(.2, .8, .2, 1); }
.ruler-track.drag .needle { transition: none; }
.ruler-track:focus-visible { outline: 1px dotted var(--ink-soft); outline-offset: 4px; }
/* the date at the top turns like a dial */
.dial { display: inline-flex; font-variant-numeric: tabular-nums; }
.dial .dg { display: inline-block; height: 1.35em; overflow: hidden; vertical-align: bottom; }
.ruler .stats { text-align: center; font: 12.5px/1.4 var(--mono); color: var(--ink-soft); margin-bottom: 4px; }
.dial .strip { display: grid; transition: transform .7s cubic-bezier(.25, .9, .3, 1); }
.dial .strip span { height: 1.35em; line-height: 1.35em; }
@media (prefers-reduced-motion: reduce) { .dial .strip { transition: none; } }

.reader p a { text-decoration: none; border-bottom: 1px dotted var(--ink-soft); }
/* a note in the reader: its own page, framed whole (day.js openNote); it scrolls inside the frame, under the card */
.reader.is-note { overflow: hidden; padding: 0; }
.reader.is-note .reader-inner { max-width: none; height: 100%; padding: 0; }
.note-frame { display: block; width: 100%; height: 100%; border: 0; background: transparent; }
/* a picture in the note opened large: the card and its buttons step aside */
body.note-lb .top { visibility: hidden; }

/* tells the reader there is more below */
.more {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; height: 72px; pointer-events: none;
  background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 85%);
  transition: opacity .3s ease;
}
.more.off { opacity: 0; }

@media (prefers-reduced-motion: reduce) { .stage canvas { transition: none; } .cur { animation: none; } }
/* wide screens (≥ 900px). Phones keep the layout above unchanged.
   The same stack as on a phone (date card, building, today's words and buttons). The card stays at the top, as on
   every page; the building and its words are centred in the room under it (day.js sizeStage). The timeline is one
   block too: building, name, then the ruler right under it, centred under the card. */
@media (min-width: 900px) {
  .caption { max-width: 40em; }
  /* the buttons' room under the words is kept while they are down in the terminal, so the page never shifts */
  .bar-slot { min-height: 50px; }
  .bar-slot .cmdbar { justify-content: center; }
  .term .cmdbar { position: sticky; bottom: 0; margin-top: 6px; padding-inline: 0; }
  /* the bar's ❯ sits right under the input line's ❯: pulled left by the button's own padding */
  .term .cmdbar .arrow { margin-left: -10px; }
  /* the timeline: the ruler right under the name, in the flow, not pinned to the bottom edge (phones: at the bottom,
     under the thumb) */
  .tlm { padding-bottom: 0; }
  .ruler { position: static; background: none; padding: 20px max(16px, env(safe-area-inset-left, 0px)) 32px; }
}
