@layer reset, base, layout, responsive;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body,
  h1,
  h2,
  p {
    margin: 0;
  }
}

@layer base {
  :root {
    color-scheme: light;
    --background: #c9ebe0;
    --text: #0b2e30;
    --muted-text: #1f4a4a;
    --active: #b4350f;
    --underline: #5b3fd0;
    background: var(--background);
    color: var(--text);
    font-family: Newsreader, Georgia, serif;
    font-synthesis: none;
  }

  body {
    min-width: 320px;
    background: var(--background);
  }

  a {
    color: var(--text);
    text-decoration-color: var(--underline);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  a:hover {
    text-decoration-thickness: 2px;
  }

  a:focus-visible {
    border-radius: 2px;
    outline: 2px solid var(--active);
    outline-offset: 4px;
  }

  a.active {
    color: var(--active);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
  }
}

@layer layout {
  .page {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    flex-direction: column;
    justify-content: space-between;
    gap: 64px;
    overflow: hidden;
    padding: 56px 7.5vw;
  }

  .page::after {
    position: absolute;
    z-index: -1;
    right: -22px;
    bottom: -28px;
    width: 230px;
    height: 230px;
    background-image: radial-gradient(circle, rgba(11, 46, 48, 0.12) 1px, transparent 1.5px);
    background-size: 24px 24px;
    content: "";
    mask-image: linear-gradient(135deg, transparent 12%, #000 82%);
  }

  .site-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .site-header,
  .site-footer {
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
  }

  .site-name {
    letter-spacing: 0.02em;
    text-decoration: none;
  }

  nav {
    display: flex;
    gap: 32px;
  }

  .intro {
    display: flex;
    max-width: 760px;
    flex-direction: column;
    gap: 28px;
  }

  .intro h1 {
    font-size: clamp(64px, 6.56vw, 84px);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .intro p {
    color: var(--muted-text);
    font-size: 28px;
    line-height: 1.4;
  }

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

  .footer-projects {
    display: none;
  }

  .inner-page {
    min-height: max(100svh, 760px);
  }

  .prose {
    align-self: flex-start;
    max-width: 640px;
  }

  .prose h1 {
    margin-bottom: 32px;
    font-size: 56px;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.05;
  }

  .prose p {
    font-size: 22px;
    line-height: 1.55;
  }

  .about-content p + p {
    margin-top: 24px;
  }

  .projects-page {
    gap: 80px;
  }

  .projects-content {
    width: 100%;
    max-width: 780px;
  }

  .project + .project {
    margin-top: 56px;
    padding-top: 48px;
    border-top: 1px solid rgba(11, 46, 48, 0.22);
  }

  .project h2 {
    margin-bottom: 14px;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.2;
  }
}

@layer responsive {
  @media (max-width: 600px) {
    .page {
      gap: 52px;
      padding: 32px 24px;
    }

    .page::after {
      right: -76px;
      bottom: -36px;
    }

    .nav-projects {
      display: none;
    }

    .intro {
      gap: 20px;
    }

    .intro h1 {
      max-width: 8ch;
      font-size: 52px;
    }

    .intro p {
      font-size: 21px;
    }

    .site-footer {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0 24px;
    }

    .site-footer a {
      padding: 14px 0;
    }

    .footer-projects {
      display: block;
    }

    .inner-page,
    .projects-page {
      min-height: 100svh;
      justify-content: flex-start;
    }

    .inner-page .site-footer,
    .projects-page .site-footer {
      margin-top: auto;
    }

    .prose h1 {
      margin-bottom: 28px;
      font-size: 46px;
    }

    .prose p {
      font-size: 20px;
      line-height: 1.5;
    }

    .about-content p + p {
      margin-top: 22px;
    }

    .projects-page {
      gap: 64px;
    }

    .project + .project {
      margin-top: 40px;
      padding-top: 36px;
    }

    .project h2 {
      font-size: 25px;
    }
  }

  @media (min-width: 1280px) {
    .page {
      padding-right: 96px;
      padding-left: 96px;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    a {
      transition: color 120ms ease, text-decoration-color 120ms ease;
    }
  }
}
