:root {
  --ink: #000000;
  --paper: #f7f3ee;
  --rule: #c8b89a;
  --accent: #2c5f8a;
  --muted: #1a1208;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: #000000;
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  font-size: 23px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.nav {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 2rem;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.nav a:hover { border-color: var(--accent); }

.export-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: #f0ebe3;
  border-bottom: 1px solid var(--rule);
}

.export-toolbar button,
.export-toolbar a.export-btn {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  background: white;
  color: var(--ink);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.export-toolbar button:hover,
.export-toolbar a.export-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero {
  width: 100%;
  max-height: 280px;
  overflow: hidden;
  position: relative;
  background: #f3efe4;
}

.hero img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.hero-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.55rem 1.5rem 0.45rem;
  background: linear-gradient(transparent, rgba(5, 10, 25, 0.7));
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #faf8f5;
  font-family: 'Source Serif 4', serif;
}

.article-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.4rem 2rem 5rem;
  animation: fadeUp 0.6s ease both;
}

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}

.byline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.byline strong { color: var(--ink); font-weight: 400; }

.article-body p { margin-bottom: 1.5rem; font-size: 1.32rem; color: #000000; overflow-wrap: anywhere; }

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6rem 0;
  border: 1px solid #d4cfc6;
}

.article-body p:first-child::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.8rem;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin: 0.1em 0.08em 0 0;
  color: var(--accent);
}

.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  font-style: italic;
  color: #111111;
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.article-body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111111;
  margin: 1.6rem 0 0.7rem;
}

.article-body ul {
  margin: 0 0 1.5rem 1.4rem;
}

.article-body li {
  margin-bottom: 0.55rem;
  font-size: 1.15rem;
  color: #000000;
}

.article-body ol {
  margin: 0 0 1.5rem 1.4rem;
}

.article-body h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #111111;
  margin: 1.3rem 0 0.5rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
  background: #fff;
}

.article-body th,
.article-body td {
  border: 1px solid var(--rule);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background: #f3efe4;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.6rem;
  border: 1px solid var(--rule);
}

.table-wrap table {
  border: none;
}

.not-ai-flag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b0125f;
  border: 1px solid #b0125f;
  padding: 0.28rem 0.55rem;
  margin: 0 0 1rem;
}

.book-toc {
  margin: 0 0 2.2rem;
  padding: 1.1rem 1.3rem 1.2rem;
  background: #fff;
  border: 1px solid #d4cfc6;
}

.book-toc h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  margin: 0 0 0.8rem;
  padding: 0;
  border: none;
}

.book-toc ol {
  margin: 0 0 0 1.2rem;
}

.book-toc li {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.book-toc a {
  color: var(--accent);
  text-decoration: none;
}

.book-toc a:hover {
  text-decoration: underline;
}

.workbench {
  margin: 1.6rem 0 2rem;
  padding: 1rem 1.15rem 0.4rem;
  background: #fff;
  border: 1px solid #d4cfc6;
}

.workbench h3 {
  margin-top: 0;
}

.article-body .toc-top {
  font-size: 0.95rem;
}

.pull-quote {
  margin: 2.5rem 0;
  padding: 1.5rem 0 1.5rem 1.8rem;
  border-left: 4px solid var(--accent);
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
}

.try-it {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: #e8f0f7;
  border-left: 4px solid var(--accent);
  border-radius: 0 4px 4px 0;
}

.try-it-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.try-it p {
  font-family: 'Source Serif 4', serif;
  font-size: 0.98rem;
  color: #1a2a3a;
  margin-bottom: 0;
  font-style: italic;
}

.series-note {
  background: #f0ebe3;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin-bottom: 2.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.series-note a {
  color: var(--accent);
  text-decoration: none;
}

.series-note a:hover { text-decoration: underline; }

.author-note {
  margin-top: 3rem;
  padding: 1.2rem 1.4rem;
  background: white;
  border: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  border-radius: 4px;
}

.article-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-footer a { color: var(--accent); text-decoration: none; }

.buy-box {
  margin: 0 0 2.2rem;
  padding: 1.15rem 1.3rem;
  background: #ffffff;
  border: 1px solid #d4cfc6;
  border-radius: 4px;
}

.buy-box p {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #111111;
}

.buy-box a {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  background: #ffffff;
  color: #111111;
  border: 2px solid var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
}

.buy-box a:hover { background: #f3f0ea; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .hero img { height: 180px; }
  .hero { max-height: 180px; }
  .article-wrap { padding: 1.6rem 1rem 3rem; }
  .export-toolbar { padding: 0.75rem 1rem; }
}

@media print {
  .export-toolbar, .nav { display: none; }
  .hero { max-height: 200px; }
  .hero img { height: 200px; }
}
