:root {
  color-scheme: dark;
  --page: #24282a;
  --surface: #2d3133;
  --surface-muted: #383d40;
  --ink: #f7f5ee;
  --muted: #b9bdbe;
  --line: rgba(247, 245, 238, 0.18);
  --accent: #ffe39c;
  --accent-strong: #d6a33c;
  --room-1: #85b8ae;
  --room-2: #b9969a;
  --room-3: #a9b98f;
  --room-4: #9eb0c7;
  --room-5plus: #c8ad72;
  --hover: #ffe39c;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(247, 245, 238, 0.12);
  background: rgba(36, 40, 42, 0.92);
  backdrop-filter: blur(22px);
}

.brand {
  color: var(--ink);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
}

.icon-button {
  width: 54px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
}

.icon-button span {
  display: block;
  height: 1px;
  background: var(--ink);
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink);
}

.top-actions a {
  color: inherit;
  text-decoration: none;
}

.pill-button,
.ghost-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  padding: 0 22px;
}

.pill-button {
  background: var(--surface);
}

main {
  padding: 44px clamp(16px, 4vw, 56px) 64px;
}

.gallery-intro {
  max-width: 1380px;
  margin: 0 auto 32px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.intro-row,
.section-heading,
.plan-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(42px, 8vw, 96px);
  font-weight: 400;
  line-height: 0.95;
}

h2 {
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 400;
  line-height: 1;
}

.intro-row p {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.55;
}

.selector-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.filters-panel,
.plan-wrap,
.projects-section {
  border: 1px solid rgba(247, 245, 238, 0.12);
  background: rgba(45, 49, 51, 0.78);
  box-shadow: var(--shadow);
}

.filters-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100%;
  padding: 26px;
}

.field,
.field-grid {
  display: grid;
  gap: 10px;
}

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

label,
legend {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

select,
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 0 14px;
}

select:focus,
input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(255, 227, 156, 0.45);
}

.field-large select {
  min-height: 58px;
  font-size: 20px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
}

.segmented button {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  background: var(--accent);
  color: #24282a;
}

.filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 8px;
}

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

.result-count span {
  color: var(--ink);
  font-size: 28px;
}

.plan-wrap {
  min-height: 560px;
  padding: clamp(20px, 3vw, 34px);
}

.plan-wrap.is-empty {
  display: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 13px;
  height: 13px;
  background: var(--room-color);
  display: inline-block;
}

.room-1 {
  --room-color: var(--room-1);
}

.room-2 {
  --room-color: var(--room-2);
}

.room-3 {
  --room-color: var(--room-3);
}

.room-4 {
  --room-color: var(--room-4);
}

.room-5plus {
  --room-color: var(--room-5plus);
}

.plan-canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  margin-top: 32px;
  overflow: hidden;
  background: #1d2022;
}

.plan-board {
  position: relative;
  width: min(100%, 940px);
  aspect-ratio: var(--plan-ratio, 841.9 / 595.3);
  overflow: hidden;
}

.plan-stage,
.plan-vector {
  position: absolute;
  inset: 0;
}

.plan-vector {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.plan-underlay {
  filter: grayscale(1) invert(1) brightness(1.75) contrast(1.28);
  opacity: 0.62;
  user-select: none;
  pointer-events: none;
}

.hotspots {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.apartment {
  cursor: pointer;
  outline: none;
}

.apartment-shape {
  fill: color-mix(in srgb, var(--room-color) 74%, transparent);
  opacity: 0.86;
  stroke: transparent;
  stroke-width: 0;
  transition:
    fill 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.apartment.is-filtered-out .apartment-shape {
  opacity: 0.08;
}

.apartment:hover .apartment-shape,
.apartment.is-hovered .apartment-shape {
  fill: color-mix(in srgb, var(--hover) 88%, transparent);
  opacity: 1;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.35));
}

.apartment:focus-visible .apartment-shape {
  stroke: var(--accent);
  stroke-width: 4;
}

.apartment-marker {
  position: absolute;
  left: var(--label-x);
  top: var(--label-y);
  z-index: 4;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.apartment-marker:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.apartment-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 88px;
  background: rgba(247, 245, 238, 0.92);
  color: #24282a;
  padding: 8px 10px;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(34, 39, 42, 0.12);
}

.apartment-label strong {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  background: var(--room-color);
  color: #24282a;
  font-weight: 600;
}

.apartment-marker:hover .apartment-label strong,
.apartment-marker.is-hovered .apartment-label strong {
  background: #24282a;
  color: var(--ink);
}

.projects-section {
  max-width: 1380px;
  margin: 18px auto 0;
  padding: clamp(20px, 3vw, 34px);
}

.active-summary {
  color: var(--muted);
  line-height: 1.45;
  text-align: right;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.project-card {
  display: grid;
  min-width: 0;
  border: 1px solid rgba(247, 245, 238, 0.12);
  background: var(--surface);
  color: inherit;
  overflow: hidden;
  text-decoration: none;
}

.project-card:hover .project-image img {
  transform: scale(1.04);
}

.project-card.is-related {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(255, 227, 156, 0.45);
}

.project-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-muted);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.58) brightness(0.76) contrast(1.08);
  transition: transform 220ms ease;
}

.project-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  background: #f7f5ee;
  color: #24282a;
  padding: 0 12px;
}

.project-badge i {
  width: 10px;
  height: 10px;
  background: var(--room-color);
}

.project-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.project-title {
  min-height: 56px;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.25;
}

.project-meta,
.project-stats,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span,
.tag {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 8px;
  font-size: 12px;
}

.project-stats {
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.project-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rating-stars {
  position: relative;
  display: inline-block;
  width: 74px;
  height: 18px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.24);
  font-size: 16px;
  line-height: 18px;
  letter-spacing: 0;
  white-space: nowrap;
}

.rating-stars-base,
.rating-stars-fill {
  display: block;
}

.rating-stars-fill {
  position: absolute;
  inset: 0 auto 0 0;
  overflow: hidden;
  color: var(--accent);
}

.price {
  color: var(--ink);
  font-size: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
}

@media (max-width: 1080px) {
  .top-actions a {
    display: none;
  }

  .selector-shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 54px 1fr;
  }

  .brand {
    justify-self: end;
    font-size: 30px;
  }

  .top-actions {
    display: none;
  }

  main {
    padding: 28px 12px 44px;
  }

  .intro-row,
  .section-heading,
  .plan-heading {
    align-items: start;
    flex-direction: column;
  }

  .intro-row p,
  .active-summary {
    text-align: left;
  }

  .filters-panel,
  .plan-wrap,
  .projects-section {
    box-shadow: none;
  }

  .field-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .plan-wrap {
    min-height: 0;
  }

  .plan-canvas {
    min-height: 300px;
    margin-top: 22px;
  }

  .apartment-label {
    min-width: 0;
    font-size: 12px;
    padding: 6px;
  }

  .apartment-label strong {
    min-width: 26px;
    min-height: 26px;
  }
}
