:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --ink: #1c1c1a;
  --ink-2: #4a4740;
  --muted: #77726a;
  --rule: #d6cfbf;
  --accent: #1f4d3a;
  --accent-ink: #f4f1ea;
  --ok: #2f6b3f;
  --err: #9b2c1f;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: #d9e4d6; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 5;
  background: rgba(244, 241, 234, .94);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(1.2) blur(6px);
}
.head-row { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font: 600 19px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: .1px; }
.site-nav { display: flex; gap: 26px; align-items: center; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav .nav-cv { color: var(--accent); font-weight: 500; }
.nav-toggle { display: none; font: 500 14px var(--sans); background: none; border: 1px solid var(--rule); color: var(--ink); padding: 6px 12px; border-radius: 3px; }

/* Hero */
.hero { padding-top: 96px; padding-bottom: 72px; border-bottom: 1px solid var(--rule); }
.eyebrow { font: 13px/1.4 var(--mono); color: var(--muted); margin: 0 0 18px; letter-spacing: .2px; }
.eyebrow a { color: inherit; }
h1 { font: 500 clamp(40px, 6.4vw, 68px)/1.04 var(--serif); margin: 0 0 26px; letter-spacing: -.6px; }
.lede { font: 400 clamp(20px, 2.3vw, 24px)/1.5 var(--serif); color: var(--ink-2); max-width: 720px; margin: 0 0 26px; }
.status { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); margin: 0 0 34px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3f8a52; flex: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin: 0; }

.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  font: 500 15px/1 var(--sans); padding: 14px 22px; border: 0; border-radius: 3px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #173b2c; text-decoration: none; }
.link-arrow { font-size: 15px; font-weight: 500; }
.link-arrow::after { content: " →"; }

/* Sections */
.section { padding-top: 64px; padding-bottom: 64px; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.section-label {
  font: 400 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin: 0 0 32px;
}
.section-note { color: var(--muted); font-size: 15px; margin: -18px 0 28px; }
.prose p { margin: 0 0 18px; max-width: 640px; }
.prose p:last-child { margin-bottom: 0; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; align-items: start; }
.facts { margin: 0; border-top: 1px solid var(--ink); }
.facts div { padding: 13px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font: 12px/1.3 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 3px; }
.facts dd { margin: 0; font-size: 16px; }

/* Experience */
.job + .job { margin-top: 52px; }
.job-head { display: flex; justify-content: space-between; gap: 24px; align-items: baseline; margin-bottom: 16px; }
.job h3 { font: 500 26px/1.2 var(--serif); margin: 0 0 4px; }
.job-role { margin: 0; color: var(--ink-2); }
.job-meta { margin: 0; text-align: right; font: 13px/1.6 var(--mono); color: var(--muted); white-space: nowrap; }
.job-points { margin: 0; padding: 0; list-style: none; max-width: 820px; }
.job-points li { position: relative; padding-left: 22px; margin: 0 0 11px; color: var(--ink-2); }
.job-points li::before { content: "–"; position: absolute; left: 0; color: var(--muted); }

/* Projects */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; }
.project { display: grid; grid-template-columns: 38px 1fr; padding: 22px 0 24px; border-top: 1px solid var(--rule); }
.project-no { font: 13px/2 var(--mono); color: var(--muted); }
.project h3 { font: 500 21px/1.3 var(--serif); margin: 0 0 8px; }
.project-kind { display: block; font: 12px/1.6 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.project p { margin: 0 0 10px; color: var(--ink-2); font-size: 16px; }
.project-stack { font: 13px/1.6 var(--mono); color: var(--muted) !important; margin: 0 !important; }

/* Skills */
.skills { margin: 0; }
.skills div { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 13px 0; border-top: 1px solid var(--rule); }
.skills div:last-child { border-bottom: 1px solid var(--rule); }
.skills dt { font: 500 15px/1.6 var(--sans); }
.skills dd { margin: 0; color: var(--ink-2); }

/* Posts */
.post-list { list-style: none; margin: 0 0 24px; padding: 0; }
.post-list li { padding: 18px 0; border-top: 1px solid var(--rule); }
.post-list a { font: 500 22px/1.3 var(--serif); text-decoration: none; color: var(--ink); }
.post-list a:hover { color: var(--accent); text-decoration: underline; }
.post-list time { display: block; font: 13px/1.8 var(--mono); color: var(--muted); }
.post-list p { margin: 6px 0 0; color: var(--ink-2); max-width: 680px; }
.empty { color: var(--muted); }

.page-head { padding-top: 80px; padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: clamp(36px, 5vw, 54px); }

.post { max-width: 760px; padding-top: 72px; padding-bottom: 72px; }
.post-head h1 { font-size: clamp(34px, 5vw, 50px); margin-bottom: 14px; }
.post-meta { font: 13px var(--mono); color: var(--muted); margin: 0 0 44px; }
.post-body { font: 19px/1.7 var(--serif); }
.post-body p, .post-body ul, .post-body ol, .post-body blockquote, .post-body pre { max-width: none; margin: 0 0 22px; }
.post-body h2 { font: 500 28px/1.25 var(--serif); margin: 44px 0 14px; }
.post-body h3 { font: 600 21px/1.3 var(--serif); margin: 34px 0 10px; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote { border-left: 2px solid var(--accent); margin-left: 0; padding-left: 20px; color: var(--ink-2); font-style: italic; }
.post-body code { font: 15px var(--mono); background: var(--paper-2); padding: 2px 5px; border-radius: 2px; }
.post-body pre { background: #1f211f; color: #e7e3d8; padding: 18px 20px; overflow-x: auto; border-radius: 3px; }
.post-body pre code { background: none; padding: 0; color: inherit; font-size: 14px; line-height: 1.6; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }
.post-foot { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 16px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; align-items: start; }
.contact-lede { font: 400 22px/1.5 var(--serif); margin: 0 0 28px; }
.contact-direct { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.contact-direct li { display: grid; grid-template-columns: 100px 1fr; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
.contact-direct span { font: 12px/2 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.contact-direct a { word-break: break-word; }

.contact-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.contact-form input, .contact-form select, .contact-form textarea {
  display: block; width: 100%; margin-top: 6px;
  font: 16px/1.4 var(--sans); color: var(--ink);
  background: #fbfaf6; border: 1px solid var(--rule); border-radius: 3px; padding: 11px 12px;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--paper-2); font-size: 15px; margin: 0 0 20px; }
.notice.ok { border-color: var(--ok); }
.notice.err { border-color: var(--err); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding: 28px 0 36px; font-size: 14px; color: var(--muted); }
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.foot-row p { margin: 0; }
.foot-links { display: flex; gap: 20px; }
.foot-links a { color: var(--ink-2); }

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

/* Responsive */
@media (max-width: 860px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .projects { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: 6px 16px 14px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; width: 100%; font-size: 16px; }
  .hero { padding-top: 56px; padding-bottom: 52px; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .job-head { flex-direction: column; gap: 6px; }
  .job-meta { text-align: left; white-space: normal; }
  .job h3 { font-size: 23px; }
  .skills div { grid-template-columns: 1fr; gap: 2px; }
  .post-body { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .site-head, .site-foot, .contact-form, .hero-actions { display: none; }
  body { background: #fff; }
}
