:root {
  --ink: #151511;
  --muted: #696b63;
  --paper: #f4f0e8;
  --warm: #e7ded0;
  --line: rgba(21, 21, 17, 0.14);
  --accent: #b84c2a;
  --accent-dark: #8f3921;
  --white: #fffaf2;
  --shadow: 0 28px 80px rgba(21, 21, 17, 0.16);
  --header-height: 94px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: #e9e3d7;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

body.is-lightbox-open {
  overflow: hidden;
}

.page-shell {
  width: min(100%, 1280px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  right: auto;
  width: min(100%, 1280px);
  transform: translateX(-50%);
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  height: var(--header-height);
  padding: 0 clamp(18px, 4vw, 56px);
  color: var(--white);
  background: linear-gradient(180deg, rgba(14, 14, 10, 0.72), rgba(14, 14, 10, 0));
  transition:
    color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
}

.site-header.is-scrolled {
  color: var(--ink);
  background: rgba(244, 240, 232, 0.94);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(16px);
}

.brand,
.nav-links,
.hero-actions,
.contact-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
}

.brand-logo {
  width: 87px;
  height: 87px;
  display: block;
  object-fit: contain;
}

.nav-links {
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
  font-size: 18px;
  font-weight: 700;
}

.nav-links a,
.header-phone {
  opacity: 0.84;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.nav-links a:hover,
.header-phone:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.header-phone {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.hero {
  position: relative;
  min-height: 50svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--white);
  background-image:
    linear-gradient(90deg, rgba(10, 10, 8, 0.82), rgba(10, 10, 8, 0.42) 46%, rgba(10, 10, 8, 0.14)),
    url("heroimg.png");
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, rgba(244, 240, 232, 0), var(--paper));
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 250, 242, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 250, 242, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, black, transparent 70%);
  opacity: 0.52;
  transform: translateY(var(--hero-drift, 0px));
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100% - 36px));
  margin: calc(var(--header-height) + 46px) 0 clamp(44px, 7vh, 76px) clamp(18px, 7vw, 96px);
  animation: heroIn 760ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f7c3a5;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 1050px;
  margin-bottom: 22px;
  font-size: clamp(49px, 6.46vw, 99px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(36px, 6vw, 86px);
  line-height: 0.93;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 34px;
  color: rgba(255, 250, 242, 0.9);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.35;
}

.hero-actions,
.contact-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--white);
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-ghost {
  color: var(--white);
  border-color: rgba(255, 250, 242, 0.58);
  background: rgba(255, 250, 242, 0.08);
  backdrop-filter: blur(14px);
}

.button-ghost.dark {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
  backdrop-filter: none;
}

.button-full {
  width: 100%;
}

.service-item span,
.work-item figcaption span {
  color: #f7c3a5;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.services,
.portfolio,
.quote-section,
.contact-band {
  padding: clamp(82px, 11vw, 150px) clamp(18px, 6vw, 88px);
}

.media-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: clamp(520px, 45vw, 620px);
  background: var(--paper);
}

.media-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(42px, 6vw, 88px) clamp(18px, 5vw, 64px);
}

.media-copy > p {
  max-width: 520px;
}

.media-copy h2 {
  max-width: 430px;
  font-size: clamp(38px, 4.2vw, 58px);
  line-height: 1.14;
  margin-bottom: 26px;
}

.media-copy p,
.quote-intro p,
.contact-band p,
.service-item p {
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.6;
}

.fact-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: clamp(28px, 5vw, 70px);
}

.fact-row div {
  min-width: 0;
  padding: 24px 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.fact-row div + div {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.fact-row strong,
.fact-row span {
  display: block;
}

.fact-row strong {
  color: var(--accent);
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.05;
  white-space: nowrap;
}

.fact-row span {
  margin-top: 8px;
  color: var(--muted);
}

.video-frame {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #000;
}

.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #000;
}

.video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
}

.section-head {
  max-width: 940px;
  margin-bottom: clamp(34px, 6vw, 74px);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.service-item {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 50px);
  background: var(--paper);
}

.service-item span {
  color: var(--accent);
}

.service-item > div {
  max-width: 280px;
}

.portfolio {
  background: var(--warm);
}

.work-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(190px, 0.72fr));
  grid-auto-rows: minmax(240px, 29vw);
  gap: 14px;
}

.work-item {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  margin: 0;
  border-radius: 8px;
  background: #d8d2c4;
  cursor: zoom-in;
}

.work-item-large {
  grid-row: span 2;
}

.work-item:nth-child(4) {
  grid-column: span 2;
}

.work-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition:
    transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 700ms ease;
}

.work-item:hover img {
  transform: scale(1.045);
  filter: saturate(1.06);
}

.work-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(21, 21, 17, 0), rgba(21, 21, 17, 0.72));
  pointer-events: none;
}

.work-item figcaption {
  position: absolute;
  left: clamp(18px, 3vw, 30px);
  right: clamp(18px, 3vw, 30px);
  bottom: clamp(18px, 3vw, 30px);
  z-index: 1;
  color: var(--white);
  pointer-events: none;
}

.work-item figcaption span,
.work-item figcaption strong {
  display: block;
}

.work-item figcaption span {
  margin-bottom: 8px;
}

.work-item figcaption strong {
  max-width: 430px;
  font-size: clamp(20px, 2.4vw, 34px);
  line-height: 1.05;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 40px 72px;
  background: rgba(10, 10, 8, 0.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 144px);
  max-height: calc(100svh - 80px);
  object-fit: contain;
}

.lightbox-button {
  position: absolute;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 250, 242, 0.24);
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 250, 242, 0.08);
  font: inherit;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.lightbox-button:hover {
  border-color: rgba(255, 250, 242, 0.54);
  background: rgba(255, 250, 242, 0.16);
  transform: translateY(-1px);
}

.lightbox-close {
  top: 24px;
  right: 24px;
  font-size: 30px;
}

.lightbox-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  transform: translateY(calc(-50% - 1px));
}

.quote-section {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 0.72fr);
  gap: clamp(34px, 7vw, 100px);
  align-items: start;
}

.quote-intro {
  max-width: 720px;
}

.quote-tool {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 3vw, 34px);
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.field-row,
.contact-grid label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 50px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid rgba(21, 21, 17, 0.2);
  border-radius: 5px;
  padding: 0 14px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 76, 42, 0.16);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  background: var(--warm);
  border-radius: 6px;
}

.segmented-two {
  grid-template-columns: repeat(2, 1fr);
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.segmented input:checked + span {
  color: var(--ink);
  background: var(--white);
}

.estimate {
  display: grid;
  gap: 8px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.estimate span,
.estimate small {
  color: var(--muted);
}

.estimate strong {
  color: var(--accent);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

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

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: end;
  background: var(--warm);
}

.contact-band h2 {
  max-width: 840px;
}

.contact-band p {
  max-width: 580px;
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 6vw, 88px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer a {
  color: var(--ink);
  font-weight: 900;
}

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 720ms ease,
    transform 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }

  .nav-links {
    display: none;
  }

  .media-proof,
  .quote-section,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .service-grid,
  .work-gallery {
    grid-template-columns: 1fr;
  }

  .service-item {
    min-height: 230px;
  }

  .work-gallery {
    grid-auto-rows: minmax(300px, 58vw);
  }

  .work-item-large,
  .work-item:nth-child(4) {
    grid-column: auto;
    grid-row: span 1;
  }
}

@media (max-width: 680px) {
  :root {
    --header-height: 83px;
  }

  .site-header {
    padding-inline: 16px;
  }

  .brand {
    gap: 10px;
    font-size: 17px;
  }

  .brand-logo {
    width: 72px;
    height: 72px;
  }

  .brand span:last-child {
    max-width: 128px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-phone {
    max-width: 92px;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  .header-phone::after {
    content: "Позвонить";
    color: var(--white);
  }

  .site-header.is-scrolled .header-phone::after {
    color: var(--ink);
  }

  .hero {
    min-height: min(58svh, 560px);
    background-position: 58% center;
  }

  .hero-inner {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    margin: calc(var(--header-height) + 34px) 16px 48px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(41px, 12.75vw, 56px);
    line-height: 1.04;
  }

  .hero-copy {
    max-width: 330px;
    font-size: 17px;
    overflow-wrap: break-word;
  }

  .hero-actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .media-proof,
  .services,
  .portfolio,
  .quote-section,
  .contact-band {
    padding-inline: 16px;
  }

  .media-proof {
    min-height: auto;
    padding-inline: 0;
  }

  .media-copy {
    padding: 58px 16px;
  }

  .media-copy > p {
    max-width: 100%;
  }

  .media-copy h2 {
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.08;
  }

  .fact-row,
  .contact-grid,
  .segmented {
    grid-template-columns: 1fr;
  }

  .fact-row {
    gap: 0;
  }

  .fact-row div {
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
  }

  .fact-row div + div {
    border-left: 0;
    padding-left: 0;
  }

  .fact-row div:last-child {
    border-bottom: 0;
  }

  .fact-row strong {
    font-size: clamp(34px, 12vw, 48px);
  }

  .video-frame {
    border-radius: 0;
  }

  .video-frame video {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }

  .service-item {
    min-height: 210px;
  }

  .work-gallery {
    gap: 10px;
    grid-auto-rows: minmax(300px, 86vw);
  }

  .work-item {
    border-radius: 6px;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox-image {
    max-width: calc(100vw - 32px);
    max-height: calc(100svh - 108px);
  }

  .lightbox-button {
    width: 44px;
    height: 44px;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .lightbox-prev {
    left: 16px;
  }

  .lightbox-next {
    right: 16px;
  }

  .lightbox-prev:hover,
  .lightbox-next:hover {
    transform: translateY(-1px);
  }

  .quote-tool {
    padding: 18px;
  }

  .site-footer {
    flex-direction: column;
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
