:root {
  --ink: #111111;
  --muted: #686868;
  --paper: #f4f2ee;
  --paper-strong: #ffffff;
  --line: rgba(17, 17, 17, 0.13);
  --black: #080808;
  --graphite: #1b1b1b;
  --red: #d5001c;
  --silver: #d8d5cf;
  --blue: #2f6675;
  --white: #ffffff;
  --radius: 4px;
  --container: min(1180px, calc(100% - 36px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Manrope, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

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

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  display: grid;
  width: min(1180px, calc(100% - 32px));
  min-height: 62px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 8px 10px 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(8, 8, 8, 0.82);
  color: var(--white);
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}

.brand,
.nav,
.hero-actions,
.footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 12px;
  letter-spacing: 0;
}

.nav {
  justify-content: center;
  gap: 24px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  text-transform: uppercase;
}

.nav a,
.top-action,
.button {
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.nav a:hover,
.top-action:hover,
.button:hover {
  transform: translateY(-1px);
}

.top-action {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
}

.hero {
  position: relative;
  min-height: 96vh;
  padding: 118px 24px 84px;
  color: var(--white);
  background: var(--black);
}

#hero-canvas,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hero-canvas {
  z-index: 0;
}

.hero-overlay {
  z-index: 1;
  background:
    radial-gradient(circle at 78% 22%, rgba(213, 0, 28, 0.16), transparent 28%),
    linear-gradient(90deg, rgba(8, 8, 8, 0.98), rgba(8, 8, 8, 0.68) 58%, rgba(8, 8, 8, 0.9)),
    linear-gradient(180deg, rgba(8, 8, 8, 0.12), rgba(8, 8, 8, 0.88));
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1180px, 100%);
  min-height: calc(96vh - 178px);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  margin: 0 auto;
}

.eyebrow,
.section-label,
.panel-kicker {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.intro h2,
.section-head h2,
.automation h2,
.contact h2 {
  margin: 0;
  font-family: Manrope, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 850px;
  max-width: 780px;
  font-size: clamp(38px, 5.4vw, 72px);
}

.hero-lead {
  max-width: 690px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(17px, 1.5vw, 21px);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  margin-bottom: 30px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  text-transform: uppercase;
}

.button.primary {
  background: var(--red);
  color: var(--white);
}

.button.primary:hover {
  background: #b80018;
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.42);
  color: var(--white);
}

.button.secondary:hover {
  border-color: rgba(255, 255, 255, 0.8);
}

.signal-panel {
  align-self: end;
  margin-bottom: 60px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(14px);
}

.signal-panel ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-panel li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  text-transform: uppercase;
}

.signal-panel li span {
  color: var(--red);
  font-weight: 800;
}

.ticker {
  position: relative;
  z-index: 2;
  width: 100vw;
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #171717;
}

.ticker-band {
  margin-top: 0;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 28s linear infinite;
}

.ticker span {
  padding: 16px 34px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

@keyframes ticker {
  to {
    transform: translateX(-33.333%);
  }
}

section:not(.hero) {
  padding: 88px 0;
  scroll-margin-top: 92px;
}

.section-band {
  background: var(--paper-strong);
}

.intro.section-band {
  width: var(--container);
  max-width: 1180px;
  background: transparent;
  color: var(--ink);
  margin: 0 auto;
  padding: 88px 0;
  border-radius: 0;
}

.intro,
.services,
.work,
.automation,
.portfolio,
.cases,
.contact,
.footer {
  width: var(--container);
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.intro .section-label {
  grid-column: 1;
}

.intro h2,
.intro p:last-child {
  grid-column: 2;
}

.intro p:last-child {
  max-width: none;
  width: 100%;
}

.intro h2,
.section-head h2,
.automation h2,
.contact h2 {
  font-size: clamp(30px, 3.7vw, 48px);
}

.intro p:last-child,
.automation p,
.contact p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.intro p:last-child {
  color: var(--muted);
}

.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  margin-bottom: 42px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.portfolio {
  position: relative;
}

.portfolio-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

@media (min-width: 921px) {
  .portfolio-grid {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 18px;
    scroll-padding-left: 0;
    scroll-snap-type: x mandatory;
  }

  .portfolio-grid::-webkit-scrollbar {
    height: 6px;
  }

  .portfolio-grid::-webkit-scrollbar-track {
    background: rgba(17, 17, 17, 0.08);
  }

  .portfolio-grid::-webkit-scrollbar-thumb {
    background: rgba(17, 17, 17, 0.36);
  }

  .work-card {
    display: flex;
    flex: 0 0 min(430px, 38vw);
    aspect-ratio: auto;
    flex-direction: column;
    scroll-snap-align: start;
  }

  .work-card picture,
  .work-shot {
    height: auto;
  }

  .work-shot {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
  }

  .work-meta {
    position: static;
    min-height: 92px;
    background: #5f5f5f;
    backdrop-filter: none;
  }
}

.work-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #f7f7f7;
  color: var(--white);
  isolation: isolate;
}

.work-card picture,
.work-shot {
  width: 100%;
  height: 100%;
}

.work-card picture {
  display: block;
}

.work-shot {
  object-fit: contain;
  object-position: top center;
  opacity: 1;
  filter: saturate(0.96) contrast(1.02);
  transform: scale(1);
  transition: transform 500ms ease, opacity 500ms ease, filter 500ms ease;
}

.work-card:hover .work-shot {
  opacity: 1;
  filter: saturate(0.96) contrast(1.02);
  transform: scale(1);
}

.work-card::before {
  display: none;
}

.work-meta {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 18px 20px;
  background: rgba(8, 8, 8, 0.62);
  backdrop-filter: blur(18px) saturate(1.12);
}

.work-meta img {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: var(--white);
}

.work-meta span {
  display: grid;
  gap: 2px;
}

.work-meta strong {
  font-size: 18px;
}

.work-meta em {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-style: normal;
  text-transform: uppercase;
}

.service-card {
  min-height: 260px;
  padding: 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

.service-card.accent {
  background: var(--graphite);
  color: var(--white);
}

.service-number {
  color: var(--red);
  font-weight: 900;
}

.service-card h3,
.step h3,
.case-list h3 {
  margin: 38px 0 14px;
  font-family: Manrope, "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.12;
}

.service-card p,
.step p,
.case-list p {
  margin: 0;
  color: var(--muted);
}

.service-card.accent p {
  color: rgba(255, 255, 255, 0.76);
}

.work.section-band,
.cases.section-band {
  background: transparent;
  padding-top: 56px;
  padding-bottom: 56px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  background: transparent;
}

.step {
  min-height: 280px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
}

.step span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
  font-weight: 900;
}

.automation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 54px;
}

.stack-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stack-map span {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 84px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: rgba(255, 250, 240, 0.66);
  color: var(--graphite);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.stack-map .ai-tile,
.stack-map .tech-tile {
  min-height: 164px;
  border-color: rgba(255, 255, 255, 0.12);
  background-color: #090909;
  color: var(--white);
  font-size: 24px;
  isolation: isolate;
  background-position: center;
  background-size: cover;
}

.stack-map .ai-tile {
  background-size: cover;
}

.stack-map .ai-tile::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.02), rgba(8, 8, 8, 0.46)),
    radial-gradient(circle at 50% 22%, rgba(213, 0, 28, 0.1), transparent 42%);
  content: "";
}

.ai-gpt {
  background-image: linear-gradient(180deg, rgba(8, 8, 8, 0.04), rgba(8, 8, 8, 0.42)), url("assets/ai-panels.png");
  background-position: left center;
  background-size: 300% 100%;
}

.ai-claude {
  background-image: linear-gradient(180deg, rgba(8, 8, 8, 0.04), rgba(8, 8, 8, 0.42)), url("assets/ai-n8n-new.png");
  background-position: center center;
}

.ai-n8n {
  background-image: linear-gradient(180deg, rgba(8, 8, 8, 0.04), rgba(8, 8, 8, 0.42)), url("assets/ai-claude-new.png");
  background-position: center center;
}

.tech-tile::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
}

.tile-amo {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.58)),
    url("assets/ai-claude-new.png") center / cover;
}

.tile-bitrix {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.58)),
    url("assets/ai-n8n-new.png") center / cover;
}

.tile-retail {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.6)),
    url("assets/ai-panels.png") right center / 300% 100%;
}

.tile-direct {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.6)),
    url("assets/integration-panels.png") 60% center / 600% 100%;
}

.tile-metrika {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.6)),
    url("assets/integration-panels.png") 80% center / 600% 100%;
}

.tile-pay {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.6)),
    url("assets/integration-panels.png") 100% center / 600% 100%;
}

.case-list {
  display: grid;
  gap: 16px;
  background: transparent;
}

.case-list article {
  display: grid;
  grid-template-columns: 0.9fr 1fr;
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
}

.case-list h3 {
  margin: 0;
}

.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 54px;
  align-items: start;
}

.contact-copy {
  max-width: 820px;
}

.contact h2 {
  margin-bottom: 28px;
}

.telegram-button {
  margin-top: 28px;
}

.footer {
  justify-content: space-between;
  gap: 18px;
  padding: 32px 0 46px;
  color: var(--muted);
  font-size: 14px;
}

[data-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  .hero-inner,
  .intro,
  .section-head,
  .automation,
  .contact,
  .case-list article {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    align-items: end;
    gap: 24px;
  }

  .signal-panel {
    align-self: auto;
    margin-bottom: 40px;
  }

  .service-grid,
  .timeline,
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intro.section-band {
    padding: 68px 0;
  }

  .intro .section-label,
  .intro h2,
  .intro p:last-child {
    grid-column: 1;
  }

}

@media (max-width: 620px) {
  .topbar {
    top: 10px;
    width: calc(100% - 20px);
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 10px;
  }

  .brand span:last-child {
    display: none;
  }

  .top-action {
    padding: 9px 10px;
    font-size: 13px;
  }

  .hero {
    min-height: auto;
    padding: 72px 18px 0;
  }

  .hero-inner {
    min-height: auto;
    padding-top: 18px;
  }

  .hero h1 {
    font-size: 32px;
    line-height: 1.08;
  }

  .hero-lead {
    font-size: 15px;
  }

  .button {
    width: 100%;
  }

  .signal-panel {
    padding: 18px;
  }

  .ticker {
    width: 100vw;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
  }

  .ticker span {
    font-size: 12px;
  }

  section:not(.hero) {
    padding: 68px 0;
  }

  .work.section-band,
  .cases.section-band {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .service-grid,
  .timeline,
  .stack-map,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .intro,
  .services,
  .work,
  .automation,
  .portfolio,
  .cases,
  .contact,
  .footer {
    width: min(1180px, calc(100% - 36px));
  }

  .intro.section-band {
    margin: 0 auto;
    padding: 68px 0;
  }

  .work-card {
    display: flex;
    aspect-ratio: auto;
    min-height: 0;
    flex-direction: column;
  }

  .work-card picture,
  .work-shot {
    height: auto;
  }

  .work-shot {
    display: block;
    object-fit: contain;
  }

  .work-meta {
    position: static;
    min-height: 92px;
    background: #5f5f5f;
    backdrop-filter: none;
  }

  .service-card,
  .step {
    min-height: auto;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 0;
  }
}

@media (min-width: 921px) {
  .work-shot {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center top;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
