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

html {
  background: #000;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
}

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

button {
  font: inherit;
  cursor: pointer;
  border: none;
}

/* === Main scroll viewport === */
.snap-root {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

.panel {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* === Panel 1: hero (16:9 scene, единый масштаб) === */
.panel--hero {
  --hero-bar-width: 85%;
  --hero-bar-content-inset: 10%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #000;
}

.hero-scene-fit {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.25rem) clamp(1rem, 4vw, 3rem);
  container-type: size;
  container-name: herofit;
}

.hero-scene {
  position: relative;
  /* Fallback без container query units */
  width: min(100%, calc((100dvh - 3.5rem) * 16 / 9));
  aspect-ratio: 16 / 9;
  max-width: 100%;
  container-type: size;
  container-name: heroscene;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

@supports (width: 1cqw) {
  .hero-scene {
    width: min(100cqw, 100cqh * 16 / 9, 100%);
  }
}

.hero-scene__bg {
  position: absolute;
  inset: 0;
  background-color: #000;
  background-image: url("../assets/Template.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-scene__ui {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(0.5rem, 2.5cqi, 1.35rem) clamp(0.65rem, 3.2cqi, 1.75rem) clamp(0.45rem, 2cqi, 1.1rem);
}

.header {
  width: var(--hero-bar-width);
  max-width: 100%;
  margin-inline: auto;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border: none;
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.header__inset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem 2rem;
  padding: clamp(0.85rem, 2vw, 1.1rem) var(--hero-bar-content-inset);
  min-width: 0;
}

.header__brand {
  display: flex;
  align-items: center;
}

.header__logo-img {
  display: block;
  height: clamp(1.5rem, 7cqi, 2.6rem);
  width: auto;
  max-width: min(100%, 38cqi);
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) invert(1);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  justify-self: center;
}

.header__link {
  font-size: 0.875rem;
  color: #e8eaed;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.92;
}

.header__link:hover {
  opacity: 1;
  color: #fff;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-self: end;
}

.header__phone {
  font-size: 0.875rem;
  color: #ccc;
  white-space: nowrap;
}

.header__phone:hover {
  color: #fff;
}

.btn {
  padding: 0.55rem 1.15rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

.btn--primary {
  background: #0056b3;
  color: #fff;
}

.btn--primary:hover {
  background: #0066cc;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.hero__inner {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  max-width: none;
  position: relative;
  z-index: 1;
}

.hero__copy {
  min-width: 0;
  max-width: 46cqi;
}

.hero__eyebrow {
  margin: 0 0 0.75em;
  font-size: clamp(0.72rem, 2.4cqi, 0.95rem);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

.hero__title {
  margin: 0;
  font-size: clamp(1.35rem, 6cqi, 2.9rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-foot {
  margin-top: auto;
  padding-top: 0.5rem;
}

.hero-foot__panel {
  width: var(--hero-bar-width);
  max-width: 100%;
  margin-inline: auto;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border: none;
  border-radius: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.hero-foot__panel-inset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(0.85rem, 2vw, 1.1rem) var(--hero-bar-content-inset);
  min-width: 0;
}

.hero-foot__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  min-width: 0;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat__num {
  font-size: clamp(1.1rem, 3.4cqi, 1.85rem);
  font-weight: 700;
}

.stat__label {
  font-size: 0.75rem;
  color: #999;
}

.hero-foot__partners {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  padding-left: clamp(1rem, 2.5vw, 1.75rem);
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.partner-logo {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
}

/* === Panel 2: machines === */
.panel--machines {
  background: #000;
  padding: clamp(1.5rem, 4vw, 3rem);
  justify-content: center;
}

.machines {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.machines__head {
  text-align: center;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.machines__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
}

.machines__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #999;
  font-weight: 400;
}

.machines__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 2vw, 1.25rem);
}

.tile {
  aspect-ratio: 4 / 3;
  min-height: 120px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* === Responsive === */
@media (max-width: 960px) {
  .header__inset {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .header__nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .header__actions {
    justify-self: center;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero__inner {
    justify-content: center;
    text-align: center;
  }

  .hero__copy {
    max-width: 100%;
  }

  .hero-foot__panel-inset {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 1.25rem;
  }

  .hero-foot__partners {
    justify-content: center;
    padding-left: 0;
    padding-top: 1rem;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
  }
}

@media (max-width: 640px) {
  .machines__grid {
    grid-template-columns: 1fr;
  }

  .hero-foot__stats {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .stat {
    align-items: center;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .machines__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
