:root {
  --page: #ffffff;
  --ink: #4a4a4a;
  --muted: #a8a8a8;
  --soft: #eeeeee;
  --line: #dedede;
  --nav-height: 52px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0;
}

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

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

.site-header {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 94px 0 18px;
  text-align: center;
}

.site-nav {
  position: absolute;
  top: 42px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 34px;
  min-height: var(--nav-height);
}

.site-nav a {
  color: #aaa;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: #414141;
}

.brand {
  display: inline-block;
  margin-top: 4px;
}

.brand-title {
  margin: 0;
  color: #555;
  font-size: clamp(28px, 2vw, 37px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-subtitle {
  margin: 34px 0 0;
  color: #d4d4d4;
  font-size: clamp(18px, 1.25vw, 24px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 58px 46px;
  width: min(860px, 100%);
  margin: 0 auto;
}

.portfolio-card {
  display: block;
  text-align: center;
}

.portfolio-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--soft);
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease, transform 220ms ease;
}

.portfolio-card:hover img {
  opacity: 0.92;
  transform: scale(1.015);
}

.portfolio-label {
  display: block;
  margin-top: 18px;
  color: #989898;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.page-shell {
  width: min(840px, 100%);
  margin: 0 auto;
}

.empty-page {
  min-height: 300px;
}

.bio {
  width: min(760px, 100%);
  margin: 0 auto;
  color: #777;
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.01em;
}

.bio p {
  margin: 0 0 26px;
}

.contact-form {
  display: grid;
  gap: 22px;
  width: min(560px, 100%);
  margin: 0 auto;
}

.form-field {
  display: grid;
  gap: 9px;
}

.form-field label {
  color: #999;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: #555;
  font: inherit;
  letter-spacing: 0.01em;
  padding: 14px 15px;
  outline: none;
  transition: border-color 160ms ease;
}

.form-field textarea {
  min-height: 158px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: #9b9b9b;
}

.button {
  justify-self: center;
  min-width: 138px;
  border: 1px solid #b8b8b8;
  border-radius: 0;
  background: #fff;
  color: #777;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.14em;
  padding: 13px 24px;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease;
}

.button:hover {
  border-color: #666;
  color: #444;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: #999;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.gallery-page {
  width: min(980px, 100%);
  margin: 0 auto;
}

.gallery-title {
  margin: 0 0 28px;
  color: #9a9a9a;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.carousel {
  position: relative;
  width: 100%;
  min-height: 560px;
  display: grid;
  align-items: center;
}

.carousel-frame {
  width: 100%;
  min-height: 560px;
  display: grid;
  place-items: center;
  background: #fafafa;
  cursor: zoom-in;
}

.carousel-image {
  max-width: 100%;
  max-height: min(68vh, 700px);
  object-fit: contain;
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 64px;
  border: 0;
  background: rgb(255 255 255 / 72%);
  color: #777;
  cursor: pointer;
  font-size: 40px;
  font-weight: 200;
  line-height: 1;
  transform: translateY(-50%);
  transition: color 160ms ease, background 160ms ease;
}

.carousel-button:hover {
  background: rgb(255 255 255 / 92%);
  color: #333;
}

.carousel-button.prev {
  left: 0;
}

.carousel-button.next {
  right: 0;
}

.carousel-count {
  margin: 18px 0 0;
  color: #aaa;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 34px;
  background: rgb(255 255 255 / 94%);
}

.lightbox.is-open {
  display: flex;
}

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

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 28px;
  border: 0;
  background: transparent;
  color: #777;
  cursor: pointer;
  font-size: 34px;
  font-weight: 200;
  line-height: 1;
}

@media (max-width: 900px) {
  .site-header {
    padding-top: 108px;
  }

  .site-nav {
    left: 0;
    right: 0;
    justify-content: center;
    gap: 24px;
  }

  .portfolio-grid {
    gap: 44px 30px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .main {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    padding-top: 94px;
  }

  .site-nav {
    top: 24px;
    flex-wrap: wrap;
    gap: 15px 20px;
  }

  .site-nav a {
    font-size: 12px;
  }

  .brand-subtitle {
    margin-top: 24px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    width: min(390px, 100%);
  }

  .portfolio-label {
    font-size: 14px;
  }

  .bio {
    font-size: 16px;
    line-height: 1.75;
  }

  .carousel,
  .carousel-frame {
    min-height: 420px;
  }

  .carousel-button {
    width: 38px;
    height: 56px;
    font-size: 32px;
  }

  .lightbox {
    padding: 16px;
  }
}
