/* =========================================================
   NovaPeptide — Bento landing
   Палитра снята с фото: холодный серый студийный фон,
   белый корпус ручек, фиолетовый акцент бренда.
   ========================================================= */

:root {
  /* Color */
  --bg:            #ECECF0;
  --bg-soft:       #F4F4F7;
  --surface:       #FFFFFF;
  --ink:           #16161C;
  --ink-soft:      #5B5B68;
  --line:          rgba(22, 22, 28, .08);

  --accent:        #8A2FC4;   /* фирменный фиолетовый с колпачков */
  --accent-deep:   #5E1F94;
  --accent-night:  #24103D;
  --accent-tint:   #EFE4F8;

  /* Shape & depth */
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-1: 0 1px 2px rgba(30, 14, 54, .04), 0 8px 24px rgba(30, 14, 54, .06);
  --shadow-2: 0 2px 4px rgba(30, 14, 54, .06), 0 24px 56px rgba(30, 14, 54, .16);

  /* Motion */
  --ease-out:    cubic-bezier(.22, 1, .36, 1);      /* плавное «приземление» */
  --ease-in:     cubic-bezier(.4, 0, 1, 1);         /* быстрый выход */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);   /* лёгкий «пружинный» перелёт */

  --gap: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #FFFFFF 0%, transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: "Manrope", "Inter", sans-serif; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.container { width: min(1240px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  padding: 12px 0;
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  background: rgba(255, 255, 255, .8);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .35s var(--ease-out), background-color .35s var(--ease-out);
}
/* при прокрутке плашка становится плотнее и получает тень */
.header.is-stuck { background: rgba(255, 255, 255, .94); box-shadow: 0 8px 28px rgba(30, 14, 54, .12); }
.header__inner {
  width: min(1240px, 100% - 32px); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Manrope", sans-serif; font-weight: 800; font-size: 20px; color: var(--accent); }

/* ---------- Section head ---------- */
.section { padding: 56px 0 72px; }
.eyebrow {
  font-family: "Manrope", sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.eyebrow--light { color: rgba(255, 255, 255, .7); }
/* ---------- Hero ---------- */
/* Правая карточка по высоте = блок заголовка (от «Линейка NovaPeptide» до конца H1) */
.hero { display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: stretch; margin-bottom: 32px; }
.hero__text { display: flex; flex-direction: column; justify-content: center; min-width: 0; container-type: inline-size; }
.hero h1 { font-size: min(9.2cqi, 54px); line-height: 1.1; font-weight: 800; text-wrap: balance; }

.hero__card { position: relative; display: flex; flex-direction: column; min-height: 260px; padding: 12px; background: var(--surface); }
.hero__stage {
  position: relative; flex: 1; min-height: 220px; overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 55% 70% at 50% 100%, rgba(138, 47, 196, .22) 0%, transparent 70%),
    linear-gradient(180deg, #EFEFF2 0%, #DEDEE2 100%);
}
/* Веер: все ручки вращаются вокруг общей точки у нижнего края */
.pen {
  position: absolute; left: 50%; bottom: -5%; height: 102%; width: auto;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(var(--r));
  filter: drop-shadow(0 10px 12px rgba(36, 16, 61, .28));
  transition: transform 1.25s var(--ease-spring);
}
/* Анимация при появлении в окне: ручки лежат стопкой и раскрываются веером */
.js .hero__card:not(.is-fanned) .pen { transform: translateX(-50%) rotate(0deg); }
.hero__stage .pen:nth-child(1) { transition-delay: 0s; }
.hero__stage .pen:nth-child(2) { transition-delay: .07s; }
.hero__stage .pen:nth-child(3) { transition-delay: .14s; }
.hero__stage .pen:nth-child(4) { transition-delay: .21s; }
.hero__card .btn { position: absolute; left: 36px; bottom: 36px; z-index: 2; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: clamp(28px, 6.4vw, 46px); }
  .hero__stage { min-height: 300px; }
  .hero__card .btn { position: static; margin-top: 12px; width: 100%; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px;
  font-family: "Manrope", sans-serif; font-weight: 700; font-size: 15px;
  transition: transform .35s var(--ease-spring), box-shadow .3s, background-color .2s, color .2s;
  will-change: transform;
}
.btn:active { transform: scale(.97); }
.btn--sm { padding: 9px 18px; font-size: 14px; }
.btn--lg { padding: 18px 30px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(138, 47, 196, .35); }
.btn--primary:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(138, 47, 196, .42); }
.btn--light { background: #fff; color: var(--accent-night); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.btn--light:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 40px rgba(0, 0, 0, .32); }
.btn--ghost { background: var(--accent-tint); color: var(--accent-deep); }
.btn:focus-visible, .product__toggle:focus-visible, .lead__close:focus-visible { outline: 3px solid rgba(138, 47, 196, .55); outline-offset: 3px; }

/* =========================================================
   BENTO GRID
   Desktop: 4 колонки × 3 ряда
   ┌───────────┬─────┬─────┐
   │  HERO 2×2 │TALL │ NAD │
   │           │ 1×2 ├─────┤
   │           │     │MOTS │
   ├───────────┴─────┼─────┤
   │     CTA  3×1    │STEPS│
   └─────────────────┴─────┘
   ========================================================= */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: var(--gap);
}
.cta   { grid-column: 1 / 4; min-height: 280px; }
.steps { grid-column: 4 / 5; min-height: 280px; }

/* ---------- Card base ---------- */
.card {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out), opacity .5s var(--ease-out), filter .5s var(--ease-out);
}

/* ---------- About ---------- */
.about {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: center;
  padding: 40px 44px;
  background: var(--surface);
}
.about__title { font-size: clamp(28px, 3.2vw, 44px); font-weight: 800; line-height: 1.05; margin-bottom: 16px; }
.about__text { font-size: 17px; line-height: 1.6; color: var(--ink-soft); max-width: 560px; }
.about__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.about__facts li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 20px; border-radius: var(--radius-md);
  background: var(--accent-tint);
}
.about__facts strong { font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 800; color: var(--accent-deep); }
.about__facts span { font-size: 14px; color: var(--ink-soft); }
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; gap: 24px; padding: 28px 24px; }
}

/* ---------- Product card ---------- */
/* Текст виден сразу. Слева — уменьшенное фото на мягкой подложке, справа — название, описание, кнопка. */
.product {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(180px, 38%) 1fr;
  gap: 8px 24px;
  padding: 12px;
  background: var(--surface);
}
.product__media {
  position: relative; overflow: hidden;
  min-height: 300px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #E8E8EB 0%, #DDDDE0 100%);
}
.product__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  /* края фото растворяются в подложке — без видимых границ */
  -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 78%, transparent 100%);
          mask-image: radial-gradient(ellipse closest-side at 50% 50%, #000 78%, transparent 100%);
  transition: transform .9s var(--ease-out);
}
.product__body {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 20px 20px 20px 0;
}
.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-tint);
  font-family: "Manrope", sans-serif; font-weight: 700; font-size: 12px; color: var(--accent-deep);
}
.product__name { font-size: clamp(22px, 2.1vw, 28px); font-weight: 800; margin: 12px 0 10px; color: var(--ink); }
.product__text { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.product__link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 16px; font-weight: 600; color: var(--accent);
  transition: color .2s;
}
.product__link span { display: inline-block; transition: transform .35s var(--ease-out); }
.product__link:hover { color: var(--accent-deep); }
.product__link:hover span { transform: translateX(4px); }
.product__link:focus-visible { outline: 3px solid rgba(138, 47, 196, .45); outline-offset: 3px; border-radius: 6px; }

@media (hover: hover) and (pointer: fine) {
  .product:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
  .product:hover .product__media img { transform: scale(1.04); }
}

/* Планшет и телефон: фото сверху, текст под ним */
@media (max-width: 1100px) {
  .product { grid-column: span 1; grid-template-columns: 1fr; gap: 0; }
  .product__media { height: 280px; min-height: 0; align-self: start; }
  /* фото целиком по центру плитки, края растворяются в подложке */
  .product__media img { width: auto; height: 100%; max-width: 100%; margin-inline: auto; object-fit: contain; }
  .product__body { padding: 20px 12px 12px; }
}

/* ---------- Accent CTA ---------- */
.cta {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  gap: 24px; padding: 40px 44px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-night) 0%, var(--accent-deep) 55%, var(--accent) 100%);
  box-shadow: 0 2px 4px rgba(30, 14, 54, .08), 0 30px 60px rgba(94, 31, 148, .35);
}
.cta__glow { position: absolute; border-radius: 50%; filter: blur(70px); z-index: -1; pointer-events: none; }
.cta__glow--a { width: 340px; height: 340px; right: -60px; top: -120px; background: rgba(214, 140, 255, .55); animation: drift 12s ease-in-out infinite alternate; }
.cta__glow--b { width: 280px; height: 280px; right: 220px; bottom: -160px; background: rgba(255, 255, 255, .18); animation: drift 16s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-40px, 30px) scale(1.15); } }
.cta__title { font-size: clamp(24px, 3vw, 38px); line-height: 1.08; font-weight: 800; }
.cta__text { margin-top: 12px; max-width: 520px; color: rgba(255, 255, 255, .78); font-size: 16px; }

/* Форма в одну строку: телефон + кнопка в общей «таблетке» */
.cta__actions { width: min(100%, 560px); display: flex; flex-direction: column; gap: 12px; }
.cta__form { width: 100%; }
.cta__or { display: flex; align-items: center; gap: 16px; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.cta__or::before, .cta__or::after { content: ""; flex: 1; height: 1px; }
.cta__or::before { background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .4)); }
.cta__or::after  { background: linear-gradient(90deg, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0)); }
.btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 17px 28px; border-radius: 999px;
  background: linear-gradient(135deg, #2E9E44 0%, #1B7A63 100%);
  color: #fff; font-family: "Manrope", sans-serif; font-weight: 800; font-size: 17px;
  box-shadow: 0 10px 26px rgba(10, 60, 40, .35);
  transition: transform .35s var(--ease-spring), box-shadow .3s, filter .2s;
}
.btn-wa svg { width: 26px; height: 26px; flex: none; }
.btn-wa:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(10, 60, 40, .42); filter: brightness(1.06); }
.btn-wa:active { transform: scale(.98); }
.btn-wa:focus-visible { outline: 3px solid rgba(255, 255, 255, .8); outline-offset: 3px; }
.cta__row {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  padding: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s;
}
.cta__row:focus-within { border-color: rgba(255, 255, 255, .75); box-shadow: 0 0 0 4px rgba(255, 255, 255, .15); }
.cta__row.is-invalid { border-color: #FF8FB1; box-shadow: 0 0 0 4px rgba(255, 143, 177, .22); }
.cta__row input[type="tel"] {
  flex: 1 1 auto; min-width: 0; padding: 14px 8px 14px 20px;
  background: transparent; border: 0; outline: 0;
  font: inherit; font-size: 17px; color: #fff;
}
.cta__row input::placeholder { color: rgba(255, 255, 255, .6); }
.cta__row .btn { flex: none; white-space: nowrap; }
.cta__error { margin-top: 8px; padding-left: 20px; font-size: 14px; color: #FFC2D6; }
.cta__done { padding: 14px 0; font-size: 18px; font-weight: 600; }
.cta__form.is-done .cta__row { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Steps ---------- */
.steps { padding: 28px; background: var(--accent-tint); display: flex; flex-direction: column; justify-content: space-between; }
.steps__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-weight: 600; font-size: 15px; }
.steps__list li { display: flex; align-items: center; gap: 12px; }
.steps__list span {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-family: "Manrope", sans-serif; font-size: 13px; font-weight: 800;
}

/* ---------- Footer ---------- */
.footer { padding: 40px 0 56px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.brand--footer { font-size: 18px; margin-bottom: 6px; }
.footer__note { color: var(--ink-soft); font-size: 14px; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; }
.js .reveal.in {
  opacity: 1;
  /* backwards: после завершения анимации hover-transform снова работает */
  animation: rise .9s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(32px) scale(.97); } }

/* ---------- Lead modal ---------- */
.lead {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  overflow: visible;
}
.lead::backdrop { background: rgba(22, 12, 38, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lead[open] { animation: modal-in .5s var(--ease-out); }
.lead[open]::backdrop { animation: fade-in .4s ease; }
.lead.is-closing { animation: modal-out .22s var(--ease-in) forwards; }
.lead.is-closing::backdrop { animation: fade-out .22s ease forwards; }
@keyframes modal-in  { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes modal-out { to   { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes fade-in   { from { opacity: 0; } }
@keyframes fade-out  { to   { opacity: 0; } }

.lead__form {
  position: relative; padding: 36px 32px 32px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(30px) saturate(1.6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
}
.lead__form h2 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.lead__product { color: var(--ink-soft); font-size: 14px; margin-bottom: 20px; }
.lead__product strong { color: var(--accent-deep); }
.lead__close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--bg); color: var(--ink-soft); display: grid; place-items: center;
  transition: transform .4s var(--ease-spring), background-color .2s;
}
.lead__close svg { width: 16px; height: 16px; }
.lead__close:hover { transform: rotate(90deg); background: var(--accent-tint); }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-md);
  border: 1.5px solid var(--line); background: #fff; font: inherit; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(138, 47, 196, .15); }
.field input.is-invalid, .check input.is-invalid { border-color: #D6336C; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); margin: 4px 0 20px; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }

.lead__state--done { text-align: center; padding: 12px 0 4px; }
.lead__state--done p { color: var(--ink-soft); margin: 8px 0 20px; }
.lead__tick { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); animation: pop .6s var(--ease-spring); }
.lead__tick svg { width: 30px; height: 30px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
[hidden] { display: none !important; }

body.is-locked { overflow: hidden; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Планшет: 2 колонки */
@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cta   { grid-column: 1 / 3; }
  .steps { grid-column: 1 / 3; min-height: 0; }
}

/* Мобильный: одна колонка */
@media (max-width: 640px) {
  .section { padding: 32px 0 48px; }
  .bento { grid-template-columns: 1fr; }
  .cta, .steps { grid-column: 1; }
  .cta { padding: 28px 24px; }
  .cta__actions { width: 100%; }
  .cta__row { flex-direction: column; align-items: stretch; border-radius: 28px; }
  .cta__row input[type="tel"] { padding: 12px 16px; }
  .cta__row .btn { width: 100%; }
  .btn--lg { padding: 16px 22px; }
  .header .btn { padding: 9px 16px; font-size: 14px; }
  .lead__form { padding: 32px 22px 24px; }
}

/* Уважение к настройке «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
