/* Экран 2: крем как на первом экране, изометрия без растягивания */

:root {
  --bg: #fffbef;
  --frame: #fffbef;
  --panel: rgba(255, 251, 239, 0.92);
  --text: #141414;
  --muted: #5a5a5a;
  --line: rgba(20, 20, 20, 0.12);
  /* Эталон второго экрана — см. locked-second-screen/COLOR-PALETTE.md */
  --eco-bg: #fffbef;
  --eco-sites: #e8a828;
  --eco-seo: #1888d8;
  --eco-crm: #58c878;
  --eco-support: #d83828;
  --eco-earth-ocean: #2d72a4;
  --eco-earth-land: #969957;
  --eco-earth-outline: #f5f5f8;
  --eco-shirt: #f5f5f5;
  --eco-label: #ffffff;
  /* UI hover/labels: чуть светлее эталона блоков */
  --sites: #f0bc45;
  --seo: #6bc4e8;
  --crm: #4dcf78;
  --support: #e05a54;
  --font-display: "Manrope", "Golos Text", "Segoe UI", sans-serif;
  --font-body: "Golos Text", "Manrope", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
}

button {
  font: inherit;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--bg);
}

.ecosystem {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0;
  overflow: visible;
}

.hero.is-zone-active {
  color-scheme: dark;
}

/* Сцена: крем, картинка 1024×576 без растягивания */
.scene-shell {
  grid-area: 1 / 1;
  position: relative;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.scene-shell::before {
  content: none;
}

.scene-fit {
  position: absolute;
  inset: 2% 14%;
  display: grid;
  place-items: center;
  container-type: size;
}

.scene {
  position: relative;
  width: min(100cqi, calc(100cqb * 1024 / 576));
  aspect-ratio: 1024 / 576;
  height: auto;
  transform: none;
}

@supports not (width: 1cqi) {
  .scene {
    width: 100%;
    max-height: 100%;
  }
}

.scene__picture {
  position: absolute;
  inset: 0;
  display: block;
}

/* Четыре блока картинки: двигаются цепочкой за мышью */
.scene-parallax {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.scene-layer {
  position: absolute;
  inset: 0;
  display: block;
  will-change: transform;
}

.scene-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.scene-layer[data-layer="crm"] { z-index: 1; }
.scene-layer[data-layer="sites"] { z-index: 2; }
.scene-layer[data-layer="seo"] { z-index: 3; }
.scene-layer[data-layer="support"] { z-index: 4; }

/* Квадрокоптер: живой чёрный корпус, прозрачные винты, зелёный пузырь */
.drone {
  position: absolute;
  z-index: 2;
  left: 49.12109375%;
  top: 4.86111111%;
  width: 8.984375%;
  height: 16.49305556%;
  pointer-events: none;
  animation: drone-hover 3.2s ease-in-out infinite;
}

.drone__craft,
.drone__payload {
  position: absolute;
  inset: 0;
}

.drone__payload {
  animation: drone-icon-bob 2.4s ease-in-out infinite;
}

.drone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  user-select: none;
  pointer-events: none;
}

.drone__blade {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 17.4%;
  height: 16.8%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.drone__blade::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(210, 214, 220, 0.42) 0deg 8deg,
    rgba(28, 28, 32, 0.18) 8deg 45deg,
    rgba(170, 176, 184, 0.28) 45deg 53deg,
    rgba(28, 28, 32, 0.12) 53deg 90deg
  );
  animation: drone-spin 0.11s linear infinite;
  opacity: 0.9;
  mix-blend-mode: normal;
}

@keyframes drone-hover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7%); }
}

@keyframes drone-icon-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5%); }
}

@keyframes drone-spin {
  to { transform: rotate(360deg); }
}

.drone.is-flying {
  animation: none;
}


/* Человечки: при наведении на зону имитируют работу */
.workers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.worker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3.1%;
  aspect-ratio: 40 / 56;
  transform: translate(-50%, -88%);
  opacity: 0;
  overflow: visible;
  transition: opacity 0.18s ease;
}

.scene[data-active="sites"] .worker[data-zone="sites"],
.scene[data-active="seo"] .worker[data-zone="seo"],
.scene[data-active="crm"] .worker[data-zone="crm"],
.scene[data-active="support"] .worker[data-zone="support"] {
  opacity: 1;
}

.worker svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.worker-shadow {
  fill: rgba(20, 16, 10, 0.22);
}

.worker-torso {
  fill: var(--shirt, #f5f5f5);
  stroke: #161616;
  stroke-width: 1.15;
  stroke-linejoin: round;
}

.worker-head {
  fill: #efc4a4;
  stroke: #161616;
  stroke-width: 1.15;
}

.worker-hair {
  fill: #1c1c1c;
}

.worker-legs,
.worker-arm-l,
.worker-arm-r {
  fill: none;
  stroke: #161616;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.worker-arm-l,
.worker-arm-r,
.worker-head,
.worker-hair,
.worker-body {
  transform-box: fill-box;
}

.worker-arm-r { transform-origin: 12% 18%; }
.worker-arm-l { transform-origin: 88% 18%; }
.worker-head,
.worker-hair { transform-origin: 50% 90%; }
.worker-body { transform-origin: 50% 88%; }

.scene[data-active] .worker[data-job="type"] .worker-arm-r {
  animation: worker-type 0.42s ease-in-out infinite;
}
.scene[data-active] .worker[data-job="type"] .worker-arm-l {
  animation: worker-type 0.42s ease-in-out infinite reverse;
  animation-delay: -0.2s;
}
.scene[data-active] .worker[data-job="type"] .worker-head {
  animation: worker-nod 2.4s ease-in-out infinite;
}
.scene[data-active] .worker[data-job="talk"] .worker-arm-r {
  animation: worker-wave 1.1s ease-in-out infinite;
}
.scene[data-active] .worker[data-job="talk"] .worker-head {
  animation: worker-nod 1.8s ease-in-out infinite;
}
.scene[data-active] .worker[data-job="look"] .worker-head,
.scene[data-active] .worker[data-job="look"] .worker-hair {
  animation: worker-look 2.6s ease-in-out infinite;
}
.scene[data-active] .worker[data-job="pedal"] .worker-body {
  animation: worker-pedal 0.55s ease-in-out infinite;
}
.scene[data-active] .worker[data-job="carry"] .worker-body {
  animation: worker-shift 1.4s ease-in-out infinite;
}
.scene[data-active] .worker[data-job="carry"] .worker-arm-r {
  animation: worker-wave 1.4s ease-in-out infinite;
}

@keyframes worker-type {
  0%, 100% { transform: rotate(8deg); }
  50% { transform: rotate(-18deg); }
}
@keyframes worker-nod {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(1px); }
}
@keyframes worker-look {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}
@keyframes worker-wave {
  0%, 100% { transform: rotate(6deg); }
  50% { transform: rotate(-16deg); }
}
@keyframes worker-pedal {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(2px) rotate(3deg); }
}
@keyframes worker-shift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px) translateY(-1px); }
}

@media (prefers-reduced-motion: reduce) {
  .worker { opacity: 0 !important; }
  .worker-arm-l,
  .worker-arm-r,
  .worker-head,
  .worker-hair,
  .worker-body {
    animation: none !important;
  }

  .scene-layer {
    transform: none !important;
    will-change: auto;
  }
}

.scene__base {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  user-select: none;
  pointer-events: none;
}

.zone-hit-map {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.zone-state {
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}

.scene-veil {
  grid-area: 1 / 1 / -1 / 1;
  z-index: 5;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  pointer-events: none;
  opacity: 0;
  overflow: visible;
  /* Края не режут полосой: размытие + сход в крем сверху и снизу */
  filter: blur(22px);
  transform: scale(1.14);
  transform-origin: center center;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 12%,
    #000 24%,
    #000 78%,
    rgba(0, 0, 0, 0.35) 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 12%,
    #000 24%,
    #000 78%,
    rgba(0, 0, 0, 0.35) 90%,
    transparent 100%
  );
}

.zone-state__dim {
  display: none;
}

.zone-state__halo {
  fill: none;
  stroke: var(--zone-color);
  stroke-width: 1.25;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.45;
  filter: url("#zone-glow");
}

.zone-hit {
  fill: rgba(255, 255, 255, 0.001);
  pointer-events: fill;
  cursor: pointer;
}

.scene-labels {
  grid-area: 1 / 1;
  position: absolute;
  inset: 1% 1.5%;
  width: auto;
  height: auto;
  min-height: 0;
  z-index: 7;
  pointer-events: none;
}

.scene-label {
  --accent: var(--sites);
  position: absolute;
  width: auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  color: #141414;
  background: transparent;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: clamp(1.21rem, 1.73vw, 1.55rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.96;
  pointer-events: auto;
  text-decoration: none;
  text-shadow: none;
  transition: opacity 0.44s ease, color 0.35s ease, filter 0.44s ease;
  will-change: transform, opacity;
}

.scene-label__dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 72%, transparent);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.scene-label[aria-pressed="true"] {
  opacity: 1;
  color: #141414;
  z-index: 2;
  background: transparent;
  filter: none;
}

.hero.is-zone-active .scene-label,
.hero.is-zone-active .scene-label[aria-pressed="true"] {
  color: #141414;
}

.scene-label[aria-pressed="true"] .scene-label__dot {
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 55%, transparent);
}

.scene-label--sites {
  left: 12%;
  top: 21%;
  --accent: var(--sites);
}

.scene-label--seo {
  left: 12%;
  bottom: 19%;
  --accent: var(--seo);
}

.scene-label--crm {
  right: 12%;
  top: 19%;
  width: auto;
  max-width: none;
  justify-content: flex-end;
  text-align: right;
  white-space: nowrap;
  --accent: var(--crm);
}

.scene-label::after {
  content: "";
  width: clamp(18px, 2.2vw, 48px);
  height: 1px;
  margin-left: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 68%, transparent), transparent);
  opacity: 0.62;
  transform-origin: left center;
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}

.scene-label--support {
  right: 12%;
  bottom: 17%;
  width: auto;
  max-width: none;
  justify-content: flex-end;
  text-align: right;
  white-space: nowrap;
  --accent: var(--support);
}

.scene-label--crm .scene-label__dot,
.scene-label--support .scene-label__dot {
  order: 2;
  margin-left: 7px;
}

.scene-label--crm::after,
.scene-label--support::after {
  order: -1;
  margin: 0 3px 0 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 68%, transparent));
  transform-origin: right center;
}

.scene-label[aria-pressed="true"]::after {
  opacity: 1;
  transform: scaleX(1.2);
}

.hero.is-zone-active .scene-label:not([aria-pressed="true"]) {
  opacity: 0.28;
  color: #141414;
}

.service-detail {
  --accent: #75879d;
  grid-area: 2 / 1;
  position: relative;
  z-index: 4;
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px clamp(18px, 3vw, 40px);
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 0;
  background: var(--bg);
  transition: border-color 0.35s ease, background 0.35s ease, color 0.35s ease;
}

.hero.is-zone-active .service-detail {
  z-index: 6;
  color: #f4f1ea;
  background: transparent;
  border-top-color: rgba(255, 255, 255, 0.14);
}

.service-detail__number,
.service-detail__eyebrow {
  display: none;
}

.service-detail h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero.is-zone-active .service-detail h2 {
  color: #fff;
}

.service-detail p {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 1.1vw, 1.02rem);
  font-weight: 400;
  line-height: 1.5;
  max-width: 80ch;
}

.hero.is-zone-active .service-detail p {
  color: rgba(244, 241, 234, 0.78);
}

.service-detail__go {
  display: inline-block;
  margin-top: 0.55rem;
  color: inherit;
  font-weight: 700;
}

.hero.is-zone-active .service-detail__go {
  color: #fff;
}

.mobile-controls {
  display: none;
  grid-area: 3 / 1;
  position: relative;
  z-index: 4;
  margin-top: 12px;
}

.mobile-controls button,
.mobile-controls a {
  --accent: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  color: #141414;
  background: rgba(255, 251, 239, 0.92);
  text-align: left;
  cursor: pointer;
}

.mobile-controls button[aria-pressed="true"],
.mobile-controls a[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 68%, transparent);
}

.mobile-controls .dot {
  width: 8px;
  height: 8px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.mobile-controls b {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mobile-controls button:nth-child(3) b,
.mobile-controls button:nth-child(4) b,
.mobile-controls a:nth-child(3) b,
.mobile-controls a:nth-child(4) b {
  font-size: 0.72rem;
}

.mobile-controls small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.67rem;
}

.mobile-controls button:nth-child(1),
.mobile-controls a:nth-child(1) { --accent: var(--sites); }
.mobile-controls button:nth-child(2),
.mobile-controls a:nth-child(2) { --accent: var(--seo); }
.mobile-controls button:nth-child(3),
.mobile-controls a:nth-child(3) { --accent: var(--crm); }
.mobile-controls button:nth-child(4),
.mobile-controls a:nth-child(4) { --accent: var(--support); }

.dot--sites { background: var(--sites); }
.dot--seo { background: var(--seo); }
.dot--crm { background: var(--crm); }
.dot--support { background: var(--support); }

@media (max-width: 620px) {
  .hero {
    height: auto;
    min-height: 100vh;
    padding: 8px 0 0;
    align-content: start;
  }

  .scene-shell {
    border-radius: 0;
    min-height: 0;
    aspect-ratio: 16 / 9;
    padding: 0;
  }

  .scene-fit {
    inset: 0;
  }

  .scene-labels {
    display: none;
  }

  .scene {
    width: min(100cqi, calc(100cqb * 1024 / 576));
    left: auto;
    top: auto;
    height: auto;
  }

  .service-detail {
    max-width: none;
  }

  .mobile-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

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

  .zone-state { will-change: auto; }
}

@media (min-width: 2200px) {
  .hero {
    padding: clamp(16px, 1.5vw, 36px);
  }

  .scene-label {
    font-size: clamp(1.21rem, 1.73vw, 1.55rem);
  }

  .scene-label__dot {
    width: 12px;
    height: 12px;
  }

  .service-detail h2 {
    font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  }

  .service-detail {
    padding: 18px 28px;
  }
}
