:root {
  --background: #fff;
  --text: #202020;
  --secondary-text: #686868;
  --line: #dedede;
  --accent: #444;
  --page-width: 1180px;
  --reading-width: 880px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.58;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 5px;
}


/* ========================================
   Header
   ======================================== */

.site-header {
  position: relative;
  width: min(var(--page-width), calc(100% - 96px));
  min-height: 120px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
}

.site-name {
  justify-self: start;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.contact-link {
  justify-self: end;
  color: var(--secondary-text);
  font-size: 0.85rem;
  text-decoration: none;
}


/* ========================================
   Desktop SVG navigation
   ======================================== */

.main-navigation {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 125px));
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.nav-item {
  min-width: 0;
  min-height: 70px;

  display: flex;
  align-items: center;
  justify-content: center;

  text-decoration: none;
}

.nav-icon {
  width: 115px;
  height: 65px;
  object-fit: contain;

  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.nav-item:hover .nav-icon {
  opacity: 0.72;
  transform: translateY(-3px) rotate(-2deg);
}

.nav-item:nth-child(2):hover .nav-icon {
  transform: translateY(-3px) rotate(2deg);
}

.nav-item:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--text);
  outline-offset: 5px;
}


/* Hidden on desktop */

.mobile-menu {
  display: none;
}


/* ========================================
   Main content
   ======================================== */

main {
  width: min(var(--reading-width), calc(100% - 96px));
  margin: 0 auto;
}


/* ========================================
   Homepage profile
   ======================================== */

.home-profile {
  padding: 42px 0 34px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  grid-template-areas:
    "heading portrait"
    "biography portrait";

  align-items: center;
  column-gap: 60px;
  row-gap: 10px;
}

.profile-heading {
  grid-area: heading;
}

.profile-biography {
  grid-area: biography;
  min-width: 0;
}

.eyebrow {
  margin: 0;

  color: var(--secondary-text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-biography p {
  max-width: 620px;
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.profile-biography p:last-child {
  margin-bottom: 0;
}

.home-profile .portrait {
  grid-area: portrait;
  width: 240px;
  margin: 0;
  justify-self: end;
}

.home-profile .portrait img {
  width: 100%;
  height: auto;
  filter: none;
}


/* ========================================
   Content sections
   ======================================== */

.content-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.content-section h2 {
  margin: 0 0 14px;

  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.content-section h3 {
  margin: 24px 0 10px;
  font-size: 1rem;
  font-weight: 600;
}

.content-section p {
  width: 100%;
  max-width: none;
  margin: 0 0 16px;
}

.content-section p:last-child {
  margin-bottom: 0;
}

.content-section ul {
  width: 100%;
  margin: 14px 0 0;
  padding-left: 1.25rem;
}

.content-section li {
  margin-bottom: 10px;
}

.content-section li:last-child {
  margin-bottom: 0;
}


/* ========================================
   Hand-drawn page titles
   ======================================== */

.page-title-image {
  width: 200px;
  max-width: 55%;
  height: 80px;

  object-fit: contain;
  object-position: left center;
}


/* ========================================
   Professional links
   ======================================== */

.professional-links {
  margin: 22px 0 0;
  padding: 0;

  display: flex;
  flex-wrap: wrap;
  gap: 24px;

  list-style: none;
}

.professional-links li {
  margin: 0;
}


/* ========================================
   Footer
   ======================================== */

.site-footer {
  width: min(var(--page-width), calc(100% - 96px));
  margin: 0 auto;
  padding: 30px 0;

  color: var(--secondary-text);
  font-size: 0.75rem;
}


/* ========================================
   Mobile layout
   ======================================== */

@media (max-width: 700px) {
  .site-header {
    width: calc(100% - 40px);
    min-height: auto;
    margin: 0 auto;
    padding: 22px 0;

    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0;
  }

  /*
    Keep the name in the upper-left.
  */

  .site-name {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    z-index: 1;
  }

  /*
    Hide the desktop navigation and Contact.
  */

  .main-navigation,
  .contact-link {
    display: none;
  }

  /*
    The Menu element spans the header,
    while the button stays upper-right.
  */

  .mobile-menu {
    display: block;

    grid-column: 1 / -1;
    grid-row: 1;

    width: 100%;
    margin: 0;
  }

  .mobile-menu summary {
    width: max-content;
    margin-left: auto;

    color: var(--secondary-text);
    font-size: 0.85rem;
    line-height: 1.58;

    cursor: pointer;
    list-style: none;
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu summary::marker {
    content: "";
  }

  .mobile-menu summary::after {
    content: "+";
    margin-left: 8px;
  }

  .mobile-menu[open] summary::after {
    content: "−";
  }

  /*
    The menu links begin below the name and
    Menu button. Opening the menu expands the
    header and pushes the main page downward.
  */

  .mobile-menu-links {
    width: 100%;
    margin-top: 24px;
    padding: 22px 0 4px;
    border-top: 1px solid var(--line);

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .mobile-menu-links a {
    font-size: 1.15rem;
    line-height: 1.4;
    text-decoration: none;
  }

  @media (max-width: 700px) {
  .mobile-menu-links a:last-child {
    font-style: italic;
    }
  }

  main {
    width: calc(100% - 40px);
  }

  /*
    Mobile homepage order:
    1. Role
    2. Photograph
    3. Biography
  */

  .home-profile {
    padding: 32px 0 28px;

    grid-template-columns: 1fr;
    grid-template-areas:
      "heading"
      "portrait"
      "biography";

    gap: 24px;
  }

  .home-profile .portrait {
    width: min(68%, 250px);
    justify-self: start;
  }

  .home-profile .portrait img {
    filter: none;
  }

  .profile-biography p {
    margin-bottom: 14px;
    font-size: 1rem;
  }

  .content-section {
    padding: 26px 0;
  }

  .content-section h2 {
    margin-bottom: 12px;
  }

  .content-section h3 {
    margin-top: 20px;
    margin-bottom: 8px;
  }

  .content-section p {
    width: 100%;
    max-width: none;
    margin-bottom: 14px;
  }

  .content-section ul {
    width: 100%;
    margin-top: 12px;
  }

  .content-section li {
    margin-bottom: 8px;
  }

  .page-title-image {
    width: 160px;
    max-width: 65%;
    height: 64px;
  }

  .professional-links {
    margin-top: 18px;
    gap: 20px;
  }

  .site-footer {
    width: calc(100% - 40px);
    padding: 26px 0;
  }
}


/* ========================================
   Reduced-motion preference
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-icon {
    transition: none;
  }
}
