/* ===== Reset / base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #333;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }

/* ===== Tokens ===== */
:root {
  --accent: #e600ad;
  --accent-tint: #f7d8e6;
  --text-primary: #333;
  --text-secondary: #656d77;
  --text-tertiary: #c0c6ce;
  --bg-tertiary: #f8f8f8;
  --border: #e2e8f0;
  --shadow-card: 0 10px 40px -6px rgba(110, 117, 126, 0.16);
  --shadow-card-hover: 0 20px 50px -10px rgba(110, 117, 126, 0.28);
  --shadow-pic: 0 10px 20px rgba(110, 117, 126, 0.16);
  --container-w: 1170px;
  --container-px: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Reveal-on-scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* лёгкий каскад для соседних карточек */
.reveal--cascade > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal--cascade.is-visible > * { opacity: 1; transform: none; }
.reveal--cascade.is-visible > *:nth-child(1) { transition-delay: .05s; }
.reveal--cascade.is-visible > *:nth-child(2) { transition-delay: .15s; }
.reveal--cascade.is-visible > *:nth-child(3) { transition-delay: .25s; }
.reveal--cascade.is-visible > *:nth-child(4) { transition-delay: .35s; }
.reveal--cascade.is-visible > *:nth-child(5) { transition-delay: .45s; }
.reveal--cascade.is-visible > *:nth-child(6) { transition-delay: .55s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal--cascade > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===== Layout helpers ===== */
.container {
  max-width: calc(var(--container-w) + var(--container-px) * 2);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.section-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.1;
}
.section-head p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
}

.accent { color: var(--accent); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 99px;
  font-family: 'Syne', 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1;
  border: 0;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}
.btn--accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(230, 0, 173, 0.45);
}
.btn--accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(230, 0, 173, 0.55);
}
.btn--accent:active { transform: translateY(0); }

/* ===== Topbar ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo__mark {
  background: var(--accent);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo__mark img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.logo__text {
  font-weight: 600;
  font-size: 17px;
  line-height: 1.1;
  color: var(--text-primary);
}
.nav {
  display: flex;
  gap: 32px;
}
.nav a {
  position: relative;
  font-size: 17px;
  color: var(--text-primary);
  letter-spacing: -0.24px;
  transition: color .25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .3s var(--ease);
}
.nav a:hover { color: var(--accent); }
.nav a:hover::after { transform: scaleX(1); }

/* ===== Hero ===== */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 502px) minmax(0, 1fr);
  gap: 80px;
  align-items: center;
}
.hero__text { padding: 24px 0; }
.hero__title {
  font-weight: 700;
  font-size: 48px;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.hero__lead {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
}

/* Browser mockup */
.browser {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  overflow: hidden;
  height: 440px;
  display: flex;
  flex-direction: column;
}
.browser__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}
.browser__dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot--r { background: #e11d48; }
.dot--y { background: #fbbf24; }
.dot--g { background: #22c55e; }
.browser__address {
  background: #f1f5f9;
  color: #94a3b8;
  font-family: 'Roboto', system-ui, sans-serif;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.browser__arrows {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}
.browser__shot {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ===== Services ===== */
.services {
  padding: 0 0 40px;
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}
.service {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.service:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}
.service__title {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
  padding: 16px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.service__title::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left .8s var(--ease);
}
.service:hover .service__title::after { left: 130%; }
.checklist li {
  transition: transform .25s var(--ease), color .25s var(--ease);
}
.checklist li:hover {
  transform: translateX(4px);
  color: var(--text-primary);
}
.checklist {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checklist li {
  position: relative;
  padding-left: 32px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
  min-height: 24px;
  display: flex;
  align-items: center;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background-image: url("assets/icon-check.svg");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ===== Portfolio ===== */
.portfolio { padding: 80px 0; }
.portfolio__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
  gap: 80px;
  align-items: center;
}
.portfolio__text h2 {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.portfolio__text p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
  margin-bottom: 16px;
}
.portfolio__text p:last-child { margin-bottom: 0; }
.portfolio__pics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.portfolio__pic {
  border-radius: 12px;
  overflow: hidden;
  filter: drop-shadow(var(--shadow-pic));
  transition: transform .5s var(--ease), filter .5s var(--ease);
}
.portfolio__pic:hover {
  transform: translateY(-6px) scale(1.015);
  filter: drop-shadow(0 16px 28px rgba(110, 117, 126, 0.28));
}
.portfolio__pic img { transition: transform 1.2s var(--ease); }
.portfolio__pic:hover img { transform: scale(1.05); }
.portfolio__pic--tall {
  aspect-ratio: 3/5;
}
.portfolio__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* Мобильные приложения */
.portfolio--mobile { padding-top: 0; }
.portfolio__col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}
.portfolio__col .portfolio__text { order: -1; }
.portfolio__pics--mobile {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.portfolio__pics--mobile .portfolio__pic { aspect-ratio: 16/10; background: #fff; }
.portfolio__pics--mobile .portfolio__pic img { object-fit: contain; object-position: center; }

/* ===== Stages ===== */
.stages { padding: 40px 0 80px; }
.stages__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.stage {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.stage::before {
  content: "";
  position: absolute;
  inset: auto auto -40px -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(230, 0, 173, 0.10), transparent 70%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.stage:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}
.stage:hover::before { opacity: 1; }
.stage__num {
  font-weight: 700;
  font-size: 48px;
  line-height: 1.1;
  color: var(--text-primary);
  background: linear-gradient(135deg, #333 0%, #333 100%);
  -webkit-background-clip: text;
  background-clip: text;
  transition: background .35s var(--ease);
}
.stage:hover .stage__num {
  background: linear-gradient(135deg, var(--accent) 0%, #ff5fcb 100%);
  -webkit-text-fill-color: transparent;
}
.stage__title {
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: var(--accent);
}
.stage p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 20px;
}

/* ===== Contacts ===== */
.contacts { padding: 40px 0 80px; }
.contacts__card {
  background: var(--bg-tertiary);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.contacts__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.contact {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.contact:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.contact__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .35s var(--ease), background .35s var(--ease);
}
.contact:hover .contact__icon {
  transform: scale(1.08) rotate(-5deg);
  background: var(--accent);
}
.contact__icon img { width: 24px; height: 24px; transition: filter .35s var(--ease); }
.contact:hover .contact__icon img { filter: brightness(0) invert(1); }
.contact__value { transition: color .25s var(--ease); }
.contact:hover .contact__value { color: var(--accent); }
.contact__label {
  font-size: 16px;
  line-height: 20px;
  color: var(--text-primary);
}
.contact__value {
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: var(--text-primary);
}
.contacts__legal p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 20px;
  margin-bottom: 6px;
}
.contacts__legal p:last-child { margin-bottom: 0; }

/* ===== Footer ===== */
.footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.footer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
}
.footer__nav {
  display: flex;
  gap: 16px;
  font-family: 'Syne', 'Open Sans', sans-serif;
  font-size: 16px;
  color: var(--text-primary);
}
.footer__nav a:hover { color: var(--accent); }
.footer__divider {
  border: 0;
  border-top: 1px solid #d9d9d9;
  margin: 0 0 16px;
}
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Syne', 'Open Sans', sans-serif;
  font-size: 16px;
  color: var(--text-tertiary);
}
.footer__bottom a:hover { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .hero { padding: 64px 0; }
  .hero__title { font-size: 40px; }
  .hero__grid { gap: 48px; }
  .browser { height: 380px; }
  .portfolio { padding: 64px 0; }
  .portfolio__row { gap: 48px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .section-head h2 { font-size: 32px; }
}

@media (max-width: 820px) {
  .topbar__inner { gap: 12px; flex-wrap: wrap; }
  .nav { gap: 20px; }
  .hero { padding: 48px 0; }
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero__title { font-size: 36px; }
  .browser { height: 320px; }
  .services__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .portfolio { padding: 48px 0; }
  .portfolio__row {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .portfolio__pics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .portfolio__pics--mobile { grid-template-columns: 1fr; }
  .stages__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contacts__row { grid-template-columns: 1fr; }
  .footer__top, .footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 520px) {
  :root { --container-px: 16px; }
  .topbar__inner .btn--accent { display: none; }
  .hero__title { font-size: 28px; }
  .section-head h2 { font-size: 26px; }
  .browser { height: 260px; }
  .browser__address { font-size: 11px; }
  .stages__grid { grid-template-columns: 1fr; }
  .contact__value { font-size: 20px; }
  .portfolio__pics { grid-template-columns: 1fr; gap: 16px; }
  .portfolio__pic--tall { aspect-ratio: 3/4; }
}
