/* Frame: the site's look shared by the digest page (docs/page-template.html) and the sign-in
   page (docs/signin-template.html): esaba.ca's colour tokens, the monospace frame, the header
   (the site's mark, address and navigation), the title line and the $ command.
   Never contains: anything only one of the two pages shows. */
/* Colours: the website's tokens. Dark is the default; light follows the reader's system, and
   paper always takes the light ones (R9-05: print had its own copy of them). */
:root {
  color-scheme: dark;
  --bg: #18191d; --surface: #1f2025; --text: #e6edf3; --muted: #8b949e; --line: #3a3c43;
  --blue: #00b1d2; --green: #69ff47; --pink: #ff51ae; --violet: #946cf0;
  /* the one surface of everything that opens over the page: translucent, blurred, soft shadow */
  --material: rgba(22,25,32,.32); --edge: rgba(255,255,255,.15); --field: rgba(255,255,255,.045);
  --hover: rgba(255,255,255,.05); --band: rgba(0,177,210,.14);
  --pop-shadow: 0 28px 72px -12px rgba(0,0,0,.55), 0 6px 20px -4px rgba(0,0,0,.28);
  --mono: "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease: 160ms ease;
  /* The website's type (design-system.xml, typeScale, weights and lineHeights; its global.css):
     three sizes, two weights, two line heights, in one monospace face with 0.01em spacing. Only
     the headlines keep the system face (Saba's choice, 2026-11-25), at the body size; menus
     and panels keep the popover's own scale. Every size on screen goes through these. */
  --text-sm: .875rem; --text-base: 1rem; --text-lg: 1.25rem;
  --weight-regular: 400; --weight-strong: 600;
  --leading: 1.5; --leading-tight: 1.3; --letter-spacing: .01em;
  /* The website's two header gaps (its global.css): above the header, and from the header to the
     first line of content, the same on every page of the site at every width. */
  --header-top-gap: clamp(1rem, 2.4vw, 2.25rem);
  --content-top-gap: clamp(4rem, 6vw, 8rem);
}
@media (prefers-color-scheme: light), print {
  :root {
    color-scheme: light;
    --bg: #f3f4f6; --surface: #e3e3e5; --text: #18191d; --muted: #565c63; --line: #bbbcc0;
    --blue: #007a92; --green: #228100; --pink: #d60089; --violet: #7546d8;
    --material: rgba(249,250,252,.36); --edge: rgba(0,0,0,.14); --field: rgba(0,0,0,.035);
    --hover: rgba(0,0,0,.05); --band: rgba(0,122,146,.1);
    --pop-shadow: 0 28px 72px -12px rgba(0,0,0,.24), 0 6px 20px -4px rgba(0,0,0,.12);
  }
}

/* The frame: monospace, one column; no boxes, outlines or underlines. */
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
/* A phone never enlarges the text by itself (iOS does on turning), so a phone's page and its
   print use the sizes set here, as the website does (its global.css). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--weight-regular) var(--text-base)/var(--leading) var(--mono);
  letter-spacing: var(--letter-spacing); }
/* The website's frame and gutter (design-system.xml, --frame and --gutter): 960px at most, and
   each side margin a twelfth of the window, 2rem at least. */
.frame { width: min(960px, calc(100% - 2 * max(2rem, 100vw / 12))); margin-inline: auto; }
button, a { -webkit-tap-highlight-color: transparent; transition: color var(--ease), background-color var(--ease); }
button { border: 0; border-radius: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; min-height: 32px; }
a { color: inherit; text-decoration: none; }
button:hover, a:hover { color: var(--blue); }
/* The keyboard's focus: the band and the blue on every control, whatever colour it rests in (blue
   is the design system's focus colour). Not on what only the script focuses (tabindex -1: a menu's
   frame on a touch screen), whose band would fill the whole menu. A field keeps its own look by
   its own :focus-visible rule in its page, so typed text stays in the text colour (review PAGE-3;
   PD2-1: a weightless :where() here let every muted control keep its grey). */
:focus-visible:not([tabindex="-1"]) { outline: 0; background: var(--band); color: var(--blue); border-radius: 3px; }
[tabindex="-1"]:focus { outline: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.print-only { display: none; }
.plain { color: var(--muted); font-size: var(--text-sm); margin: 16px 0 0; max-width: 60ch; }

/* Header: the website's mark and path (esaba.ca's design system, "header"): the @esaba mark in
   violet and the path with every folder a link to its page (energydigest is this page). The
   website's navigation (me, tutoring, lab, stuff) is left out on purpose: the digest sits inside
   lab, which the path already opens (Saba, 2026-11-25). The digest page puts its clock on the
   right edge instead. */
/* The mark and path match the website's header (its .site-header, .site-mark, .address-path): the
   same 40px and 32px boxes with the line centred in them, ~/lab/energydigest written as one path
   with no spaces, the same 0.01em letter spacing, and the path a row whose links and slashes share
   one centre line (Saba, 2026-11-25: the address must be the same on every page). The line height
   is the tight one where the website's is 1.5; the boxes hide the difference (R9-16). */
.top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 1ch;
  min-height: 40px; padding-top: var(--header-top-gap); color: var(--muted); line-height: var(--leading-tight); }
.mark { color: var(--violet); min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }
/* :focus-visible always in a rule of its own: Safari before 15.4 drops a whole rule it cannot read. */
.mark:hover { color: var(--violet); }
.mark:focus-visible { color: var(--violet); }
.address { display: inline-flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.address a { display: inline-flex; min-height: 32px; align-items: center; color: var(--muted); }
.address a:hover { color: var(--text); }
.address a:focus-visible { color: var(--text); }
time { color: var(--muted); font-size: var(--text-sm); line-height: 26px; font-variant-numeric: tabular-nums; }
.clock { justify-self: end; margin-left: 1ch; font-size: var(--text-sm); white-space: nowrap; display: inline-flex; flex-wrap: wrap; gap: 0 1.5ch; }
.clock b { color: var(--text); font-weight: var(--weight-regular); }

/* Page heading, and a command: a green $ and a muted word that lights up. As on the website (its
   pageHeading): the $ line, then the title 8px under it (its --gap-heading); the title the website's
   h1: the title size, strong, the tight line height, at every width. */
main { padding-top: var(--content-top-gap); }
.titleline { display: grid; justify-items: start; gap: 8px; }
h1 { font-size: var(--text-lg); line-height: var(--leading-tight); font-weight: var(--weight-strong); margin: 0; }
.cmd { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); }
.cmd::before { content: "$"; color: var(--green); }
.cmd:hover { color: var(--text); }

/* The clock takes its own row under the mark and the path when the full path would not fit beside
   it: header.js measures and sets data-layout (wrap first, then shorten). Before it has run,
   760px decides, on screens only (paper is the same from any device). */
.top[data-layout="stacked"] { grid-template-columns: auto minmax(0, 1fr); }
.top[data-layout="stacked"] .clock { grid-column: 1 / -1; justify-self: start; margin-left: 0; }
@media screen and (max-width: 760px) {
  .top:not([data-layout]) { grid-template-columns: auto minmax(0, 1fr); }
  .top:not([data-layout]) .clock { grid-column: 1 / -1; justify-self: start; margin-left: 0; }
}
