:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #62706c;
  --line: #dbe2dc;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --soft: #edf3ee;
  --teal: #147d76;
  --teal-dark: #0d5954;
  --coral: #d95f43;
  --mustard: #d9a12e;
  --graphite: #26302e;
  --shadow: 0 18px 50px rgba(24, 33, 31, 0.12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(219, 226, 220, 0.85);
  background: rgba(251, 252, 248, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  font-weight: 800;
  background: var(--ink);
  border-radius: 8px;
}

.brand-name {
  font-weight: 800;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.top-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-width: 0;
}

.top-nav a {
  min-height: 38px;
  padding: 9px 13px;
  color: var(--muted);
  border-radius: 8px;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--ink);
  background: var(--soft);
}

.header-action,
.primary-button,
.text-button,
.icon-button,
.filter-chip,
.collection-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.header-action {
  gap: 8px;
  padding: 0 15px;
  color: #fff;
  background: var(--teal);
}

.header-action:hover,
.primary-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.header-action svg,
.primary-button svg,
.text-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.hero {
  position: relative;
  min-height: 520px;
  display: grid;
  align-items: end;
  padding: 64px 34px 42px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(14, 19, 18, 0.82), rgba(14, 19, 18, 0.36) 52%, rgba(14, 19, 18, 0.1)),
    url("assets/photos/business-office.png") center 33% / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 110px;
  background: linear-gradient(180deg, rgba(251, 252, 248, 0), var(--paper));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffb38f;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: 4.5rem;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 660px;
  margin: 20px 0 26px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(680px, 100%);
  min-height: 58px;
  padding: 0 8px 0 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.hero-search svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.hero-search input {
  width: 100%;
  height: 56px;
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
}

.hero-search input::placeholder {
  color: #7b8581;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-metrics span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.catalog-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 42px auto 0;
}

.section-heading {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-heading h2,
.rsya-note h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.result-count {
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
}

.filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.filter-row,
.collection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip,
.collection-chip {
  gap: 8px;
  padding: 0 13px;
  color: var(--graphite);
  background: var(--panel);
  border: 1px solid var(--line);
}

.filter-chip:hover,
.collection-chip:hover,
.filter-chip.is-active,
.collection-chip.is-active {
  color: #fff;
  background: var(--graphite);
  border-color: var(--graphite);
}

.filter-chip .count,
.collection-chip .count {
  color: currentColor;
  opacity: 0.7;
  font-size: 0.86rem;
}

.sort-control {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.sort-control label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.sort-control select {
  height: 42px;
  padding: 0 38px 0 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.collections {
  margin: 12px 0 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.collections-head {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.collections h3 {
  margin: 0;
  font-size: 1rem;
}

.text-button {
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--teal);
  background: transparent;
  border: 1px solid transparent;
}

.text-button:hover {
  color: var(--teal-dark);
  background: var(--soft);
  border-color: var(--line);
}

.gallery {
  columns: 270px;
  column-gap: 18px;
}

.photo-card {
  position: relative;
  min-width: 0;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(24, 33, 31, 0.07);
  break-inside: avoid;
}

.photo-card-image {
  width: 100%;
  height: auto;
  cursor: zoom-in;
  object-fit: contain;
  background: var(--soft);
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: rgba(24, 33, 31, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.favorite-button svg {
  width: 19px;
  height: 19px;
}

.favorite-button.is-active {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.photo-card-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-pill,
.model-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  color: var(--graphite);
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--soft);
  border-radius: 8px;
}

.model-pill,
.badge {
  color: #623d07;
  background: #fff1c9;
}

.photo-card h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.28;
  letter-spacing: 0;
}

.photo-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-stats span,
.modal-stats span,
.modal-stats a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  color: #43514d;
  font-size: 0.82rem;
  background: #f3f6f1;
  border: 1px solid #e3e8e1;
  border-radius: 8px;
}

.card-stats svg,
.modal-stats svg {
  width: 15px;
  height: 15px;
}

.card-stats strong,
.modal-stats strong {
  color: var(--ink);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  color: #43514d;
  font-size: 0.78rem;
  background: #f3f6f1;
  border: 1px solid #e3e8e1;
  border-radius: 8px;
}

.primary-button {
  gap: 9px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: #fff;
  font-weight: 800;
  background: var(--teal);
  border: 1px solid var(--teal);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.66;
  transform: none;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 260px;
  margin-top: 16px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: var(--teal);
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.loading-line {
  display: inline-block;
  width: 100%;
  padding: 20px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rsya-note {
  display: grid;
  grid-template-columns: minmax(220px, 380px) 1fr;
  gap: 42px;
  width: min(1220px, calc(100% - 40px));
  margin: 66px auto;
  padding: 30px 0 0;
  border-top: 1px solid var(--line);
}

.rsya-note p:last-child {
  max-width: 700px;
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 23, 0.68);
  backdrop-filter: blur(12px);
}

.modal-panel {
  position: absolute;
  inset: 24px;
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
  width: min(1080px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  overflow: hidden;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.92);
}

.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--graphite);
  background: transparent;
  border: 1px solid transparent;
}

.icon-button:hover {
  background: var(--soft);
  border-color: var(--line);
}

.modal-media {
  min-height: 100%;
  background: var(--soft);
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  min-height: 0;
  padding: 28px;
  overflow: auto;
}

.modal-title-row {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title-row h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-stats a {
  color: var(--teal);
  font-weight: 800;
}

.ad-box {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #f6f2ea;
  border: 1px solid #eadfce;
  border-radius: 8px;
}

.ad-label {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 28px;
  color: #fff;
  font-weight: 900;
  background: var(--coral);
  border-radius: 8px;
}

.ad-box strong {
  font-size: 1.3rem;
}

.ad-box p {
  margin: 0;
  color: #65574c;
  line-height: 1.5;
}

.ad-progress {
  height: 10px;
  overflow: hidden;
  background: rgba(24, 33, 31, 0.12);
  border-radius: 999px;
}

.ad-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--mustard), var(--teal));
  transition: width 300ms ease;
}

.prompt-step {
  display: grid;
  gap: 16px;
}

.prompt-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.prompt-block {
  display: grid;
  gap: 8px;
}

.prompt-block h3 {
  margin: 0;
  font-size: 1rem;
}

pre {
  max-height: 260px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #21302c;
  white-space: pre-wrap;
  background: #f4f7f2;
  border: 1px solid #e0e7dd;
  border-radius: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.settings-grid div {
  min-width: 0;
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

.settings-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-grid dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: auto auto;
    gap: 12px;
    padding: 0 18px;
  }

  .top-nav {
    display: none;
  }

  .header-action span {
    display: none;
  }

  .hero {
    min-height: 500px;
    padding: 54px 20px 34px;
  }

  h1 {
    font-size: 3.15rem;
  }

  .hero-copy {
    font-size: 1rem;
  }

  .catalog-shell,
  .rsya-note {
    width: min(100% - 28px, 1220px);
  }

  .section-heading,
  .filters,
  .rsya-note {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
  }

  .sort-control {
    min-width: 0;
  }

  .modal-panel {
    inset: 12px;
    grid-template-columns: 1fr;
    width: calc(100% - 24px);
    overflow: auto;
  }

  .modal-media {
    height: 340px;
    min-height: 340px;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 64px;
  }

  .brand-name {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero {
    min-height: 470px;
    background-position: 58% 24%;
  }

  h1 {
    font-size: 2.55rem;
  }

  .hero-search {
    min-height: 54px;
    padding-left: 13px;
  }

  .hero-search input {
    height: 52px;
    padding: 0 8px;
  }

  .section-heading h2,
  .modal-title-row h2,
  .rsya-note h2 {
    font-size: 1.55rem;
  }

  .gallery {
    columns: 1;
  }

  .photo-card h3,
  .photo-card p,
  .tag-list {
    min-height: 0;
  }

  .prompt-actions,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 22px 16px;
  }
}
