/* Shared by every page. The colours here are the light pages'; the home page sets its own (style.css). */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --fg: #1a1a1a; --bg: #f3f3f3; --dim: #707070; /* --dim stays above 4.5:1 on --bg */
  --pad: clamp(15px, 2vw, 30px);
  --shadow: 0 0 14px rgba(0, 0, 0, .5); /* a whisper of shadow behind white text on a picture */
  --blank: rgba(128, 128, 128, .12); /* where a picture will be, until it loads */
  font: 400 15px/22px Newsreader, Georgia, "Hiragino Mincho ProN", serif;
  color: var(--fg);
  background: var(--bg);
  text-underline-offset: 3px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body { margin: 0; min-height: 100svh; color: var(--fg); background: var(--bg); } /* repeated here so a page can change --fg on the body (works.css: body.lit) */
p, ol, ul, h1 { margin: 0; padding: 0; font: inherit; }
ol, ul { list-style: none; }
/* An underline is a thin line a little under the text. A rule that wants one sets text-decoration-line
   alone: the short text-decoration would put the thickness back to the browser's own. */
* { text-decoration-thickness: 1px; }
a { color: inherit; text-decoration-line: none; }
button { all: unset; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

/* Top line: the name on the left goes home, the site's sections sit on the right at text size.
   The links' own padding makes them tall enough to tap, so the line's padding is that much less. */
.top {
  --tap: 11px;
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 26px;
  padding:
    max(calc(var(--pad) * .7 - var(--tap)), env(safe-area-inset-top))
    max(var(--pad), env(safe-area-inset-right))
    calc(var(--pad) - var(--tap))
    max(var(--pad), env(safe-area-inset-left));
}
.brand { font-size: 18px; }
.nav { display: flex; align-items: center; gap: 26px; }
.brand, .nav a { padding: var(--tap) 0; }
/* Icon links: a square you can tap, pulled right so the drawing lines up with the page edge. */
.nav .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 44px; padding: 0; margin: 0 -7px 0 -6px;
  opacity: .85; transition: opacity .2s ease;
}
.nav .icon:hover { opacity: 1; }
.nav a:hover, .nav [aria-current] { text-decoration-line: underline; text-underline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Written text (a writing, a work's text): links are underlined and lists get their marks back. */
.prose a { text-decoration-line: underline; }
.prose ul { list-style: disc; padding-left: 1.2em; }
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose blockquote { padding-left: 1em; border-left: 1px solid currentColor; color: var(--dim); }

@media (max-width: 640px) {
  :root { font-size: 14px; line-height: 20px; }
}
