/* Typeface: CMU Serif (Computer Modern), SIL OFL — see fonts/OFL.txt */
@font-face {
  font-family: "CMU Serif";
  src: url("/fonts/cmu-serif-roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  src: url("/fonts/cmu-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #faf9f5;
  --fg: #161616;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: "CMU Serif", "Latin Modern Roman", "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 4px;
}
a:focus-visible { outline: 1px dotted currentColor; outline-offset: 4px; }

.u {
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 4px;
}

.name {
  font-variant: small-caps;
  letter-spacing: 0.14em;
  font-size: 18px;
}

.sep { opacity: 0.5; }

/* ---------- Home ---------- */
.home {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 96px 24px 72px;
  font-size: 21px;
  line-height: 1.6;
}
.home .epigraph { margin: 0 0 56px; font-size: 16px; line-height: 1.5; }
.home .epigraph p { margin: 0; font-style: italic; }
.home .name { margin: 0; font-size: 30px; font-weight: 400; letter-spacing: 0.12em; line-height: 1.3; }
.home .intro { margin: 28px 0 0; }
.home nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 18px;
  margin-top: 40px;
  font-size: 20px;
}
body > .contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  padding: 0 24px 40px;
  font-size: 15px;
  text-align: center;
}
body > .contact .sep { margin: 0 12px; }
body > .contact .sep.mid { margin: 0; }

/* ---------- Inner pages ---------- */
.page {
  flex-grow: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 24px 64px;
  display: flex;
  flex-direction: column;
}
.page > .name { align-self: center; }
.page h1 {
  margin: 96px 0 28px;
  font-size: 30px;
  font-weight: 400;
  text-align: center;
  line-height: 1.3;
}
.page p { margin: 0; }
.page p + p { margin-top: 16px; }
.page p.empty { text-align: center; }

/* Section headings: small caps, never bold */
.page h2 {
  margin: 64px 0 20px;
  font-size: 19px;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  line-height: 1.4;
}
.page h1 + h2 { margin-top: 24px; }
.page h3 {
  margin: 28px 0 10px;
  font-size: 16px;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.08em;
}
.page h2 + h3 { margin-top: 0; }
.page h2 + .entries, .page h3 + .entries { margin-top: 0; }
.page p + .entries { margin-top: 20px; }

.entries {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.entries .note { font-size: 17px; }

.compact { gap: 4px; }

.reading { gap: 20px; }
.reading .books > span { display: block; }
.reading cite { font-style: italic; }

.timeline { gap: 14px; }
.timeline li { display: flex; gap: 24px; align-items: baseline; }
.timeline .yr { flex: 0 0 96px; font-size: 17px; }

.page nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 18px;
  margin-top: auto;
  padding-top: 96px;
  font-size: 17px;
}
.page nav [aria-current="page"] { opacity: 0.6; }

@media (max-width: 480px) {
  body > .contact { flex-direction: column; align-items: center; }
  body > .contact .sep.mid { display: none; }
  .page h1 { margin-top: 64px; }
  .timeline li { flex-direction: column; gap: 0; }
  .timeline .yr { flex-basis: auto; }
}

/* ---------- Photography ---------- */
.album { display: flex; flex-direction: column; }
.album h2, .album .empty { text-align: center; }
.album + .album h2 { margin-top: 72px; }

.viewer { margin-top: 4px; }
.track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  outline: none;
}
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline: 1px dotted currentColor; outline-offset: 6px; }
.track figure {
  flex: 0 0 100%;
  margin: 0;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
}
.track img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.viewer.js .track { cursor: pointer; }

.controls {
  display: none;
  justify-content: center;
  align-items: baseline;
  gap: 24px;
  margin-top: 14px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.viewer.js .controls { display: flex; }
.controls button {
  font: inherit;
  font-size: 17px;
  color: inherit;
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.controls button:hover, .controls button:focus-visible { opacity: 1; }
.controls button:focus-visible { outline: 1px dotted currentColor; outline-offset: 2px; }
.controls .count { min-width: 4.5em; text-align: center; }

@media (max-width: 480px) {
  .track figure { height: 280px; }
}
