:root {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-kerning: normal;
  color: #141414;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  --ink: #141414;
  --muted: #66645f;
  --faint: #9c9a94;
  --link: #2438a8;
  --wash: #f4f3f0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; padding: 40px 28px 32px; }
.page-header, main { width: min(100%, 640px); margin-inline: auto; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
main { padding: 56px 0 72px; }
.page-header + main { padding-top: 48px; }
.back-link { font-size: 15px; }
h1 { margin: 0 0 20px; font-size: 30px; font-weight: 400; line-height: 1.2; }
.site-name { font-size: 40px; }
p { margin: 0; font-size: 17px; line-height: 1.55; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; }
.intro-copy { display: grid; gap: 14px; }
.intro-copy p:first-child { font-size: 21px; line-height: 1.45; }
/* The table of contents: a row of links under the intro, and on wide screens a fixed column
   beside the page whose current section opens to list its entries (filled in by toc.js). */
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc > ol { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 24px; font-size: 15px; }
.toc-sub { display: none; }
@media (min-width: 1220px) {
  .toc {
    position: fixed;
    top: 96px;
    left: calc(50% - 320px - 272px);
    width: 232px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .toc > ol { display: grid; gap: 0; margin: 0; }
  .toc a { display: block; color: var(--muted); text-decoration: none; transition: color .2s, border-color .2s; }
  .toc a:hover, .toc a[aria-current] { color: var(--ink); }
  .toc > ol > li > a { padding: 3px 0; font-size: 15px; font-variant-caps: all-small-caps; letter-spacing: .07em; }
  .toc-sub { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .35s ease, visibility .35s; }
  .toc .is-open > .toc-sub { grid-template-rows: 1fr; visibility: visible; }
  .toc-sub ol { min-height: 0; overflow: hidden; border-left: 1px solid #e4e2dc; }
  .toc-sub a { margin-left: -1px; padding: 3px 0 3px 12px; border-left: 1px solid transparent; font-size: 14px; line-height: 1.3; }
  .toc-sub a[aria-current] { border-left-color: var(--ink); }
  .toc-sub li:last-child { padding-bottom: 10px; }
}

/* Below that width, an icon pulls the contents out over a blurred page. The section being read starts
   open; pointing at another opens it (on touch screens, tapping does), and tapping it again jumps. */
:is(.toc-toggle, .toc-drawer-toggle) {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
:is(.toc-toggle, .toc-drawer-toggle):hover { color: var(--link); }
:is(.toc-toggle, .toc-drawer-toggle) svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
@media (min-width: 1220px) { .toc-toggle { display: none; } }

.toc-drawer {
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(255 255 255 / .6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--ink);
  opacity: 0;
  transition: opacity .25s;
}
.toc-drawer::backdrop { background: none; }
.toc-drawer.is-open { opacity: 1; }
body:has(.toc-drawer[open]) { overflow: hidden; }
.toc-drawer > ol {
  position: absolute;
  top: max(72px, env(safe-area-inset-top) + 48px);
  left: max(24px, env(safe-area-inset-left));
  width: min(320px, 100% - 48px);
  max-height: calc(100% - 144px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-10px);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
.toc-drawer.is-open > ol { transform: none; }
.toc-drawer ol { list-style: none; margin: 0; padding: 0; }
.toc-drawer a { display: block; color: var(--muted); text-decoration: none; transition: color .2s, border-color .2s; }
.toc-drawer :is(a[aria-current], .is-open > a) { color: var(--ink); }
.toc-drawer > ol > li > a { padding: 6px 0; font-size: 16px; font-variant-caps: all-small-caps; letter-spacing: .07em; }
.toc-drawer .toc-sub { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .35s ease, visibility .35s; }
.toc-drawer .is-open > .toc-sub { grid-template-rows: 1fr; visibility: visible; }
.toc-drawer .toc-sub ol { min-height: 0; overflow: hidden; border-left: 1px solid #d9d7d1; }
.toc-drawer .toc-sub a { margin-left: -1px; padding: 6px 0 6px 14px; border-left: 1px solid transparent; font-size: 15px; line-height: 1.3; }
.toc-drawer .toc-sub a[aria-current] { border-left-color: var(--ink); }
.toc-drawer .toc-sub li:last-child { padding-bottom: 8px; }
.home-section { margin-top: 64px; scroll-margin-top: 32px; }
.section-heading {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
  font-size: 16px;
  font-weight: 400;
  font-variant-caps: all-small-caps;
  letter-spacing: .08em;
}
.entries article { padding-top: 26px; scroll-margin-top: 32px; }
.entries article + article { padding-top: 40px; }
.entries article > div:first-child { margin-bottom: 10px; }
.entries :is(h2, h3) { display: inline; margin: 0; font-size: 19px; font-weight: 600; line-height: 1.35; }
.entries .entry-meta { display: inline-block; margin-left: .45em; font-size: 15px; font-style: italic; color: var(--muted); }
.entry-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.entry-links { display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 15px; }
.page-deck { margin: -10px 0 36px; color: var(--muted); font-style: italic; }
.page-links { margin-top: 32px; }
h4 { margin: 0 0 8px; font-size: 15px; font-weight: 400; font-style: italic; color: var(--muted); }
.entry-body > h4 { margin: 4px 0 -4px; }
.milestones ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.milestones li { display: grid; grid-template-columns: 3em 1fr; gap: 12px; font-size: 16px; line-height: 1.45; }
.milestone-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.milestones .video-grid { margin-top: 8px; }
::selection { background: #dde2f6; }

/* Classes by tense: a label column, then the list. */
.tenses { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px 12px; margin: 0; font-size: 16px; line-height: 1.45; }
.tenses dt { color: var(--muted); font-style: italic; }
.tenses dd { margin: 0; }

/* Videos are a 16:9 thumbnail until played (see embeds.js); placeholders hold the spot. */
.video {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: var(--wash);
  overflow: hidden;
}
.video img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter .3s; }
a.video::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 52px;
  height: 52px;
  margin: auto;
  border-radius: 50%;
  background: rgb(255 255 255 / .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 14'%3E%3Cpath d='M0 0l12 7-12 7z' fill='%23141414'/%3E%3C/svg%3E") 56% 50% / 15px no-repeat;
  box-shadow: 0 1px 6px rgb(0 0 0 / .18);
  transition: transform .2s;
}
a.video:hover img { filter: brightness(1.06); }
a.video:hover::after { transform: scale(1.06); }
.video.is-placeholder { display: grid; place-items: center; color: var(--faint); font-size: 14px; font-style: italic; }
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
.video-grid.is-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.video-grid figure { margin: 0; }
.video-grid figcaption { margin-top: 6px; font-size: 14px; line-height: 1.35; color: var(--muted); }
.video-grid cite { font-style: normal; color: var(--ink); }
/* Episode thumbnails print their own titles, so the play button waits for a pointer or focus. */
.video-grid a.video::after { opacity: 0; transition: opacity .2s, transform .2s; }
.video-grid a.video:is(:hover, :focus-visible)::after { opacity: 1; }

/* Document cards show the top of the first page, framed so a white page reads against the white site. */
.video.is-doc { border: 1px solid #e4e2dc; }
.video.is-doc img { object-position: top; }
a.video.is-doc::after { content: none; }

/* An opened card sits over a blurred page, like the contents; embeds.js fills the frame. */
.media-viewer {
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(255 255 255 / .6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity .25s;
}
.media-viewer[open] { display: grid; place-items: center; }
.media-viewer::backdrop { background: none; }
.media-viewer.is-open { opacity: 1; }
body:has(.media-viewer[open]) { overflow: hidden; }
.media-viewer-frame { background: #111; box-shadow: 0 12px 48px rgb(0 0 0 / .14); transform: scale(.98); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.media-viewer.is-open .media-viewer-frame { transform: none; }
.media-viewer-frame.is-video { width: min(960px, 100vw - 48px, (100dvh - 120px) * 16 / 9); aspect-ratio: 16 / 9; }
.media-viewer-frame.is-doc { width: min(820px, 100vw - 48px); height: calc(100dvh - 120px); background: #fff; }
.media-viewer-frame > * { display: block; width: 100%; height: 100%; border: 0; }
.media-viewer-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.media-viewer-close:hover { color: var(--link); }
.media-viewer-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* A few photos in one row of equal height; each grows in proportion to its aspect ratio. */
.photo-preview { display: flex; align-items: flex-start; gap: 6px; cursor: pointer; }
.photo-preview img { flex: var(--r) 1 0; min-width: 0; height: auto; background: var(--wash); transition: filter .3s; }
.photo-preview:hover img { filter: brightness(1.06); }

/* One irregular, connected cluster laid out by collage.js; a 1px bleed hides hairline seams. */
.gallery-page h1 { margin-bottom: 40px; text-align: center; }
:is(.photography-gallery, .luke-gallery) {
  --canvas: min(1000px, 100vw - 48px);
  --u: calc(var(--canvas) / 1000);
  position: relative;
  width: var(--canvas);
  height: calc(var(--height) * var(--u));
  margin-left: calc((100% - var(--canvas)) / 2);
}
.gallery-piece {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u) + 1px);
  height: calc(var(--h) * var(--u) + 1px);
  z-index: var(--z);
  margin: 0;
  background: var(--wash);
}
/* Photos that overlap come forward when pointed at or focused. */
.gallery-piece:focus-within { z-index: 999; }
.gallery-piece a { display: block; height: 100%; cursor: zoom-in; }
.gallery-piece a:focus-visible { outline-offset: -2px; }
.gallery-piece img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s, filter .3s; }
.gallery-piece img.is-loading { opacity: 0; }
@media (hover: hover) {
  .gallery-piece:hover { z-index: 999; }
  .gallery-piece a:hover img { filter: brightness(1.08); }
}
@media (max-width: 720px) {
  :is(.photography-gallery, .luke-gallery) { --canvas: calc(100vw - 32px); height: calc(var(--m-height) * var(--u)); }
  .gallery-piece {
    left: calc(var(--mx) * var(--u));
    top: calc(var(--my) * var(--u));
    width: calc(var(--mw) * var(--u) + 1px);
    height: calc(var(--mh) * var(--u) + 1px);
    z-index: var(--mz);
  }
}

.photo-viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 12px 20px 16px;
  border: 0;
  background: #111;
  color: #cfccc4;
}
.photo-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.photo-viewer::backdrop { background: #111; }
.photo-viewer :focus-visible { outline-color: #cfccc4; }
body:has(.photo-viewer[open]) { overflow: hidden; }
.photo-viewer button { border: 0; background: none; color: inherit; font: inherit; font-size: 15px; cursor: pointer; min-width: 44px; min-height: 44px; }
.photo-viewer button:hover { color: #fff; }
.viewer-close { justify-self: end; }
.viewer-image { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.viewer-footer { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px; }
.viewer-caption { color: inherit; text-align: center; font-size: 14px; font-style: italic; }

@media (max-width: 560px) {
  body { padding: 24px 20px 20px; }
  main { padding: 44px 0 52px; }
  .page-header + main { padding-top: 36px; }
  .site-name { font-size: 34px; }
  .intro-copy p:first-child { font-size: 19px; }
  .video-grid { grid-template-columns: minmax(0, 1fr); }
  .video-grid.is-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-grid.is-preview > :nth-child(n + 3) { display: none; }
  .photo-preview { gap: 4px; }
}

/* A quiet social dock that stays with the viewport on every page. */
.socials {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  gap: 8px;
}
.socials a { display: grid; place-items: center; width: 28px; height: 28px; color: var(--ink); }
.socials a:hover { color: var(--link); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }

@media (max-width: 560px) {
  .socials { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  :is(.toc-toggle, .toc-drawer-toggle) { left: max(4px, env(safe-area-inset-left)); bottom: max(4px, env(safe-area-inset-bottom)); }
  main { padding-bottom: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .gallery-piece img, .video img, .photo-preview img, a.video::after, .video-grid a.video::after, .toc a, .toc-sub,
    .toc-drawer, .toc-drawer > ol, .toc-drawer a, .toc-drawer .toc-sub, .media-viewer, .media-viewer-frame { transition: none; }
}

/* Keep every photo readable if scripts are disabled or fail to load. */
:is(.photography-gallery, .luke-gallery):not(.is-laid-out) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: auto;
  gap: 8px;
}
:is(.photography-gallery, .luke-gallery):not(.is-laid-out) .gallery-piece {
  position: static;
  width: auto;
  height: auto;
}
:is(.photography-gallery, .luke-gallery):not(.is-laid-out) img { height: auto; }
