/* =========================
   DESIGN TOKENS / BASE + GLOBAL SYSTEMS (FINAL)
   Вставь вместо старых общих стилей целиком
========================= */

/* =========================
   DESIGN TOKENS / BASE
========================= */
:root{
  /* Контейнер */
  --container: 1560px;
  --gutter: 24px;
  --gutter-m: 16px;

  /* Радиусы */
  --radius: 6px;
  --radius-lg: 16px;

  /* Цвета */
  --text: #0f0f10;
  --muted: rgba(15,15,16,.68);
  --line: rgba(15,15,16,.12);
  --bg: #ffffff;
  --accent: #2d6bff;

  /* Тени */
  --shadow-sm: 0 6px 18px rgba(0,0,0,.08);
  --shadow-md: 0 14px 38px rgba(0,0,0,.12);

  /* Типографика (единые размеры секций) */
  --h1: clamp(34px, 3.2vw, 56px);
  --h2: clamp(28px, 3vw, 44px);
  --h3: clamp(20px, 1.7vw, 28px);
  --p:  clamp(16px, 1.15vw, 19px);
  --lh: 1.5;

  /* =========================
     GLOBAL HERO HEIGHT SYSTEM
     (для всех страниц с баннером/hero)
  ========================= */
  --x-header-h: 84px;
  --x-hero-h: 560px; /* ОСНОВНАЯ ВЫСОТА HERO */
}

/* =========================
   SAFE GLOBALS
========================= */
html { -webkit-text-size-adjust: 100%; }
body{
  font-family: 'Tilda Sans', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

img{ max-width: 100%; height: auto; display: block; }
a{ color: inherit; text-decoration: none; }

/* box-sizing — безопасная база */
*, *::before, *::after{ box-sizing: border-box; }

/* Prevent horizontal scroll */
html, body, .t-body{ overflow-x: hidden; }

/* =========================
   LAYOUT SYSTEM
========================= */
.x-container{
  width: min(var(--container), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

/* Full-bleed without X-scroll issues */
.x-fullbleed{
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Расширяем стандартные контейнеры Tilda под нашу сетку */
.t-container{
  max-width: var(--container) !important;
}

/* =========================
   TYPO CLASSES
========================= */
.x-h2{
  font-size: var(--h2);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.x-p{
  font-size: var(--p);
  line-height: var(--lh);
}

/* =========================
   UI ELEMENTS
========================= */
.x-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff !important;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.x-btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow-md); }
.x-btn:active{ transform: translateY(0); opacity: .92; }

/* =========================
   SECONDARY / GHOST BUTTON
========================= */
.x-btn--ghost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  color: rgba(255,255,255,.92) !important;
  box-shadow: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.x-btn--ghost:hover{
  transform: translateY(-1px);
  background: rgba(0,0,0,.30);
  border-color: rgba(255,255,255,.22);
}

.x-btn--ghost:active{
  transform: translateY(0);
  opacity: .95;
}

/* =========================
   SERVICE SECTION THEMES
========================= */

/* Тёмный */
.x-service--dark{
  background:
    radial-gradient(800px 420px at 15% 30%, rgba(45,107,255,.12), transparent 55%),
    linear-gradient(180deg, #0c0d11 0%, #07080b 100%);
  color: #fff;
}
.x-service--dark .x-p{ color: rgba(255,255,255,.85); }

/* Светло-тёмный */
.x-service--soft{
  background:
    radial-gradient(900px 520px at 20% 20%, rgba(45,107,255,.08), transparent 60%),
    linear-gradient(180deg, #141622 0%, #0f111a 100%);
  color: #fff;
}
.x-service--soft .x-p{ color: rgba(255,255,255,.82); }

/* Общий вид изображений */
.x-service .x-service__img{
  box-shadow: 0 30px 60px rgba(0,0,0,.55);
  position: relative;
  overflow: hidden;
}
.x-service .x-service__img::after{
  content:'';
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.25));
}

/* Кнопка */
.x-service--dark .x-btn,
.x-service--soft .x-btn{
  color:#fff;
}

/* =========================
   SERVICES: LAYOUT SYSTEM
========================= */

/* Сетка услуги */
.x-service .x-service__inner{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  padding: 96px 0;
  align-items: center;
}

/* Инверсия (картинка слева, текст справа) */
.x-service .x-service__inner--rev{
  grid-template-columns: .95fr 1.05fr;
}

/* Заголовок услуги — верхний регистр */
.x-service .x-service__title{
  text-transform: uppercase;
  margin: 0 0 20px 0;
  letter-spacing: -0.02em;
}

/* Текст — ровный по ширине (на десктопе), на мобилке отключим */
.x-service .x-service__content{
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Чтобы заголовок и кнопка не "justify" */
.x-service .x-service__title,
.x-service .x-service__actions{
  text-align: left;
}

.x-service .x-service__content .x-p{
  margin: 0;
  margin-top: 14px;
  max-width: 62ch;
}

.x-service .x-service__content .x-p:first-of-type{
  margin-top: 0;
}

.x-service .x-service__actions{
  margin-top: 28px;
}

/* Картинка */
.x-service .x-service__img{
  width: 100%;
  height: 420px;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Align top for perfect rhythm */
.x-service .x-service__inner{ align-items: flex-start; }
.x-service .x-service__content{ justify-content: flex-start; }

/* Add breathing room on reversed blocks */
.x-service .x-service__inner--rev .x-service__content{ padding-left: 16px; }

/* =========================
   LIGHT SCROLL REVEAL (NO WHITE FLASH)
========================= */
.x-service .x-service__content,
.x-service .x-service__media{
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .55s ease, transform .55s ease;
  will-change: opacity, transform;
}

/* Мягкая задержка */
.x-service .x-service__media{
  transition-delay: .08s;
}

.x-service.is-visible .x-service__content,
.x-service.is-visible .x-service__media{
  opacity: 1;
  transform: translateY(0);
}

/* Уважение к настройке "уменьшить анимации" */
@media (prefers-reduced-motion: reduce){
  .x-service .x-service__content,
  .x-service .x-service__media{
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* =========================
   rec1777144931 — widen FORM COLUMN (works)
========================= */
#rec1777144931 .t-col:last-child{
  flex: 0 0 460px !important;
  max-width: 460px !important;
}

#rec1777144931 form,
#rec1777144931 .t-form,
#rec1777144931 .t-form__wrapper,
#rec1777144931 .t-form__inputsbox{
  width: 100% !important;
  max-width: 100% !important;
}

#rec1777144931 input,
#rec1777144931 textarea,
#rec1777144931 select,
#rec1777144931 .t-input,
#rec1777144931 .t-textarea,
#rec1777144931 .t-submit,
#rec1777144931 .t-btn,
#rec1777144931 button{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* =========================
   ADAPTIVE
========================= */
@media (max-width: 1200px){
  #rec1777144931 .t-col:last-child{
    flex-basis: 400px !important;
    max-width: 400px !important;
  }
}

@media (max-width: 980px){
  :root{
    --gutter: var(--gutter-m);
    --x-header-h: 74px;
    --x-hero-h: 520px;
  }

  .x-service .x-service__inner,
  .x-service .x-service__inner--rev{
    grid-template-columns: 1fr;
    padding: 72px 0;
  }

  .x-service .x-service__content{
    text-align: left;
  }

  .x-service .x-service__img{
    height: 360px;
  }

  #rec1777144931 .t-col:last-child{
    flex: 0 0 100% !important;
    max-width: 520px !important;
    margin: 24px auto 0 !important;
  }
}

@media (max-width: 480px){
  :root{
    --x-header-h: 68px;
    --x-hero-h: 460px;
  }

  .x-btn,
  .x-btn--ghost{
    width: 100%;
    box-sizing: border-box;
  }

  .x-service .x-service__inner,
  .x-service .x-service__inner--rev{
    padding: 56px 0;
  }

  .x-service .x-service__img{
    height: 260px;
  }
}
