/* ===== СБРОС ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ===== БАЗОВЫЕ СТИЛИ — SKETCH AESTHETIC ===== */
body {
  /* Inter — чистый основной шрифт */
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: #1a1a1a;            /* почти чёрный */
  background: #fafafa;       /* чуть тёплый белый */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Caveat — рукописный / эскизный шрифт для акцентов */
.hero-accent,
.section-title,
.logo-text {
  font-family: 'Caveat', cursive;
}

/* ===== КОНТЕЙНЕР ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== ШАПКА — скрыта, появляется при скролле ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: none;
  transition: background 0.35s ease, border-bottom 0.35s ease, backdrop-filter 0.35s ease;
}

/* При скролле — появляется фон, blur и рамка */
.header.header-visible {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1.5px dashed #ccc;
}

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

/* Логотип — рукописный, как подпись на чертеже */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  color: #1a1a1a;
}

.logo-text {
  font-family: 'Caveat', cursive;
  font-size: 1.7rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 1px;
}

/* Правая часть шапки */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА ===== */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn {
  background: none;
  border: 1.5px solid transparent;
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  color: #aaa;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.lang-btn.active {
  color: #1a1a1a;
  border-color: #1a1a1a;
}

.lang-btn:hover:not(.active) {
  color: #555;
}

.lang-sep {
  color: #ccc;
  font-size: 0.85rem;
}

/* Телефон в шапке — рукописный */
.header-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  transition: opacity 0.2s;
  letter-spacing: 0.5px;
}

.header-phone:hover {
  opacity: 0.6;
}

.phone-icon {
  width: 18px;
  height: 18px;
}

/* ===== ГЕРОЙ-СЕКЦИЯ (fullscreen, sketch) ===== */
.hero {
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 80px 0 50px;
  overflow: hidden;
}

/* Декоративная сетка-эскиз на фоне — тонкие линии как на миллиметровке */
.sketch-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, #e5e5e5 1px, transparent 1px),
    linear-gradient(to bottom, #e5e5e5 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.5;
  pointer-events: none;
}

/* Декоративные серые паллеты на фоне hero */
.hero-bg-pallets {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-pallet {
  position: absolute;
  opacity: 0.06;
}

/* Паллет 1 — левый верх, бочки */
.bp-1 {
  width: 110px;
  top: 12%;
  left: 5%;
  transform: rotate(-8deg);
}

/* Паллет 2 — правый верх, коробки */
.bp-2 {
  width: 100px;
  top: 8%;
  right: 6%;
  transform: rotate(5deg);
}

/* Паллет 3 — левый низ, мешки */
.bp-3 {
  width: 95px;
  bottom: 14%;
  left: 4%;
  transform: rotate(6deg);
}

/* Паллет 4 — правый низ, трубы */
.bp-4 {
  width: 115px;
  bottom: 10%;
  right: 4%;
  transform: rotate(-4deg);
}

/* Паллет 5 — центр слева, доски */
.bp-5 {
  width: 90px;
  top: 50%;
  left: 2%;
  transform: translateY(-50%) rotate(3deg);
}

/* На мобилке прячем боковые паллеты чтобы не мешали */
@media (max-width: 600px) {
  .bp-5 { display: none; }
  .bp-1, .bp-2 { width: 70px; opacity: 0.04; }
  .bp-3, .bp-4 { width: 70px; opacity: 0.04; }
}

/* Контент героя — компактный блок по центру */
.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 8px;
}

/* Порядок элементов: заголовок → акцент → иллюстрация → кнопки */
.hero-title   { order: -2; }
.hero-accent  { order: -1; }
.hero-illustration { order: 0; }
.hero-actions { order: 1; }

/* SVG-иллюстрация манипулятора — большая, по центру */
.hero-illustration {
  width: 100%;
  max-width: 660px;
  margin: 16px 0 20px;
}

.hero-illustration svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* --- АНИМАЦИИ ИЛЛЮСТРАЦИИ --- */

/* 1. Грузовик — плавное появление слева */
.anim-truck {
  opacity: 0;
  transform: translateX(-30px);
  animation: truckAppear 0.8s ease-out 0.2s forwards;
}

@keyframes truckAppear {
  to { opacity: 1; transform: translateX(0); }
}

/* 2. Стрела — рисование линий (stroke-dashoffset) */
.draw-line {
  stroke-dasharray: 500;
  stroke-dashoffset: 500;
  animation: drawStroke 1s ease-out forwards;
}

/* Задержки для секций стрелы: 1-я → 2-я → 3-я */
.draw-line.d1 { animation-delay: 0.9s; }
.draw-line.d2 { animation-delay: 1.5s; }
.draw-line.d3 { animation-delay: 2.0s; }

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}

/* Контейнер стрелы — скрыт до начала рисования */
.anim-crane {
  opacity: 0;
  animation: fadeIn 0.1s ease 0.85s forwards;
}

/* 3. Стрела — JS управляет вращением через transition */
.crane-arm {
  transform-origin: 178px 55px;
  transform: rotate(-5deg);
  transition: transform 1s ease-in-out;
}

/* 4. Груз на крюке — JS управляет translateY и opacity */
.cargo-load {
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.7s ease-in-out, opacity 0.35s ease;
}

/* 5. Паллеты в кузове — плавное исчезновение */
#bed-p1, #bed-p2, #bed-p3 {
  transition: opacity 0.3s ease;
}

/* 6. Паллеты на земле — плавное появление */
#ground-p1, #ground-p2, #ground-p3 {
  transition: opacity 0.3s ease;
}

/* Вспомогательная анимация */
@keyframes fadeIn {
  to { opacity: 1; }
}

/* Заголовок — рукописный sketch-стиль, как подпись к чертежу */
.hero-title {
  font-family: 'Caveat', cursive;
  font-size: 5.5rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 2px;
  letter-spacing: 3px;
  position: relative;
  display: inline-block;
}

/* Пунктирное подчёркивание заголовка */
.hero-title::after {
  content: '';
  display: block;
  width: 105%;
  height: 2px;
  margin: 4px auto 0;
  background: repeating-linear-gradient(
    90deg,
    #1a1a1a 0px, #1a1a1a 6px,
    transparent 6px, transparent 10px
  );
  border-radius: 2px;
  opacity: 0.35;
}

/* Рукописный акцент под заголовком — typewriter-анимация */
.hero-accent {
  font-family: 'Caveat', cursive;
  font-size: 2.4rem;
  font-weight: 400;
  color: #555;
  margin-bottom: 0;
  letter-spacing: 1px;
  min-height: 3rem;
}

/* Мигающий курсор после текста */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: #555;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.hero-subtitle {
  font-size: 1.05rem;
  color: #777;
  margin-bottom: 32px;
  max-width: 460px;
  font-weight: 400;
}

/* ===== КНОПКИ (sketch-стиль) ===== */
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Слово «или» между кнопками — тихое, не отвлекает */
.hero-or {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: #bbb;
  text-transform: lowercase;
}

/* Кнопка «Посмотреть прайс» — второстепенная */
.hero-actions .btn-outline {
  border-width: 1.5px;
  border-color: #bbb;
  color: #888;
  font-size: 1.1rem;
  padding: 12px 28px;
  box-shadow: none;
}

.hero-actions .btn-outline:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
  background: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  /* Неровные края — как нарисовано от руки */
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid #1a1a1a;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

/* Главная кнопка — заливка, контрастный белый текст */
.btn-primary {
  background: #222;
  color: #fff;
  box-shadow: 2px 3px 0 #999;
  -webkit-font-smoothing: antialiased;
  border-color: #222;
}

.btn-primary:hover {
  background: #333;
  transform: translate(1px, 1px);
  box-shadow: 1px 2px 0 #888;
}

/* Кнопка-обводка — лёгкий контур карандашом */
.btn-outline {
  background: transparent;
  color: #1a1a1a;
}

.btn-outline:hover {
  background: #1a1a1a;
  color: #fff;
}

/* Большая CTA — крупный, жирный, читаемый */
.btn-lg {
  padding: 20px 56px;
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* Обёртка кнопки «Позвонить» с рукописными стрелками */
.call-btn-wrap {
  position: relative;
  display: inline-flex;
}

/* Рукописные стрелочки вокруг кнопки */
.sketch-arrow {
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
}

/* Левая стрелка → указывает на кнопку слева */
.arrow-left {
  width: 40px;
  height: 24px;
  top: 50%;
  right: 100%;
  margin-right: 6px;
  transform: translateY(-50%);
  animation: wiggleLeft 2s ease-in-out infinite;
}

/* Правая стрелка ← указывает на кнопку справа */
.arrow-right {
  width: 40px;
  height: 24px;
  top: 50%;
  left: 100%;
  margin-left: 6px;
  transform: translateY(-50%);
  animation: wiggleRight 2s ease-in-out 0.3s infinite;
}

/* Покачивание стрелочек — привлекают внимание */
@keyframes wiggleLeft {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-50%) translateX(5px); }
}

@keyframes wiggleRight {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-50%) translateX(-5px); }
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* Стрелка-скролл */
.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: #bbb;
  transition: color 0.2s;
  animation: bounce 2.5s infinite;
  z-index: 1;
}

.scroll-hint svg {
  width: 30px;
  height: 30px;
}

.scroll-hint:hover {
  color: #1a1a1a;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(10px); }
}

/* ===== ОБЩИЙ ФОН СЕКЦИЙ — миллиметровка ===== */
.advantages, .services, .pricing {
  position: relative;
  background: #fff;
}

.advantages::before, .services::before, .pricing::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, #e5e5e5 1px, transparent 1px),
    linear-gradient(to bottom, #e5e5e5 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
  pointer-events: none;
}

/* ===== ПРЕИМУЩЕСТВА ===== */
.advantages {
  padding: 80px 0;
  border-top: 2px dashed #ccc;
}

.section-title {
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 3.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 52px;
  position: relative;
  z-index: 1;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  z-index: 1;
}

.card {
  background: rgba(255,255,255,0.9);
  border: 1.5px solid #1a1a1a;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 32px 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 3px 4px 0 #ccc;
}

/* Иконки карточек — чёрные линии */
.card-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  color: #1a1a1a;
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card h3 {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.card p {
  font-size: 0.9rem;
  color: #777;
  line-height: 1.5;
}

/* ===== УСЛУГИ ===== */
.services {
  padding: 80px 0;
  border-top: 2px dashed #ccc;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  position: relative;
  z-index: 1;
}

.service-item {
  padding: 28px;
  background: rgba(255,255,255,0.9);
  border: 1.5px dashed #999;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.service-item:hover {
  border-color: #1a1a1a;
  border-style: solid;
  box-shadow: 2px 3px 0 #ddd;
}

.service-item h3 {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.service-item p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* ===== ПРАЙС-ЛИСТ ===== */
.pricing {
  padding: 72px 0;
  border-top: 2px dashed #ccc;
}

.price-table {
  max-width: 600px;
  margin: 0 auto;
  border: 2px solid #1a1a1a;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,0.95);
}

/* Строка прайса */
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px dashed #ccc;
}

.price-row:last-child {
  border-bottom: none;
}

/* Заголовок таблицы */
.price-header {
  background: #1a1a1a;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.price-header .price-service,
.price-header .price-value {
  font-weight: 700;
  color: #fff;
}

/* Чередование строк */
.price-row:nth-child(even):not(.price-header) {
  background: rgba(0,0,0,0.02);
}

/* Название услуги — чёткий, читаемый */
.price-service {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* Цена — жирная, чёткая */
.price-value {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #1a1a1a;
  white-space: nowrap;
}

/* Подпись под таблицей */
.price-note {
  text-align: center;
  font-family: 'Caveat', cursive;
  color: #888;
  font-size: 1.2rem;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

/* CTA-блок под прайсом: кнопка со стрелочками */
.price-cta {
  display: flex;
  justify-content: center;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px dashed #ccc;
  position: relative;
  z-index: 1;
}

/* ===== ФОРМА ЗАЯВКИ ===== */
.order {
  padding: 80px 0;
  background: #fafafa;
  border-top: 1.5px solid #ddd;
}

.order-subtitle {
  text-align: center;
  color: #888;
  font-size: 1rem;
  margin-top: -36px;
  margin-bottom: 40px;
}

.order-form {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #bbb;
  border-radius: 0;            /* прямые углы */
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: #1a1a1a;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #1a1a1a;
}

.form-input::placeholder {
  color: #aaa;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-submit {
  align-self: center;
  padding: 14px 48px;
  font-size: 1rem;
}

/* Сообщение об успехе */
.success-message {
  display: none;
  text-align: center;
  padding: 24px;
  background: #fff;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 600;
  max-width: 540px;
  margin: 0 auto;
  border: 1.5px solid #1a1a1a;
}

/* ===== ПОДВАЛ — тонкий, sketch-стиль ===== */
.footer {
  background: #fff;
  padding: 20px 0;
  border-top: 2px dashed #ccc;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, #e5e5e5 1px, transparent 1px),
    linear-gradient(to bottom, #e5e5e5 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
  pointer-events: none;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 1;
}

/* Левая часть: лого + описание */
.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  color: #1a1a1a;
  font-size: 1.4rem;
}

.footer-desc {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  color: #999;
}

.footer-sep {
  color: #ccc;
  font-size: 0.9rem;
}

/* Правая часть: контакты в ряд */
.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #888;
}

.footer-contact:hover {
  color: #1a1a1a;
}

/* Адаптив футера */
@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .footer-left, .footer-right {
    justify-content: center;
  }
}

/* ===== ПЛАВАЮЩАЯ КНОПКА «НАВЕРХ» ===== */
.fab-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.8);
  color: #999;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: all 0.3s;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* Показываем при скролле */
.fab-top.fab-visible {
  opacity: 1;
  pointer-events: auto;
}

.fab-top svg {
  width: 20px;
  height: 20px;
}

.fab-top:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* ===== АДАПТИВ — ПЛАНШЕТ ===== */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 4rem;
  }

  .hero-accent {
    font-size: 2rem;
  }

  .hero-illustration {
    max-width: 600px;
  }
}

/* ===== АДАПТИВ — МОБИЛЬНЫЙ ===== */
@media (max-width: 600px) {
  .header-inner {
    height: 56px;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  /* Скрываем текст телефона, оставляем иконку */
  .header-phone {
    font-size: 0;
  }

  .header-phone .phone-icon {
    width: 22px;
    height: 22px;
  }

  .hero {
    min-height: 100svh;
    padding: 60px 0 50px;
  }

  .hero-illustration {
    max-width: 100%;
    margin: 6px 0;
  }

  .hero-title {
    font-size: 3rem;
  }

  .hero-accent {
    font-size: 1.6rem;
    min-height: 2.2rem;
  }

  .btn-lg {
    padding: 16px 40px;
    font-size: 1.1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 300px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 32px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
