:root {
  --paper: #EEE8DA;
  --card: #F5F0E4;
  --ink: #17150F;
  --ink-2: #3B372D;
  --muted: #5C5648;
  --rule: #CFC6B1;
  --accent: #2C3C73;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 12px 16px; font-family: var(--ui); font-size: 14px;
}
.skip:focus { left: 16px; top: 16px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

/* Masthead and navigation */
.masthead {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 32px; padding-top: 24px; padding-bottom: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: 24px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; padding: 10px 0;
}
.brand-mark { display: block; width: 34px; height: 34px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0 28px; font-family: var(--ui); font-size: 14px; font-weight: 500; }
.nav a { color: var(--ink); text-decoration: none; padding: 14px 0; display: inline-block; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] { font-weight: 600; }

/* Headings and intros */
.eyebrow {
  margin: 0; font-family: var(--ui); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.display {
  margin: 20px 0 0; max-width: 900px;
  font-family: var(--display); font-weight: 300;
  font-size: clamp(38px, 5.6vw, 68px); line-height: 1.04; letter-spacing: -0.025em;
  text-wrap: balance;
}
.display.xl { font-size: clamp(40px, 6.4vw, 80px); line-height: 1.02; max-width: 960px; }
.intro { margin: 28px 0 0; max-width: 640px; font-size: 20px; color: var(--ink-2); text-wrap: pretty; }
.hero { padding-top: 72px; padding-bottom: 80px; }
.page-head { padding-top: 72px; }
.list-section { padding-top: 72px; }

/* Article lists */
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; margin-bottom: 24px;
}
.label {
  margin: 0; font-family: var(--ui); font-size: 12px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.more { font-family: var(--ui); font-size: 14px; font-weight: 600; padding: 10px 0; text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.entries { border-bottom: 1px solid var(--rule); }
.entry {
  display: grid; grid-template-columns: 1fr 2fr; gap: 8px 32px;
  padding: 32px 0; border-top: 1px solid var(--rule);
  color: var(--ink); text-decoration: none;
}
.entry:first-child { border-top-color: var(--ink); }
.entry-meta { font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--muted); }
.entry-meta .topic { color: var(--accent); }
.entry h3 {
  margin: 0 0 8px; font-family: var(--display); font-weight: 400;
  font-size: 30px; line-height: 1.15; letter-spacing: -0.01em;
}
.entry p { margin: 0; font-size: 17px; color: var(--muted); max-width: 620px; }
.entry:hover h3 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.list-note { margin: 56px 0 0; max-width: 620px; font-size: 15px; color: var(--muted); }

/* Article page */
.article { max-width: 720px; margin: 0 auto; padding: 56px 32px 0; }
.back {
  display: inline-block; padding: 12px 0; font-family: var(--ui);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.back:hover { text-decoration: underline; text-underline-offset: 4px; }
.article .eyebrow { margin: 24px 0 20px; }
.article .eyebrow span { color: var(--muted); }
.article h1 {
  margin: 0; font-family: var(--display); font-weight: 300;
  font-size: clamp(34px, 5vw, 54px); line-height: 1.07; letter-spacing: -0.025em; text-wrap: balance;
}
.lede {
  margin: 28px 0 0; font-family: var(--display); font-weight: 300;
  font-size: 24px; line-height: 1.4; color: var(--ink-2); text-wrap: pretty;
}
.prose { margin-top: 56px; font-size: 20px; line-height: 1.7; }
.prose h2 {
  margin: 44px 0 16px; font-family: var(--display); font-weight: 400;
  font-size: 28px; line-height: 1.2; letter-spacing: -0.01em;
}
.prose h3 { margin: 32px 0 12px; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.25; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 20px; text-wrap: pretty; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 1.3em; }
.prose li { margin-bottom: 8px; }
.prose blockquote { margin: 0 0 20px 24px; font-style: italic; color: var(--ink-2); }
.prose blockquote p { margin: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 0 0 20px; }
.prose a { overflow-wrap: anywhere; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--card); padding: 0.1em 0.3em; }
.prose pre { overflow-x: auto; margin: 0 0 20px; padding: 16px; background: var(--card); font-size: 16px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 44px 0; }
.note {
  margin: 44px 0 0; padding-top: 24px; border-top: 1px solid var(--rule);
  font-family: var(--ui); font-size: 13px; line-height: 1.6; color: var(--muted);
}
.nextcard {
  display: block; margin-top: 56px; padding: 28px;
  background: var(--card); border: 1px solid var(--rule);
  color: var(--ink); text-decoration: none;
}
.nextcard .label { color: var(--accent); }
.nextcard strong {
  display: block; margin-top: 8px; font-family: var(--display); font-weight: 400;
  font-size: 24px; line-height: 1.2;
}
.nextcard:hover strong { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

/* About page */
.about { display: grid; grid-template-columns: 2fr 1fr; gap: 56px 72px; padding-top: 64px; align-items: start; }
.about .prose { margin-top: 0; max-width: 660px; font-size: 21px; line-height: 1.65; }
.facts { margin: 0; padding-top: 20px; border-top: 2px solid var(--ink); display: grid; gap: 16px; font-size: 16px; }
.facts dt {
  font-family: var(--ui); font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.facts dd { margin: 0; }
.fine { max-width: 660px; margin-top: 72px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }

/* Footer */
.site-footer { margin-top: 112px; border-top: 1px solid var(--rule); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between;
  padding-top: 40px; padding-bottom: 56px; font-size: 15px; color: var(--muted);
}
.footer-inner p { margin: 4px 0 0; }
.footer-name { font-family: var(--display); font-size: 20px; color: var(--ink); }
.footer-fine { margin-top: 12px; font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 24px; font-family: var(--ui); font-size: 14px; font-weight: 500; }
.footer-nav a { color: var(--muted); text-decoration: none; padding: 12px 0; display: inline-block; }
.footer-nav a:hover { color: var(--accent); }

@media (max-width: 800px) {
  .entry, .about { grid-template-columns: 1fr; }
  .wrap { padding-left: 20px; padding-right: 20px; }
  .article { padding-left: 20px; padding-right: 20px; }
  .hero { padding-top: 48px; padding-bottom: 56px; }
  .page-head { padding-top: 48px; }
  .prose { font-size: 19px; }
}

/* Home cards: two sections, with a hover and focus response that needs no script */
@property --accent { syntax: "<color>"; inherits: true; initial-value: #2C3C73; }
.cards { display: flex; gap: 24px; }
.card {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  padding: 36px; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--accent);
  color: var(--ink);
}
.card-law { --accent: #2C3C73; }
.card-fiction { --accent: #7A2E2A; }
.card h2 {
  margin: 0; font-family: var(--display); font-weight: 300;
  font-size: clamp(34px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -0.025em; color: var(--accent);
}
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; }
.card-link:focus-visible { outline: none; }
.card:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.arrow { display: inline-block; margin-left: 0.3em; font-family: var(--ui); font-size: 0.55em; }
.card-text { margin: 20px 0 0; max-width: 460px; font-size: 19px; color: var(--ink-2); text-wrap: pretty; }
.card-list { margin-top: auto; padding-top: 32px; }
.card-list .label { margin-bottom: 10px; color: var(--accent); }
.card-list ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.card-list li { border-bottom: 1px solid var(--rule); }
.card-list a {
  position: relative; z-index: 1; display: block; padding: 11px 0;
  color: var(--ink); text-decoration: none; font-family: var(--ui);
}
.ci-title { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; }
.ci-meta { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.card-list a:hover .ci-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

@media (hover: hover) and (min-width: 801px) {
  body { transition: --accent 0.4s ease; }
  .card { transition: flex-grow 0.4s ease, background-color 0.3s ease; }
  .card-list, .arrow { transition: opacity 0.3s ease, transform 0.3s ease; }
  .card:hover, .card:focus-within { flex-grow: 1.3; background: #F9F5EB; }
  .cards:has(.card:hover, .card:focus-within) .card:not(:hover):not(:focus-within) { flex-grow: 0.8; }
  .cards:has(.card:hover, .card:focus-within) .card:not(:hover):not(:focus-within) .card-list, .cards:has(.card:hover, .card:focus-within) .card:not(:hover):not(:focus-within)   .card:hover .arrow, .card:focus-within .arrow { transform: translateX(8px); }
  body:has(.card-fiction:hover), body:has(.card-fiction:focus-within) { --accent: #7A2E2A; }
}
@media (prefers-reduced-motion: reduce) {
  body, .card, .card-list, .arrow { transition: none !important; }
}

/* Fiction section: its own accent and a book-like reading column */
body.fiction { --accent: #7A2E2A; }
.section-label { margin-bottom: 16px; }
.series-head .readbtn {
  display: inline-block; margin-top: 8px; padding: 14px 22px; background: var(--accent); color: var(--paper);
  font-family: var(--ui); font-size: 15px; font-weight: 600; text-decoration: none;
}
.series-head .readbtn:hover { background: var(--ink); }
.series-head .prose { margin-top: 40px; }
.reading { font-size: 21px; line-height: 1.8; }
.reading p { margin: 0; text-indent: 1.5em; }
.reading p:first-child, .reading hr + p, .reading h2 + p, .reading h3 + p { text-indent: 0; }
.reading hr { border: 0; margin: 2.2em 0; text-align: center; }
.reading hr::before { content: "\2217\00a0\00a0\2217\00a0\00a0\2217"; color: var(--muted); letter-spacing: 0.2em; }
.reading.poem { font-size: 21px; line-height: 1.7; }
.reading.poem p { margin: 0 0 1.6em; text-indent: 0; }
.chapnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.chapnav .nextcard { margin-top: 0; }
.chapnav .nextcard:only-child { grid-column: 1 / -1; }
.chapnav .nextcard:last-child:nth-child(2) { text-align: right; }

@media (max-width: 800px) {
  .cards { flex-direction: column; }
  .chapnav { grid-template-columns: 1fr; }
  .card { padding: 28px; }
  .reading, .reading.poem { font-size: 19px; }
  .chapnav .nextcard:last-child:nth-child(2) { text-align: left; }
}
