:root {
  --green: #008540;
  --green-dark: #006b34;
  --text: #162018;
  --muted: #637066;
  --line: #dce5de;
  --surface: #ffffff;
  --surface-soft: #f5f8f5;
  --shadow: 0 18px 40px rgba(11, 32, 19, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}

.site-header,
main {
  width: min(1680px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.02;
}

.intro {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 260px;
}

.stats span {
  min-width: 124px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

.stats strong {
  display: block;
  color: var(--text);
  font-size: 1.5rem;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 248, 245, 0.94);
  backdrop-filter: blur(14px);
}

.filters,
.controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

button,
input,
select,
.button {
  font: inherit;
}

.filter-button,
.button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: 160ms ease;
}

.filter-button {
  padding: 0 15px;
}

.filter-button:hover,
.filter-button.is-active,
.button:hover {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
}

input {
  width: min(320px, 70vw);
}

.result-line {
  display: flex;
  justify-content: space-between;
  padding: 18px 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  padding-bottom: 44px;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #e9eee9;
  cursor: zoom-in;
}

.image-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.image-id {
  color: var(--green);
  font-weight: 900;
}

.hero-badge {
  display: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5f4ec;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.image-card.is-hero .hero-badge {
  display: inline-flex;
}

h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.2;
}

dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #edf1ee;
  padding-bottom: 6px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-weight: 800;
}

.lightbox {
  width: min(1180px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #0b130e;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.lightbox-inner {
  position: relative;
  padding: 18px;
}

.lightbox figure {
  margin: 0;
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  background: #111;
}

.lightbox figcaption {
  display: grid;
  gap: 4px;
  padding-top: 12px;
}

.lightbox a {
  color: #84e3ac;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  cursor: pointer;
}

.lightbox-close {
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-nav {
  top: 46%;
  width: 44px;
  height: 56px;
  font-size: 2.4rem;
  line-height: 1;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

@media (max-width: 960px) {
  .site-header,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header,
  main {
    width: min(100% - 24px, 1680px);
  }

  .toolbar {
    position: static;
  }

  .filters,
  .controls,
  .controls label,
  input,
  select {
    width: 100%;
  }

  .filter-button {
    flex: 1 1 calc(50% - 8px);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  dl div {
    display: grid;
  }

  dd {
    text-align: left;
  }
}
