:root {
  color-scheme: dark;
  --bg: #101010;
  --fg: #f2f1ed;
  --muted: #999995;
  --rule: #393937;
  --edge: clamp(24px, 3.5vw, 64px);
  --rail: clamp(185px, 20vw, 310px);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 40px; }
body { margin: 0; background: var(--bg); color: var(--fg); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 6px; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
[hidden] { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.arrow, .download-icon, .edit-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1; flex: 0 0 auto; }
.arrow { transition: transform 300ms cubic-bezier(.22,1,.36,1); }
a:hover .arrow { transform: translate(2px,-2px); }
.skip-link { position: fixed; top: 16px; left: 16px; z-index: 20; padding: 12px; background: var(--fg); color: var(--bg); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--rail); padding: 252px 20px 30px var(--edge); z-index: 5; }
.section-nav { display: grid; gap: 23px; }
.section-nav a { display: flex; align-items: baseline; width: fit-content; gap: 22px; font-size: 13px; color: var(--muted); transition: color 200ms ease, transform 300ms ease; }
.section-nav a:hover { color: var(--fg); transform: translateX(3px); }
.section-nav a[aria-current] { color: var(--fg); }
.nav-number { font-size: 10px; font-variant-numeric: tabular-nums; position: relative; }
.section-nav a[aria-current] .nav-number::before { content: ""; width: 3px; height: 3px; background: currentColor; position: absolute; left: -12px; top: 4px; }
main { margin-left: var(--rail); padding: 34px var(--edge) 0 30px; max-width: 1620px; }
.topline { display: flex; justify-content: flex-end; min-height: 24px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 25px; }
.contact-links a { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.identity-grid { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: end; padding: 44px 0 70px; }
h1 { font-size: clamp(30px,3.1vw,46px); line-height: 1.15; letter-spacing: -.045em; overflow-wrap: anywhere; }
.profile-education { margin-top: 20px; font-size: 14px; line-height: 1.6; }
.profile-education p + p { color: var(--muted); font-size: 12px; }
.profile-background { margin-top: 17px; color: #b7b7b2; font-size: 13px; line-height: 1.65; white-space: pre-line; }
.profile-location { color: var(--muted); font-size: 11px; margin-top: 8px; }
.resume-button { display: inline-flex; justify-content: center; align-items: center; gap: 17px; border: 1px solid #6b6b67; border-radius: 0; background: transparent; padding: 14px 18px; font-size: 11px; line-height: 1; min-height: 44px; white-space: nowrap; transition: color 200ms,background 200ms; }
a.resume-button:hover { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.resume-button:disabled { opacity: .55; cursor: not-allowed; }
.section { margin-bottom: 78px; }
.section-heading { border-top: 1px solid #a9a9a4; padding: 23px 0 30px; }
h2 { font-size: clamp(26px,2.3vw,34px); line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
.skill-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 25px 0; }
.skill-row h3 { font-size: 19px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.skill-items { color: #b7b7b2; font-size: 14px; line-height: 1.7; list-style: none; margin: 0; padding: 0; overflow-wrap: anywhere; }
.experience-row { display: grid; grid-template-columns: 1fr 2.5fr auto; gap: 24px; padding: 27px 0 30px; }
.row-label, .row-location, .row-dates { font-size: 11px; line-height: 1.5; color: var(--muted); }
.row-label { padding-top: 4px; overflow-wrap: anywhere; }
.experience-row h3 { font-size: 20px; letter-spacing: -.025em; line-height: 1.35; overflow-wrap: anywhere; }
.experience-row p { margin-top: 9px; font-size: 13px; line-height: 1.65; color: #b7b7b2; white-space: pre-line; }
.experience-meta { display: grid; gap: 7px; align-content: start; padding-top: 4px; text-align: right; }
.skill-row + .skill-row, .experience-row + .experience-row { border-top: 1px solid var(--rule); }
footer { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 20px; padding: 18px 0 26px; color: var(--muted); }
footer small { font-size: 11px; }
#green-hosting-badge { display: block; width: 200px; max-width: 100%; height: auto; aspect-ratio: 200 / 95; }
#editor-entry { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--muted); }
#editor-entry:hover { color: var(--fg); }
#content-error { color: var(--muted); padding: 20px 0; font-size: 13px; }
@media (max-width:1050px) {
  :root { --rail: 155px; --edge: 28px; }
  main { padding-left: 20px; }
  .identity-grid { grid-template-columns: 1fr; gap: 24px; }
  .resume-button { padding: 13px 17px; }
  .experience-row { grid-template-columns: 1fr 3fr; }
  .experience-meta { grid-column: 2; text-align: left; margin-top: -13px; }
}
@media (max-width:760px) {
  :root { --rail: 98px; --edge: 17px; }
  html { scroll-padding-top: 25px; }
  main { padding: 27px 19px 0 14px; }
  .sidebar { padding-top: 237px; padding-right: 10px; }
  .section-nav { gap: 25px; }
  .section-nav a { font-size: 10px; gap: 8px; }
  .nav-number { font-size: 8px; }
  .section-nav a[aria-current] .nav-number::before { left: -7px; top: 3px; }
  .contact-links { gap: 13px; justify-content: flex-end; }
  .contact-links a { font-size: 10px; gap: 5px; }
  .arrow { width: 11px; height: 11px; }
  .identity-grid { padding: 31px 0 47px; gap: 23px; }
  h1 { font-size: clamp(21px,4.7vw,30px); letter-spacing: -.045em; }
  .profile-education { margin-top: 17px; font-size: 12px; }
  .profile-education p + p { font-size: 10px; }
  .profile-background { font-size: 11px; margin-top: 14px; }
  .profile-location { font-size: 10px; }
  .resume-button { font-size: 10px; gap: 15px; padding: 12px 14px; }
  .section { margin-bottom: 57px; }
  .section-heading { padding: 19px 0 24px; }
  h2 { font-size: 24px; }
  .skill-row { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .skill-row h3 { font-size: 17px; }
  .skill-items { font-size: 12px; }
  .experience-row { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .experience-row h3 { font-size: 18px; }
  .experience-row p { font-size: 12px; }
  .row-label,.row-location,.row-dates { font-size: 10px; }
  .experience-meta { grid-column: 1; margin: 0; padding: 0; }
  footer { grid-template-columns: minmax(0,1fr) auto; }
  footer small { grid-column: 1; grid-row: 1; font-size: 9px; }
  footer #editor-entry { grid-column: 2; grid-row: 1; }
  #green-hosting-badge { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition: none !important; animation: none !important; }
}

/* Content templates */
html { scrollbar-gutter: stable; }
body.modal-open { overflow: hidden; }
.section-nav { max-height: calc(100dvh - 285px); overflow-y: auto; padding: 4px 6px 6px 0; }
.section-nav a { width: 100%; }
.nav-title { min-width: 0; overflow-wrap: anywhere; }
.nav-number { flex-shrink: 0; }
.project-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 48px 32px; }
.project-card { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; padding: 0; text-align: left; color: var(--fg); font: inherit; background: transparent; border: 0; cursor: pointer; }
.project-card:nth-child(n+3)::before { content: ""; position: absolute; top: -24px; left: 0; right: 0; border-top: 1px solid var(--rule); pointer-events: none; }
.project-thumbnail { display: block; width: 100%; }
.project-thumbnail img { display: block; width: 100%; height: auto; }
.project-copy { display: block; width: 100%; padding: 22px 0 0; }
.project-card:not(.has-image) .project-copy { padding-top: 0; }
.project-card:hover .project-title { color: #fff; }
.project-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.project-title { font-size: 22px; letter-spacing: -.025em; line-height: 1.3; overflow-wrap: anywhere; }
.project-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 12px; overflow-wrap: anywhere; }
.expand-icon { position: relative; display: block; width: 14px; height: 14px; flex-shrink: 0; }
.expand-icon::before, .expand-icon::after { content: ""; position: absolute; top: 6px; left: 0; width: 14px; height: 1px; background: currentColor; }
.expand-icon::after { transform: rotate(90deg); }
.article-row { display: flex; width: 100%; padding: 26px 0; gap: 32px; justify-content: space-between; align-items: baseline; font: inherit; text-align: left; border: 0; color: var(--fg); background: transparent; cursor: pointer; }
.article-row + .article-row { border-top: 1px solid var(--rule); }
.article-title { font-size: 20px; line-height: 1.5; letter-spacing: -.02em; max-width: 750px; overflow-wrap: anywhere; }
.article-row:hover .article-title { color: #fff; }

/* The reading surface stays on the page; the page behind it keeps its position. */
.detail-dialog { width: min(860px,calc(100vw - 80px)); max-height: calc(100dvh - 64px); margin: auto; padding: 0; border: 1px solid #454541; border-radius: 0; background: #151515; color: var(--fg); overflow: hidden; }
.detail-dialog[open] { display: flex; flex-direction: column; animation: dialog-in 220ms ease-out; }
.detail-dialog::backdrop { background: rgb(0 0 0 / .72); backdrop-filter: blur(4px); }
.dialog-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 24px; padding: 10px 25px; min-height: 61px; border-bottom: 1px solid var(--rule); }
#detail-section { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.dialog-close { display: flex; align-items: center; justify-content: center; border: 0; background: transparent; padding: 10px; margin-right: -10px; cursor: pointer; }
.dialog-close svg { height: 20px; width: 20px; fill: none; stroke: currentColor; stroke-width: 1; }
.dialog-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.detail-cover { display: block; width: 100%; height: auto; }
.detail-copy { padding: 35px 45px 45px; }
#detail-date { font-size: 11px; color: var(--muted); margin-bottom: 17px; }
#detail-title { font-size: clamp(25px,3vw,36px); line-height: 1.25; letter-spacing: -.035em; margin-bottom: 26px; }
#detail-summary { color: #cecec8; font-size: 16px; line-height: 1.75; margin-bottom: 27px; white-space: pre-line; overflow-wrap: anywhere; }
.reading-body { font-size: 15px; line-height: 1.85; color: #b7b7b2; overflow-wrap: anywhere; }
.reading-body p { margin-bottom: 1.25em; white-space: pre-line; }
.reading-body h3,.reading-body h4,.reading-body h5 { font-size: 21px; color: var(--fg); font-weight: 400; line-height: 1.4; margin: 1.8em 0 .8em; letter-spacing: -.02em; }
.reading-body blockquote { border-left: 1px solid var(--muted); padding-left: 20px; margin: 22px 0; }
.reading-body code { font: inherit; background: #252525; padding: 1px 4px; }
.reading-body ul { padding-left: 20px; margin: 18px 0; }
.project-external { display: inline-flex; align-items: center; gap: 13px; padding: 12px 0; margin-top: 10px; border-bottom: 1px solid var(--muted); font-size: 12px; }
#preview-banner { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 30px; align-items: center; max-width: calc(100vw - 32px); padding: 13px 18px; border: 1px solid #8e8e87; background: #f2f1ed; color: #101010; font-size: 12px; }
#close-preview { border: 0; border-bottom: 1px solid currentColor; border-radius: 0; color: inherit; padding: 2px 0; background: none; white-space: nowrap; cursor: pointer; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width:1050px) { .project-grid { column-gap: 24px; } .project-title { font-size: 20px; } }
@media (max-width:760px) {
  .section-nav { max-height: calc(100dvh - 260px); }
  .project-grid { grid-template-columns: 1fr; gap: 36px; }
  .project-card:nth-child(n+2)::before { content: ""; position: absolute; top: -18px; left: 0; right: 0; border-top: 1px solid var(--rule); pointer-events: none; }
  .project-title { font-size: 19px; }
  .project-summary { font-size: 12px; }
  .project-copy { padding-top: 18px; }
  .article-row { gap: 18px; padding: 23px 0; }
  .article-title { font-size: 17px; }
  .detail-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .dialog-toolbar { padding: 8px 20px; min-height: 55px; }
  .detail-copy { padding: 25px 23px 33px; }
  #detail-title { font-size: 26px; }
  #detail-summary { font-size: 14px; }
  .reading-body { font-size: 14px; }
  .reading-body h3,.reading-body h4,.reading-body h5 { font-size: 19px; }
}
