:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #0b0b0c;
  color: #f4f0ea;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgb(223 45 34 / 12%), transparent 30rem),
    #0b0b0c;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #df2d22;
  outline-offset: 4px;
}

#app {
  max-width: 1280px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #303033;
}

.brand {
  color: #f4f0ea;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.brand span {
  color: #aaa7a4;
  font-weight: 650;
}

.header nav {
  display: flex;
  gap: 18px;
}

.nav-button,
.reset-button,
.state button,
.state-link {
  min-height: 42px;
  border: 1px solid #303033;
  border-radius: 8px;
  padding: 9px 14px;
  background: #171719;
  color: #f4f0ea;
  font-weight: 750;
}

.nav-button {
  position: relative;
  border: 0;
  border-radius: 0;
  padding: 8px 0;
  background: transparent;
}

.nav-button::after {
  position: absolute;
  right: 0;
  bottom: -21px;
  left: 0;
  height: 3px;
  content: '';
  background: #df2d22;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav-button:hover::after,
.nav-button.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.nav-button span {
  display: inline-grid;
  min-width: 20px;
  margin-left: 4px;
  place-items: center;
  border-radius: 999px;
  background: #303033;
  color: #f4f0ea;
  font-size: 12px;
}

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(150px, 1fr)) auto;
  gap: 12px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid #303033;
  border-radius: 12px;
  background: #171719;
}

.filters label {
  display: grid;
  gap: 7px;
  color: #aaa7a4;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #454548;
  border-radius: 7px;
  padding: 0 12px;
  background: #0b0b0c;
  color: #f4f0ea;
}

.filters input::placeholder {
  color: #777477;
}

.reset-button {
  align-self: end;
}

.reset-button:hover,
.state button:hover,
.state-link:hover {
  border-color: #df2d22;
  background: #df2d22;
}

.result-count,
.eyebrow {
  margin: 0 0 12px;
  color: #df2d22;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.artist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.artist-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #303033;
  border-radius: 10px;
  background: #171719;
  box-shadow: 0 20px 45px rgb(0 0 0 / 22%);
  transition: border-color 180ms ease, transform 180ms ease;
}

.artist-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  content: '';
  background: #df2d22;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.artist-card:hover {
  border-color: #656166;
  transform: translateY(-3px);
}

.artist-card:hover::after {
  transform: scaleX(1);
}

.artist-open {
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.artist-image {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #252528;
}

.artist-image img,
.portfolio-image img,
.artist-page-image img,
.viewer-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artist-image img {
  transition: transform 180ms ease;
}

.artist-card:hover .artist-image img {
  transform: scale(1.03);
}

.artist-copy {
  display: grid;
  gap: 7px;
  padding: 17px;
}

.artist-copy strong {
  font-size: 22px;
  line-height: 1.05;
}

.artist-styles,
.artist-price {
  color: #aaa7a4;
  font-size: 14px;
  line-height: 1.4;
}

.artist-price {
  color: #df2d22;
  font-weight: 850;
}

.favorite-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgb(244 240 234 / 28%);
  border-radius: 50%;
  background: rgb(11 11 12 / 82%);
  color: #df2d22;
  font-size: 24px;
  line-height: 1;
}

.favorite-button:hover {
  border-color: #df2d22;
  background: #171719;
}

.image-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: #252528;
  color: #df2d22;
  font-size: 32px;
}

.image-fallback[hidden] {
  display: none;
}

.state {
  max-width: 580px;
  margin: 96px auto;
  padding: 34px;
  border: 1px solid #303033;
  border-radius: 10px;
  background: #171719;
  text-align: center;
}

.state h1 {
  margin-top: 0;
}

.state p {
  color: #aaa7a4;
  line-height: 1.6;
}

.state button,
.state-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #df2d22;
  background: #df2d22;
  color: #f4f0ea;
  text-decoration: none;
}

.artist-profile {
  max-width: 1180px;
  margin: 0 auto;
}

.artist-page-back {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-bottom: 22px;
  border-bottom: 1px solid #df2d22;
  color: #f4f0ea;
  font-weight: 750;
  text-decoration: none;
}

.artist-profile-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
  padding: clamp(18px, 3vw, 36px);
  border: 1px solid #303033;
  border-radius: 12px;
  background: #171719;
}

.artist-profile-portrait {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #252528;
}

.artist-profile-portrait .artist-page-image {
  width: 100%;
  height: 100%;
}

.artist-profile-copy {
  min-width: 0;
  padding-top: clamp(4px, 2vw, 28px);
}

.artist-profile-copy::before {
  display: block;
  width: 58px;
  height: 3px;
  margin-bottom: 24px;
  content: '';
  background: #df2d22;
}

.artist-profile-copy h1 {
  max-width: 100%;
  margin: 0 0 18px;
  font-size: clamp(42px, 5.5vw, 80px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.93;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.profile-styles,
.profile-meta,
.profile-description {
  max-width: 42rem;
  margin: 0;
  line-height: 1.55;
}

.profile-styles {
  color: #aaa7a4;
  font-size: 15px;
}

.profile-meta {
  margin-top: 14px;
  color: #df2d22;
  font-weight: 850;
}

.profile-description {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #454548;
  color: #f4f0ea;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.5;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.profile-actions .favorite-button,
.artist-page-favorite {
  position: static;
  flex: 0 0 auto;
}

.hero-contacts {
  display: flex;
  flex: 1 1 20rem;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-contact-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  border: 1px solid #454548;
  border-radius: 6px;
  color: #f4f0ea;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.hero-contact-link svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.hero-contact-link:hover,
.hero-contact-link:focus-visible {
  border-color: #df2d22;
  background: #df2d22;
}

.profile-source {
  margin: 18px 0 0;
  color: #777477;
  font-size: 13px;
  line-height: 1.45;
}

.profile-source a {
  color: #aaa7a4;
  text-decoration-color: #575458;
  text-underline-offset: 3px;
}

.profile-source a:hover,
.profile-source a:focus-visible {
  color: #f4f0ea;
  text-decoration-color: #df2d22;
}

.artist-profile-portfolio {
  margin-top: clamp(52px, 8vw, 104px);
}

.artist-profile-portfolio h2 {
  max-width: 12ch;
  margin: 0 0 24px;
  font-size: clamp(38px, 5vw, 72px);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.portfolio-grid button {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 0;
  border: 1px solid #303033;
  border-radius: 8px;
  background: #252528;
}

.portfolio-grid button:hover {
  border-color: #df2d22;
}

.portfolio-image {
  width: 100%;
  height: 100%;
  background: #252528;
}

.portfolio-more {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin: 24px auto 0;
  border: 1px solid #df2d22;
  border-radius: 4px;
  background: transparent;
  color: #f4f0ea;
  padding: 0.65rem 1rem;
  font-weight: 800;
}

.portfolio-more:hover {
  background: #df2d22;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 56px 72px;
  background: rgb(0 0 0 / 97%);
  color: #f4f0ea;
}

.viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #df2d22;
  border-radius: 50%;
  background: #171719;
  color: #f4f0ea;
  font-size: 28px;
}

.viewer-image {
  width: min(100%, 960px);
  height: min(78vh, 840px);
}

.viewer-image img {
  object-fit: contain;
}

.viewer-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 72px;
  border: 0;
  background: transparent;
  color: #f4f0ea;
  font-size: 64px;
  transform: translateY(-50%);
}

.viewer-arrow:hover {
  color: #df2d22;
}

.viewer-previous {
  left: 14px;
}

.viewer-next {
  right: 14px;
}

.viewer-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  color: #aaa7a4;
  transform: translateX(-50%);
}

@media (max-width: 1119px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .artist-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 719px) {
  #app {
    padding: 18px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header nav {
    gap: 16px;
  }

  .nav-button::after {
    bottom: -21px;
  }

  .filters,
  .artist-grid,
  .artist-profile-hero,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .artist-profile-hero {
    padding: 16px;
  }

  .hero-contacts {
    flex-basis: 100%;
  }

  .viewer {
    padding: 56px 36px;
  }

  .viewer-arrow {
    width: 36px;
    font-size: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
