:root {
  --dark: #2D2D2D;
  --white: #FFFFFF;
  --accent: #D4A373;
  --accent-dark: #b8865a;
  --bg: #f7f4f0;
  --muted: #7a746d;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(45, 45, 45, 0.08);
  --shadow-lg: 0 24px 60px rgba(45, 45, 45, 0.18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--dark);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(45, 45, 45, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--dark);
}

.logo-mark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--dark);
  padding: 6px 10px;
  border-radius: 10px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
}

.header-contacts {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-city {
  color: var(--muted);
  font-size: 14px;
}

.header-phone {
  color: var(--dark);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-phone:hover {
  color: var(--accent-dark);
}

/* Hero */

.hero {
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(212, 163, 115, 0.25), transparent 60%),
    linear-gradient(160deg, #232323 0%, var(--dark) 55%, #3a3530 100%);
  color: var(--white);
  padding: 64px 0 72px;
}

.hero-inner {
  display: block;
}

.hero-copy {
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(212, 163, 115, 0.45);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero .accent {
  color: var(--accent);
}

.hero-subtitle {
  margin-top: 22px;
  max-width: 520px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.72);
}

.hero-points {
  margin-top: 28px;
  list-style: none;
  display: grid;
  gap: 12px;
}

.hero-points li {
  position: relative;
  padding-left: 30px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}

.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 4px rgba(45, 45, 45, 0.85);
}

/* Planner */

.planner-section {
  padding: 56px 0 32px;
}

.planner-card {
  background: var(--white);
  border-radius: calc(var(--radius) + 6px);
  padding: 32px;
  box-shadow: var(--shadow);
}

.calc-title {
  font-size: 22px;
  font-weight: 700;
}

.calc-note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.planner-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 200px;
  gap: 20px;
  align-items: start;
  margin-top: 24px;
}

.planner-tools {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tool-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1.5px solid #e6e0d8;
  border-radius: 10px;
  background: #fbf9f7;
  color: var(--dark);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-btn:hover {
  border-color: var(--accent);
}

.tool-btn.is-active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.tool-row .tool-btn {
  justify-content: center;
  padding: 10px 0;
}

.material-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(45, 45, 45, 0.2);
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(45, 45, 45, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.is-active {
  border: 3px solid #2563eb;
}

.planner-canvas {
  min-width: 0;
}

#planner-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  border: 1.5px solid #e6e0d8;
  border-radius: 12px;
  background: #fdfcfa;
  user-select: none;
  -webkit-user-select: none;
}

#planner-empty {
  font-family: inherit;
  font-size: 14px;
  fill: var(--muted);
  pointer-events: none;
}

.planner-module rect {
  cursor: grab;
}

.planner-module.is-selected rect {
  cursor: grabbing;
}

.module-label {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  fill: var(--dark);
  pointer-events: none;
}

.module-sub {
  font-family: inherit;
  font-size: 9px;
  fill: rgba(45, 45, 45, 0.7);
  pointer-events: none;
}

.planner-total {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1.5px solid #e6e0d8;
  border-radius: 12px;
  padding: 16px;
  background: #fbf9f7;
}

.planner-total .field-label {
  margin-bottom: 0;
}

.total-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.total-note {
  font-size: 12px;
  color: var(--muted);
}

.prepay-btn {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.3;
  padding: 12px 10px;
}

/* Photo analysis */

.photo-analyzer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #eee7de;
}

.photo-title {
  font-size: 17px;
  font-weight: 700;
}

.photo-note {
  margin: 4px 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.photo-btn {
  width: auto;
  padding: 12px 20px;
  font-size: 14px;
  background: transparent;
  border: 1.5px dashed rgba(212, 163, 115, 0.9);
  color: var(--dark);
}

.photo-btn:hover {
  background: rgba(212, 163, 115, 0.12);
}

.photo-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.analysis-result {
  margin-top: 16px;
  padding: 16px;
  border: 1.5px solid #e6e0d8;
  border-radius: 12px;
  background: #fbf9f7;
}

.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.analysis-head .field-label {
  margin-bottom: 0;
}

.analysis-json {
  margin-top: 12px;
  font-family: Consolas, 'SFMono-Regular', Menlo, 'Liberation Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--dark);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

.analysis-result .form-message.info {
  margin-top: 12px;
  background: #2563eb;
  color: var(--white);
}

.analysis-json.info {
  color: #8a6134;
}

.analysis-json.error {
  color: #b53d3d;
}

/* Layout variants */

.layout-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.layout-options[hidden] {
  display: none;
}

.layout-btn {
  flex: 1 1 160px;
  border: none;
  border-radius: 12px;
  background: var(--dark);
  color: var(--white);
  padding: 13px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.layout-btn:hover {
  background: #4a4a4a;
}

.layout-btn:active {
  transform: translateY(1px);
}

/* Gallery of ready-made projects */

.gallery {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery h2 {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.01em;
}

.gallery-subtitle {
  margin: 8px 0 28px;
  color: var(--muted);
  font-size: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gallery-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.gallery-card .preview {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
}

.gallery-card .preview .swatch {
  width: 60px;
  height: 100px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.gallery-card h3 {
  padding: 0 16px 8px;
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}

.gallery-card .price {
  padding: 0 16px 16px;
  color: #2563eb;
  font-weight: 600;
  font-size: 16px;
}

.gallery-card button {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 12px;
  background: #1f2937;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}

.gallery-card button:hover {
  background: #374151;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile move controls (hidden on desktop) */

.move-controls {
  display: none;
}

/* Fields (lead form) */

.field {
  display: block;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input,
.field select {
  width: 100%;
  appearance: none;
  border: 1.5px solid #e6e0d8;
  border-radius: 12px;
  background: #fbf9f7;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(212, 163, 115, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-accent {
  background: var(--accent);
  color: var(--dark);
}

.btn-accent:hover {
  background: var(--accent-dark);
  color: var(--white);
}

.btn-accent:active {
  transform: translateY(1px);
}

/* Lead section */

.lead-section {
  padding: 48px 0 88px;
}

.lead-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.lead-copy h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead-copy p {
  margin-top: 18px;
  max-width: 440px;
  color: var(--muted);
  font-size: 16px;
}

.lead-form {
  background: var(--white);
  border-radius: calc(var(--radius) + 6px);
  padding: 32px;
  box-shadow: var(--shadow);
}

.form-message {
  margin-top: 16px;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
}

.planner-total .form-message {
  font-size: 13px;
  padding: 10px 12px;
}

.form-message.success {
  background: rgba(76, 153, 99, 0.12);
  color: #2e7d4f;
}

.form-message.error {
  background: rgba(198, 71, 71, 0.1);
  color: #b53d3d;
}

.form-message.info {
  background: rgba(212, 163, 115, 0.16);
  color: #8a6134;
}

.form-policy {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(45, 45, 45, 0.08);
  background: var(--white);
  padding: 26px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}

.footer-inner a {
  color: var(--dark);
  font-weight: 600;
  text-decoration: none;
}

/* Responsive */

@media (max-width: 920px) {
  .hero {
    padding: 56px 0 64px;
  }

  .lead-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .lead-section {
    padding: 40px 0 64px;
  }
}

@media (max-width: 767px) {
  .planner-card {
    padding: 24px 20px;
  }

  .planner-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .planner-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .tool-group:first-child {
    grid-column: 1 / -1;
  }

  .planner-total {
    gap: 8px;
  }

  .move-controls {
    display: block;
    margin-top: 14px;
  }

  .move-hint {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 10px;
  }

  .move-grid {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(2, 44px);
    gap: 6px;
    justify-content: center;
  }

  .move-up {
    grid-column: 2;
    grid-row: 1;
  }

  .move-left {
    grid-column: 1;
    grid-row: 2;
  }

  .move-down {
    grid-column: 2;
    grid-row: 2;
  }

  .move-right {
    grid-column: 3;
    grid-row: 2;
  }

  .move-btn {
    border: 1.5px solid #e6e0d8;
    background: var(--white);
    border-radius: 10px;
    font-size: 18px;
    font-family: inherit;
    color: var(--dark);
    cursor: pointer;
  }

  .move-btn:active {
    background: rgba(37, 99, 235, 0.08);
    border-color: #2563eb;
  }
}

@media (max-width: 560px) {
  .header-city {
    display: none;
  }

  .logo-text {
    display: none;
  }

  .lead-form {
    padding: 24px 20px;
  }

  .hero-points li {
    font-size: 14px;
  }
}
