:root {
  --paper: #f5f1e9;
  --paper-2: #ece5da;
  --surface: #fffdf8;
  --surface-muted: #faf7f0;
  --ink: #242925;
  --muted: #666e68;
  --line: #d8cfc1;
  --line-strong: #c2b5a4;
  --green: #49654d;
  --green-dark: #2f4638;
  --wood: #a36b3f;
  --sage: #dce2d4;
  --sand: #e5d7c2;
  --radius: 8px;
  --shadow: 0 16px 38px rgba(36, 41, 37, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

h1 {
  max-width: 700px;
  margin-bottom: 18px;
  font-size: clamp(44px, 4.8vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 66px;
  padding: 12px clamp(20px, 4vw, 56px);
  background: rgba(245, 241, 233, 0.96);
  border-bottom: 1px solid rgba(216, 207, 193, 0.92);
  backdrop-filter: blur(14px);
}

.site-header > * {
  min-width: 0;
}

.brand,
.nav,
.hero-actions,
.project-title-row,
.project-bottom {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--green-dark);
  color: #fff;
  font-size: 13px;
}

.nav {
  gap: 20px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--ink);
}

.header-action,
.primary-button,
.secondary-button,
.option-button {
  min-height: 44px;
  border-radius: 7px;
  cursor: pointer;
}

.header-action,
.primary-button {
  border: 1px solid var(--green-dark);
  background: var(--green-dark);
  color: #fff;
  font-weight: 700;
}

.header-action {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  white-space: nowrap;
}

.primary-button {
  padding: 0 20px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink);
  font-weight: 700;
}

.primary-button:hover,
.header-action:hover,
.chat-float:hover {
  background: #263b30;
}

.secondary-button:hover,
.option-button:hover {
  border-color: var(--green);
}

.section {
  padding: clamp(58px, 8vw, 94px) clamp(20px, 5vw, 72px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.72fr);
  gap: clamp(30px, 5vw, 68px);
  align-items: center;
  min-height: min(720px, calc(100vh - 66px));
  padding-top: clamp(38px, 5vw, 60px);
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.hero-copy,
.section-heading,
.project-content,
.offer-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-text {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 24px;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 700px;
  margin: 0;
}

.hero-facts div {
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.58);
}

.hero-facts dt {
  margin-bottom: 5px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.hero-facts dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.hero-visual {
  position: relative;
  align-self: stretch;
  display: grid;
  align-content: center;
}

.house-frame {
  min-height: clamp(300px, 36vw, 430px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.image-placeholder {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background-color: var(--sage);
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(36, 41, 37, 0.08);
  isolation: isolate;
}

.image-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(36, 41, 37, 0.02) 0%, rgba(36, 41, 37, 0.14) 100%);
  pointer-events: none;
}

.image-placeholder span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 5px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.image-start {
  background-image: url("assets/domosfera-start-36.jpg");
}

.image-komfort {
  background-image: url("assets/domosfera-komfort-52.jpg");
}

.image-semeyny {
  background-image: url("assets/domosfera-semeyny-72.jpg");
}

.image-barn {
  background-image: url("assets/domosfera-barn-85.jpg");
}

.image-duplex {
  background-image: url("assets/domosfera-duplex-arenda-96.jpg");
}

.hero-note {
  width: calc(100% - 36px);
  margin: -34px auto 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.97);
  box-shadow: 0 12px 26px rgba(36, 41, 37, 0.11);
}

.hero-note .muted {
  margin-bottom: 5px;
}

.hero-note strong,
.hero-note span {
  display: block;
}

.hero-note span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(130px, 0.22fr) minmax(0, 0.78fr);
  gap: 28px;
  align-items: start;
  max-width: 1080px;
  margin-bottom: 30px;
}

.section-heading p:not(.eyebrow) {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.section-heading.compact {
  display: block;
  max-width: 740px;
}

.projects-section,
.advantages-section,
.faq-section {
  background: var(--surface-muted);
}

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

.project-card,
.package-card,
.advantages-grid article,
.build-steps li,
.faq-list details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-card {
  overflow: hidden;
  display: flex;
  grid-column: span 2;
  flex-direction: column;
}

.project-card:nth-child(4) {
  grid-column: 2 / span 2;
}

.project-card:nth-child(5) {
  grid-column: 4 / span 2;
}

.project-image {
  min-height: 190px;
  border-width: 0 0 1px;
  border-radius: 0;
}

.project-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.project-title-row {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.project-title-row h3 {
  margin: 0;
}

.project-title-row span {
  color: var(--green-dark);
  font-weight: 800;
  white-space: nowrap;
}

.project-purpose,
.project-meta,
.project-price,
.catalog-note,
.offer-copy p,
.advantages-grid p,
.package-card p,
.build-steps p,
.faq-list p,
.final-cta p {
  color: var(--muted);
}

.project-purpose {
  min-height: 72px;
  margin-bottom: 0;
  font-size: 15px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 16px;
  font-size: 13px;
}

.project-meta span {
  padding: 4px 8px;
  border-radius: 5px;
  background: #eee7dc;
  color: #4d554f;
}

.project-bottom {
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.project-price {
  margin: 0;
  font-size: 14px;
}

.project-price strong,
.project-price span {
  display: block;
}

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

.project-card .secondary-button {
  min-height: 42px;
  white-space: nowrap;
}

.catalog-note {
  max-width: 760px;
  margin: 24px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--wood);
  font-size: 16px;
}

.offer-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  background: var(--green-dark);
  color: #fff;
}

.offer-copy {
  max-width: 760px;
}

.offer-section .eyebrow,
.final-cta .eyebrow {
  color: #dfe7d8;
}

.offer-copy p,
.final-cta p {
  max-width: 660px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
}

.offer-section .primary-button,
.final-cta .primary-button {
  border-color: #fff;
  background: #fff;
  color: var(--green-dark);
}

.advantages-grid,
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.advantages-grid article {
  padding: 20px;
}

.advantages-grid span {
  display: block;
  margin-bottom: 24px;
  color: var(--wood);
  font-size: 13px;
  font-weight: 800;
}

.advantages-grid p,
.package-card p,
.build-steps p {
  margin-bottom: 0;
}

.packages-section,
.build-section {
  background: var(--paper);
}

.package-card {
  padding: 22px;
}

.package-card.featured {
  border-color: var(--green);
  background: #fbfbf5;
  box-shadow: 0 12px 28px rgba(36, 41, 37, 0.08);
}

.packages-section > .secondary-button {
  margin-top: 22px;
}

.build-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.build-steps li {
  padding: 22px 20px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.build-steps li:last-child {
  border-right: 0;
}

.build-steps span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--wood);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.faq-list {
  display: grid;
  gap: 10px;
  max-width: 920px;
  margin-top: 28px;
}

.faq-list details {
  padding: 0;
}

.faq-list summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 800;
}

.faq-list p {
  margin: 0;
  padding: 0 20px 18px;
}

.final-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  background: var(--green-dark);
  color: #fff;
}

.final-cta h2 {
  max-width: 760px;
}

.chat-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
}

.chat-float {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 14px 34px rgba(36, 41, 37, 0.22);
  cursor: pointer;
  font-weight: 800;
}

.chat-float span:first-child {
  font-size: 15px;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  display: none;
  width: min(390px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 58px rgba(36, 41, 37, 0.22);
}

.chat-panel.open {
  display: block;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: var(--green-dark);
  color: #fff;
}

.chat-header span {
  display: block;
  opacity: 0.82;
  font-size: 12px;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: min(430px, 58vh);
  overflow-y: auto;
  padding: 14px;
}

.chat-options {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #f6f1e9;
}

.message {
  width: fit-content;
  max-width: 88%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.message.consultant {
  background: #fff;
  border: 1px solid var(--line);
}

.message.client {
  margin-left: auto;
  background: var(--green-dark);
  color: #fff;
}

.option-button {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.contact-row {
  display: flex;
  gap: 8px;
}

.contact-row input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.contact-row button {
  min-width: 86px;
  min-height: 42px;
}

.summary-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.summary-box strong {
  display: block;
  margin-bottom: 8px;
}

.summary-box dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.summary-box div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
}

.summary-box dt {
  color: var(--muted);
}

.summary-box dd {
  margin: 0;
  font-weight: 700;
}

.muted {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .build-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .build-steps li:nth-child(3) {
    border-right: 0;
  }

  .build-steps li:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 1100px) {
  .project-card,
  .project-card:nth-child(4),
  .project-card:nth-child(5) {
    grid-column: span 3;
  }

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

@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .header-action {
    margin-left: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .section-heading,
  .offer-section,
  .final-cta {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 8px;
  }

  .build-steps {
    grid-template-columns: 1fr;
  }

  .build-steps li,
  .build-steps li:nth-child(3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .build-steps li:nth-child(n + 4) {
    border-top: 0;
  }

  .build-steps li:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 12px 16px;
  }

  .brand,
  .header-action {
    width: 100%;
  }

  .nav {
    width: 100%;
    max-width: calc(100vw - 32px);
    gap: 16px;
  }

  .header-action {
    margin-left: 0;
  }

  .section {
    padding: 48px 16px;
  }

  .hero {
    padding-top: 34px;
    padding-bottom: 28px;
  }

  h1 {
    font-size: 33px;
    line-height: 1.12;
  }

  h2 {
    font-size: 26px;
  }

  h3 {
    font-size: 18px;
  }

  .hero-text,
  .offer-copy p,
  .final-cta p {
    font-size: 16px;
  }

  .hero-actions,
  .contact-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .header-action {
    width: 100%;
    min-height: 44px;
  }

  .hero-facts,
  .advantages-grid,
  .package-grid {
    grid-template-columns: 1fr;
  }

  .hero-facts div {
    min-height: 0;
  }

  .house-frame {
    min-height: 270px;
  }

  .hero-note {
    width: 100%;
    margin-top: 10px;
  }

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

  .project-card,
  .project-card:nth-child(4),
  .project-card:nth-child(5) {
    grid-column: auto;
  }

  .project-image {
    min-height: 178px;
  }

  .project-purpose {
    min-height: 0;
  }

  .project-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  .project-card .secondary-button {
    width: 100%;
  }

  .summary-box div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .chat-dock {
    right: 14px;
    bottom: 14px;
  }

  .chat-float {
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
  }

  .chat-float-text {
    display: none;
  }

  .chat-panel {
    position: fixed;
    right: 12px;
    bottom: 76px;
    left: 12px;
    width: auto;
  }

  .chat-body {
    max-height: 52vh;
  }
}
