@font-face {
  font-family: 'Fragment Mono';
  src: url('assets/fonts/FragmentMono-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #111;
  --parma: #a08bb8;
  --edge: 22px;
  --rail: clamp(240px, 23vw, 350px);
  --type: 13px;
  --mobile-top: 72px;
  --compact-layout: 0;
  --menu-top: 18px;
  color-scheme: light;
  font-family: 'Fragment Mono', monospace;
  font-size: var(--type);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); }
button, a { -webkit-tap-highlight-color: transparent; }
button, a, h1, h2, h3, p, ul, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { border: 0; border-radius: 0; padding: 0; color: inherit; background: none; font: inherit; text-align: inherit; cursor: pointer; }
a, button { transition: color 140ms ease; }
a:hover, button:hover { color: var(--parma); }
:focus-visible { outline: 1px solid var(--parma); outline-offset: 5px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-size: 1rem; font-weight: 400; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; left: 22px; top: -80px; z-index: 100; background: white; padding: 8px; }
.skip-link:focus { top: 12px; }

.identity { position: fixed; top: 50svh; left: var(--edge); width: calc(var(--rail) - 2 * var(--edge)); z-index: 30; transform: translateY(-50%); }
.wordmark { white-space: nowrap; font-size: calc(var(--type) + 2px); }
.identity-portrait { position: absolute; left: 0; bottom: calc(100% + 24px); width: 126px; }
.identity-portrait img { width: 100%; height: auto; }
.location { position: absolute; top: calc(100% + 10px); left: 0; width: 100%; font-size: calc(var(--type) - 2px); }
.navigation { position: fixed; top: var(--edge); right: var(--edge); width: calc(var(--rail) - 2 * var(--edge)); z-index: 40; text-align: right; }
.menu-toggle { display: block; margin-left: auto; }
.menu-level { position: relative; }
.menu-list { list-style: none; padding: 0; display: flex; flex-direction: column; align-items: stretch; gap: 5px; max-height: calc(100svh - 100px); overflow-y: auto; scrollbar-width: thin; font-size: calc(var(--type) - 1px); }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: right; line-height: 1.5; padding: 1px 0; overflow-wrap: anywhere; }
.menu-back { display: block; margin-left: auto; padding: 1px 0; font-size: calc(var(--type) + 2px); }
.menu-back-item { margin-bottom: 9px; }
.menu-list [aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.footer { position: relative; z-index: 40; }
.copyright, .instagram { position: fixed; bottom: var(--edge); }
.copyright { left: var(--edge); font-size: calc(var(--type) - 2px); }
.instagram { right: var(--edge); }

#content { margin-inline: var(--rail); width: calc(100% - 2 * var(--rail)); outline: none; }
.home { height: 100svh; display: grid; place-items: center; }
.home-photo { display: flex; align-items: center; justify-content: center; width: 100%; height: 68svh; cursor: zoom-in; }
.home-photo img { width: auto; height: auto; max-width: 100%; max-height: 66svh; object-fit: contain; }
.photo-block { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding-block: 65px; }
.photo-button { display: flex; justify-content: center; align-items: center; width: 100%; cursor: zoom-in; }
.photo-button img { width: auto; height: auto; max-width: 88%; max-height: 72svh; object-fit: contain; }
.project-text { max-width: 660px; margin: 30px auto 120px; line-height: 1.7; }
.project-text h1 { margin-bottom: 36px; text-align: center; }
.project-text h2, .project-text h3 { margin: 30px 0 16px; }
.project-text p, .about-copy p, .text-entry { text-align: justify; text-justify: inter-word; hyphens: auto; overflow-wrap: break-word; }
.project-text p + p { margin-top: 1.4em; }
.project-text .attribution { margin-top: 2.5em; }
.text-section { margin-top: 32px; }
.text-entry { margin-top: 12px; }
.exhibition-heading { text-align: center; margin: 0 auto 0; }
.exhibition .photo-block:first-of-type { min-height: 90svh; }
.project-end { height: 50px; }

.about { display: grid; grid-template-columns: 1fr 1fr; row-gap: 64px; padding: var(--edge) 0 110px; line-height: 1.7; }
.about-block { min-width: 0; }
.about-profile, .about-footer { display: none; }
.about-block > h1, .about-block > h2 { margin-bottom: 22px; }
.about-bio { grid-column: 2; grid-row: 1; }
.about-contact { grid-column: 1; grid-row: 2; text-align: right; }
.about-cv { grid-column: 2; grid-row: 3; }
.about-publications { grid-column: 1; grid-row: 4; text-align: right; }
.contact { margin: 0; }
.contact a { overflow-wrap: anywhere; }
.about-copy p + p { margin-top: 1.5em; }
.cv-section + .cv-section { margin-top: 48px; }
.cv-entry { display: grid; grid-template-columns: 40px 1fr; gap: 12px; margin-bottom: 18px; }
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry p { text-align: justify; hyphens: auto; }
.cv-year { white-space: nowrap; }
.publications-list p { margin: 0; padding: 0; }
body.is-about .identity { top: 0; height: 100svh; transform: none; }
body.is-about .wordmark { position: absolute; top: 50%; transform: translateY(-50%); }
body.is-about .location { top: calc(50% + 24px); }
body.is-about .identity-portrait { top: var(--edge); bottom: auto; width: min(100%, 260px, 15vw); }
body.is-about .identity-portrait img { width: auto; max-height: calc(50svh - 80px); object-fit: contain; object-position: left top; }

.lightbox { position: fixed; inset: 0; background: #fff; z-index: 25; }
.lightbox-stage { position: absolute; inset: 58px var(--rail) 58px; display: flex; justify-content: center; align-items: center; touch-action: pan-y; }
.lightbox-stage img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-toolbar { position: fixed; top: var(--edge); right: var(--edge); }
.lightbox-project { position: fixed; top: 50svh; right: var(--edge); transform: translateY(-50%); width: calc(var(--rail) - 2 * var(--edge)); text-align: right; font-size: calc(var(--type) + 2px); overflow-wrap: break-word; }
.lightbox-controls { position: absolute; bottom: var(--edge); left: 50%; transform: translateX(-50%); width: min(360px, calc(100% - 2 * var(--rail))); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 34px; }
#lightbox-previous { justify-self: end; white-space: nowrap; }
#lightbox-next { justify-self: start; white-space: nowrap; }
#lightbox-counter { grid-column: 2; text-align: center; min-width: 6ch; }
#lightbox-close { font-size: calc(var(--type) + 2px); }
.lightbox-controls button { padding: 5px 0; }
body.viewer-open { overflow: hidden; }
.noscript { margin: 25vh auto; width: 50%; }

@media (min-width: 1800px) { :root { --rail: calc((100vw - 1000px) / 2); } }
@media (min-width: 761px) and (max-width: 1050px) {
  :root { --rail: 210px; --edge: 18px; --type: 12px; }
  .location { max-width: 165px; }
  .identity-portrait { width: 110px; }
  .about { grid-template-columns: 1fr; row-gap: 48px; padding-top: 70px; }
  .about-block { grid-column: 1; grid-row: auto; }
}

@media (max-width: 1050px) and (min-height: 501px), (max-width: 760px) and (orientation: portrait) {
  :root { --edge: 16px; --rail: 16px; --type: 12px; --compact-layout: 1; }
  html, body { height: 100%; overflow: hidden; }
  .identity { top: 18px; left: var(--edge); width: auto; max-width: 60%; transform: none; }
  .navigation { top: 18px; right: var(--edge); width: min(60%, 270px); }
  .menu-list { max-height: 34svh; gap: 3px; padding-bottom: 5px; }
  .menu-list a, .menu-list button { padding-block: 3px; }
  .copyright, .instagram { bottom: 15px; }
  .instagram { font-size: 10px; }
  #content { position: fixed; top: var(--mobile-top); bottom: 54px; width: auto; left: 20px; right: 20px; margin: 0; overflow-y: auto; scrollbar-width: none; }
  #content::-webkit-scrollbar { display: none; }
  .home { height: 100%; min-height: 0; }
  .home-photo { height: 100%; }
  .home-photo img { max-height: min(66svh, calc(100svh - var(--mobile-top) - 100px)); }
  .photo-block { min-height: calc(100svh - var(--mobile-top) - 54px); padding-block: 24px; }
  .photo-button img { max-width: 88%; max-height: calc(100svh - var(--mobile-top) - 120px); }
  .project-text { margin: 36px auto 70px; padding-inline: 5px; }
  .exhibition .photo-block:first-of-type { min-height: calc(100svh - var(--mobile-top) - 54px); }
  .about { grid-template-columns: 1fr; row-gap: 42px; padding: 25px 5px 45px; }
  .about-block { grid-column: 1; grid-row: auto; }
  .cv-entry { grid-template-columns: 38px 1fr; gap: 12px; }
  body.is-about .identity { top: 18px; height: auto; }
  body.is-about .wordmark { position: static; transform: none; }
  body.is-about .identity-portrait { position: static; width: 108px; margin-bottom: 12px; }
  body.is-about .location { position: static; margin-top: 6px; max-width: 190px; }
  .lightbox { top: var(--mobile-top); bottom: 54px; }
  .lightbox-stage { inset: 16px 16px 56px; }
  .lightbox-toolbar { top: 18px; right: var(--edge); }
  .lightbox-controls { bottom: 0; width: min(340px, calc(100% - 32px)); gap: 24px; }
  body.viewer-open .identity { top: 64px; width: calc(50% - 24px); max-width: none; }
  body.viewer-open .wordmark { white-space: normal; }
  .lightbox-project { top: 64px; width: calc(50% - 24px); transform: none; }
  body.viewer-open #content { overflow: hidden; }
}

/* Give photographs the full central width on tablets as well as phones. */
@media (min-width: 761px) and (max-width: 1050px) and (min-height: 501px) {
  :root { --edge: 24px; --type: 13px; }
  #content { left: 36px; right: 36px; }
  .menu-list { max-height: min(34svh, 320px); }
  body.is-about .identity-portrait { width: 144px; }
  .about { max-width: 600px; margin-inline: auto; }
  .project-text { max-width: 600px; }
}

/* A short landscape phone keeps the interface beside the photographs. */
@media (max-width: 760px) and (max-height: 500px) and (orientation: landscape) {
  :root { --rail: 140px; --edge: 16px; --type: 12px; }
  .wordmark { white-space: normal; }
  .menu-list { max-height: calc(100svh - 80px); }
  .about { grid-template-columns: 1fr; row-gap: 36px; }
  .about-block { grid-column: 1; grid-row: auto; }
  .lightbox-controls { gap: 16px; }
}

/* Keep the lettering small while making each control comfortable to tap. */
@media (max-width: 1180px), (pointer: coarse) {
  .menu-toggle, #lightbox-close { min-width: 44px; min-height: 44px; text-align: right; }
  .wordmark { display: inline-flex; align-items: center; min-height: 44px; }
  .instagram { min-height: 44px; display: flex; align-items: flex-end; }
  .lightbox-controls button { min-height: 44px; }
  .lightbox-stage { bottom: calc(var(--edge) + 56px); }
  .lightbox-project { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; }
  .navigation { top: var(--menu-top); width: min(72vw, 320px); pointer-events: none; }
  .menu-toggle, .menu-back { pointer-events: auto; }
  .menu-back { width: 44px; height: 44px; text-align: right; }
  .menu-back-item { margin: 0; background: transparent; }
  .menu-list { max-height: calc(100svh - var(--menu-top) - 116px); gap: 0; padding: 0; overscroll-behavior: contain; }
  .menu-list li { width: max-content; max-width: 100%; margin-left: auto; }
  .menu-list a, .menu-list button { width: auto; min-height: 26px; padding: 4px 0; pointer-events: auto; }
  .menu-label {
    background: rgb(255 255 255 / 78%);
    padding: 1px 3px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }
  /* About shares the same fixed header as other mobile pages. Its profile
     and footer belong to the scrolling content, not the identity rail. */
  body.is-about { --compact-layout: 1; height: 100svh; overflow: hidden; }
  body.is-about .identity {
    top: 18px;
    left: var(--edge);
    width: auto;
    max-width: calc(100% - 2 * var(--edge) - 72px);
    height: auto;
    transform: none;
  }
  body.is-about .wordmark { position: static; transform: none; white-space: nowrap; }
  body.is-about .identity-portrait, body.is-about .location,
  body.is-about > .footer { display: none; }
  body.is-about #content {
    position: fixed;
    top: var(--mobile-top);
    bottom: 0;
    left: var(--edge);
    right: var(--edge);
    width: auto;
    margin: 0;
    overflow-y: auto;
    scrollbar-width: none;
  }
  body.is-about #content::-webkit-scrollbar { display: none; }
  body.is-about .about {
    grid-template-columns: 1fr;
    max-width: none;
    row-gap: 42px;
    padding: 0 0 24px;
  }
  body.is-about .about-block { grid-column: 1; grid-row: auto; max-width: 600px; width: 100%; margin-inline: auto; }
  .about-profile { display: block; grid-column: 1; grid-row: auto; }
  .about-location { font-size: calc(var(--type) - 2px); }
  .about-portrait { width: clamp(144px, 42vw, 260px); margin-top: 18px; }
  .about-portrait img { width: 100%; height: auto; }
  .about-footer { display: flex; grid-column: 1; justify-content: space-between; align-items: baseline; gap: 24px; }
  .about-footer span { font-size: calc(var(--type) - 2px); }
  .about-footer a { display: flex; align-items: center; min-height: 44px; }
  /* Only the actual image responds to a tap; its surrounding white space
     remains available to dismiss the menu. Keyboard activation still works. */
  .home-photo, .photo-button { pointer-events: none; }
  .home-photo img, .photo-button img { pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { a, button { transition: none; } }
