:root {
  --ink: #171613;
  --muted: #5a5a54;
  --paper: #ffffff;
  --soft: #f7f7f4;
  --line: #d9d8d2;
  --wood: #7a5733;
  --focus: #1d4ed8;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  background: var(--paper);
}

button {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 0 max(20px, calc((100vw - 1200px) / 2));
  color: #ffffff;
  background: #12110f;
}

.brand-mark {
  font-size: 15px;
  font-weight: 800;
}

main {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

.intro-section {
  max-width: 820px;
  padding: 44px 0 26px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: 42px;
  line-height: 1.08;
  font-weight: 900;
}

h2 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
}

.intro-text {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 8px 0 34px;
}

.build-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.gallery-card {
  display: grid;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: zoom-in;
}

.gallery-card:hover .card-media img,
.gallery-card:focus-visible .card-media img {
  transform: scale(1.015);
}

.card-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #efeee9;
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 150ms ease;
}

.member-name {
  display: block;
  min-width: 0;
  padding: 13px 14px 15px;
  font-size: 16px;
  line-height: 1.28;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.build-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
}

.build-dialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dialog-content {
  display: grid;
  gap: 0;
}

.dialog-image-wrap {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 24px;
  background: #efeee9;
}

.dialog-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.dialog-member-name {
  margin: 0;
  padding: 16px 60px 18px 20px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
  overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  main {
    width: min(100% - 32px, 660px);
  }

  .intro-section {
    padding-top: 34px;
  }

  h1 {
    font-size: 34px;
  }

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

  .dialog-image-wrap {
    min-height: 300px;
    padding: 18px;
  }
}

@media (max-width: 520px) {
  main {
    width: calc(100% - 28px);
  }

  h1 {
    font-size: 31px;
  }

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

  .build-dialog {
    width: calc(100vw - 22px);
    max-height: calc(100vh - 22px);
  }
}
