:root {
  --text: #1a1a1a;
  --muted: #777;
  --line: #e4e4e4;
  --background: #fff;
  --placeholder: #f2f1ef;
  --gutter: clamp(16px, 4vw, 48px);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}

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

img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.6s ease;
}

img.loaded {
  opacity: 1;
}

h1,
h2 {
  font-weight: 400;
  margin: 0;
}

main {
  padding: 0 var(--gutter);
  min-height: 70vh;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--gutter);
  background: var(--background);
}

.logo {
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 32px;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.2s;
}

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

.menu-toggle {
  display: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

/* Work grid */

.intro {
  max-width: 34em;
  margin: 48px 0 72px;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.35;
}

.intro-heading {
  color: var(--muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 72px var(--gutter);
}

.project-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--placeholder);
}

.project-card-image img {
  height: 100%;
  object-fit: cover;
  transition: opacity 0.6s ease, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project-card:hover .project-card-image img {
  transform: scale(1.03);
}

.project-card-text {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.project-card-text h2 {
  font-size: 15px;
}

.project-card-text p {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

/* Project page */

.project-hero {
  margin: 0 calc(var(--gutter) * -1);
  background: var(--placeholder);
}

.project-hero img {
  max-height: 88vh;
  object-fit: cover;
}

.project-info {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gutter);
  padding: 64px 0 80px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
}

.project-info h1 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
}

.facts {
  margin: 32px 0 0;
}

.facts div {
  display: grid;
  grid-template-columns: 90px 1fr;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.project-description p {
  margin: 0 0 1.2em;
  max-width: 36em;
  font-size: 17px;
}

.project-gallery figure {
  margin: 0 0 var(--gutter);
}

/* Keep portrait images from filling more than one screen. */
.project-gallery img {
  width: auto;
  max-width: 100%;
  max-height: 92vh;
  margin: 0 auto;
}

.project-pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 48px 0 24px;
  border-top: 1px solid var(--line);
}

.project-pager a:last-child {
  text-align: right;
}

.project-pager span {
  display: block;
  color: var(--muted);
}

.not-found {
  margin: 80px 0;
}

.not-found a {
  text-decoration: underline;
}

/* About & contact */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: var(--gutter);
  padding-top: 48px;
}

/* Capped near the portrait's real size (251px wide) so it isn't upscaled. */
.about-image {
  max-width: 280px;
  margin: 0;
  background: var(--placeholder);
}

.about-text h1,
.contact h1 {
  font-size: clamp(26px, 3vw, 36px);
  margin-bottom: 24px;
}

.about-text p {
  max-width: 34em;
  font-size: 17px;
}

.contact {
  padding-top: 48px;
}

.contact-lead {
  max-width: 30em;
  font-size: 17px;
  margin: 0 0 40px;
}

.contact-list {
  max-width: 560px;
  margin: 0;
}

.contact-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.contact-list dt {
  color: var(--muted);
}

.contact-list dd {
  margin: 0;
}

.contact-list a {
  border-bottom: 1px solid var(--line);
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 96px;
  padding: 28px var(--gutter);
  color: var(--muted);
  font-size: 13px;
}

.site-footer a:hover {
  color: var(--text);
}

/* Small screens */

@media (max-width: 760px) {
  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: fixed;
    inset: 80px 0 0;
    flex-direction: column;
    gap: 16px;
    padding: 24px var(--gutter);
    background: var(--background);
    font-size: 24px;
  }

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

  .menu-open {
    overflow: hidden;
  }

  .intro {
    margin: 24px 0 48px;
  }

  .project-grid,
  .project-info,
  .about {
    grid-template-columns: 1fr;
  }

  .project-grid {
    gap: 48px;
  }

  .project-info {
    padding: 40px 0 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  img,
  .project-card-image img {
    transition: none;
  }
}
