/* ===== Base ===== */
:root {
  --ink: #201c18;
  --ink-soft: #4a443d;
  --paper: #faf7f2;
  --paper-alt: #f1ebe1;
  --line: #e3dbcc;
  --wood: #a9702c;
  --wood-dark: #7c4f1c;
  --charcoal: #21201e;
  --charcoal-soft: #33312d;
  --radius: 14px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Montserrat', 'Manrope', sans-serif;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .5em;
  line-height: 1.15;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

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

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 72px 0; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: invert(9%) sepia(9%) saturate(700%) hue-rotate(0deg) brightness(85%);
}

.main-nav {
  display: flex;
  gap: 28px;
}

.main-nav a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

.main-nav a:hover { color: var(--wood-dark); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-phone {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform .2s, opacity .2s;
}

.burger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  transition: transform .15s ease, background .15s ease, color .15s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--charcoal);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-2px); background: var(--wood-dark); }

.btn-outline {
  border-color: var(--charcoal);
  color: var(--charcoal);
}
.btn-outline:hover { transform: translateY(-2px); background: var(--charcoal); color: #fff; }

/* ===== Hero ===== */
.hero {
  padding: 56px 0 64px;
  background: linear-gradient(180deg, var(--paper-alt) 0%, var(--paper) 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  margin-bottom: .4em;
}

.hero-sub {
  font-size: 17px;
  max-width: 46ch;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(33, 28, 20, 0.35);
  aspect-ratio: 4 / 4.4;
}

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

.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 20px;
  background: linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,0));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* ===== Facts ===== */
.facts {
  padding: 0 0 8px;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 40px 24px;
  background: var(--charcoal);
  border-radius: var(--radius);
  margin: 0 24px;
  max-width: calc(var(--max) - 48px);
}

.fact {
  color: #f4efe6;
  padding: 4px 8px;
}

.fact-num {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #e7a95c;
  margin-bottom: 10px;
}

.fact p {
  color: #cfc9bd;
  font-size: 14.5px;
  margin: 0;
}

/* ===== Services ===== */
.services h2, .portfolio h2, .process h2, .about h2, .contacts h2 {
  font-size: clamp(26px, 3vw, 34px);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.service-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -24px rgba(33,28,20,.25);
}

.service-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.service-card p {
  font-size: 14.5px;
  margin: 0;
}

/* ===== Portfolio ===== */
.portfolio { background: var(--paper-alt); }

.portfolio-intro {
  font-size: 17px;
  max-width: 60ch;
  margin-top: -4px;
}

.case {
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.case:first-of-type {
  margin-top: 40px;
}

.case-head h3 {
  font-size: clamp(22px, 2.6vw, 28px);
}

.case-head p {
  max-width: 72ch;
  font-size: 16px;
}

.case-gallery {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.grid-square {
  grid-template-columns: repeat(4, 1fr);
}

.grid-square img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
}

.grid-portrait {
  grid-template-columns: repeat(4, 1fr);
}

.grid-portrait-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
}

/* ===== Process ===== */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.process-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--charcoal);
  color: #e7a95c;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 16px;
}

.process-step h3 {
  font-size: 17px;
}

.process-step p {
  font-size: 14.5px;
  margin: 0;
}

/* ===== About ===== */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.about-text p {
  font-size: 16px;
}

.about-links {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.about-links a {
  padding: 10px 20px;
  border: 2px solid var(--charcoal);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.about-links a:hover {
  background: var(--charcoal);
  color: #fff;
}

.about-media {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: 0 30px 60px -24px rgba(33,28,20,.3);
}

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

/* ===== Contacts ===== */
.contacts { background: var(--charcoal); }

.contacts h2 { color: #fff; }

.contacts-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}

.contacts-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 22px;
}

.contacts-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contacts-label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #a89f8f;
  font-weight: 700;
}

.contacts-list a, .contacts-list span:not(.contacts-label) {
  color: #f4efe6;
  font-size: 17px;
  font-weight: 600;
}

.contacts-list a { margin-right: 16px; }
.contacts-list a:hover { color: #e7a95c; }

.contacts-map {
  min-height: 220px;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 220px;
  background: var(--charcoal-soft);
  border: 1px dashed #5b564c;
  border-radius: var(--radius);
  padding: 26px;
  color: #f4efe6;
}

.map-placeholder span:first-child {
  font-size: 17px;
  font-weight: 700;
  max-width: 20ch;
}

.map-link {
  font-weight: 700;
  color: #e7a95c;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--charcoal);
  border-top: 1px solid #3a372f;
  padding: 32px 0 40px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f4efe6;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}

.footer-brand .brand-logo { filter: invert(1) brightness(1.3); }

.footer-legal, .footer-copy {
  color: #9a9284;
  font-size: 13px;
  margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; aspect-ratio: 16/10; max-width: 560px; margin: 0 auto; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; }
  .about-media { order: -1; }
  .contacts-inner { grid-template-columns: 1fr; }
  .facts-grid { grid-template-columns: 1fr; }
  .grid-square { grid-template-columns: repeat(3, 1fr); }
  .grid-portrait { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 12px 24px 20px;
    gap: 4px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .burger { display: flex; }
  .header-phone { display: none; }
  section { padding: 52px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .grid-square { grid-template-columns: repeat(2, 1fr); }
  .grid-portrait { grid-template-columns: repeat(2, 1fr); }
  .grid-portrait-3 { grid-template-columns: repeat(2, 1fr); }
  .facts-grid { margin: 0 16px; padding: 32px 20px; }
  .wrap { padding: 0 18px; }
  .case { margin-top: 40px; padding-top: 36px; }
  .contacts-list a { display: inline-block; margin: 0 16px 8px 0; }
}

@media (max-width: 420px) {
  .grid-square { grid-template-columns: repeat(2, 1fr); }
  .btn { width: 100%; }
  .hero-cta { flex-direction: column; }
}
