:root {
  --bg: #fafaf7; --fg: #1f2328; --muted: #6b7280; --accent: #b45309; --line: #e5e2da; --card: #ffffff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181c; --fg: #e6e6e3; --muted: #9aa0a6; --accent: #d6a15a; --line: #2b2f36; --card: #1e2126; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.65 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

.site-header { border-bottom: 1px solid var(--line); padding: 18px 0; }
.site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.site-title { font-size: 1.3rem; font-weight: 700; color: var(--fg); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav a { color: var(--muted); font-size: 0.95rem; }
.site-nav a[aria-current] { color: var(--fg); }

main.wrap { padding-top: 40px; padding-bottom: 64px; }
.meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 6px; }

.post-list { display: grid; gap: 28px; }
.post-card { display: grid; grid-template-columns: 220px 1fr; gap: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 8/5; }
.post-card-body { padding: 18px 20px 18px 0; }
.post-card-body:first-child { padding-left: 20px; grid-column: 1 / -1; }
.post-card h2 { margin: 0 0 4px; font-size: 1.3rem; }
.post-card h2 a { color: var(--fg); }
.post-card p { margin: 0 0 8px; }
.post-card .more { font-size: 0.9rem; }
@media (max-width: 640px) {
  .post-card { grid-template-columns: 1fr; }
  .post-card-body { padding: 0 18px 18px; }
}

.post-header h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
.post-body h1, .post-body h2 { font-size: 1.35rem; margin: 2em 0 0.6em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.post-body p { margin: 0 0 1.1em; }
.post-body figure { margin: 1.4em 0; }
.post-body figcaption { color: var(--muted); font-size: 0.9rem; text-align: center; margin-top: 6px; }
.post-body .wp-image { margin: 0 auto; border-radius: 6px; }
.post-body .alignright { float: right; max-width: 45%; margin: 0 0 1em 1.5em; }
.post-body .alignleft { float: left; max-width: 45%; margin: 0 1.5em 1em 0; }
.post-body .img-link { display: block; }
.post-body h1::after, .post-body h2::after { content: ""; display: table; clear: both; }
.post-body .youtube-video { margin: 1.4em 0; }
.post-body iframe { max-width: 100%; }

.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 1.4em 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.comments { margin-top: 3em; border-top: 1px solid var(--line); padding-top: 1em; }
.comment { border-left: 3px solid var(--line); padding: 4px 0 4px 16px; margin: 1em 0; }
.comment-meta { margin: 0 0 4px; font-size: 0.9rem; }
.contact-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.contact-form { display: grid; gap: 16px; max-width: 560px; }
.contact-form label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.contact-form input, .contact-form textarea { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; width: 100%; }
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form button { justify-self: start; font: inherit; font-weight: 600; color: var(--bg); background: var(--accent); border: 0; border-radius: 6px; padding: 9px 20px; cursor: pointer; }
.contact-form button:disabled { opacity: 0.6; cursor: default; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .form-status { margin: 0; min-height: 1.65em; }
.contact-form .form-status.error { color: #dc2626; }

.site-footer { padding: 0 20px 18px; color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0; padding-top: 18px; border-top: 1px solid var(--line); }

.post-body pre { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; overflow-x: auto; font-size: 0.8rem; line-height: 1.5; }
.post-body code { font-family: var(--mono); }
.post-body details { margin: 0 0 1.1em; }
.post-body summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; margin-bottom: 0.6em; }
.post-body table { border-collapse: collapse; margin: 0 0 1.1em; font-size: 0.95rem; }
.post-body th, .post-body td { border-bottom: 1px solid var(--line); padding: 6px 14px 6px 0; text-align: left; vertical-align: top; }

.list-header { margin-bottom: 28px; }
.list-header h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 8px; }
.list-header p { color: var(--muted); margin: 0; }

/* Front-page resume. Left column: dates, keys, labels (mono, muted). Right column: content. */
.cv h1 { font-size: 2.4rem; line-height: 1.1; margin: 0 0 6px; letter-spacing: -0.02em; }
.cv h2 { font-size: 1.15rem; margin: 0 0 18px; padding-top: 14px; border-top: 2px solid var(--fg); }
.cv h3 { font-size: 1.05rem; margin: 0 0 4px; line-height: 1.4; }
.cv code { font-family: var(--mono); font-size: 0.88em; }
.cv-section { margin: 52px 0 0; }
.role-when, .spec dt, .cv .meta { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.cv-intro.has-photo { display: grid; grid-template-columns: 1fr 220px; gap: 40px; align-items: start; }
.cv-intro p { margin: 0 0 14px; }
.cv-headline { font-size: 1.15rem; color: var(--muted); }
.cv-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.95rem; }
.cv-intro-figure { margin: 6px 0 0; }
.cv-intro-figure img { width: 100%; border: 1px solid var(--line); }
.cv-intro-figure figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

.spec { margin: 0; border-top: 1px solid var(--line); }
.spec div { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.spec dt { padding-top: 2px; }
.spec dd { margin: 0; }

.role { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 0 0 26px; }
.role-when { margin: 3px 0 0; line-height: 1.5; }
.role .org { font-weight: 400; color: var(--muted); }
.role-context { color: var(--muted); margin: 0 0 8px; }
.role ul { margin: 0 0 8px; padding-left: 1.1em; }
.role li { margin: 0 0 4px; }
.role-body p:last-child { margin-bottom: 0; }

.section-note { color: var(--muted); margin: -6px 0 18px; }
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
.project-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--line); margin-bottom: 10px; }
.project h3 { font-size: 0.98rem; }
.project h3 a { color: var(--fg); }
.project p { margin: 0 0 4px; font-size: 0.92rem; line-height: 1.55; }
.subhead { margin-top: 30px !important; }
.plain { margin: 0; padding-left: 1.1em; }
.plain li { margin: 0 0 4px; }


@media (max-width: 640px) {
  .cv h1 { font-size: 2rem; }
  .cv-intro.has-photo { grid-template-columns: 1fr; gap: 8px; }
  .cv-intro-figure { max-width: 180px; }
  .spec div, .role { grid-template-columns: 1fr; gap: 2px; }
  .role { padding-bottom: 22px; }
  .projects { grid-template-columns: 1fr; gap: 24px; }
}

@page { margin: 0.5in 0.6in; }
@media print {
  :root { --bg: #fff; --fg: #000; --muted: #444; --line: #ccc; --accent: #000; }
  body { font-size: 9.5pt; line-height: 1.4; }
  .cv-intro p { margin-bottom: 8px; }
  .role li { margin-bottom: 1px; }
  .role-context { margin-bottom: 4px; }
  .site-header, .site-footer, .no-print, .cv-links, .cv-intro-figure { display: none; }
  main.wrap { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .cv-intro { display: block; }
  .cv h1 { font-size: 20pt; }
  .cv-section { margin-top: 12px; }
  .cv h2 { font-size: 11pt; margin-bottom: 8px; padding-top: 6px; border-top-width: 1px; }
  .role { padding-bottom: 8px; }
  .role li, .role h3, .spec div { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .spec div { padding: 3px 0; }
  .spec div, .role { grid-template-columns: 150px 1fr; }
  .role-when, .spec dt { font-size: 7.5pt; }
  a { color: inherit; }
}
