@font-face {
    font-family: "Inter";
    src: url("/inter-latin-standard-normal.woff2") format("woff2");
    font-display: swap;
}

:root {
    --primary: black;
    --secondary: rgba(0, 0, 0, 0.65);
    --background: white;
    --transition: 150ms ease-out;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    max-width: calc(650px + 1.5rem * 2);
    min-height: 100vh;
    margin: 0 auto;
    padding: 1.5rem;
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
    box-sizing: border-box;

    font-family: Inter, -apple-system, sans-serif;
    color: var(--secondary);
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

h1, h2, h3, h4, p, a {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -2%;
    line-height: 120%;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    opacity: 0.6;
}
a:active {
    opacity: 0.4;
}

a span {
    text-decoration: underline;
}

strong {
    color: var(--primary);
    font-weight: inherit;
}

nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

nav > a {
    text-decoration: none;
}

nav > a svg {
    width: 4rem;
    min-width: 4rem;
    max-width: 4rem;
    height: 4rem;
    min-height: 4rem;
    max-height: 4rem;
    color: var(--primary);
}

nav > ul {
    display: none;
    gap: 1rem;
    list-style: none;
}

nav > ul a {
    font-size: 1.25rem;
    text-decoration: none;
}
nav > ul a:not(.active) {
    color: var(--secondary);
}
nav > ul a.active {
    color: var(--primary);
    opacity: 1;
}

#menu {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 5.5rem 1.5rem 2rem;
  border: 0;
  background: transparent;
  color: var(--secondary);
}

#menu::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to right, rgb(255 255 255 / 75%), white);
}

#menu::backdrop {
  /* Keep the page visible beneath the menu */
  background: transparent;
}

body:has(#menu[open]) {
  overflow: hidden;
}

#menu nav {
  justify-content: flex-end;
}

#menu ul {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0;
}

#menu li:nth-child(4) {
  margin-top: 1.5rem;
}

#menu a {
  font-size: 2rem;
}

#menu-toggle {
    width: 2rem;
    height: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}
#menu > #menu-toggle {
    position: fixed;
    top: var(--menu-toggle-top);
    left: var(--menu-toggle-left);
}
#menu-toggle:hover {
    opacity: 0.6;
}
#menu-toggle:active {
    opacity: 0.4;
}
#menu-toggle > div {
    width: 100%;
    height: 0.125rem;
    background: var(--primary);
}

#menu-toggle[aria-expanded="true"] > div:nth-child(1) {
    transform: translateY(0.625rem) rotate(45deg);
}
#menu-toggle[aria-expanded="true"] > div:nth-child(2) {
    opacity: 0;
}
#menu-toggle[aria-expanded="true"] > div:nth-child(3) {
    transform: translateY(-0.625rem) rotate(-45deg);
}

@media (prefers-reduced-motion: no-preference) {
  #menu-toggle > div {
    transition: transform var(--transition), opacity var(--transition);
  }

  #menu[open] nav {
    animation: menu-enter 150ms ease-out both;
  }

  #menu[open]::before {
    animation: menu-background-enter 150ms ease-out both;
  }

  #menu[open] li {
    animation: menu-enter 150ms ease-out both;
  }

  #menu li:nth-child(1) { animation-delay: 30ms; }
  #menu li:nth-child(2) { animation-delay: 60ms; }
  #menu li:nth-child(3) { animation-delay: 90ms; }
  #menu li:nth-child(4) { animation-delay: 120ms; }
  #menu li:nth-child(5) { animation-delay: 150ms; }
  #menu li:nth-child(6) { animation-delay: 180ms; }

  @keyframes menu-enter {
    from { opacity: 0; transform: translateX(2rem); }
    to { opacity: 1; transform: translateX(0); }
  }

  @keyframes menu-background-enter {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media screen and (min-width: 900px) {
    main {
        gap: 3rem;
    }

    nav > ul {
        display: flex;
    }

    #menu-toggle {
        display: none;
    }
}
