/* ==========================================================================
   Lapot landing — styles
   Макет: десктоп 1440, таблет 1000, мобайл 390. Контент — колонка 800px.
   ========================================================================== */

:root {
  --color-primary: #4F6BFF;
  --color-primary-hover: #3D57E8;
  --gradient-start: #4F6BFF;
  --gradient-end: #8B5CF6;

  --color-text: #252B36;
  --color-text-secondary: #5B5C60;
  --color-text-muted: #74767E;

  --color-border: #E8E8F5;

  --color-bg: #FFFFFF;
  --color-bg-soft: #F2F3F6;
  --color-bg-card-soft: #F9FAFB;

  --icon-blue-bg: #EEF1FF;
  --icon-blue-fg: #4F6BFF;
  --icon-purple-bg: #F3EEFF;
  --icon-purple-fg: #8B5CF6;
  --icon-green-bg: #E9FBEF;
  --icon-green-fg: #22C55E;
  --icon-orange-bg: #FFF4E5;
  --icon-orange-fg: #F59E0B;

  --container: 800px;
  --gutter: 20px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --shadow-media: 0 0 40px rgba(0, 0, 0, 0.14);
  --shadow-primary: 0 8px 24px rgba(79, 107, 255, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 20px;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Buttons & links ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  line-height: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.btn--sm {
  height: 36px;
  font-size: 15px;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

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

.btn--glow {
  box-shadow: var(--shadow-primary);
}

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

.btn--outline:hover {
  background: var(--icon-blue-bg);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
}

.link-arrow svg {
  transition: transform 0.15s ease;
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ---- Header ---- */

.site-header {
  padding: 20px var(--gutter) 0;
}

.nav {
  max-width: var(--container);
  height: 54px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 9px 0 15px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  font-weight: 500;
  line-height: 24px;
  color: var(--color-text);
}

.logo__icon {
  flex-shrink: 0;
}

/* ---- Sections ---- */

.section {
  padding: 80px 0;
}

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

.section__title {
  font-size: 32px;
  line-height: 37px;
  font-weight: 500;
  letter-spacing: -1px;
  text-align: center;
  margin-bottom: 40px;
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

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

.hero {
  padding: 86px var(--gutter) 80px;
}

.hero__inner {
  max-width: 600px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero__title {
  font-size: 48px;
  line-height: 55px;
  font-weight: 500;
  letter-spacing: -1px;
  background: linear-gradient(90deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: 540px;
}

.hero__subtitle {
  margin-top: 20px;
}

.hero__inner > .btn {
  margin-top: 20px;
}

.hero__image {
  width: 100%;
  margin-top: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-media);
}

/* ---- How it works ---- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.step {
  display: grid;
  grid-template-columns: 320px 360px;
  justify-content: space-between;
  align-items: center;
}

.step--reverse {
  grid-template-columns: 360px 320px;
}

.step--reverse .step__media {
  order: -1;
}

.step__text h3 {
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  margin-bottom: 12px;
}

.step__media img {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-media);
}

/* Анимация на месте видео из макета. Сама карточка в SVG — 1400×700, вокруг
   неё по 50px холста под тень, поэтому картинка шире колонки ровно на эти поля. */
.flow-demo {
  /* Проценты вертикальных отступов тоже считаются от ширины — поля холста
     съедаются со всех сторон, и карточка встаёт в 40px под шагами. */
  margin: calc(40px - 100% / 28) calc(-100% / 28) calc(-100% / 28);
}

.flow-demo img {
  width: 100%;
}

/* ---- Features ---- */

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "large a"
    "large b"
    "wide wide";
  gap: 20px;
}

.feature--large { grid-area: large; }
.feature:nth-child(2) { grid-area: a; }
.feature:nth-child(3) { grid-area: b; }
.feature--wide { grid-area: wide; }

.feature__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  margin-bottom: 12px;
}

.feature__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.feature__icon svg {
  width: 18px;
  height: 18px;
}

.feature__icon--blue   { background: var(--icon-blue-bg);   color: var(--icon-blue-fg); }
.feature__icon--purple { background: var(--icon-purple-bg); color: var(--icon-purple-fg); }
.feature__icon--green  { background: var(--icon-green-bg);  color: var(--icon-green-fg); }
.feature__icon--orange { background: var(--icon-orange-bg); color: var(--icon-orange-fg); }

.feature .link-arrow {
  margin-top: 12px;
}

.feature__image {
  width: 100%;
  margin-top: 12px;
  border-radius: var(--radius-md);
}

/* ---- Pricing ---- */

.plans {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.plan {
  flex: 0 0 calc((100% - 40px) / 3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  background: var(--color-bg-card-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.plan__name {
  font-size: 28px;
  line-height: 32px;
  font-weight: 400;
}

.plan__price {
  margin-top: 8px;
  font-size: 28px;
  line-height: 32px;
  white-space: nowrap;
}

.plan__period {
  margin-left: 4px;
  font-size: 16px;
  line-height: 22px;
  color: var(--color-text-secondary);
}

.plan__desc {
  margin-top: 8px;
  margin-bottom: 20px;
  color: var(--color-text-secondary);
  flex-grow: 1;
}

.plan--skeleton {
  min-height: 212px;
  background: linear-gradient(90deg, var(--color-bg-card-soft) 25%, #fff 50%, var(--color-bg-card-soft) 75%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .plan--skeleton { animation: none; }
}

.pricing__status {
  text-align: center;
  color: var(--color-text-secondary);
}

.pricing__status a {
  color: var(--color-primary);
}

.pricing__status .btn {
  margin-top: 16px;
}

.compare {
  margin-top: 40px;
}

/* border-spacing даёт зазоры между линиями шапки, как в макете; внешние
   зазоры съедаются отрицательным отступом — он уходит в поля контейнера,
   поэтому таблица не шире колонки и не скроллится. */
.compare table {
  border-collapse: separate;
  border-spacing: 12px 0;
  margin-inline: -12px;
  width: calc(100% + 24px);
}

.compare th,
.compare td {
  height: 44px;
  padding: 0;
  font-weight: 400;
  vertical-align: middle;
}

.compare thead th {
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.compare thead th:first-child {
  text-align: left;
}

.compare tbody th {
  text-align: left;
  color: var(--color-text-secondary);
  padding-block: 6px;
}

.compare td {
  text-align: center;
  white-space: nowrap;
}

.compare td svg {
  vertical-align: middle;
}

.compare col.compare__plan {
  width: 96px;
}

/* ---- Blog ---- */

.blog {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.post time {
  display: block;
  font-size: 12px;
  line-height: 14px;
  color: var(--color-text-secondary);
}

.post h3 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
}

.post p {
  margin-top: 4px;
  color: var(--color-text-secondary);
}

.post__image {
  width: 100%;
  aspect-ratio: 338 / 174;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.post--wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post--wide .post__body {
  flex: 1;
}

.post--wide .post__image {
  width: 128px;
  flex-shrink: 0;
  aspect-ratio: 128 / 86;
  margin-bottom: 0;
}

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

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding: 32px 24px;
  border-top: 1px solid var(--color-border);
}

.footer__nav {
  margin-top: 32px;
}

.footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
}

.footer__nav a {
  font-size: 14px;
  line-height: 16px;
}

.footer__nav a:hover {
  color: var(--color-primary);
}

.footer__copy {
  font-size: 14px;
  line-height: 16px;
  color: var(--color-text-muted);
}

/* Реквизиты под копирайтом — их требует платёжный провайдер на каждой странице сайта. */
.footer__legal {
  display: grid;
  gap: 6px;
  text-align: right;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Узкий таблет: колонка 800 уже не влезает, но шаги ещё можно держать в два столбца. */
@media (max-width: 839px) {
  .step,
  .step--reverse {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .plan {
    flex-basis: calc((100% - 20px) / 2);
  }
}

@media (max-width: 767px) {
  body {
    font-size: 14px;
    line-height: 16px;
  }

  .site-header {
    padding: 12px 12px 0;
  }

  .hero {
    padding: 94px var(--gutter) 60px;
  }

  .hero__title {
    font-size: 32px;
    line-height: 37px;
  }

  .section {
    padding: 60px 0;
  }

  .section__title {
    font-size: 28px;
    line-height: 32px;
  }

  .step,
  .step--reverse {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .step__media,
  .step--reverse .step__media {
    order: -1;
  }

  .step__text h3 {
    font-size: 16px;
    line-height: 20px;
  }

  .features {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    gap: 16px;
  }

  .features .feature {
    grid-area: auto;
  }

  .feature__image {
    display: none;
  }

  .feature .link-arrow svg {
    width: 16px;
    height: 16px;
  }

  .plan {
    flex-basis: 100%;
  }

  .plan__desc {
    flex-grow: 0;
  }

  .feature__title,
  .post h3 {
    font-size: 16px;
    line-height: 20px;
  }

  .plan__name,
  .plan__price {
    font-size: 24px;
    line-height: 28px;
  }

  /* Пять колонок тарифов рядом с подписью в 350px не помещаются, а скролла
     вбок быть не должно: подпись встаёт строкой над значениями, и колонкам
     тарифов достаётся вся ширина. Число колонок JS кладёт в --plans. */
  .compare {
    font-size: 12px;
    line-height: 14px;
  }

  .compare table,
  .compare thead,
  .compare tbody {
    display: block;
    margin: 0;
    width: auto;
  }

  .compare colgroup,
  .compare thead th:first-child {
    display: none;
  }

  .compare tr {
    display: grid;
    grid-template-columns: repeat(var(--plans, 3), minmax(0, 1fr));
    column-gap: 4px;
  }

  .compare th,
  .compare td {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
  }

  /* 11px — чтобы «Энтерпрайз» (63px) целиком вставал в колонку 67px;
     перенос посреди слова остаётся только страховкой для длинных названий. */
  .compare thead th {
    min-height: 30px;
    padding-bottom: 4px;
    font-size: 11px;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .compare tbody th {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 12px 0 6px;
  }

  .compare td {
    min-height: 20px;
  }

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

  .post p {
    font-size: 14px;
    line-height: 16px;
  }

  .post--wide .post__image {
    display: none;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer__nav ul {
    flex-direction: column;
  }

  .footer__legal {
    text-align: left;
  }
}

/* Узкие телефоны (iPhone SE и уже): колонка тарифа меньше 63px. */
@media (max-width: 374px) {
  .compare thead th {
    font-size: 10px;
  }
}
