:root {
  --bg: #090c10;
  --bg-elevated: rgba(18, 24, 31, 0.92);
  --panel: rgba(14, 20, 27, 0.9);
  --panel-strong: rgba(22, 30, 40, 0.98);
  --text: #f5f7fa;
  --muted: #a5b3c5;
  --accent: #9bd5c5;
  --accent-strong: #d8b36f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 1.35rem;
  --radius-sm: 0.9rem;
  --shell: min(1280px, calc(100vw - 2rem));
  --font-sans: "Space Grotesk", "Avenir Next", "Segoe UI Variable", sans-serif;
  --font-serif: "Fraunces", "Iowan Old Style", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(155, 213, 197, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(216, 179, 111, 0.12), transparent 24%),
    linear-gradient(180deg, #0b1117 0%, #090c10 100%);
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100vh;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  opacity: 0.38;
  mask-image: linear-gradient(to bottom, transparent 70px, #000 230px);
}

body:has(.viewer[open]) .site-backdrop {
  display: none;
}

@media (max-width: 700px) {
  .site-backdrop {
    opacity: 0.18;
    object-position: left center;
  }
}

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

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

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #081012;
}

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

.shell {
  width: var(--shell);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(9, 12, 16, 0.72);
  border-bottom: 1px solid var(--line);
}

.shell-header,
.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  color: #dfb476;
  --logo-accent: #9fbca6;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-title {
  display: inline-block;
  margin-bottom: 0.1rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-subtitle,
.site-footer p,
.eyebrow,
.photo-card__meta,
.album-card__meta,
.search-status,
.meta-list dt {
  color: var(--muted);
}

.brand-subtitle {
  margin: 0;
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav a {
  white-space: nowrap;
}

.nav-label-short {
  display: none;
}

.site-nav a,
.button-link,
.pagination__link,
.viewer__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.site-nav a:hover,
.button-link:hover,
.pagination__link:hover,
.viewer__link:hover {
  transform: translateY(-1px);
  border-color: rgba(155, 213, 197, 0.55);
  background: rgba(155, 213, 197, 0.08);
}

.site-main {
  padding: 2rem 0 5rem;
}

.hero,
.page-head,
.section-block {
  margin-top: 2rem;
}

.hero,
.page-head,
.panel,
.search-panel,
.nav-card,
.viewer__frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 24, 31, 0.92), rgba(10, 14, 20, 0.98));
  box-shadow: var(--shadow);
}

.hero,
.page-head,
.panel,
.search-panel {
  padding: clamp(1.4rem, 2vw, 2rem);
}

.hero--home {
  margin-top: 1rem;
  padding: clamp(1.35rem, 2.2vw, 1.9rem);
}

.hero__copy h1,
.page-head h1,
.photo-stage h1 {
  margin: 0.1rem 0 0.8rem;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.1vw, 4rem);
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hero__lede {
  max-width: 55rem;
  margin: 0;
  color: #d9e0ea;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.65;
}

.hero__lede > :first-child {
  margin-top: 0;
}

.hero__lede > :last-child {
  margin-bottom: 0;
}

.hero--home .hero__copy h1 {
  margin: 0.25rem 0 0.8rem;
}

.hero--home .hero__lede {
  max-width: 48rem;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.6;
}

.hero--home .eyebrow {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.album-grid,
.photo-grid {
  display: grid;
  gap: 1.2rem;
}

.archive-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.archive-stats li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  white-space: nowrap;
}

.archive-stats strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.archive-stats a:hover,
.archive-stats a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.archive-stats__separator {
  color: var(--muted);
}

.section-head,
.page-head__meta,
.photo-actions,
.viewer__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-head {
  margin-bottom: 1rem;
}

.section-head h2,
.panel h2,
.panel h3 {
  margin: 0;
  font-size: 1.05rem;
}

.album-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.album-card,
.photo-card,
.nav-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.album-card__link,
.nav-card {
  display: grid;
  min-height: 100%;
}

.album-card__media,
.photo-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(155, 213, 197, 0.14), rgba(9, 12, 16, 0.85));
}

.album-card__media img,
.photo-card__media img,
.nav-card img,
.photo-figure img,
.viewer__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-card__placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(120deg, rgba(155, 213, 197, 0.2), rgba(216, 179, 111, 0.12)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 70%);
}

.album-card__body,
.photo-card__body,
.nav-card div {
  padding: 1rem 1.1rem 1.15rem;
}

.album-card__body h3,
.photo-card__body h3,
.nav-card strong {
  margin: 0;
  font-size: 1.15rem;
}

.album-card__body p,
.photo-card__body p {
  margin: 0.55rem 0 0;
}

.album-card__meta,
.photo-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.8rem;
  font-size: 0.92rem;
}

.photo-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.quick-view,
.viewer__zoom,
.viewer__close,
.viewer__nav {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 12, 16, 0.84);
  color: var(--text);
}

.quick-view {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  min-height: 44px;
  padding: 0.6rem 0.95rem;
  font-size: 1rem;
  transition: border-color 140ms ease;
}

.quick-view:hover,
.quick-view:focus-visible {
  border-color: rgba(155, 213, 197, 0.75);
}

.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 0.9rem 0 0;
  list-style: none;
}

.tag-row a,
.tag-row--plain span,
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #dfe6ef;
}

.tag-cloud a span {
  color: var(--muted);
}

.breadcrumbs {
  width: var(--shell);
  margin: 0 auto 1rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--muted);
}

.breadcrumbs li::after {
  content: "/";
  margin-left: 0.55rem;
  color: rgba(255, 255, 255, 0.28);
}

.breadcrumbs li:last-child::after {
  content: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.3rem;
}

.pagination__state {
  color: var(--muted);
}

.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.photo-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(280px, 0.95fr);
  gap: 1.5rem;
}

.photo-stage,
.photo-sidebar {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.photo-figure,
.search-panel {
  overflow: hidden;
}

.photo-figure {
  position: relative;
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.photo-figure__open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0.9rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--text);
  cursor: zoom-in;
  align-items: flex-end;
  justify-content: flex-end;
}

.photo-figure__open:not([hidden]) {
  display: flex;
}

.photo-figure__open-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #090c10;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: border-color 140ms ease;
}

.photo-figure__open:hover .photo-figure__open-label,
.photo-figure__open:focus-visible .photo-figure__open-label {
  border-color: var(--accent);
}

.photo-figure__open:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -4px;
}

.photo-actions {
  justify-content: flex-start;
}

.panel {
  display: grid;
  gap: 1rem;
}

.meta-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.meta-list div {
  display: grid;
  gap: 0.25rem;
}

.meta-list dd {
  margin: 0;
}

.photo-exif {
  border-top: 1px solid var(--line);
}

.photo-exif summary {
  padding: 0.85rem 0;
  cursor: pointer;
  font-weight: 600;
}

.photo-exif summary::marker {
  color: var(--muted);
}

.photo-exif summary:hover {
  color: var(--accent);
}

.photo-exif .meta-list {
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

.nav-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.nav-card {
  grid-template-columns: 110px 1fr;
  align-items: stretch;
}

.nav-card img {
  height: 100%;
}

.nav-card span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 220px;
  gap: 1rem;
}

.search-panel__field {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 0.55rem;
}

.search-panel__hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.search-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.search-panel .search-panel__actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

[data-search-root] button {
  color: var(--text);
  cursor: pointer;
}

[data-search-root] :disabled {
  opacity: 0.55;
  cursor: default;
}

.search-panel__select option {
  background: var(--bg);
  color: var(--text);
}

.search-panel__label {
  color: var(--muted);
  font-size: 0.9rem;
}

.search-panel__input,
.search-panel__select {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.search-results {
  display: grid;
  gap: 0.9rem;
}

.search-result {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.search-result > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.search-result img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.8rem;
}

.search-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

[hidden] {
  display: none !important;
}

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

.photo-card {
  scroll-margin-top: 2rem;
}

.album-card__ancestry,
.meta-list__bytes {
  color: var(--muted);
  font-size: 0.85rem;
}

.album-card__ancestry,
.photo-sidebar,
.viewer__meta {
  overflow-wrap: anywhere;
  min-width: 0;
}

.photo-albums {
  margin: 0;
  padding-left: 1.1rem;
}

.photo-albums li + li {
  margin-top: 0.45rem;
}

.tag-filter {
  display: grid;
  gap: 0.65rem;
  max-width: 32rem;
  margin-bottom: 1.5rem;
}

.tag-filter p {
  min-height: 1.5em;
  color: var(--muted);
}

.pagination {
  flex-wrap: wrap;
}

.viewer {
  width: min(1180px, calc(100vw - 1rem));
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  max-height: calc(100dvh - 1rem);
}

.viewer::backdrop {
  background: rgba(3, 4, 8, 0.86);
  backdrop-filter: blur(14px);
}

.viewer__frame {
  padding: 1rem;
}

.viewer__toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  background: #10171e;
}

.viewer__zoom {
  min-width: 5.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 0.9rem;
}

.viewer__zoom:disabled {
  opacity: 0.5;
  cursor: default;
}

.viewer__zoom-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.viewer__toolbar .viewer__close {
  margin-left: auto;
  min-height: 2.75rem;
}

.viewer__content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.viewer__media-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  height: min(65dvh, 720px);
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #05070a;
}

.viewer__image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer--can-zoom .viewer__image {
  cursor: zoom-in;
}

.viewer--zoomed .viewer__media-wrap {
  display: block;
}

.viewer--zoomed .viewer__image {
  max-width: none;
  max-height: none;
  margin: auto;
  cursor: zoom-out;
}

.viewer__meta {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
  gap: 0.9rem;
  padding: 1rem 0.25rem 0.4rem;
}

.viewer__close {
  justify-self: end;
  padding: 0.7rem 1rem;
}

.viewer__nav {
  min-width: 3.4rem;
  min-height: 3.4rem;
}

.viewer__nav:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.site-footer {
  padding: 2rem 0 3rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
}

mark {
  background: rgba(216, 179, 111, 0.28);
  color: inherit;
}

@media (max-width: 960px) {
  .site-header {
    position: static;
  }

  .shell-header,
  .footer-grid,
  .section-head,
  .page-head__meta,
  .photo-actions,
  .viewer__meta-row,
  .search-panel {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .photo-layout,
  .viewer__content,
  .search-result {
    grid-template-columns: 1fr;
  }

  .viewer__nav {
    width: 100%;
  }

  .viewer__content {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "media media" "prev next";
    gap: 0.5rem;
  }

  .viewer__media-wrap { grid-area: media; }
  .viewer__nav--prev { grid-area: prev; }
  .viewer__nav--next { grid-area: next; }
}

@media (max-width: 720px) {
  .viewer__toolbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .viewer__zoom-hint {
    flex-basis: 100%;
    order: 1;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.375rem;
    width: 100%;
  }

  .site-nav a {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
  }

  .nav-label-full,
  .brand-subtitle {
    display: none;
  }

  .nav-label-short {
    display: inline;
  }

  .shell-header {
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0;
  }

  .brand-lockup {
    gap: 0.625rem;
  }

  .brand-mark {
    flex-basis: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
  }

  .brand-title {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    margin: 0;
  }

  .album-grid,
  .photo-grid {
    grid-template-columns: 1fr;
  }

  .archive-stats__separator {
    display: none;
  }
}
