:root {
  --bg: #f7f8ff;
  --text: #162034;
  --muted: #5a6888;
  --green: #6de24a;
  --blue: #5d6fff;
  --violet: #844fff;
  --card: #ffffff;
  --line: #dbe2ff;
  --radius: 22px;
  --shadow: 0 18px 40px rgba(69, 87, 160, 0.15);
}

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

body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 10%, #eef0ff 0%, #f9fbff 45%, #f6fff0 100%);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.container {
  width: min(1160px, 92%);
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.header {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
  background: rgba(247, 248, 255, 0.82);
  border-bottom: 1px solid #e8edff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  flex-shrink: 0;
}
.brand-ya {
  display: inline-block;
  line-height: 0.9;
  font-size: 1.7rem;
  font-weight: 700;
  font-style: italic;
  font-family: "Georgia", "Times New Roman", serif;
  color: #3f57c8;
  position: relative;
  z-index: 1;
  margin-right: -0.38em;
}
.brand-pill {
  position: relative;
  background: linear-gradient(120deg, #75ef52, #52d63b);
  padding: .15rem .65rem;
  border-radius: 10px;
  color: #14210f;
}
.nav { display: flex; gap: 1rem; flex: 1; justify-content: center; }
.nav a { text-decoration: none; color: #2f3f66; font-weight: 700; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.header-tel {
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  color: #2c4cb0;
  white-space: nowrap;
  padding: 0.35rem 0.1rem;
}
.header-tel:hover { text-decoration: underline; }

.btn {
  border: 0;
  background: linear-gradient(120deg, var(--green), #9cf779);
  color: #12220e;
  padding: .82rem 1.15rem;
  border-radius: 13px;
  text-decoration: none;
  font-weight: 800;
  display: inline-flex;
  justify-content: center;
  box-shadow: 0 12px 26px rgba(109, 226, 74, 0.35);
  cursor: pointer;
}
.btn.ghost { background: #fff; border: 1px solid #d8defe; color: #27335b; box-shadow: none; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.2rem;
  padding-top: 2.6rem;
}

.tag {
  display: inline-block;
  background: #e9edff;
  color: #3349a6;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-weight: 700;
}

h1 { margin: .8rem 0; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3.7vw, 2.3rem); margin: 0 0 .8rem; }
h3 { margin: 0 0 .6rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
}

.hero-art img { width: 100%; border-radius: 16px; }
.hero-total {
  margin-top: .7rem;
  border-radius: 14px;
  padding: .75rem .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(130deg, #f1fff0, #eaf4ff);
  border: 1px solid #cceec1;
}
.hero-total span {
  color: #3b4a77;
  font-weight: 700;
}
.hero-total strong {
  font-size: 1.35rem;
  background: linear-gradient(120deg, #36b92a, #66d84d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.interactive-hero {
  background: linear-gradient(145deg, #f8faff, #eef7ff);
  border: 1px solid #d7e0ff;
  border-radius: 16px;
  padding: .8rem;
}
.interactive-title {
  margin: 0 0 .65rem;
  font-weight: 700;
  color: #30437a;
}
.item-scene {
  position: relative;
  min-height: 240px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 25%, rgba(114, 141, 255, 0.15), transparent 40%),
    radial-gradient(circle at 76% 70%, rgba(96, 224, 86, 0.2), transparent 42%),
    #f7faff;
  border: 1px dashed #ccd7ff;
  overflow: hidden;
}
.trade-item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  border: 1px solid #d6dfff;
  background: #fff;
  border-radius: 12px;
  padding: .52rem .42rem;
  min-width: 92px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(93, 111, 255, 0.15);
  touch-action: manipulation;
  transform: rotate(var(--r));
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease;
}
.trade-item:hover,
.trade-item:focus-visible {
  z-index: 2;
  transform: rotate(var(--r)) translateY(-3px) scale(1.04);
  border-color: #9db0ff;
  box-shadow: 0 10px 20px rgba(93, 111, 255, 0.2);
}
.trade-item:focus-visible { outline: 2px solid #8fa6ff; outline-offset: 2px; }
@media (hover: none) and (pointer: coarse) {
  .trade-item:active {
    z-index: 2;
    transform: rotate(var(--r)) translateY(-2px) scale(1.03);
    border-color: #9db0ff;
    box-shadow: 0 8px 16px rgba(93, 111, 255, 0.22);
  }
}
.item-emoji {
  font-size: 1.6rem;
  transition: transform .2s ease, opacity .2s ease;
}
.item-icon-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  transition: transform .2s ease, opacity .2s ease;
}
.item-label {
  font-size: .78rem;
  font-weight: 700;
  color: #425080;
}
.trade-item:hover .item-emoji {
  transform: scale(1.08) rotate(-4deg);
}
.trade-item:hover .item-icon-img {
  transform: scale(1.08) rotate(-4deg);
}
.trade-item.converted {
  background: linear-gradient(150deg, #e9ffd9, #d7fbc5);
  border-color: #7be154;
  box-shadow: 0 12px 24px rgba(89, 211, 57, 0.35);
}
.trade-item.converted .item-label {
  color: #2e6e17;
}
.trade-item.converted .item-emoji {
  opacity: 0;
  transform: scale(.55);
}
.trade-item.converted .item-icon-img {
  opacity: 0;
  transform: scale(.55);
}
.ruble-pop {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  margin: 0 auto;
  top: 0.15rem;
  width: max-content;
  max-width: min(100%, 7.5rem);
  text-align: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: #33bf23;
  text-shadow: 0 0 14px rgba(81, 225, 74, 0.75);
  animation: rublePop .35s ease forwards;
  pointer-events: none;
  padding: .3rem .35rem;
  border-radius: 10px;
  background: rgba(228, 255, 216, 0.95);
  line-height: 1.2;
  word-break: break-word;
}
@keyframes rublePop {
  0% { transform: scale(.45); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.section { padding-top: 3.2rem; }
section[id] { scroll-margin-top: 4.5rem; }
.grid { display: grid; gap: 1rem; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card { height: 100%; }

.services-row { align-items: stretch; }
.service-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  /* единый отступ сверху, чтобы все три карточки были одной высоты */
  padding-top: 0.85rem;
  position: relative;
}
.service-col > .card.service {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.service-col--popular .popular-badge {
  position: absolute;
  top: 0.85rem;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  margin: 0;
  background: linear-gradient(120deg, #6f7cff, #945aff);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(99, 88, 200, 0.35);
  white-space: nowrap;
}
.main-service { border: 2px solid #b7ff9f; }
.service { display: flex; flex-direction: column; gap: 0.25rem; }
.service p { flex: 1; margin-bottom: 0.75rem; }
.commission {
  align-self: flex-end;
  min-width: min(100%, 168px);
  min-height: 40px;
  border-radius: 999px;
  background: linear-gradient(140deg, #6de24a, #53d2ff);
  color: #102018;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.45rem 0.75rem;
  box-shadow: 0 12px 20px rgba(84, 170, 130, 0.3);
}

.text-ai {
  font-weight: 800;
  background: linear-gradient(120deg, #5d6fff, #7b45ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cabinet {
  background: linear-gradient(140deg, #ffffff 0%, #f3f6ff 50%, #f2fff4 100%);
}
.cabinet-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: .9rem;
}
.cab-sidebar {
  background: #f3f6ff;
  border: 1px solid #dce4ff;
  border-radius: 14px;
  padding: .9rem;
  display: grid;
  gap: .45rem;
  align-content: start;
}
.cab-sidebar .cab-nav {
  display: block;
  color: #3b4d7e;
  font-weight: 700;
  padding: .35rem .4rem;
  border-radius: 8px;
  cursor: default;
  user-select: none;
}
.cab-content {
  border: 1px solid #dce4ff;
  border-radius: 14px;
  background: #fff;
  padding: .8rem;
}
.cabinet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .8rem;
  color: #4f5e80;
}
.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.cab-item {
  border: 1px solid #d7e0ff;
  border-radius: 14px;
  padding: .85rem;
  background: #fff;
}
.state {
  display: inline-flex;
  margin-top: .35rem;
  padding: .24rem .55rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.state-sale { background: #e8efff; color: #2f4cb6; }
.state-done { background: #e4f9da; color: #2c8e16; }
.state-accept { background: #f4e8ff; color: #743ab1; }

.case {
  text-align: left;
  background: linear-gradient(180deg, #ffffff, #f4f7ff);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  min-height: 0;
  height: 100%;
  align-self: stretch;
}
.case:nth-child(1) { background: linear-gradient(140deg, #f3f8ff, #edf7ff); }
.case:nth-child(2) { background: linear-gradient(140deg, #fff5ff, #f6efff); }
.case:nth-child(3) { background: linear-gradient(140deg, #fff8ef, #fff2db); }
.case:nth-child(4) { background: linear-gradient(140deg, #f0fff2, #e7fff8); }
.case > strong {
  font-size: 1.05rem;
  color: #2c9f19;
  display: block;
  margin: 0;
  flex: 0 0 auto;
  line-height: 1.3;
  min-height: 1.35em;
}
.case-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  flex: 0 0 auto;
}
.case-name-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.case-name-block h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  font-style: normal;
  font-weight: 800;
}
.case-city {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.2;
  font-style: italic;
  font-weight: 500;
  color: #647099;
}
.case-client {
  text-align: left;
  padding: .65rem;
  border: 1px solid #d8e0ff;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0.4rem;
}
.case-client > p {
  flex: 1 1 auto;
  margin: 0;
  min-height: 0;
}
.avatar-photo {
  --avatar-size: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: var(--avatar-size);
  min-height: var(--avatar-size);
  aspect-ratio: 1;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 14px rgba(57, 75, 145, 0.2);
  background: #e8ecfd;
  color: #2e3d66;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  user-select: none;
}
.case:nth-child(1) .avatar-photo { background: #e0e8ff; color: #3349a6; }
.case:nth-child(2) .avatar-photo { background: #f1e4f4; color: #6b3a7a; }
.case:nth-child(3) .avatar-photo { background: #fff0e0; color: #8a5520; }
.case:nth-child(4) .avatar-photo { background: #dff5ea; color: #1d6a48; }

.product-thumb {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #e5ebff;
  box-shadow: 0 8px 14px rgba(57, 75, 145, 0.2);
  background: #f0f2fa;
}
.product-thumb .product-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
  box-shadow: none;
}
.case:nth-child(1) .product-thumb .product-photo {
  object-position: 50% 38%;
}
.case:nth-child(2) .product-thumb .product-photo {
  object-position: 50% 45%;
}
.case:nth-child(3) .product-thumb .product-photo {
  object-position: 52% 48%;
}
.case:nth-child(4) .product-thumb .product-photo {
  object-position: 50% 58%;
}
.case-detail {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--muted);
  flex: 0 0 auto;
  min-height: 2.8em;
  box-sizing: content-box;
}

#cases .g4 {
  align-items: stretch;
}
.case-product {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .6rem;
  border: 1px solid #d6f1cf;
  border-radius: 12px;
  background: rgba(240, 255, 237, 0.85);
  color: #334677;
  font-weight: 700;
  min-height: 88px;
  flex: 0 0 auto;
  box-sizing: border-box;
}
.case-product > span {
  min-width: 0;
  line-height: 1.35;
}
.small-note { color: var(--muted); margin: .8rem 0 0; }

.step-card {
  position: relative;
  overflow: hidden;
}
.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf2ff;
  margin-bottom: .45rem;
}

.ai { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; align-items: stretch; }
.ai-text { display: flex; flex-direction: column; gap: .55rem; }
.ai-modern {
  position: relative;
  overflow: hidden;
  border: 1px solid #cfd8ff;
  background: linear-gradient(135deg, #f8f9ff 0%, #eef3ff 50%, #f1fff2 100%);
}
.ai-modern::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  right: -60px;
  top: -50px;
  border-radius: 50%;
  background: rgba(108, 119, 255, 0.2);
}
.ai-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.ai-badges span {
  padding: .32rem .6rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d3dbff;
  color: #425183;
  font-weight: 700;
  font-size: .85rem;
}
.ai-chart {
  border: 1px solid #d6e0ff;
  border-radius: 14px;
  background: #fff;
  padding: .8rem;
  display: grid;
  gap: .6rem;
}
.ai-chart h3 {
  margin: 0 0 .2rem;
  color: #32427a;
}
.metric {
  display: grid;
  gap: .2rem;
}
.metric span {
  color: #5b678d;
  font-size: .88rem;
}
.metric strong {
  color: #1f2d63;
}
.bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #ebefff;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, #58d743, #7ee16b);
}

.form-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.lead-form { display: grid; gap: .75rem; }
.lead-form label { display: grid; gap: .3rem; font-weight: 700; color: #2d3b62; }
input, select, textarea {
  width: 100%;
  border: 1px solid #ced7ff;
  border-radius: 12px;
  padding: .75rem .85rem;
  font: inherit;
}
input[type="file"] {
  background: #f3f6ff;
  border-style: dashed;
}
.footer {
  padding: 2.2rem 0 2.6rem;
  color: var(--muted);
  border-top: 1px solid #e2e6f5;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
}
.footer-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}
.footer-block p {
  margin: 0 0 .4rem;
  line-height: 1.45;
  font-size: 0.95rem;
}
.footer-block p:last-child { margin-bottom: 0; }
.footer-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a86a6;
  font-weight: 700;
  margin: 0 0 .5rem;
}
.footer-block a {
  color: #3b52b0;
  font-weight: 700;
  text-decoration: none;
}
.footer-block a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .footer-body { grid-template-columns: 1fr; text-align: center; }
  .footer-block .footer-title { text-align: center; }
}

.bg-fly { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.fly {
  position: absolute;
  left: var(--x);
  top: 108%;
  font-size: 1.4rem;
  opacity: 0;
  animation: rise var(--t) linear infinite;
  animation-delay: var(--d);
  text-shadow: 0 10px 18px rgba(59, 81, 156, .3);
}
.fly.money {
  color: #35b629;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(80, 210, 72, 0.6);
}
.money-burst {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(111, 231, 80, 0.95) 0%, rgba(111, 231, 80, 0) 70%);
  animation: burst .45s ease-out forwards;
  z-index: 5;
}

@keyframes rise {
  0% { transform: translateY(0) scale(.85) rotate(0); opacity: 0; }
  18% { opacity: .6; }
  52% { transform: translateY(-45vh) scale(1.06) rotate(6deg); }
  100% { transform: translateY(-122vh) scale(1.12) rotate(-8deg); opacity: 0; }
}
@keyframes burst {
  from { transform: scale(0.5); opacity: 0.9; }
  to { transform: scale(4.2); opacity: 0; }
}

@media (max-width: 1024px) {
  .nav { display: none; }
  .hero, .ai, .form-wrap { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cabinet-layout { grid-template-columns: 1fr; }
  .cabinet-grid { grid-template-columns: 1fr; }
  .hero-total { flex-direction: column; align-items: flex-start; gap: .2rem; }
  .item-scene { min-height: 210px; }
}

@media (max-width: 600px) {
  .header-tel { font-size: 0.85rem; }
  .header-actions .btn { padding: 0.72rem 0.95rem; font-size: 0.88rem; }
}

@media (max-width: 720px) {
  .section { padding-top: 2.3rem; }
  #hero { padding-top: 1.4rem; }
  .g3, .g4 { grid-template-columns: 1fr; }
  .fly { font-size: 1rem; opacity: .25; animation-duration: 17s !important; }
  .bg-fly .fly:nth-child(n+6) { display: none; }
  .interactive-title { font-size: 0.92rem; line-height: 1.35; }
  .item-scene { min-height: 300px; }
  .trade-item { min-width: 88px; min-height: 50px; padding: 0.5rem 0.4rem; }
  .trade-item:nth-child(1) { --x: 6% !important; --y: 12% !important; }
  .trade-item:nth-child(2) { --x: 49% !important; --y: 8% !important; }
  .trade-item:nth-child(3) { --x: 28% !important; --y: 36% !important; }
  .trade-item:nth-child(4) { --x: 12% !important; --y: 64% !important; }
  .trade-item:nth-child(5) { --x: 56% !important; --y: 62% !important; }
  .ruble-pop { font-size: 0.88rem; padding: 0.28rem 0.3rem; }
  .header {
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
    padding-left: max(0, env(safe-area-inset-left, 0px));
    padding-right: max(0, env(safe-area-inset-right, 0px));
  }
}
