:root {
  color-scheme: light;
  --paper: #f2f3f0;
  --surface: #e8eae6;
  --ink: #161816;
  --muted: #666b65;
  --line: #c9cdc7;
  --accent: #2f6b50;
  --accent-ink: #f5f7f4;
  --header: rgba(242, 243, 240, 0.88);
  --radius: 0px;
  --page: min(1480px, calc(100vw - 64px));
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161916;
  --surface: #202420;
  --ink: #eef1ed;
  --muted: #abb1aa;
  --line: #3d433d;
  --accent: #77ad8d;
  --accent-ink: #122017;
  --header: rgba(22, 25, 22, 0.88);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; transform: translateY(-160%); background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip-link:focus { transform: translateY(0); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 70px;
  width: 100%;
  padding: 0 max(32px, calc((100vw - 1480px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: var(--paper); font-size: 11px; letter-spacing: 0.08em; }
nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); }
nav a, .theme-toggle { font-size: 13px; font-weight: 600; text-decoration: none; }
.theme-toggle { border: 0; border-bottom: 1px solid currentColor; padding: 3px 0; color: var(--ink); background: transparent; cursor: pointer; }

.hero {
  width: var(--page);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(480px, 1.15fr);
  gap: clamp(42px, 7vw, 112px);
  align-items: center;
  padding: 32px 0 48px;
}
.hero-copy { align-self: center; padding: 0; }
.eyebrow { margin: 0 0 26px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 26px; max-width: 8ch; font-size: clamp(52px, 6vw, 86px); font-weight: 500; letter-spacing: -0.07em; line-height: 0.92; }
.hero-deck { max-width: 390px; margin-bottom: 36px; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5; }
.primary-link, #load-more, #gallery-load-more, #clear-filters, #open-featured-gallery, .download-button, .passcode-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 240ms var(--ease), background 240ms var(--ease), color 240ms var(--ease);
}
.primary-link:hover, #load-more:hover, #gallery-load-more:hover, #clear-filters:hover, #open-featured-gallery:hover, .download-button:hover, .passcode-submit:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary-link:active, button:active { transform: translateY(1px); }
.hero-figure { width: min(100%, 760px); margin: 0; justify-self: end; align-self: center; display: grid; grid-template-rows: auto auto; }
.hero-frame { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); }
.hero-frame img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity 800ms var(--ease), transform 900ms var(--ease); }
.hero-frame img.loaded.is-active { opacity: 1; }
.hero-frame:hover img.is-active { transform: scale(1.012); }
.hero-figure figcaption { min-height: 32px; display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-top: 12px; color: var(--muted); font-size: 12px; }
.hero-controls { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.hero-controls button { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 2px; background: transparent; color: var(--ink); cursor: pointer; font-size: 12px; }
.hero-controls button:hover { border-color: var(--ink); }
.skeleton { background: linear-gradient(100deg, var(--surface) 20%, var(--paper) 42%, var(--surface) 64%); background-size: 220% 100%; }

.collection-intro {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(52px, 6vw, 82px) 0 68px;
  border-top: 1px solid var(--line);
}
.collection-intro h2 { max-width: 860px; margin-bottom: 28px; font-size: clamp(40px, 5vw, 76px); font-weight: 500; letter-spacing: -0.06em; line-height: 0.98; }
.collection-intro > p { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.collection-facts { display: grid; grid-template-columns: 1.4fr 1fr 1fr; margin-top: 42px; border-top: 1px solid var(--line); }
.collection-facts div { display: flex; flex-direction: column; gap: 8px; padding: 22px 18px 0 0; }
.collection-facts strong { font-size: clamp(34px, 4vw, 62px); font-weight: 500; letter-spacing: -0.05em; }
.collection-facts span { color: var(--muted); font-size: 12px; }

.galleries { width: var(--page); margin: 0 auto; padding: 62px 0 88px; border-top: 1px solid var(--line); }
.galleries-heading { max-width: 640px; margin-bottom: 30px; }
.galleries-heading h2 { margin-bottom: 12px; font-size: clamp(44px, 6vw, 80px); font-weight: 500; letter-spacing: -0.065em; }
.galleries-heading p { color: var(--muted); font-size: 17px; line-height: 1.55; }
.gallery-navigation { margin-bottom: 26px; }
.gallery-tabs { display: flex; gap: 24px; margin-bottom: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.gallery-tab { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0 0 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.gallery-tab span { margin-left: 6px; font-size: 11px; }
.gallery-tab[aria-selected="true"] { border-color: var(--ink); color: var(--ink); }
.gallery-subgroups { display: flex; gap: 8px; overflow-x: auto; padding-top: 12px; scrollbar-width: thin; }
.gallery-subgroups[hidden] { display: none; }
.gallery-subgroup { flex: 0 0 auto; min-height: 36px; border: 1px solid var(--line); padding: 0 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; transition: background 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease); }
.gallery-subgroup span { margin-left: 5px; font-size: 10px; }
.gallery-subgroup:hover { border-color: var(--ink); color: var(--ink); }
.gallery-subgroup[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.featured-gallery { columns: 4 240px; column-gap: 16px; }
.featured-gallery .photo-card { margin-bottom: 24px; }
.gallery-action { display: flex; justify-content: center; margin-top: 36px; }

.gallery-page { width: var(--page); margin: 0 auto; padding: 54px 0 96px; }
.gallery-page-intro { max-width: 760px; padding-bottom: 40px; }
.gallery-page-intro h1 { max-width: none; margin-bottom: 20px; font-size: clamp(58px, 8vw, 108px); }
.gallery-page-intro > p:last-child { max-width: 610px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.gallery-page .gallery-navigation { position: sticky; top: 70px; z-index: 8; margin-bottom: 34px; padding-top: 16px; padding-bottom: 12px; background: var(--paper); }
.gallery-page-heading { max-width: 640px; margin-bottom: 28px; }
.gallery-page-heading h2 { margin-bottom: 8px; font-size: clamp(32px, 4vw, 54px); font-weight: 500; letter-spacing: -0.05em; }
.gallery-page-heading p { color: var(--muted); }
.gallery-page .gallery { min-height: 40dvh; }
.gallery-page .gallery-loading { margin-top: 24px; }
.gallery-page-empty { max-width: 520px; padding: 70px 0; color: var(--muted); }
.gallery-page footer { margin-top: 70px; }
nav a[aria-current="page"] { border-bottom: 1px solid currentColor; }

.archive { width: var(--page); margin: 0 auto; padding: 62px 0 96px; }
.archive-heading { max-width: 640px; margin-bottom: 34px; }
.archive-heading h2 { margin-bottom: 12px; font-size: clamp(44px, 6vw, 80px); font-weight: 500; letter-spacing: -0.065em; }
.archive-heading p { color: var(--muted); }
.filter-shell { position: sticky; top: 70px; z-index: 8; padding: 16px 0 14px; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.subject-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: thin; }
.subject-filter { flex: 0 0 auto; border: 1px solid var(--line); padding: 8px 12px; background: transparent; color: var(--ink); cursor: pointer; font-size: 12px; }
.subject-filter[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.filter-controls { display: grid; grid-template-columns: 0.7fr 1fr 0.9fr 1.4fr; gap: 12px; }
.filter-controls label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 42px; border-left: 1px solid var(--line); padding-left: 12px; }
.filter-controls label:first-child { border-left: 0; padding-left: 0; }
.filter-controls label > span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
select, input { min-width: 0; width: 100%; height: 38px; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); color: var(--ink); }
input::placeholder { color: var(--muted); opacity: 1; }
.location-note { margin: 24px 0 32px; max-width: 720px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gallery { columns: 4 260px; column-gap: 16px; }
.photo-card { width: 100%; break-inside: avoid; display: block; margin: 0 0 26px; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: zoom-in; }
.photo-image { position: relative; overflow: hidden; background: var(--surface); }
.photo-image img { width: 100%; height: auto; display: block; opacity: 0; transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.photo-image img.loaded { opacity: 1; }
.photo-card:hover img { transform: scale(1.018); }
.photo-card figcaption { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-top: 9px; color: var(--muted); font-size: 11px; }
.photo-card figcaption span:first-child { color: var(--ink); font-weight: 600; }
.gallery-loading { columns: 4 260px; column-gap: 16px; }
.gallery-loading span { display: block; break-inside: avoid; height: 360px; margin-bottom: 16px; background: linear-gradient(100deg, var(--surface) 20%, var(--paper) 42%, var(--surface) 64%); background-size: 220% 100%; animation: shimmer 1.8s infinite linear; }
.gallery-loading span:nth-child(2) { height: 250px; }
.gallery-loading span:nth-child(3) { height: 430px; }
.gallery-loading span:nth-child(4) { height: 300px; }
.load-row { display: flex; justify-content: center; margin-top: 48px; }
.empty-state { max-width: 560px; margin: 80px auto; text-align: center; }
.empty-state h3 { font-size: 28px; letter-spacing: -0.04em; }
.empty-state p { color: var(--muted); }

.about { width: var(--page); margin: 0 auto; padding: 76px 0 96px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 10vw; }
.about h2 { max-width: 800px; font-size: clamp(44px, 6vw, 84px); font-weight: 500; letter-spacing: -0.065em; line-height: 0.98; }
.about div { align-self: end; }
.about p { color: var(--muted); line-height: 1.65; }
footer { width: var(--page); min-height: 92px; margin: 0 auto; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }

.lightbox {
  width: min(1440px, calc(100vw - 40px));
  max-width: none;
  height: min(900px, calc(100dvh - 40px));
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(10, 12, 10, 0.8); }
.lightbox-bar { height: 62px; padding: 0 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.lightbox-bar button, .lightbox-nav { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 12px; font-weight: 600; }
.lightbox-layout { height: calc(100% - 62px); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.lightbox-stage { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; background: var(--surface); }
.lightbox-stage img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(86%, 1040px);
  height: calc(100% - 56px);
  max-width: none;
  max-height: none;
  display: block;
  object-fit: contain;
  transform: translate(-50%, -50%);
}
.lightbox-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  transition: transform 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}
.lightbox-nav:hover { background: var(--accent); color: var(--accent-ink); }
.lightbox-nav:active { transform: translateY(-50%) scale(0.96); }
.lightbox-nav.previous { left: 10px; }
.lightbox-nav.next { right: 10px; }
.metadata { padding: 46px 28px; overflow-y: auto; border-left: 1px solid var(--line); }
.metadata-subject { margin-bottom: 12px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.metadata h2 { margin-bottom: 42px; font-size: 26px; font-weight: 500; letter-spacing: -0.04em; word-break: break-word; }
.metadata dl { margin: 0 0 42px; }
.metadata dl div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.metadata dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.metadata dd { margin: 0; font-size: 13px; line-height: 1.4; }
.metadata .download-button { width: 100%; }
.passcode-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.passcode-dialog::backdrop { background: rgba(10, 12, 10, 0.72); }
.passcode-dialog form { padding: 32px; }
.passcode-dialog h2 { margin-bottom: 12px; font-size: 30px; font-weight: 500; letter-spacing: -0.045em; }
.passcode-dialog form > p:not(.passcode-error) { margin-bottom: 28px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.passcode-dialog label { display: block; margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.passcode-dialog input { height: 46px; border: 1px solid var(--line); padding: 0 12px; font-size: 20px; letter-spacing: 0.2em; }
.passcode-dialog input:focus { border-color: var(--accent); }
.passcode-error { margin: 12px 0 0; border-left: 2px solid var(--accent); padding-left: 10px; color: var(--muted); font-size: 13px; }
.passcode-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.passcode-actions button { min-height: 46px; white-space: nowrap; cursor: pointer; }
.passcode-cancel { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.error-banner { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: 420px; padding: 16px; background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1.5; }

@keyframes shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: enter 900ms var(--ease) both; }
  .hero-figure.reveal { animation-delay: 120ms; }
  .skeleton { animation: shimmer 1.8s infinite linear; }
  @keyframes enter { from { opacity: 0; transform: translateY(24px); } }
  .scroll-reveal { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
  .scroll-reveal.is-visible { opacity: 1; transform: translateY(0); }
  .word-mask { display: inline-block; overflow: hidden; vertical-align: bottom; }
  .reveal-word { display: inline-block; opacity: 0; transform: translateY(105%); transition: opacity 620ms var(--ease), transform 720ms var(--ease); }
  [data-word-reveal].is-visible .reveal-word { opacity: 1; transform: translateY(0); transition-delay: calc(var(--word-index) * 55ms); }
  .scroll-photo { opacity: 0; transform: translateY(18px) scale(0.992); transition: opacity 620ms var(--ease), transform 720ms var(--ease); transition-delay: calc(var(--reveal-index) * 45ms); }
  .scroll-photo.is-visible { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 900px) {
  :root { --page: calc(100vw - 32px); }
  .site-header { height: 62px; padding: 0 16px; }
  .brand span:last-child { display: none; }
  nav { gap: 18px; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 42px 0 34px; }
  .hero-copy { align-self: auto; padding: 0; }
  h1 { max-width: 7ch; font-size: clamp(54px, 13vw, 78px); }
  .hero-figure { width: 100%; justify-self: stretch; }
  .collection-intro { padding: 58px 0 62px; }
  .collection-facts { grid-template-columns: 1fr; margin-top: 38px; }
  .collection-facts div { border-bottom: 1px solid var(--line); padding: 20px 0; }
  .filter-shell { top: 62px; }
  .filter-controls { grid-template-columns: 1fr 1fr; }
  .filter-controls label, .filter-controls label:first-child { grid-template-columns: 1fr; gap: 3px; border-left: 0; padding-left: 0; }
  .gallery, .featured-gallery { columns: 2 220px; }
  .gallery-page { padding-top: 42px; }
  .gallery-page .gallery-navigation { top: 62px; }
  .about { grid-template-columns: 1fr; gap: 40px; }
  .about div { max-width: 560px; }
  .lightbox { width: 100vw; height: 100dvh; margin: 0; border: 0; }
  .lightbox-layout { grid-template-columns: 1fr; grid-template-rows: minmax(52dvh, 1fr) auto; overflow-y: auto; }
  .lightbox-stage { min-height: 52dvh; }
  .lightbox-stage img { width: calc(100% - 72px); height: calc(100% - 68px); }
  .lightbox-nav { top: auto; bottom: 8px; transform: none; background: var(--paper); }
  .lightbox-nav:active { transform: scale(0.96); }
  .metadata { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  nav a[href="#about"] { display: none; }
  .hero { padding-top: 34px; }
  h1 { font-size: clamp(50px, 16vw, 68px); }
  .hero-deck { margin-bottom: 28px; }
  .hero-figure figcaption { display: grid; gap: 10px; }
  .filter-controls { grid-template-columns: 1fr; }
  .gallery, .featured-gallery { columns: 1; }
  .gallery-page-intro h1 { font-size: clamp(54px, 17vw, 78px); }
  .photo-card { margin-bottom: 42px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
}
