:root {
  color-scheme: light;
  --background: #f2efe9;
  --surface: #faf8f4;
  --surface-strong: #ffffff;
  --text: #1e1d1a;
  --muted: #6f6a61;
  --line: rgba(30, 29, 26, 0.14);
  --overlay: rgba(12, 11, 10, 0.96);
  --overlay-text: #f7f3ec;
  --accent: #8d4b32;
  --header-background: rgba(242, 239, 233, 0.82);
  --shadow: 0 20px 55px rgba(40, 30, 22, 0.12);
  --page-gutter: clamp(1rem, 3vw, 3rem);
  --content-width: 1540px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #121210;
  --surface: #1a1916;
  --surface-strong: #23211d;
  --text: #f0ece4;
  --muted: #aaa399;
  --line: rgba(240, 236, 228, 0.14);
  --overlay: rgba(5, 5, 4, 0.97);
  --overlay-text: #f7f3ec;
  --accent: #d38b68;
  --header-background: rgba(18, 18, 16, 0.84);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.lightbox-open {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid var(--line);
  background: var(--header-background);
  backdrop-filter: blur(18px);
}

.identity {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  text-decoration: none;
}

.identity span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.identity small {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--muted);
  background: var(--surface-strong);
}

.icon-button:active {
  transform: scale(0.96);
}

main {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 0 var(--page-gutter) clamp(4rem, 8vw, 8rem);
}

.intro {
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(2.75rem, 6vw, 5rem);
}

.eyebrow,
.detail-kicker {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.25rem, 7.6vw, 6.75rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.94;
}

.intro-copy {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 1.35vw, 1.2rem);
  font-style: italic;
}

.collection {
  width: 80%;
  margin-inline: auto;
}

.collection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-button {
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.filter-button:hover {
  color: var(--text);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.photo-count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery {
  display: block;
}

.gallery-group {
  position: relative;
  display: block;
  column-gap: clamp(0.9rem, 2vw, 1.75rem);
  row-gap: clamp(1.4rem, 3vw, 2.6rem);
}

.year-section + .year-section {
  margin-top: clamp(5rem, 9vw, 9rem);
}

.year-heading {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0 0 clamp(2rem, 4vw, 3.5rem);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.5vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.year-heading::after {
  width: 100%;
  height: 1px;
  background: var(--line);
  content: "";
}

.photo-card {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  margin: 0;
  transition: transform 260ms ease;
  will-change: transform;
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.photo-button img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 500ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 240ms ease;
}

.photo-button:hover img {
  opacity: 0.96;
}

.photo-button img.is-loading {
  opacity: 0;
}

.photo-caption {
  padding-top: 0.7rem;
}

.photo-caption p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.015em;
}

.empty-state,
.noscript-message {
  padding: 4rem 0;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 1.5rem var(--page-gutter) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-underline-offset: 0.25em;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  color: var(--overlay-text);
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(20px);
}

.lightbox-shell {
  position: relative;
  display: grid;
  grid-template: auto minmax(0, 1fr) / minmax(0, 1fr) minmax(280px, 340px);
  width: 100%;
  height: 100%;
}

.lightbox-toolbar {
  z-index: 3;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 1rem 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-toolbar p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.lightbox .icon-button {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--overlay-text);
}

.lightbox .icon-button:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

.zoom-level {
  min-width: 64px;
  font-size: 0.72rem;
}

.close-button {
  margin-left: 0.35rem;
  font-size: 1.35rem;
}

.viewer {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.image-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
}

.image-stage.is-zoomed {
  cursor: grab;
}

.image-stage.is-dragging {
  cursor: grabbing;
}

.image-stage img {
  display: block;
  width: calc(100% - 6rem);
  height: calc(100vh - 116px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  opacity: 1;
  transform-origin: center;
  transition: opacity 180ms ease, transform 140ms ease-out;
  will-change: transform;
}

.image-stage img.is-loading {
  opacity: 0;
}

.image-stage.is-dragging img {
  transition: opacity 180ms ease;
}

.image-loader {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(12, 11, 10, 0.34);
  color: white;
  cursor: pointer;
  font-size: 1.3rem;
  transform: translateY(-50%);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.viewer-nav:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
}

.viewer-nav-previous {
  left: 1rem;
}

.viewer-nav-next {
  right: 1rem;
}

.photo-details {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.photo-details h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.detail-context,
.photo-description {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.86rem;
  line-height: 1.65;
}

.detail-context {
  min-height: 1.4em;
  margin: 0.8rem 0 0;
}

.exif-grid {
  display: grid;
  gap: 1rem;
  margin: 2.5rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.exif-grid div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.75rem;
}

.exif-grid dt {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.exif-grid dd {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.7rem;
}

.photo-description {
  margin: 1.5rem 0 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .collection {
    width: 100%;
  }

  .lightbox-shell {
    grid-template: auto minmax(0, 1fr) auto / 1fr;
  }

  .viewer {
    min-height: 52vh;
  }

  .image-stage img {
    height: calc(52vh - 3rem);
  }

  .photo-details {
    max-height: 36vh;
    padding: 1.25rem var(--page-gutter) 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .photo-details h2 {
    font-size: 1.7rem;
  }

  .exif-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0;
    padding: 1rem 0;
  }

  .exif-grid div {
    display: block;
  }

  .exif-grid dt {
    margin-bottom: 0.35rem;
  }
}

@media (max-width: 700px) {
  .identity small {
    display: none;
  }

  .intro {
    padding-top: 4.5rem;
  }

  .intro h1 {
    font-size: clamp(2.9rem, 13.5vw, 4.25rem);
  }

  .collection-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .lightbox-toolbar {
    min-height: 58px;
    padding-inline: 0.75rem;
  }

  .lightbox-toolbar p {
    display: none;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .viewer-nav {
    top: auto;
    bottom: 0.8rem;
    width: 44px;
    height: 44px;
    transform: none;
  }

  .viewer-nav-previous {
    left: calc(50% - 54px);
  }

  .viewer-nav-next {
    right: calc(50% - 54px);
  }

  .image-stage img {
    width: calc(100% - 1.25rem);
    height: calc(52vh - 4.5rem);
  }

  .exif-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
