/* The base style of every page and document I make: grey text on white, an
   orange title and links, a taupe rule under the header, hairline dividers,
   a dark footer band and a green for success, in a light and a dark theme.
   Its text passes WCAG AA in both. A colour that differs by theme is
   light-dark(light, dark): the system picks the theme, and data-theme="light"
   or "dark" on the root overrides it. brand.js beside this file sets it from
   a switch on the page, which .theme-switch draws.
   A project loads it by a relative path to the site root, and its own rules
   override what they need. ~/src/oceanhue mirrors the site, and
   ~/src/oceanhue/brand.css is a symlink to this file, so the same path works
   on the live site and offline. */
:root {
  --bg: light-dark(#ffffff, #0a0a0a); --ink: light-dark(#666666, #f2f2f2);
  --muted: light-dark(#707070, #a3a3a3); --title: #cc6633;
  --link: light-dark(#af5811, #cc6714); --rule: #948979;
  --hair: light-dark(#cccccc, #262626); --band: #575352;
  --panel: light-dark(#f5f5f5, #171717); --good: light-dark(#137333, #3fb950);
  --sans: "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
  --head: Arial, "Liberation Sans", Helvetica, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--sans); }
.wrap { max-width: 980px; margin: 0 auto; padding-block: 40px 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
a { color: var(--link); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

header { border-bottom: 4px solid var(--rule); padding-bottom: 14px; margin-bottom: 28px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
h1 { font-family: var(--head); color: var(--title); font-weight: 400; font-size: clamp(28px, 5vw, 40px); line-height: 1.05; margin: 0; text-wrap: balance; }
.tag { color: var(--muted); margin: 6px 0 0; }

section { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 24px; margin-bottom: 34px; }
section > h2 { font-family: var(--head); font-size: 13px; font-weight: 400; color: var(--link); margin: 0; padding: 4px 0 3px;
  border-bottom: 1px solid var(--hair); align-self: start; letter-spacing: .02em; }
section > div { min-width: 0; }
h3 { font-family: var(--head); font-size: 16px; margin: 18px 0 4px; }
h3:first-child { margin-top: 0; }
p { margin: 0 0 10px; max-width: 70ch; }
ul, ol { margin: 4px 0 12px; padding-left: 20px; max-width: 72ch; }
li { margin-bottom: 4px; }
li::marker { color: var(--rule); }
code, pre { font-family: var(--mono); font-size: 13px; background: var(--panel); border-radius: 3px; }
code { padding: 1px 5px; }
pre { padding: 10px 12px; overflow-x: auto; }

.theme-switch { position: absolute; z-index: 1; top: 8px; right: max(12px, env(safe-area-inset-right, 0px));
  font: 13px/1 var(--sans); color: var(--link); background: var(--bg); border: 1px solid var(--hair);
  border-radius: 14px; padding: 6px 10px; min-height: 28px; cursor: pointer; }
.theme-switch:hover { border-color: var(--link); }

footer { margin-top: 20px; }
footer .line { text-align: right; color: var(--muted); font-size: 13px; padding: 0 0 6px; }
footer .band { height: 14px; background: var(--band); }

@media (max-width: 640px) { section { grid-template-columns: 1fr; } section > h2 { margin-bottom: 8px; } }
@media print { .theme-switch { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
