@font-face {
  font-family: Lato;
  src: url("lato-light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: Lato;
  src: url("lato-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Lato;
  src: url("lato-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'PT Sans';
  src: url("pt-sans-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'PT Sans';
  src: url("pt-sans-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff;
  --surface: #f2f2f2;
  --ink: #212121;
  --muted: #475c66;
  --slate: #37474f;
  --charcoal: #323232;
  --teal: #7db6b1;
  --line: #d3dade;
  --heading: Lato, Arial, sans-serif;
  --body: 'PT Sans', Arial, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.55 var(--body); }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
a { color: inherit; text-underline-offset: .23em; }
a:hover { text-decoration-thickness: .13em; }
button, input { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid currentColor; outline-offset: .3rem; }
::selection { color: var(--ink); background: var(--teal); }
[id] { scroll-margin-block-start: 1.5rem; }
.wrap { width: min(100% - var(--gutter) * 2, 67rem); margin-inline: auto; }
.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 4; transform: translateY(-180%); padding: .65rem 1rem; background: var(--slate); color: var(--paper); }
.skip-link:focus { transform: none; }
#main:focus-visible { outline: none; }
[hidden] { display: none !important; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem 2rem; }
.wordmark { flex-shrink: 0; color: var(--ink); font: 300 1.25rem/1.33 var(--heading); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: clamp(.85rem, 2.4vw, 2rem); }
.site-nav a { white-space: nowrap; font: 300 1rem/1.3 var(--heading); text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav [aria-current] { font-weight: 700; }

.display-title, .section-title, .card-title { color: var(--slate); font-family: var(--heading); line-height: 1.22; overflow-wrap: break-word; }
.display-title { font-size: clamp(2.15rem, 4.6vw, 3.75rem); font-weight: 400; }
.section-title { font-size: clamp(1.6rem, 2.8vw, 2.15rem); font-weight: 400; }
.card-title { color: var(--ink); font-size: clamp(1.12rem, 2.1vw, 1.45rem); font-weight: 700; }
.date { color: var(--muted); font-size: .93rem; }
.lead { max-width: 74ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1.5rem; }
.button { display: inline-flex; align-items: center; gap: .75rem; width: fit-content; min-height: 3rem; padding: .6rem 1.05rem; border: 1px solid var(--charcoal); background: var(--charcoal); color: var(--paper); font-size: .85rem; font-weight: 650; text-decoration: none; }
.button:hover { background: var(--paper); color: var(--charcoal); }
.text-link { width: fit-content; font-size: .88rem; font-weight: 650; }
.section-rule { border-top: 1px solid var(--line); padding-block-start: clamp(1.5rem, 3vw, 2.5rem); }
.section-heading { margin-bottom: 1.15rem; }

.home-hero { display: grid; grid-template-columns: minmax(11rem, .72fr) minmax(0, 1.6fr); align-items: start; gap: clamp(1.5rem, 4.5vw, 4.25rem); padding-block: clamp(2rem, 5vw, 4.25rem); }
.home-hero .display-title { font-size: clamp(2.05rem, 4.2vw, 3.1rem); font-weight: 700; }
.home-hero .actions { margin-top: .45rem; }
.portrait { width: min(100%, 20rem); }
.portrait img { width: 100%; background: var(--surface); }
.home-about { display: grid; align-content: start; gap: .8rem; }
.home-about p { max-width: 72ch; }
.home-news { padding-block-end: clamp(2.5rem, 5vw, 4rem); }
.news-list { padding: 0; list-style: none; }
.news-list li { display: grid; grid-template-columns: 8rem 1fr; gap: .2rem 1.2rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.news-list time { font-weight: 700; }
.news-list p { max-width: 76ch; }

.page-intro { padding-block: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.4rem); }
.page-intro .display-title { max-width: 30ch; }
.page-intro .lead { margin-top: 1rem; }
.page-sections { display: grid; gap: clamp(2rem, 4vw, 3.2rem); padding-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem clamp(1.5rem, 4vw, 3rem); }
.theme-grid article { display: grid; align-content: start; gap: .4rem; }
.theme-grid p, .record p:not(.date) { max-width: 72ch; }
.record-list { display: grid; }
.record { display: grid; gap: .45rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.record .card-title { max-width: 56ch; }
.record p.links, .profile-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.record p.links a, .profile-links a { color: var(--muted); font-weight: 650; font-size: .86rem; }
.simple-list { padding-left: 1.2rem; }
.simple-list li + li { margin-top: .55rem; }
.profile-links { margin-top: 1rem; }
.contact-panel { max-width: 47rem; display: grid; gap: 1.1rem; }
.contact-panel .button { overflow-wrap: anywhere; max-width: 100%; }
.contact-panel p { max-width: 59ch; }

.writing-list { max-width: 54rem; padding: 0; list-style: none; }
.writing-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3.25fr); align-items: start; gap: clamp(.85rem, 3vw, 2rem); padding: 1.2rem 0; border-top: 1px solid var(--line); }
.writing-entry.text-only { grid-template-columns: minmax(0, 1fr); }
.writing-thumbnail { display: block; background: var(--surface); }
.writing-thumbnail img { width: 100%; height: auto; }
.writing-entry h2 a { text-decoration: underline; }
.writing-date { margin-top: .35rem; }
.writing-date, .writing-category { color: var(--muted); font-size: .94rem; }
.essay .page-intro { max-width: 47rem; margin-inline: auto; }
.essay .page-intro .display-title { margin-top: .28em; font-size: clamp(1.7rem, 3.25vw, 2.5rem); }
.essay .date { margin-top: .65rem; }
.essay-body { max-width: 47rem; margin-inline: auto; padding-bottom: clamp(2.5rem, 5vw, 4.5rem); display: grid; gap: 1.05rem; overflow-wrap: anywhere; }
.essay-body h2, .essay-body h3 { color: var(--slate); font-family: var(--heading); line-height: 1.3; }
.essay-body blockquote { margin: 0; padding-left: 1rem; border-left: .2rem solid var(--teal); }
.essay-body pre { max-width: 100%; overflow: auto; padding: 1rem; background: var(--surface); }
.essay-body pre, .essay-body code { font-size: .94em; }
.essay-body figure { width: min(100%, 37rem); margin: 0 auto .65rem; }
.essay-body figure img { width: 100%; }
.essay-body figcaption { margin-top: .4rem; color: var(--muted); font-size: .8rem; }

.gallery { columns: 3 16rem; column-gap: .85rem; }
.gallery a { display: block; margin-bottom: .85rem; overflow: hidden; break-inside: avoid; background: var(--surface); }
.gallery a:focus-visible { outline-offset: -.3rem; }
.gallery img { width: 100%; }
.gallery a:hover img { opacity: .92; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem 2rem; padding-block: 1.45rem 1.8rem; color: var(--muted); font-size: .82rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .45rem 1.1rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

dialog { color: var(--ink); border: 1px solid var(--line); background: var(--paper); }
dialog::backdrop { background: rgb(33 33 33 / .75); }
.dialog-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dialog-close, .gallery-nav button { cursor: pointer; min-width: 2.55rem; min-height: 2.55rem; padding: .4rem .65rem; background: transparent; border: 1px solid currentColor; color: inherit; }
.dialog-close:hover, .gallery-nav button:hover { background: var(--surface); color: var(--ink); }
.lightbox { width: min(75rem, calc(100% - 1.25rem)); max-height: calc(100dvh - 1rem); padding: .6rem; color: var(--paper); background: var(--ink); border: 0; }
.lightbox > img { width: 100%; max-height: 76dvh; object-fit: contain; }
.lightbox .dialog-bar { padding: .25rem .25rem .55rem; }
.gallery-nav { display: flex; gap: .45rem; }

@media (max-width: 850px) {
  .masthead-inner { flex-wrap: wrap; padding-block: .9rem; gap: .7rem 1rem; }
  .site-nav { flex-wrap: wrap; gap: .6rem 1.05rem; }
}
@media (max-width: 630px) {
  .masthead-inner { align-items: start; flex-direction: column; }
  .home-hero { grid-template-columns: 1fr; }
  .portrait { width: min(62%, 17rem); }
  .theme-grid { grid-template-columns: 1fr; }
  .news-list li { grid-template-columns: 1fr; }
  .writing-entry { grid-template-columns: minmax(4.5rem, 1fr) minmax(0, 2.1fr); }
  .gallery { columns: 2 8rem; column-gap: .5rem; }
  .gallery a { margin-bottom: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
