:root {
  --page: #ffffff;
  --ink: #222222;
  --muted: #777777;
  --hairline: #e8e4de;
  --space-page: clamp(22px, 3.4vw, 58px);
  --space-grid: clamp(34px, 4.2vw, 70px);
  --mono: "Courier New", Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
}

body.lightbox-open,
body.nav-open {
  overflow: hidden;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

button {
  font: inherit;
}

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

.page-loader {
  display: none;
}

.js .page-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--page);
  color: var(--ink);
  opacity: 1;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.js .page-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.page-loader span {
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: 0;
}

.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: minmax(0, 1fr) auto;
  align-items: start;
  gap: 32px;
  padding: 50px var(--space-page) 36px;
  background: var(--page);
}

.brand {
  justify-self: start;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(2.3rem, 3.2vw, 3.25rem);
  line-height: 1;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
  padding-top: 16px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
}

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

.nav-mark {
  color: var(--ink);
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: -8px;
}

.social-link {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink);
}

.social-link:hover,
.social-link:focus-visible {
  text-decoration: none;
}

.social-link:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.social-link svg {
  display: block;
  width: 20px;
  height: 20px;
}

.menu-toggle {
  display: none;
}

.portfolio-shell {
  padding: 30px var(--space-page) 80px;
}

.photo-grid {
  column-count: 2;
  column-gap: var(--space-grid);
}

.photo-grid.is-empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.photo-card {
  display: block;
  width: 100%;
  margin: 0 0 var(--space-grid);
  padding: 0;
  break-inside: avoid;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-card img {
  width: 100%;
  height: auto;
  background: #f2f2f2;
}

.photo-card:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 8px;
}

.projects-shell {
  padding: 30px var(--space-page) 90px;
}

.projects-list {
  display: grid;
  gap: clamp(62px, 7vw, 120px);
}

.projects-list.is-empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.project-section {
  display: grid;
  gap: clamp(22px, 2.8vw, 38px);
}

.project-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  font-weight: 400;
  line-height: 1.35;
}

.project-grid {
  column-count: 2;
  column-gap: var(--space-grid);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 44px;
  background: rgba(255, 255, 255, 0.96);
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  max-width: min(92vw, 1380px);
  max-height: 88vh;
  margin: 0;
}

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

.lightbox-close {
  position: fixed;
  top: 30px;
  right: 34px;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 1.3rem;
}

.contact-shell {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(320px, 560px);
  gap: clamp(42px, 4.6vw, 82px);
  align-items: start;
  max-width: 1060px;
  margin: 70px auto 0;
  padding: 0 var(--space-page) 80px;
}

.contact-image {
  width: 100%;
  margin: 0;
  padding: 8px;
  border: 8px solid #efede8;
  background: #f7f5ef;
}

.contact-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.contact-image.is-empty {
  display: grid;
  aspect-ratio: 4 / 5;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.contact-copy {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.contact-copy h1 {
  margin: 6px 0 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.55;
}

.contact-copy p {
  margin: 0 0 18px;
}

.contact-list {
  display: grid;
  gap: 13px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.contact-list a {
  color: var(--ink);
}

.site-footer {
  padding: 40px var(--space-page) 80px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 1rem;
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    min-height: 84px;
    padding: 22px 22px;
  }

  .brand {
    grid-column: 2;
    justify-self: center;
    font-size: 1.08rem;
  }

  .menu-toggle {
    display: grid;
    grid-column: 1;
    gap: 8px;
    align-content: center;
    width: 32px;
    height: 32px;
    color: var(--ink);
  }

  .menu-toggle span {
    display: block;
    width: 26px;
    height: 1px;
    background: currentColor;
  }

  .site-nav {
    position: fixed;
    inset: 84px 0 0;
    z-index: 9;
    display: grid;
    align-content: start;
    gap: 0;
    padding: 26px 28px;
    background: var(--page);
    border-top: 1px solid var(--hairline);
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .site-nav a {
    padding: 18px 0;
    font-size: 1.05rem;
  }

  .nav-socials {
    gap: 16px;
    margin: 14px 0 0;
  }

  .site-nav .social-link {
    width: 38px;
    height: 38px;
    padding: 0;
  }

  .social-link svg {
    width: 22px;
    height: 22px;
  }

  body.nav-open .site-nav {
    transform: translateX(0);
  }

  .portfolio-shell {
    padding: 0 0 50px;
  }

  .photo-grid {
    column-count: 1;
    column-gap: 0;
  }

  .photo-card {
    margin-bottom: 4px;
  }

  .photo-card:focus-visible {
    outline-offset: -8px;
  }

  .projects-shell {
    padding: 28px 0 58px;
  }

  .projects-list {
    gap: 54px;
  }

  .project-section {
    gap: 18px;
  }

  .project-title {
    padding: 0 22px;
  }

  .project-grid {
    column-count: 1;
    column-gap: 0;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox-close {
    top: 18px;
    right: 16px;
  }

  .contact-shell {
    grid-template-columns: 1fr;
    gap: 34px;
    margin-top: 36px;
    padding: 0 28px 52px;
  }

  .contact-image {
    max-width: 310px;
  }

  .site-footer {
    padding-bottom: 44px;
    font-size: 0.85rem;
  }
}

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

  .site-nav {
    transition: none;
  }

  .js .page-loader {
    transition: none;
  }
}
