:root {
  --ink: #1c1c1c;
  --muted: #626262;
  --accent: #0045ff;
  --paper: #ffffff;
  --line: rgba(28, 28, 28, 0.12);
  --display: "Montserrat", "Arial Black", sans-serif;
  --text: "Source Sans 3", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
}

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

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

a:hover,
a:focus-visible {
  color: var(--accent);
}

.skip-link {
  background: var(--ink);
  color: var(--paper);
  left: 1rem;
  padding: 0.55rem 0.75rem;
  position: fixed;
  top: 1rem;
  transform: translateY(-160%);
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 150px;
  padding: 0 3% 30px;
  position: relative;
  z-index: 10;
}

.brand,
.primary-nav a {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
}

.brand {
  font-size: 45px;
  line-height: 35px;
  text-align: center;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  gap: 1.05rem;
}

.primary-nav a {
  font-size: 16px;
  line-height: 24px;
}

.primary-nav .active {
  color: var(--accent);
}

.social-nav {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.social-nav a {
  align-items: center;
  display: inline-flex;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.social-nav svg {
  fill: currentColor;
  height: 18px;
  width: 18px;
}

.menu-button,
.mobile-nav {
  display: none;
}

.masthead {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: max(5rem, calc(30vh - 150px));
  padding: 0 5%;
  text-align: center;
}

.masthead h1 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 900;
  line-height: 42px;
  margin: 0;
}

.project-grid {
  display: grid;
  gap: 15px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 3% 3rem;
}

.project-card {
  aspect-ratio: 3 / 4;
  background: #f3f3f3;
  display: block;
  overflow: hidden;
  position: relative;
}

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

.project-card__overlay {
  align-items: center;
  background: rgba(28, 28, 28, 0.9);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 8%;
  position: absolute;
  text-align: center;
  transition: opacity 160ms ease;
}

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

.project-card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 23px;
}

.project-card__client {
  font-size: 16px;
  line-height: 20px;
}

.page-heading {
  margin: 0 auto;
  max-width: 750px;
  padding: 40px 0 0;
  text-align: center;
  width: 100%;
}

.page-heading p {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 1.5rem;
  text-transform: uppercase;
}

.page-heading h1 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  margin: 0;
  padding: 0 0 10px;
  text-transform: uppercase;
}

.page-heading span {
  color: var(--muted);
  display: block;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
  padding: 0 0 20px;
}

.project-page {
  padding-bottom: 4rem;
}

.project-page .page-heading {
  padding-bottom: 40px;
}

.project-page .page-heading h1 {
  font-family: var(--text);
  font-size: 25px;
  font-weight: 900;
  line-height: 30px;
  padding-bottom: 15px;
  text-transform: none;
}

.project-page .page-heading span {
  color: var(--ink);
  font-family: var(--text);
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  padding-bottom: 20px;
}

.project-images {
  margin: 0 auto;
  max-width: min(1575px, 74vw);
}

.project-images img {
  background: #f3f3f3;
  margin: 0 auto;
  width: 100%;
}

.text-page {
  font-size: 18px;
  line-height: 24px;
  margin: 0 auto 5rem;
  max-width: 500px;
  padding: 0;
}

.text-page p {
  margin: 0 0 1.2rem;
}

.text-page a {
  border-bottom: 1px solid currentColor;
  font-weight: 700;
}

.text-page--center {
  text-align: center;
}

.contact-page {
  margin: 1px auto 59px;
  max-width: 600px;
  padding: 0;
  width: 100%;
}

.contact-form {
  display: grid;
}

.contact-form label {
  display: grid;
}

.contact-form span {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  line-height: 16px;
  margin: 0 0 10px;
}

.contact-form input,
.contact-form textarea {
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font-family: var(--text);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 30px;
  padding-left: 10px;
  padding-right: 10px;
  width: 100%;
}

.contact-form input {
  height: 42px;
  line-height: 42px;
}

.contact-form textarea {
  display: block;
  height: 132px;
  padding-bottom: 13px;
  padding-top: 13px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(0, 69, 255, 0.16);
}

.contact-form button {
  background: var(--ink);
  border: 0;
  color: var(--paper);
  cursor: pointer;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 900;
  height: 40px;
  justify-self: start;
  line-height: 40px;
  padding: 0 25px;
  text-transform: none;
}

.contact-form button:hover,
.contact-form button:focus-visible {
  background: var(--accent);
}

.hidden-field {
  display: none;
}

@media (max-width: 1491px) {
  .brand {
    max-width: 12ch;
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding: 0 5% 23px;
  }

  .primary-nav,
  .social-nav {
    display: none;
  }

  .brand {
    font-size: 34px;
    justify-self: start;
    line-height: 33px;
    padding-right: 3rem;
    text-align: left;
  }

  .menu-button {
    appearance: none;
    align-content: center;
    align-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: grid;
    gap: 4px;
    height: 24px;
    justify-content: center;
    padding: 0;
    width: 42px;
  }

  .menu-button span {
    background: var(--ink);
    display: block;
    height: 2px;
    transform-origin: center;
    width: 24px;
  }

  .mobile-nav {
    background: var(--paper);
    display: none;
    inset: 0;
    padding: 8rem 5% 3rem;
    position: fixed;
    text-align: center;
    z-index: 9;
  }

  .mobile-nav a {
    display: block;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 900;
    line-height: 32px;
    margin-bottom: 30px;
    text-transform: uppercase;
  }

  .nav-open {
    overflow: hidden;
  }

  .nav-open .mobile-nav {
    display: block;
  }

  .nav-open .menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-open .menu-button span:nth-child(2) {
    opacity: 0;
  }

  .nav-open .menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-left: 0;
    margin-right: 0;
  }

  .page-heading {
    padding-left: 5%;
    padding-right: 5%;
    padding-top: 20px;
  }

  .page-heading h1 {
    font-size: 18px;
    line-height: 23px;
    padding-bottom: 8px;
  }

  .page-heading span {
    font-size: 14px;
    line-height: 19px;
    padding-bottom: 14px;
  }

  .project-page .page-heading {
    padding-bottom: 20px;
  }

  .project-page .page-heading h1 {
    font-size: 18px;
    line-height: 22px;
    padding-bottom: 11px;
  }

  .project-page .page-heading span {
    font-size: 17px;
    line-height: 20px;
    padding-bottom: 14px;
  }

  .project-card__client {
    display: none;
  }

  .text-page {
    font-size: 14px;
    line-height: 19px;
  }

  .contact-page {
    margin-bottom: 28px;
    margin-top: 2px;
  }

  .contact-form span,
  .contact-form input,
  .contact-form textarea {
    font-size: 13px;
  }

  .contact-form span {
    margin-bottom: 8px;
  }

  .contact-form input,
  .contact-form textarea {
    margin-bottom: 18px;
  }

  .contact-form button {
    font-size: 14px;
    height: 38px;
    line-height: 38px;
  }
}

@media (max-width: 540px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding-bottom: 18px;
  }

  .brand {
    font-size: 24px;
    line-height: 23px;
  }

  .masthead {
    min-height: 5rem;
  }

  .masthead h1 {
    font-size: 16px;
    line-height: 22px;
  }

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

  .page-heading {
    padding-top: 18px;
  }

  .page-heading h1 {
    font-size: 15px;
    line-height: 19px;
    padding-bottom: 7px;
  }

  .page-heading span {
    font-size: 14px;
    line-height: 20px;
    padding-bottom: 13px;
  }

  .project-page .page-heading {
    padding-bottom: 18px;
  }

  .project-page .page-heading h1 {
    font-size: 16px;
    line-height: 19px;
    padding-bottom: 10px;
  }

  .project-page .page-heading span {
    font-size: 14px;
    line-height: 17px;
    padding-bottom: 13px;
  }

  .text-page {
    font-size: 14px;
    line-height: 20px;
    padding-left: 5%;
    padding-right: 5%;
  }

  .contact-page {
    margin-bottom: 24px;
    margin-top: 2px;
    padding-left: 5%;
    padding-right: 5%;
  }

  .contact-form span {
    font-size: 12px;
    margin-bottom: 7px;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 11px;
    margin-bottom: 16px;
  }

  .contact-form input {
    height: 35px;
    line-height: 35px;
  }

  .contact-form button {
    height: 35px;
    line-height: 35px;
  }
}
