* { box-sizing: border-box; }

:root {
  --accent: #7a2e2a;
  --text: #1a1a1a;
  --sans: Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

header {
  flex-shrink: 0;
}

footer {
  flex-shrink: 0;
}

header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  padding: 2rem;
  padding-left: min(20%, 14rem);
}

.logo a {
  display: block;
  border: 2px solid var(--accent);
  border-radius: 40px;
  padding: 1rem 1.75rem;
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  width: fit-content;
}

/* flex-basis is the width nav wants beside the logo; below that the whole
   nav wraps onto its own line instead of squeezing one word per row */
nav {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 26rem;
  min-width: 0;
  gap: 0.5rem 2.5rem;
}

nav a {
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

main {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: normal;
  font-size: 3.5rem;
  line-height: 1.15;
  margin: 0;
}

.hero .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--accent);
  margin: 1rem 0 0;
}

.hero-image {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55vh;
  z-index: -1;
}

.hero-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
  mask-image: linear-gradient(to bottom, transparent, black 35%);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 35%);
  opacity: 0;
  transition: opacity 1.5s ease;
}

.hero-image img.active {
  opacity: 0.5;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  color: inherit;
  text-decoration: none;
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.project-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  margin: 1.5rem 0;
}

.project-meta dt {
  font-weight: bold;
}

.project-gallery img {
  width: 100%;
  margin-top: 1rem;
  display: block;
}

footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #888;
}

@media (max-width: 900px) {
  header {
    padding-left: 2rem;
  }
}

@media (max-width: 600px) {
  header {
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
  }

  nav {
    gap: 0.35rem 1.5rem;
  }

  nav a {
    font-size: 1rem;
  }

  main {
    padding: 1.5rem;
  }
}
