:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #686868;
  --line: #dedede;
  --paper: #ffffff;
  --soft: #f3f4f5;
  --accent: #d82731;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 4vw;
  border-bottom: 1px solid rgba(222, 222, 222, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.shuffle-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.shuffle-button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.shuffle-button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.shuffle-icon {
  font-size: 20px;
  line-height: 1;
}

main {
  min-height: calc(100vh - 150px);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  align-items: end;
  gap: 8vw;
  padding: 9vh 4vw 6vh;
}

.kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 108px;
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 410px;
  margin: 0 0 7px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
}

.gallery-wrap {
  padding: 0 4vw 5vh;
}

.gallery-status {
  min-height: 56vh;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.gallery-status[hidden] {
  display: none;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 8px;
  gap: 12px;
}

.gallery-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--soft);
  cursor: zoom-in;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 320ms ease, transform 420ms ease;
}

.gallery-item.is-loaded img {
  opacity: 1;
}

.gallery-item:hover img {
  transform: scale(1.018);
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: inherit;
  pointer-events: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 4vw;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 28px 74px 24px;
  border: 0;
  background: rgba(12, 12, 12, 0.97);
  color: #fff;
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}

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

.lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  height: 100%;
  margin: 0;
}

.lightbox img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 22px;
  color: #c6c6c6;
  font-size: 12px;
}

.lightbox button {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 34px;
  line-height: 1;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-close {
  top: 18px;
  right: 18px;
  font-size: 28px !important;
}

.lightbox-nav {
  top: calc(50% - 22px);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

@media (max-width: 900px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 8vh;
  }

  h1 {
    font-size: 72px;
  }

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

@media (max-width: 640px) {
  .site-header {
    min-height: 58px;
  }

  .brand {
    font-size: 16px;
  }

  .shuffle-button span:last-child {
    display: none;
  }

  .shuffle-button {
    width: 38px;
    justify-content: center;
    border: 0;
  }

  .intro {
    padding: 7vh 4vw 5vh;
  }

  h1 {
    font-size: 52px;
  }

  .intro-copy {
    font-size: 16px;
  }

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

  .lightbox {
    padding: 56px 10px 18px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 14px;
  }

  .lightbox figcaption {
    padding: 0 54px;
  }

  .lightbox-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .gallery-item img {
    transition: none;
  }
}
