:root {
  --navy-deep: #060b18;
  --navy: #0b1730;
  --navy-light: #10203f;
  --gold: #cda45e;
  --gold-light: #f0d9a8;
  --gold-soft: #e8c98a;
  --silver: #c9ced8;
  --text-muted: #9aa4bb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Анти-мелькание: настраиваемые тексты скрыты, пока не применён config,
   затем плавно проявляются. Фоновые изображения слайда видны сразу. */
.hero-content,
.section-title,
.contacts-grid,
.custom-block .cb-content,
.site-footer .footer-inner {
  transition: opacity 0.35s ease;
}
.cfg-loading .hero-content,
.cfg-loading .section-title,
.cfg-loading .contacts-grid,
.cfg-loading .custom-block .cb-content,
.cfg-loading .site-footer .footer-inner {
  opacity: 0;
}

body {
  font-family: var(--cfg-body-font, Tahoma, Verdana, sans-serif);
  font-style: var(--cfg-body-style, normal);
  background: var(--navy-deep);
  color: #fff;
  min-height: 100vh;
}

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

/* ---------- Hero contacts (overlay, top-right) ---------- */

.hero-contacts {
  position: absolute;
  top: 26px;
  right: 40px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #eef0f5;
  text-decoration: none;
  font-size: var(--cfg-contacts-size, 16px);
  font-weight: var(--cfg-body-weight, 600);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  transition: color 0.25s ease;
}

.contact-item:hover { color: var(--gold-light); }

.contact-icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--navy-deep);
}

.hero-image {
  position: absolute;
  inset: 0;
  height: 100%;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(1.05) contrast(1.03);
}

.hero-image-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,
      rgba(6,11,24,0.1) 0%,
      rgba(6,11,24,0.05) 40%,
      rgba(6,11,24,0.72) 68%,
      rgba(6,11,24,0.92) 100%),
    linear-gradient(0deg, rgba(6,11,24,0.45) 0%, transparent 28%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 40px;
  padding: var(--cfg-offset-top, 108px) var(--cfg-offset-x, 64px) 48px;
  text-align: right;
}

.hero-content.v-center { justify-content: center; }
.hero-content.v-bottom { justify-content: flex-end; }

.hero-content.layout-left {
  align-items: flex-start;
  text-align: left;
}

.hero-content.layout-left .hero-panel,
.hero-content.layout-left .feature-list {
  align-items: flex-start;
}

.hero-content.layout-left .feature-card {
  flex-direction: row;
}

.hero.layout-left .hero-image-fade {
  background:
    linear-gradient(270deg,
      rgba(6,11,24,0.1) 0%,
      rgba(6,11,24,0.05) 40%,
      rgba(6,11,24,0.72) 68%,
      rgba(6,11,24,0.92) 100%),
    linear-gradient(0deg, rgba(6,11,24,0.45) 0%, transparent 28%);
}

.founder-note {
  max-width: var(--cfg-max-width, 430px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.founder-quote {
  font-family: var(--cfg-quote-font, Tahoma, Verdana, sans-serif);
  font-style: var(--cfg-quote-style, italic);
  font-weight: var(--cfg-quote-weight, 600);
  font-size: var(--cfg-quote-size, 19px);
  line-height: 1.5;
  color: var(--c-quote, #dcdfe8);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.founder-name {
  font-family: var(--cfg-quote-font, Tahoma, Verdana, sans-serif);
  font-style: var(--cfg-quote-style, italic);
  font-weight: var(--cfg-quote-weight, 600);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--c-quote, var(--gold-soft));
}

.hero-panel {
  width: 100%;
  max-width: var(--cfg-max-width, 440px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
}

.hero-title {
  font-family: var(--cfg-title-font, Tahoma, Verdana, sans-serif);
  font-weight: var(--cfg-title-weight, 700);
  font-style: var(--cfg-title-style, normal);
  font-size: var(--cfg-title-size, 27px);
  line-height: 1.3;
  color: var(--c-hero-title, #fdf9f0);
  letter-spacing: 0.01em;
}

.hero-title .accent {
  display: inline-block;
  font-size: var(--cfg-accent-size, 36px);
  color: var(--gold-light);
  text-shadow: 0 0 24px rgba(205,164,94,0.35);
}

.hero-subtitle {
  font-size: var(--cfg-subtitle-size, 15px);
  font-weight: var(--cfg-body-weight, 500);
  line-height: 1.6;
  color: var(--c-hero-text, var(--text-muted));
}

.hero-subtitle .accent {
  color: var(--gold-light);
  font-weight: 700;
}

.feature-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.feature-card {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 14px;
}

.feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(205, 164, 94, 0.35);
  background: rgba(205, 164, 94, 0.08);
  color: var(--gold-light);
}

.feature-icon svg { width: 20px; height: 20px; }

.feature-text {
  font-size: var(--cfg-feature-size, 14px);
  font-weight: var(--cfg-body-weight, 600);
  line-height: 1.4;
  color: var(--c-hero-text, #eef0f5);
}

.hero-cta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, #a9803e);
  color: #1a1206;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 12px 30px -8px rgba(205, 164, 94, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(26, 18, 6, 0.14);
  flex-shrink: 0;
}

.hero-cta-icon svg { width: 18px; height: 18px; }

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -8px rgba(205, 164, 94, 0.7);
}

/* ---------- Clients marquee ---------- */

.clients-strip {
  position: relative;
  overflow: hidden;
  background: var(--navy-deep);
  border-top: 1px solid rgba(205, 164, 94, 0.22);
  border-bottom: 1px solid rgba(205, 164, 94, 0.22);
}

.clients-track {
  display: flex;
  width: max-content;
  animation: clients-scroll 55s linear infinite;
}

.clients-strip:hover .clients-track {
  animation-play-state: paused;
}

.clients-group {
  display: flex;
}

.clients-group img {
  display: block;
  height: 110px;
  width: auto;
  flex-shrink: 0;
  filter: grayscale(1) brightness(0.55);
  transition: filter 0.4s ease;
}

.clients-group img:hover {
  filter: grayscale(0) brightness(1);
}

@keyframes clients-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Section title ---------- */

.section-title {
  font-family: var(--cfg-title-font, Tahoma, Verdana, sans-serif);
  font-weight: var(--cfg-title-weight, 700);
  font-style: var(--cfg-title-style, normal);
  font-size: 32px;
  letter-spacing: 0.02em;
  color: var(--c-section-title, var(--gold-light));
  text-align: center;
  padding: 0 20px 30px;
}

.works { padding-top: var(--sp-works, 54px); }
.contacts-block { padding-top: var(--sp-contacts, 54px); }
.clients-title { padding-top: var(--sp-clients, 0px); }
.clients-strip { margin-top: var(--sp-clients-strip, 0px); }

/* ---------- Works marquee ---------- */

.works-strip {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 1px solid rgba(205, 164, 94, 0.22);
  border-bottom: 1px solid rgba(205, 164, 94, 0.22);
  cursor: grab;
}
.works-strip::-webkit-scrollbar { display: none; }
.works-strip.dragging { cursor: grabbing; }

.works-track {
  display: flex;
  width: max-content;
}

.work-item {
  position: relative;
  height: var(--cfg-works-height, 320px);
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}

.work-item img {
  height: 100%;
  width: auto;
  display: block;
  pointer-events: none;
}

.work-item.placeholder {
  width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy-light), var(--navy));
  border-right: 1px solid rgba(205,164,94,0.14);
}

.work-ph {
  color: var(--text-muted);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 34px 16px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-work-caption, #f4f0e6);
  background: linear-gradient(0deg, rgba(4,7,15, var(--works-shade, 0.85)) 0%, transparent 100%);
}

/* ---------- Contacts block ---------- */

.contacts-grid {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.05fr;
  gap: 20px;
  align-items: stretch;
}

.contact-card {
  background: linear-gradient(165deg, rgba(13,25,50,0.75), rgba(7,14,29,0.75));
  border: 1px solid rgba(205, 164, 94, 0.22);
  border-radius: 18px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-title {
  font-family: var(--cfg-title-font, Tahoma, Verdana, sans-serif);
  font-weight: var(--cfg-title-weight, 700);
  font-style: var(--cfg-title-style, normal);
  font-size: 21px;
  color: var(--c-section-title, var(--gold-light));
  letter-spacing: 0.02em;
}

.c-line {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: var(--c-contacts-text, #eef0f5);
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.45;
  transition: color .25s;
}
a.c-line:hover { color: var(--gold-light); }

.c-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--gold);
}

.c-info {
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-contacts-text, var(--text-muted));
  white-space: pre-line;
  margin-top: auto;
}

.lead-form input,
.lead-form textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: #eef0f5;
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  resize: vertical;
  transition: border-color .2s;
}
.lead-form input:focus, .lead-form textarea:focus { border-color: var(--gold); }
.lead-form input::placeholder, .lead-form textarea::placeholder { color: #77809a; }

.lead-submit {
  padding: 13px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, #a9803e);
  box-shadow: 0 10px 26px -10px rgba(205,164,94,0.55);
  transition: transform .2s, box-shadow .2s;
}
.lead-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(205,164,94,0.7); }

.form-hint { font-size: 11.5px; color: #77809a; line-height: 1.45; }

.map-card { padding: 26px 24px 24px; }
.map-card iframe {
  width: 100%;
  flex: 1;
  min-height: 240px;
  border: none;
  border-radius: 12px;
  filter: grayscale(0.35) contrast(1.02);
}

/* ---------- Custom blocks (конструктор) ---------- */

.custom-block {
  position: relative;
  overflow: hidden;
  background: var(--navy);
}

.cb-media {
  position: relative;
  height: var(--cbh, 420px);
  overflow: hidden;
}

.cb-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-img-m { display: none; } /* мобильная картинка показывается только на узких экранах */

.custom-block.fit-auto .cb-media { height: auto; }
.custom-block.fit-auto .cb-media img {
  position: static;
  inset: auto;
  width: 100%;
  height: auto;
}

.cb-shade { position: absolute; inset: 0; }

.cb-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  max-width: 1220px;
  margin: 0 auto;
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.cb-right .cb-content { align-items: flex-end; text-align: right; }
.cb-left .cb-content { align-items: flex-start; text-align: left; }
.cb-center .cb-content { align-items: center; text-align: center; }

.cb-title {
  font-family: var(--cfg-title-font, Tahoma, Verdana, sans-serif);
  font-weight: var(--cfg-title-weight, 700);
  font-style: var(--cfg-title-style, normal);
  color: #fdf9f0;
  line-height: 1.25;
  text-shadow: 0 3px 18px rgba(0,0,0,0.6);
}

.cb-text {
  color: #dfe3ec;
  line-height: 1.6;
  max-width: 560px;
  white-space: pre-line;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: var(--sp-footer, 0px);
  border-top: 1px solid rgba(205, 164, 94, 0.22);
  background: #04070f;
}

.footer-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.requisites p {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-muted);
  white-space: pre-line;
}

.btn-download {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-light);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.btn-download svg { width: 17px; height: 17px; }
.btn-download:hover { background: rgba(205,164,94,0.12); }

.copyright {
  font-size: 12.5px;
  color: #5a637a;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 18px;
}

/* ---------- Sticky-элементы при прокрутке ---------- */

.sticky-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 12px 28px;
  background: rgba(6, 11, 24, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(205, 164, 94, 0.25);
  transform: translateY(-110%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.sticky-top.show { transform: translateY(0); }
.sticky-top a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eef0f5;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: color .25s;
}
.sticky-top a:hover { color: var(--gold-light); }
.sticky-top svg { width: 16px; height: 16px; color: var(--gold); flex-shrink: 0; }

.sticky-cta {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, #a9803e);
  color: #1a1206;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 14px 34px -8px rgba(205, 164, 94, 0.6);
  transform: translate(-50%, 150%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.sticky-cta.show { transform: translate(-50%, 0); }
.sticky-cta svg { width: 17px; height: 17px; }

/* ---------- Reveal-on-load animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  animation: reveal-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--d) * 0.14s + 0.25s);
}

@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .hero { min-height: auto; }
  .hero-image { position: relative; height: 44vh; min-height: 280px; }
  .hero-image-fade { display: none; }
  .hero-contacts {
    top: 14px;
    right: auto;
    left: 16px;
    gap: 6px;
    align-items: flex-start;
  }
  .contact-item {
    font-size: var(--m-contacts-size, calc(var(--cfg-contacts-size, 16px) * 0.81));
    font-weight: 300;
    letter-spacing: 0.04em;
    color: #f4f0e6;
  }
  .contact-icon { width: 14px; height: 14px; }
  .hero-content {
    min-height: auto;
    justify-content: flex-start;
    align-items: stretch;
    gap: 30px;
    padding: 26px 20px 36px;
    text-align: left;
  }
  .founder-note {
    max-width: 100%;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(205, 164, 94, 0.22);
  }
  .founder-quote { font-size: var(--m-quote-size, calc(var(--cfg-quote-size, 19px) * 0.95)); }
  .hero-panel { max-width: 100%; gap: 14px; align-items: stretch; }
  .feature-list { align-items: flex-start; }
  .feature-card { flex-direction: row; }
  body { font-family: var(--m-body-font, var(--cfg-body-font, Tahoma, Verdana, sans-serif)); }
  .hero-title {
    font-size: var(--m-title-size, calc(var(--cfg-title-size, 27px) * 0.89));
    font-family: var(--m-title-font, var(--cfg-title-font, Tahoma, Verdana, sans-serif));
  }
  .hero-title .accent { font-size: var(--m-accent-size, calc(var(--cfg-accent-size, 36px) * 0.86)); }
  .hero-subtitle { font-size: var(--m-subtitle-size, calc(var(--cfg-subtitle-size, 15px) * 0.93)); }
  .section-title, .card-title { font-family: var(--m-title-font, var(--cfg-title-font, Tahoma, Verdana, sans-serif)); }
  .founder-quote, .founder-name { font-family: var(--m-quote-font, var(--cfg-quote-font, Tahoma, Verdana, sans-serif)); }
  /* выравнивание текста слайда на мобильном */
  .hero-content.m-align-center { align-items: center; text-align: center; }
  .hero-content.m-align-center .feature-list { align-items: center; }
  .hero-content.m-align-right { align-items: flex-end; text-align: right; }
  .hero-content.m-align-right .feature-list { align-items: flex-end; }
  .hero-content.m-align-right .feature-card { flex-direction: row-reverse; }
  .feature-list { gap: 12px; }
  .feature-icon { width: 36px; height: 36px; }
  .feature-icon svg { width: 18px; height: 18px; }
  .feature-text br { display: none; }
  .feature-text { font-size: var(--m-feature-size, var(--cfg-feature-size, 14px)); }
  .hero-cta { margin-top: 2px; }
  .clients-group img { height: 72px; }
  .section-title { font-size: 25px; padding: 0 16px 22px; }
  .works { padding-top: var(--sp-works, 40px); }
  .contacts-block { padding-top: var(--sp-contacts, 40px); }
  .contacts-grid { grid-template-columns: 1fr; padding: 0 16px 44px; }
  .map-card iframe { min-height: 220px; }
  .work-item.placeholder { width: 300px; }
  .cb-media { height: clamp(200px, 60vw, var(--cbh, 420px)); }
  .custom-block.fit-auto .cb-media { height: auto; }
  .custom-block .cb-content {
    position: static;
    padding: 22px 20px 30px;
    align-items: flex-start;
    text-align: left;
  }
  .custom-block.has-mob .cb-img-d { display: none; }
  .custom-block.has-mob .cb-img-m { display: block; }
  .founder-note .hero-contacts {
    position: static;
    margin-top: 4px;
    gap: 7px;
    align-items: flex-start;
  }
  .sticky-top { justify-content: center; padding: 11px 16px; }
  .sticky-top .st-mail { display: none; }
  .sticky-cta {
    left: 16px;
    right: 16px;
    transform: translateY(150%);
  }
  .sticky-cta.show { transform: translateY(0); }
}
