@media screen and (width <= 1024px) {
  :root {
    --nav-top: clamp(2.5rem, 15vw, 4rem);
    --row-height: clamp(2.5rem, 15vw, 4rem);
    --nav-small-row-height: 3rem;

    --heading-size: 1.5rem;
    --subheading-size: clamp(1rem, 3vw, 1.125rem);
    --normal-list-size: clamp(0.75rem, 3vw, 1rem);
    --smaller-list-size: clamp(0.75rem, 3vw, 1rem);
  }

  .mobile-hidden {
    display: none;
  }

  header img {
    padding-left: 1.5rem;
  }

  main {
    width: 100vw;
    margin: 0;
  }

  main section {
    top: 0;
    left: 0;
    margin-left: 3rem;
    right: 3.5rem;
    margin-top: calc(8.75rem - (4rem - clamp(2.5rem, 15vw, 4rem)));
    transition: opacity 0.25s ease;
    pointer-events: auto;
    background-color: var(--parchment);
  }

  main.full-page {
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
  }

  main.full-page section {
    margin-top: calc(13rem - 2 * (4rem - clamp(2.5rem, 15vw, 4rem)));
    margin-right: 1.3125rem;
    padding-top: 1rem;
    padding-bottom: 3rem;
  }

  main section.hero {
    margin-left: 3rem;
    margin-right: 3rem;
    top: 20%;
    right: 0;
    transform: translateY(-20%);
  }

  .hero-img {
    width: 12rem;
    height: auto;
  }

  main section .epigraph {
    font-size: 2rem;
    position: relative;
    pointer-events: auto;
    margin-bottom: 0;
  }

  .bracket-tl::before {
    left: -1.5rem;
    width: 9.375rem;
  }

  .bracket-br::after {
    right: -1.5rem;
    width: 9.375rem;
  }

  .bracket-tr::before {
    top: -0.6875rem;
    right: -2.625rem;
    width: 100vw;
  }

  main.full-page section.bracket-tr::before {
    top: -0.5625rem;
    right: -3.125rem; /* Offsets the section's right edge */
    width: calc(
      100vw + 1.5rem + 3.125rem
    ); /* Stretches from left screen edge (-1.5rem) to right edge */
  }

  .bracket-bl::after {
    bottom: -1rem;
    left: -1.5rem;
    width: 9.375rem;
  }

  #bio-container {
    margin-bottom: -1rem;
    max-height: calc(100svh - 4.75rem - var(--row-height) - 2rem);
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  article.bio {
    margin-top: 1rem;
  }

  nav {
    position: fixed;
    bottom: 1rem;
    z-index: 3;
  }

  nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  nav li {
    position: fixed;
    left: 1.5rem;
    padding-left: 1.25rem;
    font-size: 2.25rem;
    z-index: 5;
    transition:
      top 0.25s ease,
      font-weight 0.25s ease,
      font-size 0.25s ease;
    pointer-events: auto;
  }

  #nav-1.nav-later {
    top: calc(100vh - 1rem - 3 * var(--nav-small-row-height));
  }
  #nav-2.nav-later {
    top: calc(100vh - 1rem - 2 * var(--nav-small-row-height));
  }
  #nav-3.nav-later {
    top: calc(100vh - 1rem - 1 * var(--nav-small-row-height));
  }

  .nav-earlier {
    top: -8rem;
    font-size: 5rem;
  }

  nav li.current-section,
  .page-title {
    top: 4rem;
    margin-left: 0rem;
    font-weight: 400;
    font-size: clamp(2.5rem, 15vw, 4rem);
    line-height: clamp(2.5rem, 15vw, 4rem);
    overflow-wrap: break-word;
  }

  .full-page .page-title {
    margin-top: 4.5rem;
    margin-left: 1.5rem;
  }

  nav li:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 0.1875rem;
    width: 13.5rem;
    margin-left: -1.5rem;
    background: var(--sun-amber);
    pointer-events: none;
  }

  nav li.current-section:after {
    display: none;
  }
}

#orientation-warning {
  display: none;
}

@media screen and (width <= 1024px) and (orientation: landscape) {
  #orientation-warning {
    display: flex;
    position: fixed;
    inset: 0; /* Stretches to all 4 corners */
    z-index: 9999;
    background-color: var(--parchment);
    color: var(--ink-navy);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
  }

  #orientation-warning p {
    border: 0.1875rem var(--sun-amber) solid;
    padding: 1rem;
    font-family: "Fraunces", serif;
    font-size: 1.5rem;
    text-align: center;
  }
}
