/* Side of My Desk Research. Shares the colours and typefaces of sideofmydesk.com.
   Layout: one reading column for text; figures may run a little wider. */
:root {
  --bg: #f5f7f3;
  --surface: #ffffff;
  --ink: #1b2822;
  --muted: #4c5a53;
  --line: #d6ddd6;
  --accent: #2c6a4d;
  --accent-soft: #e3eee7;
  --on-accent: #ffffff;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 2.2vw, 2.75rem);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #18211c; --ink: #e6ede8; --muted: #a5b3ab; --line: #2b3831;
    --accent: #7fc4a1; --accent-soft: #1d2e25; --on-accent: #0c1711;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #18211c; --ink: #e6ede8; --muted: #a5b3ab; --line: #2b3831;
  --accent: #7fc4a1; --accent-soft: #1d2e25; --on-accent: #0c1711;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
.wrap {
  max-width: 68rem; margin-inline: auto; width: 100%;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.col { max-width: 44rem; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); margin-top: 2.6rem; }
h3 { font-size: var(--step-1); }
p { margin: 0.9rem 0 0; }
ul { margin: 0.9rem 0 0; padding-left: 1.25rem; }
li { margin-top: 0.4rem; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.eyebrow { font-size: var(--step--1); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
.lede { font-size: var(--step-1); color: var(--muted); }
.fine { font-size: var(--step--1); color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 5; }

.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; flex-wrap: wrap; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; }
.mark svg { flex: none; }
.mark span { color: var(--muted); font-weight: 400; }
.head-link { font-size: var(--step--1); font-weight: 600; }

.intro { padding-block: 52px 8px; }
.intro .lede { margin-top: 16px; }

/* Index: list of editions */
.editions { list-style: none; padding: 0; margin: 28px 0 72px; display: grid; gap: 20px; }
.editions li { margin: 0; }
.edition {
  display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; text-decoration: none; color: var(--ink);
}
.edition:hover { border-color: var(--accent); }
.edition p { margin: 0; color: var(--muted); }
.edition .meta { font-size: var(--step--1); }

/* Paper page */
.meta-line { margin-top: 16px; color: var(--muted); font-size: var(--step--1); }
.actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 24px; }
.btn {
  display: inline-block; background: var(--accent); color: var(--on-accent); text-decoration: none;
  font-weight: 600; padding: 12px 22px; border-radius: 999px;
}
.btn:hover { filter: brightness(1.08); }
.keys { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.keys li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; }
.keys .num { font-family: var(--font-body); font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.keys .what { font-size: var(--step--1); color: var(--muted); margin-top: 8px; }
figure { margin: 2rem 0 0; }
/* Charts are drawn dark-on-white, so they sit on a white card in both themes. */
figure img { display: block; width: 100%; height: auto; background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 10px; max-width: 44rem; }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: 18px 20px; margin-top: 1.6rem; }
.note p:first-child { margin-top: 0; }
pre {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.5; margin: 1rem 0 0;
}
.end { padding-bottom: 72px; }

.site-foot { border-top: 1px solid var(--line); }
.site-foot .foot-note { flex-basis: 100%; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 22px; font-size: var(--step--1); color: var(--muted); }

@media (max-width: 760px) {
  .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { padding-block: 36px 4px; }
}
