:root {
  color-scheme: light;
  --ink: #141414;
  --muted: #707070;
  --line: #e7e2dc;
  --paper: #fffdf9;
  --soft: #f5f0e8;
  --accent: #0f766e;
  --accent-dark: #0b4f49;
  --rose: #c94f62;
  --shadow: 0 18px 45px rgba(26, 22, 17, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(180px, 520px) auto;
  gap: 16px;
  align-items: center;
  padding: 16px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(231, 226, 220, 0.82);
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.search {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.view-button,
.filter,
.open-button,
.close-button {
  border: 0;
  cursor: pointer;
}

.view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 92px;
  height: 42px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}

main {
  padding-bottom: 56px;
}

.hero {
  min-height: min(52vh, 560px);
  display: flex;
  align-items: end;
  margin: 0;
  padding: clamp(34px, 7vw, 78px) clamp(18px, 4vw, 48px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.18)),
    url("https://images.unsplash.com/photo-1441986300917-64674bd600d8?auto=format&fit=crop&w=1800&q=85")
      center / cover;
  color: #fff;
}

.hero-copy {
  width: min(720px, 100%);
}

.hero-copy p,
.section-head p,
.photo-category {
  margin: 0;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy p {
  color: #afe9df;
}

.hero-copy h1 {
  margin: 10px 0 12px;
  max-width: 12ch;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy span {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.catalog {
  padding: 34px clamp(18px, 4vw, 48px) 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head p {
  color: var(--accent);
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter {
  min-width: 58px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.filter.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.photo-card {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(26, 22, 17, 0.05);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--soft);
}

.photo-info {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
}

.photo-info h3 {
  margin: 5px 0 0;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.photo-category {
  color: var(--muted);
}

.open-button {
  min-width: 54px;
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-weight: 750;
}

.open-button:hover,
.view-button:hover {
  background: var(--accent-dark);
}

.photo-dialog {
  width: min(920px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #111;
  color: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.photo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.photo-dialog img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #111;
}

.photo-dialog p {
  margin: 0;
  padding: 14px 18px 18px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 42px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero {
    min-height: 430px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .photo-info {
    display: grid;
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    display: none;
  }

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