:root {
  --bg: #fbfaf7;
  --paper: #ffffff;
  --ink: #1f1f1d;
  --muted: #6f6d68;
  --line: #dedbd3;
  --accent: #627065;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a {
  color: inherit;
}

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

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

.site-header {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px 28px 24px;
}

.logo img {
  width: 210px;
  height: auto;
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.nav-toggle {
  display: none;
}

.intro,
.page-title,
.portfolio-hero {
  max-width: 820px;
  margin: 34px auto 58px;
  padding: 0 28px;
  text-align: center;
}

.intro p {
  margin: 0;
  font-size: 17px;
}

.intro h1 {
  margin-bottom: 18px;
}

.home-intro {
  max-width: var(--max);
  text-align: left;
}

.portfolio-note {
  margin-top: -38px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.portfolio-hero {
  max-width: var(--max);
  text-align: left;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto 76px;
  padding: 0 28px;
}

.project-card {
  position: relative;
  overflow: hidden;
  color: white;
  background: #222;
  text-decoration: none;
}

.project-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.project-card:hover img {
  transform: scale(1.035);
  opacity: 0.82;
}

.project-card strong,
.project-card span {
  position: absolute;
  z-index: 1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.project-card strong {
  left: 18px;
  bottom: 16px;
  font-size: 20px;
  font-weight: 400;
}

.project-card span {
  right: 14px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  font-size: 12px;
}

.portfolio-section {
  max-width: var(--max);
  margin: 0 auto 86px;
  padding: 0 28px;
}

.section-copy {
  max-width: 760px;
  margin-bottom: 28px;
}

h1,
h2,
h3 {
  margin: 0 0 14px;
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: clamp(34px, 6vw, 62px);
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 22px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.gallery-item,
.content-image {
  margin: 0;
}

.image-button {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--line);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.image-button::after {
  content: "View larger";
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(31, 31, 29, 0.72);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.image-button:hover img,
.image-button:focus-visible img {
  transform: scale(1.025);
  filter: brightness(0.82);
}

.image-button:hover::after,
.image-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.content-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: var(--line);
}

figcaption {
  padding-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

figcaption strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
}

figcaption p {
  margin: 0;
}

.content-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: start;
  gap: 54px;
  max-width: var(--max);
  margin: 42px auto 86px;
  padding: 0 28px;
}

.content-copy {
  max-width: 720px;
}

.content-copy h1 {
  font-size: clamp(32px, 4.4vw, 48px);
  margin-bottom: 24px;
}

.content-copy h2,
.content-copy h3 {
  margin-top: 34px;
}

.content-copy h1 + h2,
.content-copy h1 + h3 {
  margin-top: 0;
}

.content-copy p {
  margin: 0 0 16px;
}

.content-copy a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content-copy ul {
  padding-left: 20px;
  margin: 0 0 22px;
}

.content-copy li p {
  margin-bottom: 8px;
}

.content-media {
  display: grid;
  gap: 30px;
  align-content: start;
}

.content-image img {
  border: 1px solid rgba(222, 219, 211, 0.72);
  box-shadow: 0 14px 38px rgba(31, 31, 29, 0.08);
}

.content-image-link {
  display: block;
}

.content-image-link img {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.content-image-link:hover img,
.content-image-link:focus-visible img {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(31, 31, 29, 0.14);
}

.contact-form {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.honeypot {
  position: absolute;
  left: -9999px;
}

.form-status {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.form-status.success {
  border-color: #9fb69f;
  color: #385d38;
}

.form-status.error {
  border-color: #d0a0a0;
  color: #7a3333;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.contact-form button {
  justify-self: start;
  border: 0;
  padding: 11px 18px;
  color: white;
  background: var(--accent);
  font: inherit;
  cursor: pointer;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 28px 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lightbox {
  --frame-border: clamp(18px, 4vw, 50px);
  --frame-border-bottom: clamp(44px, 6vw, 72px);
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(20, 20, 18, 0.92);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-frame {
  position: relative;
  margin: 0;
}

.lightbox-frame img {
  max-height: calc(100dvh - 56px);
  max-width: calc(100vw - 56px);
  width: auto;
  border: var(--frame-border) solid #fff;
  border-bottom-width: var(--frame-border-bottom);
  object-fit: contain;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
}

.lightbox-frame figcaption {
  position: absolute;
  left: var(--frame-border);
  right: var(--frame-border);
  bottom: clamp(12px, 2vw, 22px);
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
  pointer-events: none;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 8px 12px;
  color: white;
  background: transparent;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff;
  background: rgba(31, 31, 29, 0.38);
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  background: rgba(31, 31, 29, 0.62);
}

@media (max-width: 980px) {
  .project-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    padding: 8px 12px;
    color: var(--ink);
    background: transparent;
  }

  .site-nav {
    grid-column: 1 / -1;
    display: none;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-nav.is-open {
    display: flex;
  }

  .content-page {
    grid-template-columns: 1fr;
  }

  .content-page {
    gap: 30px;
    margin-top: 24px;
  }
}

@media (max-width: 640px) {
  .project-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .lightbox {
    --frame-border: clamp(12px, 4vw, 18px);
    --frame-border-bottom: clamp(34px, 10vw, 46px);
    padding: 10px;
  }

  .lightbox-frame img {
    max-height: calc(100dvh - 20px);
    max-width: calc(100vw - 20px);
  }

  .lightbox-frame figcaption {
    font-size: 11px;
    letter-spacing: 0.03em;
  }

  .lightbox-nav {
    width: 38px;
    height: 52px;
    font-size: 34px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}

@media (max-width: 540px) {
  .site-header,
  .intro,
  .page-title,
  .portfolio-hero,
  .project-grid,
  .portfolio-section,
  .content-page,
  .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .logo img {
    width: min(180px, 58vw);
  }

  .site-nav {
    gap: 12px 16px;
    font-size: 11px;
  }

  .project-card strong {
    font-size: 18px;
  }
}
