@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Instrument+Sans:wght@400;500;600&display=swap");

:root {
  --font-sans: "Suisse Int'l", "DM Sans", "Instrument Sans", "Helvetica Neue",
    sans-serif;
  --color-background: #ffffff;
  --color-text: #1a1a1a;
  --color-border: #e8e8e8;
  --font-body: 14px;
  --font-caption: 13px;
  --nav-height: 54px;
  --space-s: 16px;
  --space-m: 24px;
  --space-l: 32px;
  --space-xl: 40px;
  --space-2xl: 80px;
  --grid-row-unit: 8px;
  --transition-fast: 140ms ease;
}

html {
  scroll-behavior: smooth;
  background: var(--color-background);
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-body);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-lightbox-open {
  overflow: hidden;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

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

.site-nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  box-sizing: border-box;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

.site-nav__title,
.site-nav__link {
  color: var(--color-text);
  font-size: var(--font-body);
  line-height: 1;
}

.site-nav__title {
  font-weight: 600;
}

.site-nav__link {
  font-weight: 400;
}

.page {
  padding-top: var(--nav-height);
  box-sizing: border-box;
}

.page--home {
  min-height: 100vh;
}

.hero {
  width: 100%;
  height: calc(100vh - var(--nav-height));
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-grid-section {
  padding: var(--space-2xl) var(--space-l) 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: var(--grid-row-unit);
  gap: 28px;
  align-items: start;
}

.project-card {
  --column-span: 4;
  --row-span: 52;
  --card-offset: 0px;
  grid-column: span var(--column-span);
  grid-row: span var(--row-span);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: var(--card-offset);
  opacity: 1;
  transition: opacity var(--transition-fast);
}

.project-card:hover,
.project-card:focus-visible {
  opacity: 0.85;
}

.project-card:focus-visible {
  outline: none;
}

.project-card__media {
  height: calc((var(--row-span) * var(--grid-row-unit)) - 36px);
  min-height: 240px;
  overflow: hidden;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__title {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-caption);
  font-weight: 400;
  line-height: 1.4;
}

.page--about {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.about-shell {
  flex: 1;
  padding: 144px 32px 120px;
  box-sizing: border-box;
}

.about-copy {
  max-width: 480px;
  display: grid;
  gap: 28px;
}

.about-copy p {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-body);
  font-weight: 400;
  line-height: 1.8;
}

.about-copy a {
  text-decoration: none;
}

.about-copy a:hover,
.about-copy a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.page--project {
  position: relative;
  min-height: 100vh;
  padding: var(--nav-height) 32px 40px;
  box-sizing: border-box;
  overflow: hidden;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  height: calc((100vh - var(--nav-height)) * 0.85);
}

.project-frame {
  margin: 0;
}

.project-button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.project-button:hover,
.project-button:focus-visible {
  opacity: 0.85;
}

.project-button:focus-visible {
  outline: none;
}

.project-button img {
  width: 100%;
  height: calc((100vh - var(--nav-height)) * 0.85);
  object-fit: cover;
}

.project-meta {
  position: absolute;
  bottom: 40px;
  left: 32px;
  display: grid;
  gap: 2px;
}

.project-meta p {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-body);
  font-weight: 400;
  line-height: 1.35;
}

.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.project-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.project-lightbox__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.project-lightbox__image {
  width: auto;
  max-width: min(88vw, 1680px);
  max-height: 86vh;
  height: auto;
  object-fit: contain;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding: 32px;
  box-sizing: border-box;
  background: var(--color-background);
}

.site-footer p,
.site-footer__top {
  margin: 0;
  color: var(--color-text);
  font-size: var(--font-caption);
  font-weight: 400;
  line-height: 1.4;
}

.site-footer__top {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.site-footer__top:hover,
.site-footer__top:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

@media (max-width: 1200px) {
  .project-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .project-card {
    grid-column: span 3;
    grid-row: auto;
    margin-top: 0;
  }

  .project-card__media {
    height: clamp(280px, 42vw, 420px);
  }

  .page--project {
    overflow: auto;
    padding-bottom: 168px;
  }

  .project-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
  }

  .project-button img {
    height: min(44vw, 420px);
  }

  .project-meta {
    position: static;
    margin-top: 32px;
  }
}

@media (max-width: 768px) {
  .site-nav {
    padding-right: 20px;
    padding-left: 20px;
  }

  .home-grid-section,
  .about-shell,
  .page--project,
  .site-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero {
    height: calc(100svh - var(--nav-height));
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-card {
    grid-column: auto;
    margin-top: 0;
  }

  .project-card__media {
    height: min(68vw, 440px);
  }

  .project-gallery {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-button img {
    height: min(70vw, 420px);
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
