:root {
  color-scheme: light;
  --ink: #221f1b;
  --muted: #70695f;
  --paper: #fbfaf7;
  --soft: #efebe4;
  --line: #ded8ce;
  --accent: #7f4f3a;
  --accent-dark: #5f3929;
  --white: #ffffff;
  --shadow: 0 18px 60px rgba(36, 31, 25, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  min-height: 62vh;
  display: grid;
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  padding: clamp(28px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(20, 18, 16, 0.54), rgba(20, 18, 16, 0.12) 48%, rgba(20, 18, 16, 0.03)),
    linear-gradient(0deg, rgba(20, 18, 16, 0.38), transparent 44%),
    url("/cover.jpg");
  background-size: cover;
  background-position: center 42%;
}

.eyebrow {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 13vw, 9.5rem);
  font-weight: 400;
  line-height: 0.9;
  color: var(--white);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.28);
}

.subtitle {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.actions,
.tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
}

.button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.88rem;
}

main {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 28px clamp(14px, 3vw, 42px) 64px;
}

.intro {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 16px 0;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.intro span {
  display: block;
  font-weight: 900;
}

.intro p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-group {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.filter {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
}

.filter.subfilter {
  min-height: 32px;
  margin-left: 14px;
  padding: 0 11px;
  border-style: dashed;
  font-size: 0.82rem;
}

.filter:hover,
.filter:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.filter.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

input {
  width: 150px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 12px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gallery-row {
  display: flex;
  width: 100%;
  overflow: hidden;
}

.gallery-row-last {
  justify-content: flex-start;
}

.photo {
  position: relative;
  display: block;
  flex: 0 0 auto;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  background: var(--soft);
}

.photo span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 7px;
  border-radius: 3px;
  background: rgba(34, 31, 27, 0.62);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 160ms ease;
}

.photo:hover span,
.photo:focus-visible span {
  opacity: 1;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 48px 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  padding: 24px;
  background: rgba(20, 18, 16, 0.94);
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  height: min(88vh, 980px);
  margin: 0;
}

.lightbox img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transform: translate3d(var(--swipe-x, 0), 0, 0);
  transition: transform 160ms ease;
  will-change: transform;
}

.lightbox img.is-dragging {
  transition: none;
}

.lightbox img.is-swipe-out {
  transition: transform 120ms ease;
}

.lightbox figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--white);
  font-weight: 800;
}

.icon {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.close {
  position: absolute;
  top: 22px;
  right: 22px;
}

@media (max-width: 1100px) {
  .gallery {
    gap: 5px;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
    align-content: end;
    min-height: 56svh;
    gap: 20px;
    padding: 24px 18px;
    background-position: 48% center;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 0.72rem;
  }

  h1 {
    max-width: 330px;
    font-size: clamp(3rem, 18vw, 4.8rem);
    line-height: 0.92;
  }

  .subtitle {
    margin-top: 14px;
    font-size: 1rem;
  }

  .actions,
  .intro {
    align-items: stretch;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .button {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .intro {
    position: sticky;
    top: 0;
    flex-direction: column;
    gap: 12px;
    margin: 0 -14px 18px;
    padding: 10px 14px 12px;
  }

  .button,
  input {
    width: 100%;
  }

  .tools {
    width: 100%;
    gap: 7px;
  }

  .filters {
    width: 100%;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 7px;
    margin: 0 -14px;
    padding: 0 14px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .filter-group {
    flex: 0 0 auto;
    gap: 4px;
  }

  .filter.subfilter {
    min-height: 29px;
    margin-left: 10px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .search-label {
    width: 100%;
    font-size: 0.82rem;
  }

  .gallery {
    gap: 4px;
  }

  .photo span {
    opacity: 1;
    left: 5px;
    bottom: 5px;
    padding: 4px 6px;
    font-size: 0.66rem;
  }

  .lightbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .lightbox figure {
    width: 100vw;
    height: 100svh;
    padding: 52px 0 10px;
    gap: 8px;
  }

  .lightbox img {
    max-width: 100vw;
    max-height: calc(100svh - 112px);
    border-radius: 0;
    box-shadow: none;
  }

  .lightbox img.is-landscape {
    width: 100vw;
    height: auto;
  }

  .lightbox img.is-portrait {
    width: auto;
    max-width: calc(100vw - 18px);
  }

  .lightbox figcaption {
    flex-wrap: wrap;
    gap: 8px;
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .icon {
    width: 42px;
    height: 42px;
  }

  .prev,
  .next {
    position: fixed;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
  }

  .prev {
    left: 6px;
  }

  .next {
    right: 6px;
  }

  .close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 380px) {
  .actions {
    grid-template-columns: 1fr;
  }
}
