/* =========================================================
   SomaSpace — стили лендинга
   ---------------------------------------------------------
   Масштаб. Как в исходной вёрстке Tilda, макет пропорционально
   масштабируется вместе с шириной окна:
     • мобильная сетка — 360px, десктопная — 1280px;
     • 1rem = 10px макета, т.е. «14px из макета» = 1.4rem.
   Координаты элементов композиций берутся прямо из макета:
     style="--x:273; --y:388; --w:409"   — десктоп (сетка 1280)
     style="--mx:10; --my:224; --mw:300" — мобильная версия (сетка 360)
   ========================================================= */

:root {
  --ink: #26262a;
  --bg: #eeeeee;
  --muted: #4c4c4e;
  --gray: #707070;
  --white: #ffffff;
  --error: #d6303b;
  --font: 'Inter', Arial, sans-serif;

  --desktop: 1024px; /* справочно: брейкпоинт задан в медиазапросах ниже */
}

/* мобильная сетка 360 → 1rem = 1/36 ширины (не больше 16px на планшетах) */
html { font-size: min(calc(100vw / 36), 16px); }

/* десктопная сетка 1280 → 1rem = 1/128 ширины (не больше 15px на больших экранах) */
@media (min-width: 1024px) {
  html { font-size: min(calc(100vw / 128), 15px); }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.4rem;
  line-height: 1.15;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img, svg { display: block; max-width: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }

[id] { scroll-margin-top: 9rem; }

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

.skip-link {
  position: absolute; left: 1rem; top: -10rem; z-index: 1000;
  padding: 1rem 1.6rem;
  background: var(--ink); color: var(--white);
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- Сцена с абсолютным позиционированием ---------- */

.stage {
  position: relative;
  width: 36rem;
  margin-inline: auto;
}

/* мобильные координаты (--mx/--my/--mw) — только там, где они заданы */
.stage [style*="--mx"] {
  position: absolute;
  left: calc(var(--mx) * .1rem);
  top: calc(var(--my) * .1rem);
}
.stage [style*="--mw"] { width: calc(var(--mw) * .1rem); }

@media (min-width: 1024px) {
  .stage { width: 128rem; }

  .stage [style*="--x"] {
    position: absolute;
    left: calc(var(--x) * .1rem);
    top: calc(var(--y) * .1rem);
  }
  .stage [style*="--w"] { width: calc(var(--w) * .1rem); }
  .stage [style*="--h"] { height: calc(var(--h) * .1rem); }
}

/* ---------- Типографика ---------- */

.title-xl {
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.caps {
  font-size: 1.4rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.lead {
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

@media (min-width: 1024px) {
  .title-xl { font-size: 8rem; }
}

/* ---------- Кнопки и ссылки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.4rem;
  padding: 0 1.5rem .2rem;
  border: .2rem solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease-in-out, color .2s ease-in-out;
}
.btn--sm { height: 3.2rem; }

@media (hover: hover) {
  .btn:hover { background: var(--bg); color: var(--ink); }
}

.nav-link {
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.55;
  white-space: nowrap;
}
.nav-link:hover { text-decoration: underline; text-underline-offset: .4rem; }

/* ---------- Иконки соцсетей (при наведении цвета меняются местами) ---------- */

.social { display: block; width: 2.5rem; height: 2.5rem; }
.social svg { width: 100%; height: 100%; }
.social__bg { fill: var(--ink); transition: fill .2s; }
.social__fg { fill: var(--white); transition: fill .2s; }

@media (hover: hover) {
  .social:hover .social__bg { fill: var(--white); }
  .social:hover .social__fg { fill: var(--ink); }
}

/* плавающие иконки справа — только десктоп */
.floating-socials { display: none; }

@media (min-width: 1024px) {
  .floating-socials {
    position: fixed;
    z-index: 50;
    top: 51.9rem;
    left: calc(50% - 64rem + 117.9rem);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }
}

/* =========================================================
   Фиксированная шапка (десктоп)
   ========================================================= */

.topbar { display: none; }

@media (min-width: 1024px) {
  .topbar {
    display: block;
    position: fixed;
    z-index: 90;
    top: 0; left: 0; right: 0;
    height: 9rem;
    transform: translateY(-100%);
    transition: transform .15s ease-out;
  }
  .topbar.is-visible { transform: none; }

  .topbar__pill {
    position: absolute;
    top: 1.1rem;
    left: 2.5%;
    width: 95%;
    height: 6.8rem;
    border-radius: 10rem;
    background: rgba(238, 238, 238, .4);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .topbar__inner { height: 100%; }
  .topbar .topbar__inner [style*="--x"] {
    position: absolute;
    top: 50%;
    left: calc(var(--x) * .1rem);
    transform: translateY(-50%);
  }
  .topbar__nav { display: contents; }
  .topbar__logo img { width: 3.4rem; height: auto; }

  .topbar .nav-link { font-weight: 400; }
  .topbar .nav-link.is-active { font-weight: 700; }
}

/* =========================================================
   Первый экран
   ========================================================= */

.hero {
  position: relative;
  min-height: max(100svh, 80rem);
  overflow: hidden;
  isolation: isolate;
}

.hero__bg {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% center;
}

.hero__band {
  position: absolute;
  z-index: -1;
  top: 0; left: 0; right: 0;
  height: 26.5rem;
  background: var(--bg);
}

.hero__frame { display: none; }

.hero__mobile-bar {
  position: absolute;
  top: 1.9rem;
  left: calc(50% - 16rem);
  width: 32.9rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.hero__socials { display: flex; gap: 1.3rem; padding-top: .1rem; }
.hero__socials .social { width: 3rem; height: 3rem; }

.hero__logo-mobile {
  position: absolute;
  top: 10.2rem;
  left: calc(50% - 16rem);
  width: 31.7rem;
  height: auto;
}

.hero__stage { position: absolute; inset: 0; }
.hero__nav,
.hero__login,
.hero__vertical,
.hero__contact { display: none; }

.hero__tagline {
  color: var(--white);
  font-size: 1.4rem;
  line-height: 1.15;
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  .hero { min-height: max(100vh, 100rem); }

  .hero__bg {
    inset: auto;
    top: calc(50% + 4.4rem);
    left: 50%;
    width: max(194.5rem, 100%);
    height: max(113.6rem, 100%);
    transform: translate(-50%, -50%);
  }

  .hero__band { height: 26rem; }

  .hero__frame {
    display: block;
    position: absolute;
    top: 9.1rem;
    left: 6%;
    width: 88%;
    height: auto;
  }

  .hero__mobile-bar,
  .hero__logo-mobile { display: none; }

  .hero__stage { position: relative; height: 100%; }
  .hero__nav { display: contents; }
  .hero__login,
  .hero__contact { display: inline-flex; }

  .hero__vertical {
    display: grid;
    place-items: center;
    width: 13.2rem;
    height: 13.5rem;
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1.55;
    rotate: 90deg;
  }
}

/* =========================================================
   Платформа
   ========================================================= */

.about { overflow: hidden; }

.photo {
  border: .2rem solid var(--ink);
  border-radius: 2rem;
  object-fit: cover;
}

/* мобильная версия — обычный поток */
.about__stage {
  display: grid;
  grid-template-columns: 100%;
  padding-top: 8.2rem;
}
.about__stage > * { grid-column: 1; }

.about__title   { grid-row: 1; justify-self: center; width: 31.7rem; }
.about__desk    { grid-row: 2; margin: 7.8rem 0 0 1rem; width: 34rem; height: 27.7rem; }
.about__text1   { grid-row: 3; margin: 5rem 0 0 4rem; width: 28rem; }
.about__pen     { grid-row: 4; align-self: start; margin: 6.6rem 0 0 1rem; width: 12.4rem; height: 13.2rem; }
.about__cuff    { grid-row: 4; justify-self: end; margin: 13.5rem 1rem 0 0; width: 18.7rem; height: 22.7rem; }
.about__text2   { grid-row: 5; margin: 7.1rem 0 0 16.3rem; width: 18.8rem; }
.about__text3   { grid-row: 6; margin: 5rem 0 0 4rem; width: 28rem; }
.about__portrait{ grid-row: 7; margin: 5.1rem 0 0 1.2rem; width: 33.7rem; height: 24.1rem; }
.about__text4   { grid-row: 8; margin: 5rem 0 0 4rem; width: 28rem; }
.about__summary { grid-row: 9; justify-self: center; margin-top: 11.9rem; width: 30rem; }
.about__line    {
  grid-row: 10;
  justify-self: center;
  display: block;
  width: 1px;
  height: 26.6rem;
  margin-top: 8.2rem;
  background: var(--ink);
  transform-origin: top;
}

@media (min-width: 1024px) {
  .about__stage { display: block; height: 222.3rem; padding: 0; }
  .about__stage > * { margin: 0; }
  .about__line { height: 50rem; width: 1px; }
}

/* =========================================================
   Продукты (карточки)
   ========================================================= */

.products { padding-bottom: 10rem; }

.cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 34.2rem;
  margin-inline: auto;
}

.card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 3rem;
  min-height: 37.3rem;
  border: .2rem solid var(--ink);
  border-radius: 2rem;
  overflow: hidden;
}

/* градиентный фон: на мобильных виден всегда, на десктопе — при наведении */
.card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: center / cover no-repeat;
  transform: rotate(180deg);
  transition: opacity .3s ease;
}
.card--1::before { background-image: url('../img/card-bg-1.webp'); }
.card--2::before { background-image: url('../img/card-bg-2.webp'); }
.card--3::before { background-image: url('../img/card-bg-3.webp'); }

.card__num   { font-size: 6rem; font-weight: 600; line-height: 1; }
.card__title { margin-top: 2.5rem; max-width: 28rem; font-size: 2.5rem; font-weight: 500; line-height: 1; }
.card__text  { margin-top: 5rem; max-width: 27.8rem; font-size: 1.4rem; line-height: 1; }
.card--2 .card__title { max-width: 22.9rem; }

@media (min-width: 1024px) {
  .products { padding-block: 12.2rem; }

  .cards {
    flex-direction: row;
    gap: 1.1rem;
    width: 117.1rem;
  }

  .card {
    flex: 1 1 0;
    height: 46.8rem;
    min-height: 0;
    padding: 5rem;
  }

  .card__num   { font-size: 9rem; }
  .card__title { margin-top: 2rem; max-width: 27.3rem; font-size: 3.5rem; }
  .card__text  { max-width: 27.7rem; }
}

@media (min-width: 1024px) and (hover: hover) {
  .card::before { opacity: 0; }
  .card:hover::before { opacity: 1; }
}

/* =========================================================
   Решения (кривая с точками)
   ========================================================= */

.solutions { overflow: hidden; }
.solutions__stage { height: 129rem; }

.solutions__curve--desktop { display: none; }
.solutions__curve--mobile {
  position: absolute;
  top: 17.6rem;
  left: 2.3rem;
  width: 34.6rem;
  height: auto;
}

.dot {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: .2rem solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  transition: background-color .2s ease, color .2s ease;
}
.dot.is-visible { background: #000; border-color: #000; color: var(--white); }

.solution {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.solution__title {
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1;
}
.solution__text {
  width: calc(var(--mtw) * .1rem);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
}

@media (min-width: 1024px) {
  .solutions__stage { height: 141.3rem; }

  .solutions__curve--mobile { display: none; }
  .solutions__curve--desktop {
    display: block;
    position: absolute;
    top: 41.3rem;
    left: calc(50% - 70.4rem - 4.5rem);
    width: 140.8rem;
    height: auto;
    transform: rotate(16deg);
  }

  .dot {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.8rem;
  }

  .solution { gap: 2rem; }
  .solution__text { width: auto; font-size: 1.4rem; }
}

/* =========================================================
   Подвал
   ========================================================= */

.footer {
  background: var(--ink);
  color: var(--white);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "contacts contacts"
    "legal    legal"
    "logo     logo"
    "note     company";
  column-gap: 1.5rem;
  width: 36rem;
  margin-inline: auto;
  padding: 2.5rem 2rem 2.5rem 2.2rem;
}

.footer__contacts {
  grid-area: contacts;
  white-space: nowrap;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.55;
}

.footer__legal {
  grid-area: legal;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.3rem;
  margin-top: 3.5rem;
  font-size: 1rem;
  line-height: 1.15;
  text-transform: uppercase;
  opacity: .75;
}

.footer a:hover { text-decoration: underline; text-underline-offset: .3rem; }

.footer__logo { grid-area: logo; margin-top: 3.5rem; }
.footer__logo img { width: 100%; height: auto; }

.footer__note {
  grid-area: note;
  margin-top: 2.5rem;
  color: var(--gray);
  font-size: .8rem;
  line-height: 1.15;
  text-transform: uppercase;
}
.footer__company { grid-area: company; }

@media (min-width: 1024px) {
  .footer__inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "legal contacts"
      "logo  logo"
      "note  company";
    align-items: start;
    width: 128rem;
    padding: 6rem 5.5rem 6rem 6.6rem;
  }

  .footer__contacts {
    display: flex;
    gap: 5.2rem;
    font-size: 1.6rem;
  }

  .footer__legal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem 3rem;
    max-width: 42rem;
    margin-top: 1rem;
    opacity: 1;
  }

  .footer__logo { margin-top: 12.3rem; width: 115.9rem; }

  .footer__note { align-self: end; margin-top: .5rem; font-size: 1rem; }
  .footer__company { justify-self: end; width: 19.8rem; }
}

/* =========================================================
   Попап с формой
   ========================================================= */

.modal {
  width: 34rem;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 3rem 3rem 4.5rem;
  border: .2rem solid var(--ink);
  border-radius: 3rem;
  background: var(--bg);
  color: var(--ink);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(238, 238, 238, .05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.modal[open] { animation: modal-in .3s ease; }
@keyframes modal-in { from { opacity: 0; } }

.modal__close {
  position: absolute;
  top: 3rem;
  right: 3rem;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.modal__close svg { width: 100%; height: 100%; fill: none; stroke: var(--ink); stroke-width: 2; }

.modal__title {
  margin-top: 4.3rem;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1;
}

.form { margin-top: 3.6rem; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  height: 4rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(38, 38, 42, .3);
}

.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 2rem;
  border: 0;
  background: transparent;
  color: #000;
  font-size: 1.2rem;
  font-weight: 500;
  outline: none;
}
.field input::placeholder { color: rgba(0, 0, 0, .5); text-transform: uppercase; opacity: 1; }
.field:focus-within { border-bottom-color: var(--ink); }

.field--phone input { padding-left: .6rem; }
.field__prefix { padding-left: 2rem; font-size: 1.2rem; font-weight: 500; }

.field__error {
  position: absolute;
  left: 2rem;
  top: calc(100% + .2rem);
  color: var(--error);
  font-size: 1.1rem;
}
.field.is-invalid { border-bottom-color: var(--error); }

.consent {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .4rem 1rem;
  margin-top: 2.5rem;
  font-size: 1.1rem;
  line-height: 1.35;
  color: var(--muted);
  cursor: pointer;
}
.consent input { flex: none; width: 1.6rem; height: 1.6rem; margin: 0; accent-color: var(--ink); }
.consent a { text-decoration: underline; }
.consent > span:not(.field__error) { flex: 1; }
.consent .field__error { position: static; flex-basis: 100%; padding-left: 2.6rem; }
.consent .field__error:empty { display: none; }
.consent.is-invalid input { outline: 1px solid var(--error); }

.btn--form {
  height: 4rem;
  min-width: 12rem;
  margin-top: 3rem;
  background: #000;
  font-size: 1.6rem;
}
.btn--form[disabled] { opacity: .6; cursor: progress; }

.form__status { margin-top: 1.5rem; font-size: 1.4rem; line-height: 1.3; }
.form__status.is-error { color: var(--error); }

@media (min-width: 1024px) {
  .modal { width: 44rem; padding: 3rem 4rem 4.5rem; }
  .modal__title { margin-top: 4.1rem; max-width: 36.1rem; font-size: 2.9rem; }
}

/* =========================================================
   Cookie-баннер (размеры в px, как в исходном блоке Tilda)
   ========================================================= */

.cookie {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  width: 600px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 17px 24px 20px 19px;
  border-radius: 20px;
  background: var(--bg);
  box-shadow: 0 0 15px rgba(0, 0, 0, .1);
  font-size: 14px;
}
.cookie[hidden], .cookie [hidden] { display: none; }

.cookie__title { font-size: 20px; font-weight: 500; line-height: 1.35; }
.cookie__text  { margin-top: 20px; line-height: 1.55; }
.cookie__text a { text-decoration: underline; }

.cookie__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cookie__btn {
  height: 35px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cookie__btn--outline { background: transparent; color: var(--ink); }
.cookie__btn--text { margin-left: auto; border-color: transparent; background: transparent; color: var(--ink); }

.cookie__back {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.cookie__back svg { width: 19px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.cookie__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}
.cookie__option-title { font-weight: 600; }
.cookie__option-text { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.cookie__settings > .cookie__btn { margin-top: 24px; }

.toggle {
  appearance: none;
  flex: none;
  position: relative;
  width: 40px;
  height: 22px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  transition: background-color .2s;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform .2s, background-color .2s;
}
.toggle:checked { background: var(--ink); }
.toggle:checked::after { transform: translateX(18px); background: var(--white); }
.toggle:disabled { opacity: .5; cursor: default; }

@media (max-width: 639px) {
  .cookie {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0;
  }
  .cookie__buttons { flex-direction: column; }
  .cookie__btn { width: 100%; height: 40px; }
  .cookie__btn--text { margin-left: 0; }
}

/* =========================================================
   Анимации появления
   ========================================================= */

[data-reveal]:not(.dot) {
  opacity: 0;
  translate: 0 100px;
  transition: opacity 2s ease, translate 2s ease;
}
[data-reveal].is-visible { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal]:not(.dot) { opacity: 1; translate: none; transition: none; }
}

/* без JavaScript всё сразу видно */
.no-js [data-reveal] { opacity: 1; translate: none; }
