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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--gray-9);
  background: var(--gray-0);
  line-height: var(--font-lineheight-3);
}

a {
  color: var(--indigo-7);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--size-4);
  padding: var(--size-4) var(--size-6);
  border-bottom: var(--border-size-1) solid var(--gray-3);
}

.site-title {
  font-weight: var(--font-weight-7);
  text-decoration: none;
  color: var(--gray-9);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: var(--size-4);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__toggle {
  font: inherit;
  color: var(--indigo-7);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0;
  padding: var(--size-2);
  list-style: none;
  min-width: 12rem;
  max-height: 20rem;
  overflow-y: auto;
  background: var(--gray-0);
  border: var(--border-size-1) solid var(--gray-3);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-3);
  z-index: 10;
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
  display: block;
}

.nav-dropdown__menu li a {
  display: block;
  padding: var(--size-2) var(--size-2);
  text-decoration: none;
  border-radius: var(--radius-1);
  white-space: nowrap;
}

.nav-dropdown__menu li a:hover {
  background: var(--gray-2);
}

main {
  max-width: 75rem;
  margin-inline: auto;
  padding: var(--size-8) var(--size-6);
}

.prose {
  max-width: 60ch;
}

.hero h1 {
  font-size: var(--font-size-7);
  margin-block-end: var(--size-2);
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--size-5);
  margin-block-start: var(--size-7);
}

.property-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: var(--ratio-square);
  padding: var(--size-4);
  border-radius: var(--radius-3);
  overflow: hidden;
  background-color: var(--gray-5);
  background-size: cover;
  background-position: center;
  color: var(--gray-0);
  text-decoration: none;
  box-shadow: var(--shadow-3);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.property-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 70%), rgb(0 0 0 / 0%) 65%);
}

.property-card:hover,
.property-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-4);
}

.property-card__name,
.property-card__location {
  position: relative;
  z-index: 1;
}

.property-card__name {
  font-weight: var(--font-weight-7);
  font-size: var(--font-size-3);
}

.property-card__location {
  font-size: var(--font-size-1);
  opacity: 0.9;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-5);
  margin-block-start: var(--size-7);
}

.pager__status {
  color: var(--gray-6);
  font-size: var(--font-size-1);
}

.site-footer {
  text-align: center;
  padding: var(--size-6);
  color: var(--gray-6);
  font-size: var(--font-size-1);
  border-top: var(--border-size-1) solid var(--gray-3);
}

@media (prefers-color-scheme: dark) {
  body {
    color: var(--gray-2);
    background: var(--gray-9);
  }

  .site-title {
    color: var(--gray-0);
  }

  .site-header,
  .site-footer {
    border-color: var(--gray-7);
  }

  .nav-dropdown__menu {
    background: var(--gray-9);
    border-color: var(--gray-7);
  }

  .nav-dropdown__menu li a {
    color: var(--gray-2);
  }

  .nav-dropdown__menu li a:hover {
    background: var(--gray-8);
  }
}
