:root {
  --bg: #fbfbf8;
  --paper: #ffffff;
  --ink: #171717;
  --muted: #686866;
  --line: #dedbd1;
  --yellow: #ffd86b;
  --mint: #b8f3db;
  --shadow: 0 18px 45px rgba(23, 23, 23, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(23, 23, 23, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 23, 0.02) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.topbar,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.78rem;
}

.topbar-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.topbar-links {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.topbar-links a:hover,
.topbar-links a:focus-visible {
  color: var(--ink);
}

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

.simple-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: end;
  gap: 24px;
  padding: 68px 0 38px;
  border-top: 1px solid var(--line);
}

.simple-hero h1 {
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.simple-hero p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.simple-hero .eyebrow {
  margin-bottom: 16px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed #b9b6ad;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-slot-wide {
  margin: 0 0 26px;
}

.ad-slot-side {
  min-height: 260px;
}

.bottom-ad {
  margin-bottom: 72px;
}

.intro-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.intro-copy p {
  margin: 0;
}

.search-box {
  display: block;
}

.search-box input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  padding: 0 16px;
  font: inherit;
  font-weight: 750;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 8px;
}

.simple-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-count {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
}

.filter {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 0 16px;
  font-weight: 850;
}

.filter.active,
.filter:hover,
.filter:focus-visible {
  border-color: var(--ink);
  background: var(--yellow);
  color: var(--ink);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 24px 0 80px;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 34px;
  color: var(--muted);
  font-weight: 800;
}

.image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.image-card:hover {
  transform: translateY(-3px);
  border-color: var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

.image-open {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #f6f4ee;
  padding: 0;
}

.image-open img {
  width: 100%;
  aspect-ratio: 1.15;
  object-fit: cover;
}

.image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.image-meta strong,
.image-meta span {
  display: block;
}

.image-meta strong {
  font-size: 1rem;
}

.image-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.small-download,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--mint);
  padding: 0 13px;
  font-size: 0.88rem;
  font-weight: 900;
  white-space: nowrap;
}

.preview-dialog {
  width: min(920px, calc(100% - 28px));
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow), 7px 7px 0 var(--ink);
  padding: 16px;
}

.preview-dialog::backdrop {
  background: rgba(23, 23, 23, 0.52);
}

.preview-dialog img {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f4ee;
}

.close-preview {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.preview-footer strong,
.preview-footer span {
  display: block;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 0 80px;
}

.pager button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 900;
}

.pager span {
  color: var(--muted);
  font-weight: 900;
}

.keyword-band {
  border-top: 1px solid var(--line);
  padding: 34px 0 28px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 9px 13px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.preview-footer span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

@media (max-width: 900px) {
  .simple-hero {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    grid-template-columns: 1fr;
  }

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

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .topbar-links {
    flex-wrap: wrap;
  }

  .simple-hero {
    padding-top: 38px;
  }

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

  .preview-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
