/* Public site: clean, bright, image-led.
   Light high-contrast serif for titles, small monospace for supporting text,
   pure white, one warm sun-orange. */

@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("fonts/dm-mono.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #FFFFFF;
  --ink: #1F1F1F;
  --mute: #717171;
  --line: #EAEAEA;
  --tint: #F5F4F2;
  --sun: #F4A236;        /* fills: badge, hover marks */
  --sun-ink: #C4640A;    /* orange text, readable on white */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(20px, 5vw, 64px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.1875rem/1.6 var(--serif); font-optical-sizing: auto; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: .22em; transition: text-decoration-color .2s; }
a:hover { text-decoration-color: var(--sun); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.small { font: 400 .8125rem/1.6 var(--mono); color: var(--mute); letter-spacing: -.01em; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1.75rem; }
.brand { display: inline-flex; align-items: center; gap: .85rem; text-decoration: none; font: 400 .875rem var(--mono); letter-spacing: -.01em; }
.badge {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--sun); color: #fff;
  display: grid; place-items: center; font: 400 1.05rem var(--serif); letter-spacing: .02em;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: .5rem; z-index: 10; background: var(--ink); color: #fff; padding: .6rem 1rem; font: 400 .8125rem var(--mono); }
.skip:focus { left: .5rem; }

.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.75rem; font: 400 .8125rem var(--mono); }
.site-nav > a, .dd > summary { text-decoration: none; color: var(--mute); padding-block: .3rem; cursor: pointer; }
.site-nav > a:hover, .dd > summary:hover, .site-nav [aria-current] { color: var(--sun-ink); }
.menu-btn { display: none; font: 400 .8125rem var(--mono); color: var(--ink); background: none; border: 1px solid var(--ink); border-radius: 999px; padding: .5rem 1rem; cursor: pointer; }

/* Research dropdown */
.dd { position: relative; }
.dd > summary { list-style: none; display: inline-flex; align-items: center; gap: .45rem; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: .4rem; height: .4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-.15rem) rotate(45deg); transition: transform .2s; }
.dd[open] > summary::after { transform: translateY(.1rem) rotate(-135deg); }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + .6rem); z-index: 20; min-width: 15rem; display: grid; padding: .5rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .25);
}
.dd-menu a { display: flex; justify-content: space-between; gap: 1.5rem; padding: .55rem .7rem; border-radius: 6px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.dd-menu a:hover { background: var(--tint); color: var(--sun-ink); }
.dd-menu a:first-child { border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; margin-bottom: .25rem; }
.dd-menu .n { color: var(--mute); }

.nav-search input {
  width: 9.5rem; font: 400 .8125rem var(--mono); color: var(--ink); background: var(--tint);
  border: 1px solid transparent; border-radius: 999px; padding: .5rem .9rem; transition: width .25s, border-color .2s;
}
.nav-search input:focus { outline: none; border-color: var(--sun); width: 13rem; background: var(--paper); }
.nav-search input::placeholder { color: var(--mute); }

/* ---------- hero ---------- */
.hero { text-align: center; padding-block: clamp(4rem, 12vw, 9rem) clamp(3rem, 7vw, 5rem); }
.hero h1 { font-size: clamp(3.4rem, 10vw, 8.25rem); font-weight: 300; line-height: .98; letter-spacing: -.025em; text-wrap: balance; }
.tagline { margin: 1.75rem auto 0; max-width: 36ch; font-size: clamp(1.15rem, 2vw, 1.4rem); font-style: italic; color: var(--ink); line-height: 1.45; }
.meta { margin-top: 1.5rem; display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem 1.75rem; font: 400 .8125rem var(--mono); color: var(--mute); }

.cover img { width: 100%; max-height: 82vh; object-fit: cover; }
.cover figcaption { margin-top: .75rem; font: 400 .8125rem var(--mono); color: var(--mute); }
.soon { text-align: center; color: var(--mute); padding-bottom: 4rem; }

/* ---------- sections ---------- */
.block { padding-top: clamp(5rem, 11vw, 9rem); }
.block h2 {
  text-align: center; font-size: clamp(2.6rem, 6vw, 4.5rem); font-weight: 300; line-height: 1.05;
  letter-spacing: -.02em; color: var(--sun-ink); margin-bottom: clamp(2.5rem, 5vw, 4rem); text-wrap: balance;
}
.label { font: 400 .8125rem var(--mono); color: var(--mute); margin: 3.5rem 0 0; padding-bottom: .9rem; border-bottom: 1px solid var(--ink); }

.prose { max-width: 62ch; }
.prose > * + * { margin-top: 1em; }
.prose ul { padding-left: 1.1em; }
.prose li + li { margin-top: .3em; }
.prose li::marker { color: var(--sun); }
.prose strong { font-weight: 600; }
.lead { font-size: clamp(1.25rem, 1.9vw, 1.45rem); line-height: 1.55; }
.centered { margin-inline: auto; text-align: center; }

.about { max-width: 60rem; margin-inline: auto; }
.about.with-portrait { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about:not(.with-portrait) .prose { margin-inline: auto; }
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* Resume entries */
.entries { list-style: none; padding: 0; }
.entries > li { padding: 1.6rem 0; border-bottom: 1px solid var(--line); }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: .25rem 2rem; flex-wrap: wrap; }
.entry-title { font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 350; line-height: 1.2; letter-spacing: -.01em; }
.entry-head .small { margin-top: .3rem; }
.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry-body { margin-top: .9rem; font-size: 1.0625rem; }
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem 3rem; padding-top: 1.6rem; }
.skills dd { margin-top: .2rem; }
.actions { margin-top: 3rem; text-align: center; }
.pill {
  display: inline-block; text-decoration: none; font: 400 .8125rem var(--mono); letter-spacing: -.01em;
  border: 1px solid var(--ink); border-radius: 999px; padding: .8rem 1.6rem; transition: background .2s, color .2s, border-color .2s;
}
.pill:hover { background: var(--sun); border-color: var(--sun); color: #fff; }

/* Image tiles (photos and articles): picture, then a serif title underneath. */
.frame { display: block; overflow: hidden; background: var(--tint); }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
a:hover .frame img, .post-card:hover .frame img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .frame img { transition: none; } a:hover .frame img, .post-card:hover .frame img { transform: none; } }
.tile-title { display: block; margin-top: .9rem; font: 350 clamp(1.25rem, 2vw, 1.55rem)/1.25 var(--serif); letter-spacing: -.01em; }

.mosaic { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem); }
.mosaic a { display: block; text-decoration: none; cursor: zoom-in; }
.mosaic .frame { aspect-ratio: 4 / 3; }
/* The first photo spans two columns and two rows; its height comes from the two tiles beside it. */
.mosaic li:first-child { grid-column: span 2; grid-row: span 2; }
.mosaic li:first-child a { height: 100%; display: flex; flex-direction: column; }
.mosaic li:first-child .frame { aspect-ratio: auto; flex: 1; position: relative; min-height: 20rem; }
.mosaic li:first-child .frame img { position: absolute; inset: 0; }

/* Article cards: picture, subject and date, serif title, summary. The whole card is one link. */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3.5rem clamp(1rem, 2vw, 1.75rem); }
.post-card { position: relative; display: flex; flex-direction: column; }
.post-card .frame { aspect-ratio: 4 / 3; margin-bottom: 1.1rem; order: -1; }
.post-card.no-image { border-top: 1px solid var(--ink); padding-top: 1.1rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; }
.status { color: var(--sun-ink); }
.post-card .tile-title { margin-top: .35rem; }
.post-card .tile-title a { text-decoration: none; }
.post-card .tile-title a:hover { color: var(--sun-ink); }
.stretch::after { content: ""; position: absolute; inset: 0; }
.card-summary { margin-top: .6rem; font-size: 1.0625rem; color: #3d3d3d; }
.card-summary mark { background: #FCE8C8; color: inherit; padding: 0 .1em; }

/* ---------- research index ---------- */
.index-head { text-align: center; padding-block: clamp(3.5rem, 9vw, 6.5rem) 0; }
.index-head h1 { font-size: clamp(2.8rem, 7vw, 5.5rem); font-weight: 300; line-height: 1; letter-spacing: -.025em; color: var(--sun-ink); }
.big-search { display: flex; gap: .6rem; max-width: 34rem; margin: 2.25rem auto 0; }
.big-search input {
  flex: 1; min-width: 0; font: 400 1.2rem var(--serif); color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink); border-radius: 999px; padding: .7rem 1.3rem;
}
.big-search input:focus { outline: none; border-color: var(--sun); box-shadow: 0 0 0 3px #FCE8C8; }
.big-search .pill { cursor: pointer; background: var(--paper); }
.chips { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; font: 400 .8125rem var(--mono); }
.chips a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; color: var(--mute); }
.chips a:hover { border-color: var(--sun); color: var(--sun-ink); }
.chips a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.index-body { padding-top: clamp(3rem, 6vw, 4.5rem); }
.result-count { text-align: center; margin-bottom: 2.5rem; }
.results { display: grid; gap: 2.5rem; max-width: 46rem; margin-inline: auto; }
.results .post-card { display: grid; grid-template-columns: 10rem minmax(0, 1fr); column-gap: 1.75rem; align-items: start; }
.results .post-card .frame { grid-row: span 3; margin: 0; }
.results .post-card.no-image { grid-template-columns: minmax(0, 1fr); }
.results .tile-title { margin-top: .2rem; }
.empty-state { text-align: center; color: var(--mute); max-width: 36rem; margin: 0 auto; font-size: 1.2rem; }
.empty-state .actions { margin-top: 2rem; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 4rem; }

/* ---------- article page ---------- */
.draft-note { text-align: center; font: 400 .8125rem var(--mono); background: #FCE8C8; color: #6B3A04; padding: .7rem 1rem; border-radius: 999px; max-width: 34rem; margin: 1.5rem auto 0; }
.post-head { text-align: center; max-width: 52rem; padding-block: clamp(3.5rem, 9vw, 6rem) clamp(2rem, 5vw, 3.5rem); }
.post-subject a { color: var(--sun-ink); text-decoration: none; }
.post-subject a:hover { text-decoration: underline; }
.post-head h1 { margin-top: 1.1rem; font-size: clamp(2.5rem, 6vw, 4.75rem); font-weight: 300; line-height: 1.04; letter-spacing: -.02em; text-wrap: balance; }
.standfirst { margin: 1.5rem auto 0; max-width: 38rem; font-size: clamp(1.2rem, 2vw, 1.4rem); font-style: italic; line-height: 1.5; }
.post-meta { margin-top: 1.5rem; display: flex; justify-content: center; gap: 1.5rem; }
.post-cover img { width: 100%; max-height: 78vh; object-fit: cover; }
.post-body { max-width: calc(42rem + 2 * var(--gutter)); padding-top: clamp(2.5rem, 6vw, 4rem); font-size: 1.25rem; line-height: 1.7; }
.post-body > * + * { margin-top: 1.25em; }
.post-body h2 { font-size: clamp(1.7rem, 3vw, 2.1rem); font-weight: 400; line-height: 1.2; letter-spacing: -.01em; margin-top: 2.2em; }
.post-body h3 { font-size: 1.4rem; font-weight: 500; line-height: 1.3; margin-top: 1.8em; }
.post-body h4 { font: 400 .875rem var(--mono); color: var(--mute); margin-top: 2em; }
.post-body a { text-decoration-color: var(--sun); }
.post-body blockquote { margin-inline: 0; padding: .2rem 0 .2rem 1.4rem; border-left: 2px solid var(--sun); font-style: italic; color: #3d3d3d; }
.post-body blockquote > * + * { margin-top: .8em; }
.post-body code { font: 400 .85em var(--mono); background: var(--tint); padding: .1em .35em; border-radius: 3px; }
.post-body pre { background: #1F1F1F; color: #F2F0EC; border-radius: 6px; padding: 1.1rem 1.25rem; overflow-x: auto; font-size: .95rem; line-height: 1.6; }
.post-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.post-body hr { border: 0; height: 1px; background: var(--line); margin-block: 2.5em; }
.post-body .figure { margin-block: 2.25em; }
.post-body .figure a { display: block; cursor: zoom-in; }
.post-body .figure img { width: 100%; height: auto; }
.post-body figcaption { margin-top: .7rem; font: 400 .8125rem/1.6 var(--mono); color: var(--mute); }
.post-body .table-wrap { overflow-x: auto; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.post-body th { font: 400 .8125rem var(--mono); color: var(--mute); text-align: left; border-bottom: 1px solid var(--ink); padding: .5rem .75rem .5rem 0; }
.post-body td { border-bottom: 1px solid var(--line); padding: .6rem .75rem .6rem 0; vertical-align: top; }
.post-body .align-right { text-align: right; } .post-body .align-center { text-align: center; }
.post-body ul, .post-body ol { padding-left: 1.2em; }
.post-body li + li { margin-top: .4em; }
.post-body img { max-width: 100%; height: auto; }
.post-body .snippet > * + * { margin-top: 1em; }
.post-body .embed { position: relative; aspect-ratio: 16 / 9; background: var(--tint); }
.post-body .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.related h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); }

/* ---------- footer ---------- */
.foot { text-align: center; padding-block: clamp(6rem, 12vw, 10rem) 2.5rem; }
.say { font: 300 clamp(2.6rem, 6vw, 4.5rem)/1.05 var(--serif); letter-spacing: -.02em; color: var(--sun-ink); }
.foot-mail { display: inline-block; margin-top: 1rem; font: 400 1rem var(--mono); }
.foot-links { margin-top: 1.75rem; display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem 1.75rem; }
.legal { margin-top: 4rem; }

/* ---------- photo viewer ---------- */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #fff; color: var(--ink); }
.viewer::backdrop { background: #fff; }
.viewer[open] { display: grid; place-items: center; }
.viewer figure { padding: 4.5rem 5.5rem 5rem; display: grid; justify-items: center; gap: 1rem; }
.viewer img { max-width: min(100%, 1800px); max-height: calc(100dvh - 11rem); width: auto; height: auto; object-fit: contain; }
.viewer figcaption { font: 350 1.35rem/1.3 var(--serif); text-align: center; max-width: 50ch; }
.viewer button {
  position: absolute; cursor: pointer; font: 400 .8125rem var(--mono); color: var(--ink);
  background: #fff; border: 1px solid var(--ink); border-radius: 999px; padding: .55rem 1.1rem;
}
.viewer button:hover { background: var(--sun); border-color: var(--sun); color: #fff; }
.v-close { top: 1.25rem; right: 1.25rem; }
.v-prev, .v-next { top: 50%; transform: translateY(-50%); }
.v-prev { left: 1.25rem; }
.v-next { right: 1.25rem; }
.v-count { position: absolute; bottom: 1.25rem; left: 0; right: 0; text-align: center; font: 400 .8125rem var(--mono); color: var(--mute); }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .mosaic, .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Phone and tablet: the navigation becomes a menu panel. */
  .js .menu-btn { display: inline-block; }
  .js .site-nav { display: none; }
  .js .site-nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1.5rem; box-shadow: 0 24px 30px -24px rgba(0, 0, 0, .3);
  }
  .top { position: relative; }
  .site-nav.open > a, .site-nav.open .dd > summary { padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; display: flex; }
  .site-nav.open .dd > summary { justify-content: space-between; }
  .site-nav.open .dd-menu { position: static; box-shadow: none; border: 0; padding: .25rem 0 .5rem; min-width: 0; background: none; }
  .site-nav.open .nav-search { margin-top: 1.25rem; }
  .site-nav.open .nav-search input, .site-nav.open .nav-search input:focus { width: 100%; font-size: 1rem; padding: .75rem 1rem; }
  .about.with-portrait { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}
@media (max-width: 600px) {
  .top { padding-block: 1.25rem; }
  .cover { padding-inline: 0; }
  .cover figcaption { padding-inline: var(--gutter); }
  .about.with-portrait { grid-template-columns: 1fr; }
  .portrait { max-width: 20rem; }
  .mosaic { grid-template-columns: 1fr 1fr; gap: 1.25rem .75rem; }
  .mosaic li:first-child { grid-row: auto; }
  .mosaic li:first-child .frame { min-height: 0; aspect-ratio: 4 / 3; flex: none; }
  .tile-title { font-size: 1.1rem; margin-top: .6rem; }
  .post-grid { grid-template-columns: 1fr; gap: 2.75rem; }
  .results .post-card { grid-template-columns: 6rem minmax(0, 1fr); column-gap: 1rem; }
  .big-search { flex-direction: column; }
  .post-body { font-size: 1.125rem; }
  .post-cover { padding-inline: 0; }
  .viewer figure { padding: 4rem .5rem 6.5rem; }
  .v-prev, .v-next { top: auto; bottom: 3.25rem; transform: none; }
}
