:root {
  color-scheme: light dark;
  --paper: light-dark(#fff, oklch(.145 0 0));
  --ink: light-dark(oklch(.145 0 0), oklch(.985 0 0));
  --muted: light-dark(oklch(.50 0 0), oklch(.708 0 0));
  --card: light-dark(#fafafa, #101010);
  --hover: light-dark(#f5f5f5, #181818);
  --line: light-dark(#ebebeb, #282828);
  --chip: light-dark(#f2f2f2, #1b1b1b);
  --focus: light-dark(oklch(.46 .13 145), oklch(.86 .18 87));
  font-family: elza-text, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; z-index: 1; left: .5rem; top: -5rem; padding: .5rem 1rem; background: var(--paper); }
.skip:focus { top: .3rem; }
header { border-bottom: 1px solid var(--line); }
.bar { max-width: 90rem; margin: auto; padding: 0 1rem; height: 3.5rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.home, .control { display: inline-grid; place-items: center; text-decoration: none; border-radius: .5rem; }
.home { justify-self: start; width: 2.75rem; height: 2.75rem; }
.mark { width: 28px; height: 28px; background: currentColor; mask: url("/brand/logo-mark.svg") center / contain no-repeat; }
.site-nav, .controls { display: flex; align-items: center; gap: .5rem; }
.site-nav a { padding: .7rem 1rem; color: var(--muted); text-decoration: none; font-size: .875rem; font-weight: 500; border-radius: .4rem; }
.site-nav a[aria-current], .site-nav a:hover { color: var(--ink); }
.site-nav a:hover, .control:hover, .home:hover { background: var(--hover); }
.controls { justify-self: end; }
.control { padding: 0; width: 2.3rem; height: 2.3rem; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 1px 3px #0001; }
.control svg { width: 1rem; height: 1rem; }
[hidden] { display: none !important; }
main { max-width: 48rem; margin: auto; padding: 2.5rem 1.5rem 4rem; }
h1 { margin: 0 0 2.5rem; font-size: clamp(2rem, 4vw, 2.25rem); line-height: 1.17; font-weight: 700; letter-spacing: -.025em; }
.books { display: grid; gap: 1.5rem; }
.book { padding: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: .875rem; box-shadow: 0 2px 16px #00000005; }
.book:focus-within, .book:hover { background: var(--hover); }
.book h2 { margin: 0; font-weight: 600; font-size: 1.125rem; line-height: 1.5; }
.book h2 a { text-decoration: none; }
.book h2 a:hover { text-decoration: underline; }
.book p { margin: .25rem 0 1rem; font-size: .9375rem; color: var(--muted); }
.topics { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.topics a { border-radius: 2rem; border: 1px solid var(--line); background: var(--chip); padding: .17rem .65rem; color: var(--muted); font-size: .8125rem; text-decoration: none; }
.topics a:hover { color: var(--ink); text-decoration: underline; }
.status { margin: 0 0 .8rem; font: 500 .85rem/1.4 "IBM Plex Mono", monospace; color: var(--muted); }
.error h1 { margin-bottom: .75rem; }
.back { display: inline-block; margin-top: .75rem; text-underline-offset: .18em; }
@media (max-width: 36rem) {
  .bar { padding: 0 .75rem; }
  .site-nav { gap: .15rem; }
  .site-nav a { padding: .7rem .55rem; }
  .controls { gap: .35rem; }
  .control { width: 2.75rem; height: 2.75rem; }
  .topics a { display: inline-flex; align-items: center; min-height: 2rem; }
  .book { padding: 1.25rem; }
  main { padding-top: 2rem; }
  h1 { margin-bottom: 2rem; }
}

/* Keep the whole card clickable while preserving the individual topic links. */
.book { position: relative; }
.book h2 a::after { content: ""; position: absolute; inset: 0; border-radius: .875rem; }
.topics a { position: relative; }
.book h2 a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 3px; }
