:root {
  --ink: #f3f3f3;
  --muted: rgba(255, 255, 255, .66);
  --paper: #000;
  --line: rgba(255, 255, 255, .18);
  --accent: #fff;
  --panel: #080808;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: Georgia, "Times New Roman", Times, serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.home-page {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.home-page .site-header {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

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

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

button {
  font: inherit;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 178px;
  padding-top: 26px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  position: relative;
  z-index: 5;
  background: transparent;
}

.brand img {
  width: min(380px, 52vw);
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
}

.site-nav a {
  border-bottom: 1px solid transparent;
  padding: 8px 0;
  opacity: .86;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  border-color: currentColor;
  opacity: 1;
}

.menu-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 1px;
  background: var(--ink);
}

main {
  flex: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.home {
  width: 100%;
  height: 100vh;
  margin-top: 0;
  padding: 0;
}

.single-image {
  width: 100%;
  height: 100%;
}

.single-image img {
  width: 100%;
  height: 100vh;
  min-height: 620px;
  object-fit: cover;
  object-position: center;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding: 34px 0 82px;
}

.work-card {
  position: relative;
  display: block;
  overflow: hidden;
  background: #050505;
  aspect-ratio: 4 / 4.9;
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s ease, opacity 1.1s ease;
}

.work-card:hover img {
  opacity: .55;
  transform: scale(1.03);
}

.work-card span {
  position: absolute;
  inset: 0 0 34px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #fff;
  font-size: clamp(24px, 3vw, 44px);
  font-weight: 400;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.work-card small {
  position: absolute;
  inset: auto 0 31%;
  color: #fff;
  font-size: 16px;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.work-card:hover span {
  opacity: .78;
}

.personal-strip {
  padding: 34px 0 72px;
}

.personal-strip img {
  width: 100%;
  max-height: 720px;
  object-fit: cover;
}

.contact-page {
  min-height: 48vh;
  display: grid;
  place-items: center;
}

.project-detail {
  padding: 28px 0 82px;
}

.project-detail h1 {
  max-width: 900px;
  margin: 18px auto 22px;
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
}

.project-meta {
  display: grid;
  place-items: center;
  gap: 14px;
  margin: 0 auto 42px;
  color: var(--muted);
  text-align: center;
}

.project-description {
  width: min(760px, 100%);
  margin: 0 auto 34px;
  color: var(--ink);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
  text-align: center;
}

.software-strip {
  width: min(380px, 74vw);
  height: auto;
}

.project-gallery {
  display: grid;
  gap: 48px;
}

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

.project-gallery img {
  width: min(980px, 100%);
  max-height: 78vh;
  margin: 0 auto;
  object-fit: contain;
  background: #000;
  cursor: zoom-in;
}

.project-gallery .wide {
  width: min(1180px, 100%);
}

.project-gallery figure {
  margin: 0;
  display: grid;
  gap: 12px;
}

.personal-item {
  position: relative;
  display: block;
  overflow: hidden;
  background: #050505;
}

.personal-item img {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: 4 / 4.9;
  object-fit: cover;
  transition: opacity 1s ease, transform 1s ease;
}

.personal-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #fff;
  font-size: clamp(24px, 3vw, 44px);
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.personal-item:hover img {
  opacity: .55;
  transform: scale(1.03);
}

.personal-item:hover .personal-title {
  opacity: .82;
}

.personal-item.no-title:hover img {
  opacity: 1;
  transform: none;
}

.project-gallery figcaption {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, .9);
  overflow: hidden;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  cursor: grab;
  user-select: none;
  transform-origin: center;
  transition: transform .08s linear;
}

.lightbox img.dragging {
  cursor: grabbing;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-controls {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  gap: 10px;
}

.lightbox-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  background: rgba(0, 0, 0, .35);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.back-link {
  color: var(--muted);
  border-bottom: 1px solid currentColor;
  font-size: 14px;
}

.email-link {
  font-size: clamp(22px, 4vw, 42px);
  overflow-wrap: anywhere;
  margin: 0;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 42px;
  border-top: 0;
  color: var(--ink);
  text-align: center;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-footer p {
  margin: 14px 0 0;
}

.home-page .site-footer {
  position: absolute;
  left: 50%;
  bottom: 30px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 0;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.social-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
  opacity: .86;
  transition: opacity .18s ease, transform .18s ease;
}

.social-icon.instagram {
  -webkit-mask-image: url("/assets/instagram.svg");
  mask-image: url("/assets/instagram.svg");
}

.social-icon.artstation {
  -webkit-mask-image: url("/assets/artstation.svg");
  mask-image: url("/assets/artstation.svg");
}

.social-icon:hover {
  opacity: 1;
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .site-header {
    width: min(100% - 28px, 1180px);
    min-height: 150px;
    padding-top: 22px;
    position: relative;
    gap: 14px;
  }

  .menu-toggle {
    display: flex;
    position: absolute;
    top: 76px;
    right: 0;
  }

  .site-nav {
    position: absolute;
    top: 142px;
    right: 0;
    left: 0;
    z-index: 2;
    display: none;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 16px;
  }

  .site-nav.open {
    display: grid;
    gap: 10px;
  }

  main,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .home {
    padding-top: 0;
    margin-top: 0;
  }

  .single-image img {
    height: 100vh;
    min-height: 480px;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

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

  .work-card span {
    inset: 0 0 48px;
    opacity: .86;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .42));
    align-items: end;
  }

  .work-card small {
    inset: auto 0 22px;
    opacity: .78;
  }

  .personal-title {
    align-items: end;
    opacity: .86;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .42));
  }
}
