@layer reset, base, site, layout;

@layer layout {
  .project-detail {
    &::after {
      content: "";
      display: block;
      clear: both;
    }
  }

  .project-detail > h1 {
    font-size: clamp(2.05rem, 3.5vw, 2.65rem);
  }

  .project-detail > picture {
    float: right;
    width: min(42%, 18rem);
    margin: var(--space-4) 0 var(--space-5) var(--space-8);
  }

  picture img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
  }

  @media (prefers-reduced-motion: no-preference) {
    picture img {
      animation: project-image-enter 680ms ease both;
      transition: filter 220ms ease, transform 220ms ease;

      &:hover {
        filter: saturate(1.1) contrast(1.04);
        transform: translateY(-2px) scale(1.015);
      }
    }

    @keyframes project-image-enter {
      from {
        opacity: 0;
        transform: translateY(0.75rem) scale(0.985);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }
  }

  nav.project-navigation {
    clear: both;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-muted);

    & ul {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--space-2);
      padding: 0;
      list-style: none;
    }

    & a {
      display: flex;
      align-items: center;
      justify-content: center;
      width: min(100%, 10rem);
      margin-inline: auto;
      min-height: 2.25rem;
      padding: 0.42rem 0.7rem;
      color: var(--text);
      font-size: 0.92rem;
      font-weight: 650;
      text-align: center;
      text-decoration: none;
      background: var(--surface-subtle);
      border: 1px solid var(--border);
      border-radius: 999px;
      transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;

      &:hover {
        background: var(--surface-strong);
        border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
        transform: translateY(-2px);
      }
    }

    & li:first-child a {
      margin-inline: 0 auto;
    }

    & li:last-child a {
      margin-inline: auto 0;
    }
  }

  @media (max-width: 60rem) {
    .project-detail > picture {
      float: none;
      width: min(100%, 16rem);
      margin: var(--space-4) 0 var(--space-5);
    }
  }
}
