.gallery-view {
  background: #0f1115;
  color: #ecf0f6;
}

.gallery-page {
  width: min(1240px, 95vw);
  margin: 0 auto;
  padding: clamp(14px, 2.6vw, 28px) 0 clamp(34px, 5vw, 56px);
  display: grid;
  gap: 0.95rem;
}

.gallery-topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  min-height: 52px;
}

.gallery-brand {
  margin: 0;
  font-family: var(--font-brand);
  font-size: clamp(1.1rem, 2.4vw, 1.58rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: lowercase;
  text-align: center;
}

.gallery-mode {
  margin: 0;
  position: fixed;
  top: clamp(10px, 1.6vw, 16px);
  right: clamp(10px, 1.6vw, 16px);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(132, 145, 166, 0.44);
  background: rgba(24, 29, 38, 0.86);
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #bcc6d6;
  white-space: nowrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 0.9rem;
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 8 / 3;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid #323a48;
  background: #1d222b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  border-color: #566178;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

.gallery-card:focus-visible {
  outline: 2px solid #8cb4ff;
  outline-offset: 2px;
}

.gallery-card__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-card__label {
  position: absolute;
  left: 0.72rem;
  bottom: 0.72rem;
  margin: 0;
  max-width: calc(100% - 1.44rem);
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(220, 228, 241, 0.26);
  background: rgba(12, 14, 18, 0.74);
  color: #f2f5fb;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card__fallback {
  width: 100%;
  height: 100%;
  background: var(--card-solid, #2d3646);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(0.9rem, 2.1vw, 1.35rem);
}

.gallery-card__fallback-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7ddea;
}

.gallery-card__name {
  margin: 0.28rem 0 0;
  font-family: var(--font-brand);
  font-size: clamp(1.04rem, 2.5vw, 1.72rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: #ffffff;
}

@media (max-width: 760px) {
  .gallery-page {
    width: min(94vw, 720px);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-mode {
    top: 10px;
    right: 10px;
    min-height: 24px;
    padding: 0.18rem 0.52rem;
    font-size: 0.6rem;
    letter-spacing: 0.09em;
  }

  .gallery-card {
    border-radius: 16px;
  }
}
