@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --bg: #f5f5f5;
  --text: #1a1a1a;
  --text-soft: #666;
  --accent: #b08a55;
  --nav-highlight: rgba(176, 138, 85, 0.16);
  --nav-tree: rgba(102, 102, 102, 0.55);
  --line: #ddd;
  --nav-width: 11.75rem;
  --font-serif: "EB Garamond", "Georgia", serif;
  --font-sans: "Molengo", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(4rem, 9vh, 7rem) clamp(1.25rem, 4vw, 2.5rem) 4rem;
  min-height: 100vh;
}

.site-sidebar {
  position: sticky;
  top: 4rem;
  align-self: start;
  width: auto;
  height: auto;
  padding: 0;
  background: none;
  border: none;
  overflow: visible;
  z-index: 10;
}

.site-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 1.75rem;
  color: var(--text);
}

.site-title:hover {
  text-decoration: none;
}

.site-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
}

.site-nav > li {
  margin: 0.05rem 0;
}

.site-nav a,
.nav-personal-toggle {
  display: block;
  color: var(--text-soft);
  letter-spacing: -0.01em;
  padding: 0.16rem 0.45rem;
  margin-left: -0.45rem;
  border-radius: 3px;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.site-nav > li > a::before,
.nav-personal-toggle::before {
  content: "~/";
  color: var(--nav-tree);
}

.site-nav a:hover,
.nav-personal-toggle:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  background: var(--nav-highlight);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.nav-personal-toggle {
  border: 0;
  background: none;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.16rem 0.45rem;
  margin-left: -0.45rem;
  cursor: pointer;
  text-align: left;
  width: calc(100% + 0.45rem);
}

.nav-personal.is-open > .nav-personal-toggle,
.nav-personal.is-pinned > .nav-personal-toggle {
  color: var(--text);
  text-decoration: none;
}

.nav-personal-sub {
  list-style: none;
  margin: 0.05rem 0 0.15rem;
  padding: 0 0 0 0.35rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.nav-personal.is-open .nav-personal-sub {
  max-height: 8rem;
  opacity: 1;
}

.nav-personal.is-pinned .nav-personal-sub {
  max-height: none;
  overflow: visible;
  opacity: 1;
}

.nav-personal.is-pinned .nav-personal-toggle {
  cursor: default;
}

.nav-personal-sub a {
  font-size: 0.78rem;
  padding: 0.12rem 0.4rem;
  margin-left: -0.4rem;
}

.nav-personal-sub a::before {
  content: "├─ ";
  color: var(--nav-tree);
}

.nav-personal-sub li:last-child a::before {
  content: "└─ ";
}

.site-main {
  min-height: 0;
}

.gallery-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.home-main {
  padding-top: 0;
}

.home-header {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.home-photo {
  width: 140px;
  border-radius: 2px;
}

.home-heading {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-heading h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 400;
  margin: 0 0 0.3rem;
  line-height: 1.05;
}

.home-meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.2;
}

.home-tagline {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.2;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.2;
}

.home-links a {
  color: var(--text-soft);
  text-decoration: none;
}

.home-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.home-body p {
  margin: 0 0 1rem;
}

.home-body a {
  color: var(--accent);
}

.home-news {
  margin: 2rem 0;
}

.home-news h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 0 0.75rem;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-list li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
  margin: 0 0 0.6rem;
}

.news-list time {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.news-list span {
  font-size: 0.95rem;
}

.slideshow-stage {
  flex: 1;
}

.slideshow {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem 1rem;
  min-height: min(62vh, 520px);
}

.slideshow.is-thumbnails {
  align-items: flex-start;
  padding-top: 2rem;
}

.slide {
  display: none;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.slide.is-active,
.slide.is-leaving {
  display: block;
}

.slide.is-leaving {
  position: absolute;
  inset: 2rem 2.5rem 1rem;
  width: auto;
  max-width: none;
  margin: 0;
  pointer-events: none;
  z-index: 1;
}

.slide.is-active {
  position: relative;
  z-index: 2;
}

.slide.is-entering .slide-card {
  animation: slide-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide.is-leaving .slide-card {
  animation: slide-leave 0.35s cubic-bezier(0.55, 0, 0.9, 0.38) both;
}

.slide-card {
  transition: transform 0.2s ease-out;
}

.slide img {
  width: 100%;
  max-height: min(52vh, 460px);
  object-fit: contain;
  margin: 0 auto;
  border-radius: 2px;
}

@keyframes slide-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-leave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.thumbnail-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.slideshow.is-thumbnails .thumbnail-grid {
  display: grid;
}

.slideshow.is-thumbnails .slide {
  display: none !important;
}

.thumbnail-grid button {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
}

.thumbnail-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.thumbnail-grid button:hover img,
.thumbnail-grid button.is-active img {
  opacity: 1;
}

.gallery-controls {
  padding: 1rem 2.5rem 2rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.gallery-controls-inner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

.control-btn,
.thumbnail-toggle {
  border: 0;
  background: none;
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.control-btn:hover,
.thumbnail-toggle:hover,
.dot.is-active {
  color: var(--text);
}

.dots {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.dot {
  border: 0;
  background: none;
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
  padding: 0 0.1rem;
  line-height: 1;
}

.dot.is-active {
  font-weight: 700;
}

.page-main {
  max-width: 640px;
  padding: 0;
}

.doc-page {
  padding: 0;
}

.doc-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.doc-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: lowercase;
  color: var(--text);
  margin: 1.65rem 0 0.55rem;
  letter-spacing: 0.01em;
}

.doc-label::before {
  content: "# ";
  color: var(--nav-tree);
  font-weight: 400;
}

.doc-page h3.doc-label--sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: lowercase;
  color: var(--text-soft);
  margin: 0.85rem 0 0.45rem;
  letter-spacing: 0.01em;
}

.doc-page h3.doc-label--sub::before {
  content: "## ";
  color: var(--nav-tree);
  font-weight: 400;
}

.doc-page p,
.doc-page .lede {
  margin: 0 0 0.85rem;
}

.doc-page .lede {
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}

.doc-page a {
  color: var(--accent);
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
}

.doc-list li {
  position: relative;
  margin: 0.38rem 0;
  padding-left: 1rem;
  line-height: 1.55;
}

.doc-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.75;
}

.doc-list li a[target="_blank"]::after {
  content: " ↗";
  font-size: 0.72rem;
  color: var(--nav-tree);
  text-decoration: none;
}

.doc-list--ordered {
  counter-reset: doc-item;
}

.doc-list--ordered li::before {
  content: counter(doc-item) ".";
  counter-increment: doc-item;
}

.doc-page .art-grid {
  margin-top: 0.25rem;
  gap: 0.5rem;
}

.doc-page .art-grid a {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 2px;
}

.page-main h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin: 0 0 1.5rem;
  line-height: 1.15;
}

.doc-page .doc-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 1.25rem;
}

.page-main h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 2rem 0 0.65rem;
}

.doc-page h2.doc-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  margin: 1.65rem 0 0.55rem;
}

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  counter-reset: pub;
}

.pub-list[start] {
  counter-reset: pub 4;
}

.pub-list li {
  counter-increment: pub;
  position: relative;
  padding-left: 1.65rem;
  margin: 0.7rem 0;
  line-height: 1.55;
}

.pub-list li::before {
  content: counter(pub);
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  line-height: 1.1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--nav-highlight);
  border-radius: 2px;
}

.pub-venue {
  color: var(--text-soft);
}

.pub-note {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.pub-footnote {
  margin: 0.25rem 0 1.25rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.doc-page .pub-list a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(176, 138, 85, 0.45);
  text-underline-offset: 2px;
}

.doc-page .pub-list a:hover {
  color: var(--accent);
}

.page-main h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  margin: 1.5rem 0 0.5rem;
}

.page-main p,
.page-main ul,
.page-main ol {
  margin: 0 0 1rem;
}

.page-main ul,
.page-main ol {
  padding-left: 1.2rem;
}

.page-main li {
  margin: 0.3rem 0;
}

.lede {
  color: var(--text-soft);
  font-size: 1.02rem;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 0;
}

.art-grid a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
}

.art-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.art-grid a:hover img {
  opacity: 0.85;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.contact-list li {
  margin: 0.4rem 0;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  border: 0;
  background: var(--nav-highlight);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .menu-toggle {
    display: block;
  }

  .site-shell {
    grid-template-columns: 1fr;
    padding-top: 4rem;
  }

  .site-sidebar {
    position: fixed;
    inset: 0 auto auto 0;
    top: 0;
    width: min(16rem, 85vw);
    height: 100vh;
    padding: 4.5rem 1.25rem 2rem;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .site-sidebar.is-open {
    transform: translateX(0);
  }

  .slideshow {
    padding: 4rem 1.25rem 1rem;
    min-height: min(48vh, 380px);
  }

  .gallery-controls {
    padding: 1rem 1.25rem 2rem;
  }

  .home-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .home-photo {
    margin: 0 auto;
  }

  .home-links {
    justify-content: center;
  }

  .art-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-personal-sub {
    transition: none;
  }

  .slide.is-entering .slide-card,
  .slide.is-leaving .slide-card {
    animation: none;
  }

  .slide-card {
    transition: none;
  }
}
