/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --color-primary: #5b4cdb;
  --color-primary-dark: #3d2db5;
  --color-primary-light: #ede9ff;
  --color-dark: #1a1a3e;
  --color-dark-card: #23235a;
  --color-bg: #f7f8fc;
  --color-white: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-success: #10b981;

  --font-family: 'Inter', sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(91, 76, 219, 0.12);
  --shadow-lg: 0 8px 40px rgba(91, 76, 219, 0.18);

  --transition: 0.25s ease;
  --container-max: 1200px;
  --container-pad: 24px;
  --section-pad: 96px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

/* ============================================================
   Utility: Container
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ============================================================
   Utility: Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: var(--shadow-lg);
}

.btn--white {
  background-color: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

.btn--white:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.btn--lg {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

/* ============================================================
   Utility: Section
   ============================================================ */
.section {
  padding-block: var(--section-pad);
}

.section--dark {
  background-color: var(--color-dark);
  color: var(--color-white);
}

.section--bg {
  background-color: var(--color-bg);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header--light .section-title,
.section-header--light .section-subtitle {
  color: var(--color-white);
}

.section-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
  max-width: 640px;
  margin-inline: auto;
}

/* ============================================================
   Fade-in animation (triggered by JS IntersectionObserver)
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}

.header.is-scrolled {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header__logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.header__logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.header__nav {
  flex: 1;
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background-color var(--transition);
}

.header__nav-link:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.header__cta {
  margin-left: auto;
  flex-shrink: 0;
}

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-left: auto;
  flex-shrink: 0;
}

.burger:focus-visible {
  outline: 2px solid var(--color-primary);
}

.burger__line {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.burger.is-open .burger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.is-open .burger__line:nth-child(2) {
  opacity: 0;
}

.burger.is-open .burger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #1a1a3e 0%, #2d2580 50%, #5b4cdb 100%);
  position: relative;
  overflow: hidden;
  padding-top: 80px;
  padding-bottom: 0;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  min-height: 560px;
  padding-bottom: 60px;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__badge {
  display: inline-block;
  padding: 6px 14px;
  background-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.hero__title {
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-white);
  margin-bottom: 20px;
}

.hero__title-accent {
  color: #a78bfa;
}

.hero__description {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 36px;
  max-width: 480px;
  line-height: 1.65;
}

.hero__image-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.hero__image {
  max-height: 460px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

.hero__wave {
  line-height: 0;
  margin-top: -2px;
}

.hero__wave svg {
  width: 100%;
  display: block;
}

/* Hero decorative blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(91, 76, 219, 0.4) 0%, transparent 70%);
  top: -150px;
  right: -100px;
}

.hero::after {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.2) 0%, transparent 70%);
  bottom: 80px;
  left: -80px;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.service-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.service-card__img-wrap {
  width: 96px;
  height: 96px;
  margin-inline: auto;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.service-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.service-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.35;
}

.service-card__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.55;
}

.services__cta {
  text-align: center;
  margin-top: 48px;
}

/* ============================================================
   PROBLEMS / SOLUTIONS
   ============================================================ */
.problems__table {
  background-color: var(--color-dark-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.problems__table-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background-color: var(--color-primary);
  padding: 14px 28px;
  gap: 24px;
}

.problems__col-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.8);
}

.problems__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color var(--transition);
}

.problems__row:last-child {
  border-bottom: none;
}

.problems__row:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.problems__problem {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
}

.problems__icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.problems__solution {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  padding-left: 4px;
  border-left: 2px solid var(--color-primary);
}

.problems__cta {
  text-align: center;
  margin-top: 48px;
}

/* ============================================================
   BEFORE / AFTER
   ============================================================ */
.before-after__grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: stretch;
}

.before-after__card {
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.before-after__card--before {
  background: linear-gradient(135deg, #fff1f1, #ffe4e4);
  border: 1px solid #fecaca;
}

.before-after__card--after {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
}

.before-after__label {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: flex-start;
}

.before-after__card--before .before-after__label {
  background-color: #fee2e2;
  color: #dc2626;
}

.before-after__card--after .before-after__label {
  background-color: #dcfce7;
  color: #16a34a;
}

.before-after__img-wrap {
  width: 180px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.before-after__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.before-after__text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
}

.before-after__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 8px;
}

.before-after__arrow {
  font-size: 32px;
  color: var(--color-primary);
  font-weight: 700;
}

/* ============================================================
   HOW TO USE — STEPS
   ============================================================ */
.steps__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.step-card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  position: relative;
  transition: box-shadow var(--transition), transform var(--transition);
}

.step-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.step-card__number {
  font-size: 42px;
  font-weight: 800;
  color: var(--color-primary-light);
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.step-card__img-wrap {
  width: 110px;
  height: 110px;
  margin-inline: auto;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.step-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.35;
}

.step-card__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Connector line between steps */
.steps__grid .step-card:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 60px;
  right: -13px;
  width: 26px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  pointer-events: none;
  z-index: 1;
}

.steps__cta {
  text-align: center;
  margin-top: 48px;
}

/* ============================================================
   WHY US
   ============================================================ */
.why-us__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.why-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.why-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.why-card__img-wrap {
  width: 120px;
  height: 120px;
  margin-inline: auto;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary-light);
  border-radius: 50%;
  overflow: hidden;
}

.why-card__img-wrap img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.why-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.35;
}

.why-card__desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ============================================================
   FINAL CTA
   ============================================================ */
.final-cta {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 60%, #7c68f0 100%);
  overflow: hidden;
  position: relative;
}

.final-cta::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  top: -100px;
  left: -100px;
  pointer-events: none;
}

.final-cta__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}

.final-cta__content {
  position: relative;
  z-index: 1;
}

.final-cta__title {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.25;
  margin-bottom: 20px;
}

.final-cta__desc {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 460px;
}

.final-cta__image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.final-cta__image {
  max-height: 380px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.25));
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background-color: var(--color-dark);
  padding-block: 40px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer__logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer__logo-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-white);
}

.footer__copy {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.footer__telegram {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition);
}

.footer__telegram:hover {
  color: var(--color-white);
}

/* ============================================================
   RESPONSIVE — Tablet (768px–1199px)
   ============================================================ */
@media (max-width: 1199px) {
  :root {
    --section-pad: 72px;
    --container-pad: 32px;
  }

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

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

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

  .steps__grid .step-card:not(:last-child)::after {
    display: none;
  }

  .hero__inner {
    gap: 32px;
    min-height: 480px;
  }

  .hero__title {
    font-size: 40px;
  }

  .header__nav-link {
    font-size: 13px;
    padding: 5px 8px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (up to 767px)
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --section-pad: 56px;
    --container-pad: 20px;
  }

  /* Header mobile */
  .header__nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    padding: 16px var(--container-pad) 24px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 99;
  }

  .header__nav.is-open {
    display: block;
  }

  .header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .header__nav-link {
    font-size: 15px;
    padding: 10px 12px;
    display: block;
    width: 100%;
  }

  .header__cta {
    display: none;
  }

  .burger {
    display: flex;
  }

  /* Hero mobile */
  .hero {
    padding-top: 56px;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    min-height: auto;
    text-align: center;
    padding-bottom: 40px;
    gap: 32px;
  }

  .hero__description {
    margin-inline: auto;
  }

  .hero__image-wrap {
    order: -1;
  }

  .hero__image {
    max-height: 280px;
    margin-inline: auto;
  }

  /* Services mobile */
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .service-card {
    padding: 20px 14px;
  }

  .service-card__img-wrap {
    width: 72px;
    height: 72px;
  }

  /* Problems mobile */
  .problems__table-header {
    display: none;
  }

  .problems__row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px;
  }

  .problems__solution {
    border-left: none;
    border-top: 2px solid var(--color-primary);
    padding-left: 0;
    padding-top: 10px;
  }

  /* Before/After mobile */
  .before-after__grid {
    grid-template-columns: 1fr;
  }

  .before-after__divider {
    padding-block: 8px;
    transform: rotate(90deg);
  }

  /* Steps mobile */
  .steps__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .step-card {
    padding: 24px 20px;
  }

  /* Why Us mobile */
  .why-us__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Final CTA mobile */
  .final-cta__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .final-cta__desc {
    margin-inline: auto;
  }

  .final-cta__image-wrap {
    order: -1;
  }

  .final-cta__image {
    max-height: 240px;
  }

  /* Footer mobile */
  .footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  /* Sections mobile */
  .section-header {
    margin-bottom: 36px;
  }
}

/* ============================================================
   RESPONSIVE — Small mobile (up to 479px)
   ============================================================ */
@media (max-width: 479px) {
  .services__grid {
    grid-template-columns: 1fr;
  }

  .service-card__img-wrap {
    width: 80px;
    height: 80px;
  }

  .hero__title {
    font-size: 28px;
  }
}
