/* Measured design system: see design.md. Content is in content/site.js. */
:root {
  color-scheme: light;
  --bg: #fafafa; --fg: #2e2e2e; --heading: #111; --muted: #888;
  --intro: #888; --surface: #fff; --glass: rgb(255 255 255 / .75);
  --glass-open: rgb(244 244 244 / .78); --glass-border: rgb(255 255 255 / .75);
  --nav-text: rgb(0 0 0 / .4); --nav-active: rgb(0 0 0 / .95);
  --rule: rgb(0 0 0 / .1); --shadow: rgb(0 0 0 / .12);
  --spring-out: cubic-bezier(.22, 1.28, .36, 1);
  --spring-back: cubic-bezier(.22, 1.08, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171717; --fg: #a1a1a1; --heading: #dfdfdf; --intro: #a1a1a1;
    --surface: #222; --glass: rgb(28 28 28 / .85); --glass-open: rgb(28 28 28 / .78);
    --glass-border: rgb(180 180 180 / .1); --nav-text: rgb(255 255 255 / .42);
    --nav-active: #fff; --rule: rgb(255 255 255 / .1); --shadow: rgb(0 0 0 / .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171717; --fg: #a1a1a1; --heading: #dfdfdf; --intro: #a1a1a1;
  --surface: #222; --glass: rgb(28 28 28 / .85); --glass-open: rgb(28 28 28 / .78);
  --glass-border: rgb(180 180 180 / .1); --nav-text: rgb(255 255 255 / .42);
  --nav-active: #fff; --rule: rgb(255 255 255 / .1); --shadow: rgb(0 0 0 / .45);
}
@supports (animation-timing-function: linear(0, .5, 1)) {
  :root {
    --spring-out: linear(0, .024 4.43%, .092 8.86%, .344 17.71%, .653 26.57%, .905 35.43%, 1.064 41.51%, 1.147 47.59%, 1.163 50.92%, 1.16 54.43%, 1.139 60.69%, 1.091 67.69%, 1.045 73.96%, 1.014 80.22%, .998 87.04%, .995 93.85%, 1);
    --spring-back: linear(0, .024 4.43%, .092 8.86%, .344 17.71%, .653 26.57%, .905 35.43%, 1.024 41.51%, 1.055 47.59%, 1.061 50.92%, 1.06 54.43%, 1.052 60.69%, 1.034 67.69%, 1.017 73.96%, 1.005 80.22%, .999 87.04%, .998 93.85%, 1);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font); background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.lightbox-open { overflow: hidden; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
h1, h2, h3, h4 { color: var(--heading); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; padding: 0; background: none; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
button:disabled { cursor: default; opacity: .4; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--heading); outline-offset: 5px; border-radius: 3px; }
::selection { background: var(--rule); color: var(--heading); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 20px; padding: 8px 16px; background: var(--surface); border-radius: 20px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.page-enter { animation: appear .5s ease-out 50ms both; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
img[data-reveal] { transition: opacity 1s ease-out; }
html.js img[data-reveal]:not(.is-visible) { opacity: 0; }

/* Home: the portrait and the first line share their top edge. */
.home-container { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.home-content { width: 100%; max-width: 850px; margin: 0; }
.home-intro { display: flex; align-items: flex-start; gap: 64px; }
.home-portrait { width: 300px; flex: 0 0 300px; }
.home-portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 24px; }
.portrait-dark { display: none; }
.home-text { flex: 1; min-width: 0; font-size: 21px; line-height: 34px; color: var(--intro); text-wrap: pretty; }
.home-text h1 { font-size: 36px; font-weight: 700; line-height: 42px; margin-bottom: 28px; }
.home-text p { margin-bottom: 28px; }
.home-text p:last-child { margin-bottom: 0; }
.home-text a { color: var(--heading); }
.home-links { display: flex; gap: 24px; margin-top: 28px; }
.home-text a:hover, .text-main a:hover, .world-caption a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 3px; text-decoration-color: var(--fg); }
:root[data-theme="dark"] .portrait-light { display: none; }
:root[data-theme="dark"] .portrait-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .portrait-light { display: none; }
  :root:not([data-theme="light"]) .portrait-dark { display: block; }
}

/* Reading pages use the same restrained 680px measure. */
.text-main { margin: 120px auto; padding-bottom: 120px; font-size: 21px; line-height: 34px; }
.text-main > h1, .text-main > h2, .text-main > h3, .text-main > section, .text-main > ul, .text-main > nav, .text-main > .prose, .text-main > p { max-width: 680px; margin-left: auto; margin-right: auto; }
.text-main h1 { font-size: 36px; line-height: 42px; font-weight: 700; margin-bottom: 37px; }
.text-main h2, .text-main .section-title { font-size: 31.5px; line-height: 37.8px; font-weight: 700; margin-bottom: 26.145px; }
.text-main h4 { font-size: 21px; line-height: 27.3px; font-weight: 700; }
.text-main section { margin-bottom: 37px; }
.text-main ul { list-style: none; margin-top: 21px; }
.text-main li { color: var(--muted); font-size: 19px; line-height: 32px; }
.text-main li a { color: var(--fg); }
.text-main p + p { margin-top: 28px; }
.date { color: var(--muted); opacity: .7; }
.external-arrow { font-size: 18px; }
.works-main .work-row { min-height: 98px; margin-bottom: 16px; }
.work-row ul { margin-top: 0; }
.work-row li > a { display: inline-block; }
.works-main h2 { margin-top: 52px; }
.writings-main { padding-top: 16px; }
.writing-year { margin-bottom: 37px; }
.writing-year h2 { font-size: 21px; line-height: 27.3px; margin-bottom: 0; }
.writing-year ul { margin-top: 21px; }
.timeline-row { display: flow-root; min-height: 98px; margin-bottom: 60px !important; }
.timeline-row h4 { padding-top: 12px; }
.timeline-image { float: right; width: 174px; margin: 12px 0 37px 24px; }
.timeline-image img { width: 100%; border-radius: 8px; }
.image-button { display: block; width: 100%; text-align: left; }
.image-button img { width: 100%; }
.frontlist li { margin-bottom: 24px; }
.frontlist .date { margin-left: 8px; }
.link-group { scroll-margin-top: 40px; margin-bottom: 60px !important; }
.links-subnav { position: fixed; top: 50%; right: 48px; transform: translateY(-50%); width: 180px; text-align: right; }
.links-subnav a { display: block; color: var(--muted); font-size: 16px; line-height: 32px; }
.links-subnav a.active, .links-subnav a:hover { color: var(--heading); }
.entry-main h1 { margin-bottom: 37px; }
.entry-meta { font-size: 16px; color: var(--muted); }
.prose p { margin-bottom: 37px; }
.prose a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; text-decoration-thickness: 3px; }
.entry-image { width: 94%; max-width: 780px; margin: 12px auto 37px; }
.entry-image img { border-radius: 16px; }
.entry-nav { display: flex; justify-content: space-between; margin-top: 60px; }
.muted { color: var(--muted); }
.collection-main { padding-top: 16px; }
.collection-main code { font-size: .8em; }

/* The glass menu grows from a stable bottom-left origin. */
.site-menu { --timing: var(--spring-back); --width-time: 655ms; --height-time: 475ms; --menu-height: 417px;
  position: fixed; z-index: 30; left: 32px; bottom: 32px; width: 82px; height: 48px; transform: translateX(4px);
  overflow: hidden; contain: layout paint; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 25px;
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 8px 36px var(--shadow), 0 1px 2px rgb(0 0 0 / .04); -webkit-font-smoothing: auto;
  transition: width var(--width-time) var(--timing), height var(--height-time) var(--timing), bottom var(--height-time) var(--timing), transform var(--width-time) var(--timing), border-radius 216ms ease, background 132ms ease, opacity 216ms ease;
}
.site-menu.is-open { --timing: var(--spring-out); --width-time: 590ms; --height-time: 428ms; width: 149px; height: var(--menu-height); bottom: 24px; transform: none; border-radius: 26px; background: var(--glass-open); box-shadow: 0 14px 60px var(--shadow), 0 2px 4px rgb(0 0 0 / .04); }
.menu-inner { position: absolute; left: 0; bottom: 0; width: 149px; padding: 6px 22px; transform: translateX(-4px); transition: transform var(--width-time) var(--timing), bottom var(--height-time) var(--timing); }
.is-open .menu-inner { bottom: 8px; transform: none; }
.menu-items a, .menu-trigger { display: block; width: 100%; font-size: 17px; line-height: 28px; font-weight: 400; padding: 4px 0; color: var(--nav-text); text-align: left; white-space: nowrap; transition: color 264ms ease; }
.menu-items a.active { color: var(--nav-active); }
.menu-items a:hover, .menu-items a:focus-visible, .menu-trigger:hover { color: var(--nav-active); }
.site-menu:not(.is-open) .menu-trigger { color: var(--heading); }
.menu-divider { display: block; height: 1px; margin: 10px 0; background: var(--rule); }
.menu-items > * { opacity: 0; transition: opacity .2s ease; }
.is-open .menu-items > * { opacity: 1; transition-delay: calc((11 - var(--i, 0)) * 20ms); }
.menu-items > :nth-child(1) { --i: 0; } .menu-items > :nth-child(2) { --i: 1; } .menu-items > :nth-child(3) { --i: 2; } .menu-items > :nth-child(4) { --i: 3; } .menu-items > :nth-child(5) { --i: 4; } .menu-items > :nth-child(6) { --i: 5; } .menu-items > :nth-child(7) { --i: 6; } .menu-items > :nth-child(8) { --i: 7; } .menu-items > :nth-child(9) { --i: 8; } .menu-items > :nth-child(10) { --i: 9; } .menu-items > :nth-child(11) { --i: 10; }
html:not(.js) .site-menu { width: 149px; height: 417px; }
html:not(.js) .menu-items > * { opacity: 1; }
html:not(.js) .menu-trigger { display: none; }

/* Segmented section controls; JS measures the active segment. */
.archive-filter { position: fixed; z-index: 20; top: 32px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); }
.filter-track { position: relative; display: flex; gap: 2px; align-items: center; height: 46px; padding: 4px 3px; border: 1px solid var(--glass-border); border-radius: 46px; background: var(--glass-open); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 6px 36px var(--shadow); }
.filter-segment { position: relative; z-index: 1; height: 38px; padding: 0 18px; border-radius: 38px; font-size: 15px; line-height: 38px; color: var(--fg); white-space: nowrap; }
.filter-segment.is-active { color: var(--heading); }
.filter-thumb { position: absolute; height: 38px; top: 3px; background: var(--surface); border-radius: 38px; box-shadow: 0 1px 3px rgb(0 0 0 / .12); transition: left .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1); }
html:not(.js) .filter-segment.is-active { background: var(--surface); }

/* Photograph, world, camera, and record surfaces share geometry. */
.media-main { max-width: 1240px; margin: 0 auto; padding: 110px 20px 150px; }
.image-feed { display: flex; flex-direction: column; gap: 24px; }
.image-feed .image-button img { border-radius: 16px; }
.image-feed figcaption { padding: 14px 2px 4px; color: var(--fg); font-size: 18px; line-height: 28px; }
.image-feed figcaption small { display: block; color: var(--muted); font-size: 13px; line-height: 20px; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.library-card { min-width: 0; overflow: hidden; background: var(--surface); border-radius: 16px; }
.library-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.square-grid .library-card img { aspect-ratio: 1; }
.recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.recipe-collage { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; aspect-ratio: 3 / 2; overflow: hidden; }
.recipe-collage .image-button:first-child { grid-row: 1 / 3; }
.recipe-collage .image-button:only-child { grid-column: 1 / 3; }
.recipe-collage .image-button, .recipe-collage img { min-height: 0; height: 100%; width: 100%; }
.recipe-collage img { aspect-ratio: auto; object-fit: cover; }
.library-card h2 { padding: 20px 20px 0; font-size: 20px; font-weight: 400; line-height: 28px; }
.library-card > p { margin: 12px 20px 20px; font-size: 16px; line-height: 26px; }
.library-card .eyebrow { font-size: 13px; line-height: 18px; }
.eyebrow { font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.worlds-feed { display: flex; flex-direction: column; gap: 60px; }
.world-item > video, .world-poster img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; background: #111; }
.world-caption { max-width: 680px; margin: 24px auto 0; font-size: 18px; line-height: 28px; }
.world-caption h2 { font-size: 24px; line-height: 32px; font-weight: 400; margin-bottom: 12px; }
.world-caption .eyebrow { margin-bottom: 20px; }
.world-caption p + p { margin-top: 20px; }
.album-detail { padding-top: 0; }
.album-detail > .image-button { max-width: 680px; margin: 0 auto 32px; }
.album-detail img { border-radius: 8px; }
.album-detail h1 { margin-bottom: 24px; }
.track-list { list-style: none; margin-top: 28px; }

/* Full-height jukebox, with the same compact floating transport. */
.music-page { min-height: 100dvh; }
.jukebox { height: 100dvh; min-height: 480px; padding: 110px 24px 32px; display: flex; align-items: center; flex-direction: column; gap: 24px; }
.jukebox-now-playing { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 24px; min-height: 0; width: 100%; }
#jukebox-artwork { flex: none; width: min(680px, calc(100vw - 64px), max(64px, calc(100dvh - 400px)) ); aspect-ratio: 1; object-fit: cover; border-radius: 8px; box-shadow: 0 12px 48px rgb(0 0 0 / .12); }
.jukebox-info { text-align: center; width: 100%; max-width: 680px; }
.jukebox-info h1 { font-size: 28px; line-height: 36px; font-weight: 600; margin: 0 0 8px; text-wrap: balance; }
.jukebox-info p { font-size: 13px; line-height: 20px; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; }
#jukebox-release { margin-top: 4px; }
.jukebox-controls { position: relative; flex: none; min-width: 150px; display: flex; align-items: center; flex-direction: column; }
.audio-transport { display: flex; position: relative; height: 48px; padding: 0 8px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 25px; overflow: hidden; box-shadow: 0 6px 36px var(--shadow); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.audio-transport button { position: relative; width: 44px; height: 46px; display: grid; place-items: center; color: var(--heading); }
.audio-transport button svg { width: 22px; height: 22px; }
.audio-progress { position: absolute; inset: 0 auto 0 0; background: var(--rule); width: 0; }
#audio-seek { position: absolute; width: 100%; height: 4px; bottom: -8px; opacity: 0; accent-color: var(--muted); }
.jukebox-controls:hover #audio-seek, #audio-seek:focus-visible { opacity: 1; }
.audio-status { position: absolute; bottom: 70px; width: 300px; text-align: center; font-size: 14px; }

/* Small requested acknowledgement and an optional theme override. */
.site-credit { position: fixed; z-index: 15; bottom: 34px; right: 32px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; line-height: 18px; }
.site-credit > a { border-radius: 3px; }
.site-credit > a:hover { color: var(--heading); }
.theme-toggle { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.theme-toggle:hover { background: var(--rule); color: var(--heading); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Native modal supplies focus containment and Escape handling. */
.lightbox { border: 0; padding: 40px; margin: auto; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: color-mix(in srgb, var(--bg) 96%, transparent); color: var(--fg); }
.lightbox[open] { display: flex; justify-content: center; align-items: center; gap: 20px; }
.lightbox::backdrop { background: color-mix(in srgb, var(--bg) 90%, transparent); }
.lightbox figure { max-width: 90vw; }
.lightbox-image { max-height: 82dvh; max-width: 86vw; width: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 4px 32px rgb(0 0 0 / .15); }
.lightbox-caption { text-align: center; margin-top: 16px; font-size: 14px; line-height: 22px; }
.lightbox-close { position: absolute; top: 20px; right: 24px; font-size: 32px; width: 44px; height: 44px; }
.lightbox-prev, .lightbox-next { flex: none; font-size: 40px; width: 36px; height: 48px; }

@media (min-width: 1360px) { .home-content { max-width: 935px; } .home-intro { gap: 92px; } }
@media (max-width: 1240px) { .media-main { padding-left: 16px; padding-right: 16px; } .image-feed { gap: 20px; } }
@media (max-width: 1100px) { .links-subnav { right: 24px; width: 140px; } }
@media (max-width: 940px) { .home-content { width: calc(100% - 96px); } .home-intro { gap: 48px; } .home-portrait { width: 240px; flex-basis: 240px; } }
@media (max-width: 880px) {
  .home-content { margin: 48px 24px 100px; width: auto; }
  .home-intro { flex-direction: column; gap: 32px; }
  .home-portrait { width: 40%; min-width: 180px; flex-basis: auto; }
  .home-portrait img { border-radius: 16px; }
  .text-main { margin: 48px 24px 100px; padding-bottom: 32px; }
  .writings-main { padding-top: 40px; }
  .timeline-image { float: none; width: 75%; margin: 16px 0; }
  .timeline-row { margin-bottom: 28px !important; }
  .links-subnav { display: none; }
  .entry-image { width: 100%; }
  .archive-filter { top: 16px; }
  .media-main { padding-top: 94px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-main { padding-top: 46px; }
  .album-detail { padding-top: 46px; }
  .jukebox { padding-top: 94px; }
}
@media (max-width: 720px) {
  .home-text { font-size: 19px; line-height: 30px; }
  .home-text h1 { font-size: 32px; line-height: 40px; }
  .text-main { font-size: 19px; line-height: 30px; }
  .text-main h1 { font-size: 32px; line-height: 40px; }
  .text-main .section-title, .text-main h2 { font-size: 28.5px; line-height: 34.2px; }
  .writing-year h2 { font-size: 19px; line-height: 25px; }
  .text-main section, .prose p { margin-bottom: 28px; }
  .site-menu { left: calc(20px + env(safe-area-inset-left)); bottom: calc(20px + env(safe-area-inset-bottom)); transform: none; }
  .site-menu.is-open { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .menu-inner { transform: none; }
  .site-menu.scroll-hidden { opacity: 0; pointer-events: none; }
  .site-credit { bottom: calc(20px + env(safe-area-inset-bottom)); right: calc(16px + env(safe-area-inset-right)); gap: 4px; max-width: calc(100vw - 130px); align-items: center; font-size: 9px; line-height: 13px; }
  .site-credit > a { max-width: 170px; text-wrap: balance; text-align: right; }
  .theme-toggle { flex: none; width: 24px; height: 28px; }
  .filter-segment { padding: 0 12px; }
  .filter-track { gap: 0; }
  .image-feed { gap: 16px; }
  .library-grid { grid-template-columns: 1fr; gap: 20px; }
  .worlds-feed { gap: 40px; }
  .world-caption { padding: 0 8px; }
  .jukebox { padding-bottom: 112px; }
  #jukebox-artwork { width: min(330px, calc(100vw - 64px), max(64px, calc(100dvh - 440px))); }
  .jukebox-info h1 { font-size: 24px; line-height: 30px; }
  .jukebox-controls { position: absolute; bottom: 66px; }
  .music-page .site-credit { bottom: 16px; }
  .lightbox { padding: 48px 8px; }
  .lightbox[open] { gap: 4px; }
  .lightbox-image { max-width: calc(100vw - 88px); }
  .lightbox figure { min-width: 0; }
  .lightbox-prev, .lightbox-next { width: 30px; }
}
@media (max-width: 360px) { .filter-segment { font-size: 14px; padding: 0 9px; } }
@media (max-height: 600px) and (orientation: landscape) {
  .jukebox { min-height: 300px; padding-top: 78px; gap: 12px; }
  .jukebox-now-playing { flex-direction: row; gap: 24px; }
  #jukebox-artwork { width: min(240px, 28vw, max(48px, calc(100dvh - 160px))); }
  .jukebox-info { width: min(440px, 50%); }
  .jukebox-info h1 { font-size: 20px; line-height: 26px; }
  .site-menu.is-open { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .site-menu.is-open .menu-inner { position: relative; bottom: auto; padding-top: 14px; padding-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
}
