:root {
  /* Ink + paper */
  --ink: #16203a;          /* display headings, near-black navy */
  --text: #232c40;         /* body */
  --text-muted: #6b7286;   /* muted captions, meta */
  --bg: #faf8f2;           /* page background, warm white */
  --surface: #f2ede2;      /* callouts / cards, warm cream */
  --surface-soft: #f7f3ea; /* lighter card tint */

  /* Gold accent family — logo mark #C9A84C, apps #b8893b */
  --gold: #9a7322;         /* accent text: eyebrows, kickers, links */
  --gold-deep: #7d5d18;    /* hover / stronger */
  --gold-bright: #c9a84c;  /* logo gold, decorative fills only */
  --gold-line: #e0cfa0;    /* hairline underline */

  /* Lines */
  --border: rgba(22, 32, 58, 0.13);
  --border-strong: rgba(22, 32, 58, 0.28);
  --code-bg: #f1ece0;

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --max-width: 720px;
}

* { box-sizing: border-box; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  font-family: var(--sans);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Shared eyebrow / kicker label */
.eyebrow,
.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.85rem;
  font-weight: 400;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.15rem 0;
  margin-bottom: 3.5rem;
  background: var(--bg);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.site-mark {
  height: 34px;
  width: auto;
  display: block;
}

.site-nav a {
  font-family: var(--mono);
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover {
  color: var(--gold-deep);
  border-bottom-color: var(--gold-line);
}

/* Main content */
.site-main { min-height: 60vh; padding-bottom: 4rem; }

/* Headings */
h1 {
  font-family: var(--serif);
  font-size: 2.4rem;
  line-height: 1.12;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}

h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.25;
  font-weight: 500;
  color: var(--ink);
  margin: 2.8rem 0 1rem;
  letter-spacing: -0.005em;
}

h3 {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 500;
  color: var(--ink);
  margin: 1.9rem 0 0.6rem;
}

p { margin: 0 0 1.2rem; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover {
  color: var(--gold-deep);
  text-decoration-color: var(--gold);
}

strong { font-weight: 600; color: var(--ink); }

ul, ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
li { margin-bottom: 0.45rem; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.8rem 0;
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--ink);
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}
pre code { background: none; padding: 0; }

blockquote {
  border-left: 3px solid var(--gold);
  padding-left: 1.2rem;
  color: var(--text-muted);
  margin: 1.5rem 0;
  font-style: italic;
}

/* Primary download / CTA buttons (project-document, cv) */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  background: var(--ink);
  color: #faf8f2;
  border: 1px solid var(--ink);
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-download:hover {
  background: var(--gold-deep);
  border-color: var(--gold-deep);
  color: #faf8f2;
}

/* ---------- Homepage ---------- */
.home h1 { font-size: 2.9rem; }

.home-hero {
  margin: 0 0 2.4rem;
}
.home-hero h1 {
  margin: 0 0 1rem;
}
.home-lead {
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 0.9rem;
  max-width: 34em;
}
.home-avail {
  font-size: 0.98rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0;
  max-width: 36em;
}

/* Two content pillars, side by side */
.home-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 2rem 0 2.5rem;
}
.home-pillars .pillar {
  background: var(--surface-soft);
  padding: 1.5rem 1.6rem;
}
.home-pillars .pillar-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.5rem;
}
.home-pillars .pillar h3 {
  margin: 0 0 0.4rem;
  font-size: 1.18rem;
}
.home-pillars .pillar p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Build / Bridge / Field credibility list — leading word becomes a gold kicker */
.bbf-list { margin: 1.5rem 0 2rem; }
.bbf-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bbf-list > ul > li {
  position: relative;
  padding: 1rem 0 1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.97rem;
  line-height: 1.6;
  margin: 0;
}
.bbf-list > ul > li:last-child { border-bottom: none; }
.bbf-list > ul > li > strong:first-child,
.bbf-list > ul > li > p:first-child > strong:first-child {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
  margin-right: 0.4rem;
}

/* Inline section nav line (Writing / Tools / Track record links on home) */
.home .home-quicklinks {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* Article / paper cover image — aligned to the text column.
   No breakout: a wider-than-column cover collides with the fixed
   table-of-contents that sits in the right viewport margin. */
article img:first-of-type,
.paper-cover img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 2rem;
  border-radius: 4px;
}
.paper-cover { margin: 0; }

/* Any paragraph containing only an image (markdown image pattern) */
.paper-content p:has(> img:only-child) {
  margin: 0 0 2rem;
}

/* TL;DR card */
.paper-content .tldr,
article .tldr {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 1.1rem 1.4rem;
  margin: 0 0 2rem;
}
.tldr-header {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 400;
  margin: 0 0 0.6rem;
}
.tldr ul {
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
}
.tldr ul li {
  margin-bottom: 0.45rem;
  font-size: 0.97rem;
  line-height: 1.45;
}
.tldr ul li:last-child { margin-bottom: 0; }

/* Pull-quote / thesis callout */
blockquote.thesis {
  margin: 2rem 0;
  padding: 1.1rem 1.4rem;
  border-left: 4px solid var(--gold);
  background: var(--surface);
  font-style: normal;
  color: var(--ink);
  border-radius: 0 4px 4px 0;
}
blockquote.thesis::before {
  content: "Thesis";
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 400;
  margin-bottom: 0.5rem;
}
blockquote.thesis p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.5;
}

/* "Five Monday actions" — numbered action card */
.monday-actions {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem 1.8rem;
  margin: 1.5rem 0 2rem;
}
.monday-actions ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: action;
}
.monday-actions ol > li {
  counter-increment: action;
  position: relative;
  padding: 0.9rem 0 0.9rem 3rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.97rem;
  line-height: 1.5;
}
.monday-actions ol > li:first-child { padding-top: 0; }
.monday-actions ol > li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.monday-actions ol > li::before {
  content: counter(action);
  position: absolute;
  left: 0;
  top: 0.9rem;
  width: 2.1rem;
  height: 2.1rem;
  background: var(--ink);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.92rem;
  line-height: 1;
}
.monday-actions ol > li:first-child::before { top: 0; }

/* Tables in paper / article / list-page body */
.paper-content table,
.page-content table,
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
  line-height: 1.45;
}
.paper-content th,
.paper-content td,
.page-content th,
.page-content td,
article th,
article td {
  padding: 0.65em 0.9em;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.paper-content th,
.page-content th,
article th {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
  border-bottom: 2px solid var(--border-strong);
}
.paper-content td:first-child,
.page-content td:first-child,
article td:first-child {
  color: var(--ink);
  width: 25%;
}
.paper-content th:last-child,
.page-content th:last-child,
article th:last-child {
  color: var(--gold-deep);
}
.paper-content tr:hover td,
.page-content tr:hover td,
article tr:hover td {
  background: var(--surface-soft);
}

/* Click-to-zoom lightbox */
img.lightbox-zoomable { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  cursor: zoom-out;
  padding: 1.5rem;
}
.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}
.lightbox-img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

/* ---------- Paper ---------- */
.paper-series {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.7rem;
}

.paper-subtitle {
  font-family: var(--serif);
  font-size: 1.4rem;
  line-height: 1.3;
  color: var(--text-muted);
  margin: 0 0 1rem;
  font-weight: 400;
  font-style: italic;
}

.paper-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.paper-pdf-link,
.paper-doi-link {
  display: inline-block;
  font-weight: 500;
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
}
.paper-pdf-link:hover,
.paper-doi-link:hover { color: var(--ink); border-bottom-style: solid; }

.paper-citation {
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--surface);
  border-left: 3px solid var(--gold);
  padding: 0.85rem 1.1rem;
  border-radius: 0 4px 4px 0;
  margin: 0 0 3rem 0;
}
.paper-citation strong {
  font-family: var(--mono);
  color: var(--gold-deep);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 500;
}
.paper-citation code { font-size: 0.78rem; background: transparent; color: var(--gold-deep); word-break: break-all; }
.paper-citation em { font-style: italic; color: var(--text); }

.paper-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Paper Table of Contents — fixed sidebar in the right margin */
.paper-toc {
  position: fixed;
  top: 6rem;
  right: max(1.5rem, calc((100vw - var(--max-width)) / 2 - 240px));
  width: 220px;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  font-size: 0.82rem;
  z-index: 5;
}

.paper-toc-title {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin: 0 0 0.7rem;
  font-weight: 400;
}

.paper-toc nav ul,
.paper-toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.paper-toc li {
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.paper-toc a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: none;
  display: block;
  padding: 0.15rem 0;
}

.paper-toc a:hover { color: var(--gold-deep); }

.paper-toc ul ul {
  padding-left: 0.9rem;
  margin-top: 0.3rem;
}

.paper-toc ul ul li {
  font-size: 0.95em;
  opacity: 0.85;
}

@media (max-width: 1220px) {
  .paper-toc { display: none; }
}

/* Paper list */
.paper-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.paper-list li {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.paper-list a {
  text-decoration: none;
  color: var(--ink);
  display: block;
}

.paper-list a:hover h3 { color: var(--gold-deep); }

.paper-list h3 { margin: 0 0 0.5rem; }

.paper-list .subtitle {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}
.paper-list .date {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a { color: var(--text-muted); text-decoration-color: var(--border-strong); }
.site-footer a:hover { color: var(--gold-deep); }

/* Track record hub cards */
.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.hub-card {
  display: block;
  padding: 1.3rem 1.4rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.hub-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 18px rgba(154, 115, 34, 0.1);
  transform: translateY(-1px);
}

.hub-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 500;
}

.hub-card-meta {
  font-family: var(--mono);
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}

.hub-card ul {
  margin: 0 0 0.85rem;
  padding-left: 1.1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}

.hub-card ul li { margin-bottom: 0.2rem; }

.hub-card-more {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 400;
}

/* Responsive */
@media (max-width: 640px) {
  html { font-size: 17px; }
  h1 { font-size: 1.9rem; }
  .home h1 { font-size: 2.2rem; }
  h2 { font-size: 1.35rem; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .site-nav { margin-top: 0.2rem; }
  .site-nav a { margin-left: 0; margin-right: 1.2rem; }
  .home-pillars { grid-template-columns: 1fr; }
  .hub-cards { grid-template-columns: 1fr; }
}
