:root {
  --paper: #F7F4EE;
  --ink: #292723;
  --muted: rgba(41, 39, 35, .62);
  --line: rgba(41, 39, 35, .18);
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, Palatino Linotype, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  overflow-x: clip;
}

button, a, input { font: inherit; }

img {
  max-width: 100%;
  height: auto;
}

.serif {
  font-family: var(--serif);
}

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

.masthead {
  padding: clamp(2.25rem, 5.5vh, 4.25rem) 24px clamp(1.5rem, 3.4vh, 2.5rem);
  text-align: center;
}

.site-title {
  margin: 0 auto;
  max-width: 18ch;
  color: var(--ink);
  font-weight: 400;
  font-size: clamp(4rem, 4.6vw, 5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.cover {
  overflow: hidden;
  background: #d8d2c6;
}

.cover img {
  display: block;
  width: 100%;
  height: 72svh;
  object-fit: cover;
  object-position: 50% 46%;
}

main {
  padding: 20px 24px 72px;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1680px;
  margin: 0 auto 20px;
  min-height: 44px;
}

.gallery-toolbar span {
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .04em;
}

.download-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: .84rem;
}

.download-all svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.download-all:hover,
.download-all:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
  max-width: 1680px;
  margin: 0 auto;
}

.tile {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
}

.tile:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

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

.gate-body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
}

.gate {
  width: min(92vw, 480px);
  text-align: center;
  padding: 40px 20px;
}

.gate h1 {
  margin: 0 0 36px;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 400;
  line-height: 1.12;
}

.gate p { color: var(--muted); }

.gate-form { text-align: left; }

.gate-form label {
  display: block;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.gate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.gate-row input {
  min-width: 0;
  border: 1px solid var(--line);
  border-right: 0;
  background: transparent;
  color: var(--ink);
  padding: 12px 14px;
  min-height: 44px;
}

.gate-row button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 0 16px;
  min-height: 44px;
  cursor: pointer;
}

.form-error {
  color: #8a3b32 !important;
  font-size: .9rem;
}

@media (min-width: 720px) {
  main {
    padding: 24px 32px 96px;
  }

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

  .gallery-toolbar {
    margin-bottom: 20px;
  }
}

@media (min-width: 1600px) {
  .gallery,
  .gallery-toolbar {
    max-width: 1760px;
  }

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

@media (max-width: 719px) {
  .masthead {
    padding: 2rem 12px 1.15rem;
  }

  .site-title {
    font-size: clamp(2.375rem, 10vw, 2.875rem);
  }

  .cover img {
    height: 58svh;
    object-position: 46% 42%;
  }

  main {
    padding: 16px 12px 56px;
  }

  .gallery-toolbar {
    margin-bottom: 12px;
    gap: 10px;
  }

  .download-all span {
    font-size: .8rem;
  }
}

@media (max-width: 380px) {
  .download-all {
    padding: 0 10px;
  }
}
