/* Shared look for apopt.com/course, /book and /data.
   Tokens from docs/dda-graphics.md section 2. Fonts fall back to the system
   stack until the self-hosted Inter / JetBrains Mono files are added. */
:root {
  --bg: #f7f9fc; --surface: #ffffff; --surface-2: #eef2f8; --ink: #16233f; --muted: #5b6b85;
  --line: rgba(28,45,85,.14); --navy: #1c2d55; --teal: #0e7c6e; --track: #d9480f; --gold: #b7791f;
  --warn: #b42318; --violet: #6741d9; --slate: #52606d;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-card: 12px; --r-ctl: 8px; --shadow: 0 1px 2px rgba(22,35,63,.06), 0 4px 14px rgba(22,35,63,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1626; --surface: #172038; --surface-2: #1f2b47; --ink: #e8edf7; --muted: #9fb0cc;
    --line: rgba(200,215,245,.16); --navy: #a9bdf0; --teal: #2cc4b2; --track: #ff8a4c; --gold: #f2c14e;
    --warn: #ff7a6b; --violet: #b197fc; --slate: #a5b4c3; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1626; --surface: #172038; --surface-2: #1f2b47; --ink: #e8edf7; --muted: #9fb0cc;
  --line: rgba(200,215,245,.16); --navy: #a9bdf0; --teal: #2cc4b2; --track: #ff8a4c; --gold: #f2c14e;
  --warn: #ff7a6b; --violet: #b197fc; --slate: #a5b4c3; --shadow: none; color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
@media (min-width: 900px) { body { font-size: 17px; } }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 1.6em 0 .5em; }
h1 { font-size: 1.95rem; margin-top: .4em; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--surface-2); padding: 12px 14px; border-radius: var(--r-ctl); overflow-x: auto; }
pre code { background: none; padding: 0; overflow-wrap: normal; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .9em; }
.tablewrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.tablewrap table { font-size: .9rem; }
.tablewrap tbody tr:nth-child(even) { background: var(--surface-2); }
:focus-visible { outline: 3px solid var(--track); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

/* Shared header and footer */
.sitehead { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.sitehead .in { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--navy); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand b { color: var(--track); }
.sitenav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.sitenav a { color: var(--ink); text-decoration: none; padding: 10px 10px; border-radius: var(--r-ctl); min-height: 44px; display: inline-flex; align-items: center; }
.sitenav a:hover, .sitenav a[aria-current] { background: var(--surface-2); color: var(--navy); }
.sitenav a[aria-current] { font-weight: 600; box-shadow: inset 0 -3px 0 var(--track); }
main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 48px; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 16px 0 0; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }
.sitefoot { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.sitefoot .in { max-width: 1120px; margin: 0 auto; padding: 20px 16px 32px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 70ch; }
.prose { max-width: 75ch; }
.muted { color: var(--muted); }

/* Buttons, chips, badges, cards */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--track); border-color: var(--track); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #1a0f08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #1a0f08; } }
.btn.small { min-height: 32px; padding: 2px 10px; font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--bg); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--navy); }
.badge.t-watch { color: var(--teal); } .badge.t-heart { color: var(--warn); } .badge.t-book { color: var(--navy); }
.badge.t-open { color: var(--violet); } .badge.t-course { color: var(--gold); } .badge.t-video, .badge.t-pose { color: var(--track); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin: 16px 0; padding: 0; list-style: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.card h3 { margin: 0; font-size: 1.05rem; } .card h3 a { color: var(--navy); text-decoration: none; } .card h3 a:hover { text-decoration: underline; }
.card p { margin: 0; font-size: .93rem; }
.card .meta { color: var(--muted); font-size: .83rem; margin-top: auto; }
.note { border-left: 4px solid var(--gold); background: var(--surface); padding: 10px 14px; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; margin: 16px 0; }
.note.safety { border-color: var(--warn); }
.grid2 { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.grid2 > * { min-width: 0; }
@media (min-width: 980px) { .grid2 { grid-template-columns: minmax(0, 1fr) 320px; } }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; align-self: start; }
.side h2 { font-size: 1rem; margin: 0 0 8px; }
.side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: .9rem; }
.side dt { color: var(--muted); } .side dd { margin: 0; overflow-wrap: anywhere; }
.filelist td:first-child { overflow-wrap: anywhere; }
.filelist .num { white-space: nowrap; text-align: right; }
.copyrow { display: flex; flex-wrap: wrap; gap: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
input[type=search] { font: inherit; width: 100%; max-width: 520px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .sitehead, .sitefoot, .copyrow { display: none; } }
