/* =========================================================
   Personal site — shared styles
   Theme: "case file" — clean white pages framed by black
   header and footer bands, oxblood accents, tall condensed
   headlines (League Gothic) and a classic book serif
   (Crimson Pro), in the style of a crime novelist's site.
   Colors live in the tokens below; change them once here.
   ========================================================= */

/* The site is always light (no dark mode) */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f1ef;
  --ink: #1f1e1e;
  --muted: #5f5a58;
  --line: #e2dedb;
  --accent: #822c2b;          /* oxblood: links, titles, red text */
  --accent-strong: #822c2b;   /* buttons, fills (white text on top) */
  --accent-soft: #f6ebea;
  --on-accent: #fff;
  --band: #000000;            /* header, footer and feature bands */
  --band-ink: #ffffff;
  --band-muted: #b9b4b1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 10px 28px rgba(0, 0, 0, .12);

  --font-display: "League Gothic", "Arial Narrow", Impact, sans-serif;
  --font-read: "Crimson Pro", "Minion Pro", Georgia, "Times New Roman", serif;
  --font-ui: "Crimson Pro", "Minion Pro", Georgia, "Times New Roman", serif;

  --radius: 4px;
  --wrap: 1080px;
  --reader-size: 21px;
  --reader-width: 36rem;
  color-scheme: light;
}

/* Sepia is offered inside the chapter reader */
:root[data-theme="sepia"] {
  --bg: #f4ecdb;
  --surface: #f8f2e5;
  --surface-2: #ebe0c9;
  --ink: #33291f;
  --muted: #6b5d4c;
  --line: #ddd0b5;
  --accent: #822c2b;
  --accent-strong: #822c2b;
  --accent-soft: #ecdcc8;
  --on-accent: #fff;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .25s ease, color .25s ease;
}

main { flex: 1; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.muted { color: var(--muted); }

/* ---------- Header / footer ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--ink); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--muted); text-decoration: none;
  font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: 999px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.footer-inner a { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font-ui);
  padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-small { padding: 8px 14px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 13px/1 var(--font-ui);
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.tag {
  display: inline-block;
  font: 600 11px/1 var(--font-ui);
  letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.section { padding-top: 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); margin: 0; }

/* ---------- Home ---------- */
.hero { padding-top: 72px; padding-bottom: 24px; }
.hero h1 { font-size: clamp(42px, 7vw, 76px); font-weight: 600; letter-spacing: -0.025em; margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.hero .lede { font-family: var(--font-read); font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 38rem; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 48px; }
@media (max-width: 760px) { .doors { grid-template-columns: 1fr; } }
.door {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 28px; min-height: 240px;
  text-decoration: none; color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.door:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; }
.door h2 { font-size: 30px; margin: 0; }
.door p { margin: 0; color: var(--muted); max-width: 26rem; }
.door .door-cta { margin-top: auto; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.door .door-cta svg { width: 16px; height: 16px; transition: transform .2s ease; }
.door:hover .door-cta svg { transform: translateX(4px); }
.door-num {
  position: absolute; right: 20px; top: 8px;
  font-family: var(--font-display); font-size: 120px; font-weight: 700; line-height: 1;
  color: var(--surface-2); pointer-events: none; user-select: none;
}

.release-list { display: grid; gap: 12px; }
.release {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 18px; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease;
}
.release:hover { border-color: var(--accent); }
.release .mini-cover { width: 56px; }
.release h3 { font-size: 18px; margin: 0 0 2px; }
.release p { margin: 0; font-size: 14px; color: var(--muted); }
.release .release-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) {
  .release { grid-template-columns: 44px 1fr; }
  .release .mini-cover { width: 44px; }
  .release .release-date { grid-column: 2; }
}

.continue-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; margin-top: 32px;
  border-left: 4px solid var(--accent);
}
.continue-banner p { margin: 0; }

/* ---------- Book covers (typographic, no images needed) ---------- */
.cover {
  --c: #5b1f1d;
  --c-ink: #f3e8d4;
  position: relative;
  aspect-ratio: 2 / 3;
  background: radial-gradient(120% 80% at 70% 10%, rgba(255,255,255,.10), transparent 60%), var(--c);
  color: var(--c-ink);
  border-radius: 3px 8px 8px 3px;
  box-shadow: 0 1px 1px rgba(0,0,0,.15), 0 12px 28px rgba(30,15,5,.22);
  padding: 12% 11%;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  container-type: inline-size;
}
.cover::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 7%;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,0) 80%);
}
.cover::after {
  content: ""; position: absolute; inset: 5% 6% 5% 9%;
  border: 1px solid currentColor; opacity: .35; pointer-events: none;
}
.cover img.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-genre { font: 600 6.5cqi/1.2 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; opacity: .8; position: relative; }
.cover-title { font: 600 14cqi/1.02 var(--font-display); letter-spacing: -0.01em; position: relative; text-wrap: balance; }
.cover-rule { width: 30%; height: 1px; background: currentColor; opacity: .6; margin: 6cqi 0; position: relative; }
.cover-author { font: 500 6.5cqi/1.2 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; position: relative; opacity: .9; }
.mini-cover .cover-genre, .mini-cover .cover-author, .mini-cover .cover-rule { display: none; }
.mini-cover .cover { padding: 14%; justify-content: center; box-shadow: 0 4px 10px rgba(30,15,5,.2); }
.mini-cover .cover-title { font-size: 17cqi; }

/* ---------- Library ---------- */
.page-head { padding: 56px 0 8px; }
.page-head h1 { font-size: clamp(38px, 6vw, 60px); margin-bottom: 12px; }
.page-head p { font-family: var(--font-read); font-size: 19px; color: var(--muted); max-width: 40rem; margin: 0; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 24px; margin-top: 36px; }
.book-card { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 24px; }
@media (max-width: 520px) { .book-card { grid-template-columns: 1fr; } .book-card .cover-link { max-width: 180px; } }
.cover-link { display: block; text-decoration: none; transition: transform .2s ease; }
.cover-link:hover { transform: translateY(-3px) rotate(-.5deg); }
.book-card h2 { font-size: 26px; margin: 8px 0 6px; }
.book-card h2 a { color: var(--ink); text-decoration: none; }
.book-card h2 a:hover { color: var(--accent); }
.book-card .blurb { font-family: var(--font-read); color: var(--muted); margin: 0 0 14px; font-size: 16px; }
.book-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.book-meta span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.book-meta svg { width: 14px; height: 14px; flex: none; }
.book-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.progress-track { height: 4px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 0 0 16px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- Book detail ---------- */
.book-hero { display: grid; grid-template-columns: 260px 1fr; gap: 48px; padding: 56px 0 0; align-items: start; }
@media (max-width: 760px) { .book-hero { grid-template-columns: 1fr; gap: 28px; } .book-hero .cover { max-width: 220px; } }
.book-hero h1 { font-size: clamp(38px, 6vw, 58px); margin: 10px 0 6px; }
.book-hero .subtitle { font-family: var(--font-read); font-style: italic; font-size: 20px; color: var(--muted); margin: 0 0 20px; }
.book-hero .blurb { font-family: var(--font-read); font-size: 18px; line-height: 1.7; margin: 0 0 24px; max-width: 38rem; }
.book-hero .blurb p { margin: 0 0 1em; }

.toc { list-style: none; padding: 0; margin: 0; }
.toc li { border-bottom: 1px solid var(--line); }
.toc li:last-child { border-bottom: 0; }
.toc a, .toc .toc-locked {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  padding: 16px 20px; text-decoration: none; color: var(--ink);
}
.toc a:hover { background: var(--surface-2); }
.toc .toc-num { font-family: var(--font-display); font-size: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc .toc-title { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.toc .toc-sub { display: block; font-size: 13px; color: var(--muted); font-family: var(--font-ui); }
.toc .toc-state { font-size: 13px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.toc .toc-state svg { width: 16px; height: 16px; }
.toc .is-read .toc-state { color: var(--accent); }
.toc .is-current { background: var(--accent-soft); }
.toc .toc-locked { color: var(--muted); cursor: default; }
.toc .toc-locked .toc-title { font-style: italic; }

/* ---------- Resume ---------- */
.resume-head {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end;
  padding: 56px 0 28px; border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) { .resume-head { grid-template-columns: 1fr; } }
.resume-head h1 { font-size: clamp(40px, 6vw, 64px); margin-bottom: 6px; }
.resume-head .role { font-family: var(--font-read); font-size: 21px; color: var(--muted); margin: 0 0 16px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; }
.contact-row:empty { display: none; }
.contact-row a, .contact-row span { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.contact-row a:hover { color: var(--accent); }
.contact-row svg { width: 15px; height: 15px; }
.resume-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.resume-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 36px; }
@media (max-width: 900px) { .resume-grid { grid-template-columns: 1fr; gap: 0; } }

.summary { font-family: var(--font-read); font-size: 19px; line-height: 1.7; margin: 0 0 8px; }

.core-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.core-list li { position: relative; padding-left: 22px; }
.core-list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.core-list b { font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 0; }
.stat { padding: 16px; }
.stat b { display: block; font-family: var(--font-display); font-size: 34px; font-weight: 600; line-height: 1; margin-bottom: 6px; }
.stat span { font-size: 13px; color: var(--muted); }

.filter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
  background: var(--accent-soft); border-radius: var(--radius); color: var(--ink);
}
.filter-bar[hidden] { display: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.job { position: relative; margin-bottom: 16px; transition: opacity .25s ease; }
.job::before {
  content: ""; position: absolute; left: -28px; top: 26px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
  transition: background-color .2s ease, border-color .2s ease;
}
.job.is-current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.job.is-dim { opacity: .35; }
.job.is-match::before { border-color: var(--accent); }
.job.is-match .card { border-color: var(--accent); }
.job-toggle {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 20px 22px; color: inherit; font: inherit;
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start;
}
.job-toggle h3 { font-size: 21px; margin: 0 0 2px; }
.job-org { font-weight: 600; color: var(--ink); }
.job-dates { font-size: 14px; color: var(--muted); margin-top: 2px; }
.job-chevron { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); transition: transform .25s ease; }
.job-chevron svg { width: 16px; height: 16px; }
.job-toggle[aria-expanded="true"] .job-chevron { transform: rotate(180deg); }
.job-body { padding: 0 22px 20px; }
.job-body[hidden] { display: none; }
.job-body > p { margin: 0 0 12px; font-family: var(--font-read); }
.job-body ul { margin: 0 0 14px; padding-left: 20px; }
.job-body li { margin-bottom: 6px; }
.job-body li::marker { color: var(--accent); }
.job-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.job-skills .chip { font-size: 12px; padding: 5px 10px; }

.side-block { margin-bottom: 32px; }
.side-block h2 { font-size: 22px; margin-bottom: 14px; }
.skill-group { margin-bottom: 18px; }
.skill-group h3 { font: 600 12px/1.2 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.skill-group .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-group .chip-extra { display: none; }
.skill-group.is-open .chip-extra { display: inline-flex; }
.skill-group:has(.chip-extra[aria-pressed="true"]) .chip-extra { display: inline-flex; }
.chip-more { border-style: dashed; color: var(--muted); }

.edu-item, .award-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.edu-item:last-child, .award-item:last-child { border-bottom: 0; }
.edu-item b, .award-item b { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.edu-item span, .award-item span { font-size: 14px; color: var(--muted); }

.pub-item { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; padding: 10px 0; text-decoration: none; color: var(--ink); }
.pub-item:hover b { color: var(--accent); }
.pub-item b { font-family: var(--font-display); font-weight: 600; display: block; }
.pub-item span { font-size: 13px; color: var(--muted); }

/* ---------- Chapter reader ---------- */
.reader-bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.reader-bar-inner { display: flex; align-items: center; gap: 10px; height: 56px; }
.reader-where { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-where b { color: var(--ink); font-weight: 600; }
.reader-tools { display: flex; align-items: center; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button {
  border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 600 13px/1 var(--font-ui); height: 36px; min-width: 38px; padding: 0 10px;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); vertical-align: middle; }
@media (max-width: 600px) { .reader-where { display: none; } .reader-bar-inner { justify-content: space-between; } }

.reading-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); transition: width .1s linear; }

.chapter-head { text-align: center; padding-top: 64px; padding-bottom: 36px; max-width: var(--reader-width); margin: 0 auto; }
.chapter-head .book-link { font: 600 12px/1 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.chapter-head .book-link:hover { color: var(--accent); }
.chapter-head .ch-num { display: block; font-family: var(--font-display); font-style: italic; font-size: 20px; color: var(--accent); margin: 28px 0 8px; }
.chapter-head h1 { font-size: clamp(34px, 5.5vw, 52px); margin: 0 0 16px; text-wrap: balance; }
.chapter-head .ch-meta { font-size: 14px; color: var(--muted); }

.chapter-text {
  max-width: var(--reader-width);
  margin: 0 auto;
  font-family: var(--font-read);
  font-size: var(--reader-size);
  line-height: 1.75;
  hanging-punctuation: first;
  font-feature-settings: "kern", "liga", "onum";
}
.chapter-text p { margin: 0; text-indent: 1.5em; }
.chapter-text p:first-child,
.chapter-text hr + p,
.chapter-text h2 + p,
.chapter-text .author-note + p,
.chapter-text .no-indent { text-indent: 0; }
.chapter-text p:first-child:not(.author-note)::first-letter,
.chapter-text .author-note + p::first-letter {
  float: left; font-family: var(--font-display); font-weight: 600;
  font-size: 3.6em; line-height: .82; padding: .08em .1em 0 0; color: var(--accent);
}
.chapter-text hr { border: 0; margin: 2em auto; text-align: center; height: auto; overflow: visible; }
.chapter-text hr::after { content: "⁂"; font-size: 1.2em; color: var(--muted); letter-spacing: .4em; }
.chapter-text blockquote { margin: 1.2em 1.5em; font-style: italic; }
.chapter-text h2 { font-size: 1.2em; text-align: center; margin: 2em 0 1em; }
.chapter-text .author-note {
  text-indent: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.6;
  background: var(--accent-soft); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 2em;
}

.chapter-end { max-width: var(--reader-width); margin: 56px auto 0; text-align: center; }
.chapter-end .fin { font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 18px; margin-bottom: 32px; }
.chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.chapter-nav a, .chapter-nav .next-soon {
  display: block; padding: 16px 18px; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease;
}
.chapter-nav a:hover { border-color: var(--accent); }
.chapter-nav small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.chapter-nav b { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.chapter-nav .next { text-align: right; grid-column: 2; }
.chapter-nav .next-soon { color: var(--muted); text-align: right; grid-column: 2; }
@media (max-width: 520px) { .chapter-nav { grid-template-columns: 1fr; } .chapter-nav .next, .chapter-nav .next-soon { grid-column: 1; } }
.kbd-hint { font-size: 13px; color: var(--muted); margin-top: 18px; }
kbd { font: 600 12px/1 var(--font-ui); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 6px; background: var(--surface); }

/* Contents drawer */
.drawer {
  border: 0; padding: 0; margin: 0 0 0 auto; height: 100%; max-height: 100%;
  width: min(420px, 100%); background: var(--bg); color: var(--ink);
  box-shadow: -20px 0 50px rgba(0,0,0,.2);
}
.drawer::backdrop { background: rgba(10, 8, 6, .45); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
.drawer-head h2 { font-size: 20px; margin: 0; }
.drawer .toc a, .drawer .toc .toc-locked { padding: 14px 20px; }

/* Resume-position toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .25s ease, transform .25s ease; z-index: 30;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; border-radius: 999px; padding: 8px 14px; font: 600 13px/1 var(--font-ui); cursor: pointer; background: var(--bg); color: var(--ink); }
.toast .toast-x { background: transparent; color: var(--bg); padding: 8px; }

.notice { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Print (resume prints cleanly as a PDF) ---------- */
@media print {
  :root, :root[data-theme] {
    --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --ink: #111; --muted: #555; --line: #ddd;
    --accent: #8b2d2a; --accent-soft: #f6eceb;
  }
  body { font-size: 11pt; }
  .site-header, .site-footer, .reader-bar, .resume-actions, .filter-bar, .no-print, .toast, .job-chevron { display: none !important; }
  .resume-head { padding-top: 0; }
  .resume-grid { grid-template-columns: 1fr 220px; gap: 28px; }
  .job-body[hidden] { display: block !important; }
  .job.is-dim { opacity: 1; }
  .job, .side-block, .edu-item { break-inside: avoid; }
  .skill-group .chip-extra { display: inline-flex !important; }
  .chip-more, .job-skills, .stats { display: none !important; }
  .card { border-color: #e5e5e5; }
  a { color: inherit; text-decoration: none; }
  .chip { border-color: #ddd; }
}

/* =========================================================
   THEME LAYER: case file
   ========================================================= */

::selection { background: var(--accent-strong); color: #fff; }

body { font-family: var(--font-read); font-size: 18px; line-height: 1.55; }

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .005em;
}
.eyebrow {
  font-family: var(--font-display); font-weight: 400;
  font-size: 17px; letter-spacing: .06em; color: var(--accent);
}
.tag {
  font-family: var(--font-display); font-weight: 400; font-size: 14px;
  letter-spacing: .06em; padding: 4px 8px 3px; border-radius: 3px;
  background: var(--accent-strong); color: #fff;
}

/* ---------- Header: black band, oxblood name ---------- */
.site-header { background: var(--band); border-bottom: 0; }
.header-inner { height: 76px; }
.brand {
  font-family: var(--font-display); font-weight: 400;
  font-size: 36px; line-height: 1; letter-spacing: .01em;
  text-transform: uppercase; color: #a33a38;
}
.brand:hover { color: #c0504d; }
.site-nav a {
  font-family: var(--font-display); font-weight: 400;
  text-transform: uppercase; letter-spacing: .04em; font-size: 22px;
  color: var(--band-ink); border-radius: 3px; padding: 6px 12px;
}
.site-nav a:hover { background: transparent; color: #d0605c; }
.site-nav a[aria-current="page"] { background: transparent; color: #d0605c; box-shadow: inset 0 -3px 0 var(--accent-strong); border-radius: 0; }
.site-header .icon-btn {
  width: 44px; height: 44px; border-radius: 4px; margin-left: 8px;
  background: var(--accent-strong); border-color: var(--accent-strong); color: #fff;
}
.site-header .icon-btn:hover { background: #9b3533; }
.site-header .icon-btn svg { width: 20px; height: 20px; }
@media (max-width: 480px) {
  .brand { font-size: 28px; }
  .site-nav a { font-size: 19px; padding: 6px 8px; }
  .site-header .icon-btn { width: 40px; height: 40px; }
}

/* ---------- Footer: black band ---------- */
.site-footer { background: var(--band); color: var(--band-muted); border-top: 0; padding: 36px 0; font-size: 16px; }
.footer-inner a { color: var(--band-ink); }
.footer-inner a:hover { color: #d0605c; }

/* ---------- Buttons ---------- */
.icon-btn { border-radius: 4px; }
.btn {
  font-family: var(--font-display); font-weight: 400;
  font-size: 21px; line-height: 1; letter-spacing: .04em; text-transform: uppercase;
  padding: 10px 16px 9px; border-radius: 4px;
  background: var(--band); border-color: var(--band); color: #fff;
}
.btn:hover { background: #2a2a2a; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: #9b3533; border-color: #9b3533; filter: none; }
.btn-small { font-size: 18px; padding: 8px 12px 7px; }
.btn svg { width: 18px; height: 18px; }

.chip { font-family: var(--font-read); font-size: 15px; border-radius: 3px; padding: 5px 11px; }
.chip[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.seg, .toast, .toast button { border-radius: 4px; }
.seg button { font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.seg button[aria-pressed="true"] { background: var(--accent-strong); color: #fff; }
.card { border-radius: var(--radius); }

.section-head h2 { font-size: clamp(32px, 4vw, 42px); }

/* ---------- Home ---------- */
.hero { padding-top: 64px; }
.hero h1 { font-size: clamp(64px, 11vw, 128px); font-weight: 400; line-height: .9; letter-spacing: .005em; text-transform: uppercase; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--accent); font-weight: 400; }
.hero .lede { font-size: clamp(19px, 2.3vw, 22px); color: var(--ink); }

/* the two "doors" are black feature panels */
.door {
  background: var(--band); border-color: var(--band); color: var(--band-ink);
  border-radius: var(--radius);
}
.door:hover { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--accent-strong), var(--shadow); }
.door h2 { font-size: 40px; color: #fff; }
.door p { color: var(--band-muted); }
.door .eyebrow { color: #d0605c; }
.door-num { display: none; }
.door .door-cta {
  align-self: flex-start; color: #fff; background: var(--accent-strong);
  font-family: var(--font-display); font-weight: 400; font-size: 20px;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 9px 14px 8px; border-radius: 4px;
}
.release h3 { font-size: 24px; color: var(--accent); }
.continue-banner { border-left: 5px solid var(--accent-strong); }

/* ---------- Covers: black jacket, big white condensed type ---------- */
.cover {
  --c: #0e1114;
  --c-ink: #ffffff;
  border-radius: 2px 4px 4px 2px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 35%),
    linear-gradient(0deg, rgba(130, 44, 43, .55), transparent 45%),
    var(--c);
}
.cover::after { display: none; }
.cover-title {
  font: 400 19cqi/0.92 var(--font-display);
  text-transform: uppercase; letter-spacing: .01em;
  color: var(--c-title, #ffffff);
}
.cover-rule { background: #d0605c; opacity: 1; height: 2px; }
.cover-genre, .cover-author { font-family: var(--font-display); font-weight: 400; }
.cover-genre { font-size: 8cqi; letter-spacing: .1em; }
.cover-author { font-size: 10cqi; letter-spacing: .06em; opacity: 1; }
.mini-cover .cover-title { font-size: 20cqi; }

/* ---------- Library & book pages ---------- */
.page-head h1, .book-hero h1, .resume-head h1 { font-weight: 400; line-height: .95; }
.page-head h1 { font-size: clamp(48px, 7vw, 72px); }
.book-card h2 { font-size: 34px; }
.book-card h2 a { color: var(--accent); }
.book-card h2 a:hover { color: var(--ink); }
.book-card .blurb, .page-head p, .hero .lede { font-size: 18px; }
.book-hero h1 { font-size: clamp(48px, 7vw, 72px); color: var(--accent); }
.toc .toc-num, .toc .toc-title { font-weight: 400; }
.toc .toc-num { font-size: 26px; }
.toc .toc-title { font-size: 23px; letter-spacing: .01em; }
.toc .toc-sub, .toc .toc-state { font-family: var(--font-read); font-size: 15px; }
.book-meta { font-size: 15px; }

/* ---------- Resume ---------- */
.resume-head h1 { font-size: clamp(56px, 8vw, 92px); text-transform: uppercase; }
.resume-head .role { font-size: 22px; color: var(--accent); }
.summary { font-size: 20px; }
.core-list li::before { border-radius: 0; transform: none; width: 9px; height: 9px; top: .55em; background: var(--accent-strong); }
.stat { background: var(--band); border-color: var(--band); color: #fff; }
.stat b { font-size: 50px; font-weight: 400; color: #fff; }
.stat span { color: var(--band-muted); font-size: 15px; }
.job.is-current::before { background: var(--accent-strong); border-color: var(--accent-strong); }
.job-toggle h3 { font-size: 27px; font-weight: 400; letter-spacing: .01em; }
.job-org { color: var(--accent); font-weight: 600; }
.job-dates { font-size: 15px; }
.job-body > p, .job-body li { font-size: 17.5px; }
.side-block h2 { font-size: 30px; border-bottom: 3px solid var(--accent-strong); padding-bottom: 6px; }
.skill-group h3 { font-family: var(--font-display); font-weight: 400; font-size: 18px; letter-spacing: .05em; color: var(--ink); }
.edu-item b, .award-item b, .pub-item b { font-weight: 400; font-size: 21px; }
.filter-bar { font-size: 16px; }

/* ---------- Chapter reader ---------- */
.reader-where b { font-weight: 600; }
.chapter-head .book-link { font-family: var(--font-display); font-weight: 400; font-size: 18px; letter-spacing: .08em; }
.chapter-head .ch-num { font-family: var(--font-display); font-style: normal; font-size: 24px; letter-spacing: .08em; text-transform: uppercase; }
.chapter-head h1 { font-size: clamp(48px, 7.5vw, 76px); font-weight: 400; line-height: .95; text-transform: uppercase; }
.chapter-head .ch-meta { font-size: 16px; font-style: italic; }
.chapter-text { line-height: 1.66; }
.chapter-text p:first-child:not(.author-note)::first-letter,
.chapter-text .author-note + p::first-letter {
  font-family: var(--font-display); font-weight: 400;
  font-size: 4.6em; line-height: .8; padding: .04em .08em 0 0;
  color: var(--accent);
}
.chapter-text hr::after { content: "\25A0\2003\25A0\2003\25A0"; letter-spacing: 0; font-size: .6em; color: var(--accent); }
.chapter-text .author-note { border-left: 4px solid var(--accent-strong); border-radius: 0; }
.chapter-end .fin { font-family: var(--font-display); font-style: normal; text-transform: uppercase; letter-spacing: .08em; font-size: 22px; color: var(--accent); }
.chapter-nav small { font-family: var(--font-display); font-size: 16px; letter-spacing: .06em; }
.chapter-nav b { font-weight: 400; font-size: 22px; letter-spacing: .01em; }
.kbd-hint { font-size: 15px; }
.drawer { border-radius: 0; }
.drawer-head { background: var(--band); color: #fff; border-bottom: 0; }
.drawer-head h2 { font-size: 26px; color: #fff; }
.drawer-head .icon-btn { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

/* Donation box at the end of each chapter */
.support-box {
  margin: 8px auto 32px; max-width: 34rem; padding: 28px 26px; text-align: center;
  background: var(--surface-2); border-top: 5px solid var(--accent-strong); border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--font-read);
}
.support-box h2 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 34px; line-height: 1; margin: 0 0 12px; color: var(--ink); }
.support-box p { font-size: 18px; line-height: 1.5; margin: 0 0 18px; color: var(--ink); }
.support-box .btn { font-size: 21px; padding: 11px 18px 10px; }
.support-box .support-small { font-size: 15px; color: var(--muted); margin: 16px 0 0; }
.donate-btn svg { width: 20px; height: 20px; }

/* Resume contact strip: address and phone stand out under the title */
.resume-head .contact-row {
  gap: 10px 28px; margin-top: 18px; padding: 14px 18px;
  font-size: 19px; font-weight: 600;
  background: var(--surface-2); border-left: 5px solid var(--accent-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.resume-head .contact-row a, .resume-head .contact-row span { color: var(--ink); gap: 10px; }
.resume-head .contact-row a:hover { color: var(--accent); }
.resume-head .contact-row svg {
  box-sizing: content-box; width: 16px; height: 16px; padding: 6px;
  background: var(--accent-strong); color: #fff; border-radius: 3px; flex: none;
}
@media (max-width: 600px) {
  .resume-head .contact-row { flex-direction: column; font-size: 17px; padding: 12px 14px; }
}

@media print {
  .resume-head .contact-row { background: none; padding: 6px 0 6px 12px; font-size: 12pt; }
  .resume-head .contact-row svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .stat { background: #fff; color: #111; }
  .stat b { color: #111; }
  .side-block h2 { border-bottom-color: #8b2d2a; }
}
