/* ============ reset + base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-feature-settings: "ss01", "cv11", "ss03";
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Global focus ring: uses the current section accent so it feels native to the page. */
:focus-visible {
  outline: 2px solid var(--section-current);
  outline-offset: 4px;
  border-radius: 6px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, p {
  margin: 0;
}

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

:root {
  /* ============ admin.fleetx.ru-derived monochrome palette ============ */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg:        #F8FAFF;
  --bg-elev:   #FFFFFF;
  --bg-muted:  #EEF2F8;
  --hairline:  #E3E8F0;

  --ink:        #111111;
  --ink-muted:  #5B6573;
  --ink-subtle: #8A93A1;

  --primary:       #000000;
  --primary-ink:   #FFFFFF;
  --primary-hover: #1F1F1F;

  /* ---- legacy aliases ---- */
  --bg-dark:     #0D3947;
  --bg-light:    var(--bg);
  --mint:        #79F395;
  --mint-accent: #2FB14A;
  --muted:       var(--ink-muted);
  --button:      var(--primary);

  /* ---- fleetx product UI tokens ---- */
  --fx-base-100: var(--bg);
  --fx-base-200: var(--bg-muted);
  --fx-base-300: var(--hairline);
  --fx-content:  var(--ink);
  --fx-muted:    var(--ink-muted);
  --fx-primary:   #79F395;
  --fx-secondary: #D288E4;
  --fx-accent:    #3FBAE2;
  --fx-neutral:   #0D3947;
  --fx-warning:   #F4C201;
  --fx-radius-selector: 10px;
  --fx-radius-field:    16px;
  --fx-radius-box:      24px;
  --fx-ring: 0 0 0 2px color-mix(in srgb, var(--section-current) 34%, transparent);
  --fx-surface-shadow:
    0 1px 2px rgba(13, 57, 71, 0.05),
    0 12px 28px -22px rgba(13, 57, 71, 0.22);
  --fx-surface-shadow-hover:
    0 2px 4px rgba(13, 57, 71, 0.08),
    0 22px 44px -28px rgba(13, 57, 71, 0.30);

  /* ============ Canonical brand palette ============ */
  --brand-blue:         #3FBAE2;
  --brand-yellow:       #F4C201;
  --brand-yellow-dark:  #3E3100;
  --brand-green:        #79F395;
  --brand-dark-green:   #0D3947;
  --brand-purple:       #5A2776;
  --brand-purple-light: #D288E4;
  --brand-red:          #FF7B3D;
  --brand-red-dark:     #470D0D;
  --brand-black:        #080609;

  /* legacy aliases mapped to canonical brand */
  --brand-mint:     var(--brand-green);
  --brand-lavender: var(--brand-purple-light);
  --brand-teal:     var(--brand-blue);
  --brand-ink:      var(--brand-dark-green);

  /* per-section accent — drives logo dot color, hero vignette, focus rings */
  --section-crm:        var(--brand-blue);
  --section-aggregator: var(--brand-green);
  --section-safety:     var(--brand-yellow);
  --section-insurance:  var(--brand-purple);
  --section-academy:    var(--brand-purple-light);
  --section-club:       var(--brand-red);

  /* Updated by JS in sync with the logo dot animation. Default = CRM blue. */
  --section-current: var(--brand-blue);

  /* ---- type scale ---- */
  --fs-eyebrow:  12px;
  --fs-body:     clamp(15px, 1.05vw, 18px);
  --fs-lead:     clamp(16px, 1.15vw, 20px);
  --fs-h2:       clamp(40px, 4vw, 76px);
  --fs-display:  clamp(56px, 6.2vw, 128px);

  /* ---- radii — admin uses very rounded forms ---- */
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-pill: 999px;

  /* ---- shadows — soft, subtle, single-layer ---- */
  --shadow-sm:        0 1px 2px rgba(17, 17, 17, 0.04), 0 1px 1px rgba(17, 17, 17, 0.03);
  --shadow-md:        0 4px 12px rgba(17, 17, 17, 0.06), 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-cta:       0 6px 18px rgba(0, 0, 0, 0.18);
  --shadow-cta-hover: 0 10px 28px rgba(0, 0, 0, 0.28);

  --ease-out-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============ HERO pinned stage ============ */
.hero {
  position: relative;
  width: 100%;
  /* 700vh = 600vh of pinned scroll for 6 slides + intro → CRM transition */
  height: 700vh;
}

.hero__stage {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  /* Cap on ultra-wide screens: everything inside (logo, slides, tagline)
     is laid out in this box, so content doesn't stretch past ~1920px. */
  max-width: 1920px;
  margin: 0 auto;
  height: 100vh;
  overflow: hidden;
}

.hero__bg {
  /* Sibling of .hero__stage inside .hero — sticky so it follows the pin.
     Covers the full viewport width (not capped by stage max-width). */
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  margin-bottom: -100vh; /* pulls stage up so it overlaps this bg layer */
  background: var(--bg-dark);
  z-index: 0;
  isolation: isolate;
}

/* Photo backdrop for the first screen — fades out once the stage turns light. */
.hero__photo {
  position: absolute;
  inset: 0;
  background-image: url("assets/hero-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  transition: opacity 0.6s var(--ease-out-soft);
  pointer-events: none;
  z-index: 0;
}
.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.78) 100%);
}
.hero__bg.is-light .hero__photo { opacity: 0; }

/* Dot-grid + section-tinted vignette, layered over .hero__bg.
   Both children fade in via opacity as the background flips from dark to light. */
.hero__bg::before,
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out-soft);
}

/* Layer 1: bubble shape decoration — same Union silhouette, barely visible on light bg.
   Size matches the tagline bubble on the first screen (min(52vw, 880px) wide). */
.hero__bg::before {
  background-color: rgba(17, 17, 17, 0.055);
  -webkit-mask: url("assets/Union2.png") right center / min(52vw, 880px) auto no-repeat;
          mask: url("assets/Union2.png") right center / min(52vw, 880px) auto no-repeat;
}

/* Layer 2: section-tinted vignette. Follows --section-current, so color mirrors the dots. */
.hero__bg::after {
  background:
    radial-gradient(ellipse 60% 55% at 88% 12%, var(--section-current) 0%, transparent 58%),
    radial-gradient(ellipse 55% 50% at 8% 88%, var(--section-current) 0%, transparent 62%);
  opacity: 0;
  filter: blur(2px);
  transition: opacity 0.6s var(--ease-out-soft), background 0.6s var(--ease-out-soft);
}

/* JS flips this class on .hero__bg once the background turns light. */
.hero__bg.is-light::before { opacity: 1; }
.hero__bg.is-light::after  { opacity: 0.09; }
.hero__bg.is-light {
  background: var(--fx-base-100);
}

/* ---- logo ---- */
.logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.dot {
  transition: fill 0.2s linear;
  transform-box: fill-box;
  transform-origin: center;
}

/* ---- brand wordmark ---- */
.brand {
  position: absolute;
  top: 50%;
  left: 23%;
  transform: translateY(-50%);
  margin: 0;
  color: #ffffff;
  z-index: 3;
  line-height: 0;
  will-change: opacity;
  width: clamp(140px, 14vw, 220px);
}

.brand svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 181 / 47;
  fill: currentColor;
}

/* ---- tagline bubble ---- */
.tagline {
  position: absolute;
  top: 50%;
  right: 0;
  left: auto;
  transform: translateY(-50%);
  /* Container width = bubble width, so child text positions are predictable
     across viewports (and text never lands outside the bubble). */
  width: min(52vw, 132vh, 880px);
  aspect-ratio: 559 / 362;
  height: auto;
  max-height: none;
  z-index: 3;
  will-change: transform, opacity;
}

/* Bubble = PNG silhouette used as a mask, filled with mint via background-color.
   Fills the whole .tagline container. */
.tagline__bubble {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--mint);
  -webkit-mask: url("assets/Union2.png") right center / contain no-repeat;
          mask: url("assets/Union2.png") right center / contain no-repeat;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.22));
}

/* Text sits inside the bubble body. Shifted slightly left of center so it
   reads as coming from the speech-bubble shape (which has a tail on the left). */
.tagline__text {
  position: absolute;
  top: 50%;
  left: 12%;
  right: 8%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-weight: 800;
  font-size: clamp(20px, 2vw, 34px);
  line-height: 1.15;
  color: var(--ink);
  text-align: left;
  letter-spacing: -0.015em;
  z-index: 1;
}

/* ---- slide layout (shared by CRM + all module screens) ---- */
.slide {
  position: absolute;
  inset: 0;
  display: grid;
  /* Single column below 1440 — image is hidden at those sizes (see below).
     Media query below promotes 2 columns on wider screens. */
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  /* Left padding leaves room for the expanded logo on the left.
     Logo extends to ~0.38 of stage width, so padding must be larger. */
  padding: 0 6vw 0 min(50vw, 760px);
  gap: 4vw;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}


.slide__text > * + * {
  margin-top: 16px;
}

.slide__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--section-current);
  transition: color 0.4s var(--ease-out-soft);
}

.slide__eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.slide__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.04em 0.14em;
  font-weight: 800;
  font-size: var(--fs-h2);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.slide__title-logo {
  display: block;
  height: 0.78em;
  /* Keep aspect ratio of the fleetx wordmark (viewBox 181×47). */
  aspect-ratio: 181 / 47;
  width: auto;
  flex-shrink: 0;
  fill: currentColor;
  align-self: center;
}

.slide__title span {
  /* Matches the fleetx wordmark: same Manrope 800, same tracking. */
  font-family: var(--font-sans);
  font-weight: 800;
  color: var(--mint-accent);
  font-size: 1em;
  line-height: 1;
  letter-spacing: -0.04em;
  align-self: center;
  transition: color 0.5s var(--ease-out-soft);
}

/* Section-specific title accent color (matches logo dots of each slide) */
.slide--crm        .slide__title span { color: var(--section-crm); }
.slide--aggregator .slide__title span { color: var(--section-aggregator); }
.slide--safety     .slide__title span { color: var(--section-safety); }
.slide--insurance  .slide__title span { color: var(--section-insurance); }
.slide--academy    .slide__title span { color: var(--section-academy); }
.slide--club       .slide__title span { color: var(--section-club); }

.slide__sub {
  max-width: 560px;
  font-size: var(--fs-lead);
  line-height: 1.5;
  font-weight: 400;
  color: var(--fx-muted);
  margin-top: 20px;
}

.slide__bullets {
  margin-top: 28px;
  padding-left: 0;
  list-style: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slide__bullets li {
  position: relative;
  padding-left: 28px;
  font-size: var(--fs-body);
  line-height: 1.45;
  font-weight: 500;
  color: var(--fx-content);
}

.slide__bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--section-current) 20%, transparent);
  transition: background 0.4s var(--ease-out-soft);
}

.slide__bullets li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: calc(0.5em + 5px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--section-current);
  transition: background 0.4s var(--ease-out-soft);
}

.slide__media {
  display: none; /* hidden by default; shown only on wide screens below */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

/* 2-column layout with mock only on wide viewports */
@media (min-width: 1280px) {
  .slide {
    /* Leave room for the expanded logo (~38% width), then split remaining into text + mock. */
    padding: 0 5vw 0 42vw;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 3vw;
  }
  .slide__media {
    display: flex;
  }
}

@media (min-width: 1600px) {
  .slide {
    padding: 0 6vw 0 38vw;
  }
}

/* ============ Product mock frame (macOS browser chrome) ============ */
.mock {
  width: 100%;
  max-width: 460px;
  background: var(--fx-base-100);
  border: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--fx-surface-shadow);
  color: var(--section-current);
  transform: translateZ(0);
}

/* Per-slide color override so each mock inherits its own section accent, not the global one. */
.slide--crm        .mock { color: var(--section-crm); }
.slide--aggregator .mock { color: var(--section-aggregator); }
.slide--safety     .mock { color: var(--section-safety); }
.slide--insurance  .mock { color: var(--section-insurance); }
.slide--academy    .mock { color: var(--section-academy); }
.slide--club       .mock { color: var(--section-club); }

.mock__chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--fx-base-200);
  border-bottom: 1px solid color-mix(in srgb, var(--fx-content) 8%, transparent);
}

.mock__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5e7eb;
}

.mock__dot:nth-child(1) { background: #ff5f57; }
.mock__dot:nth-child(2) { background: #febc2e; }
.mock__dot:nth-child(3) { background: #28c840; }

.mock__url {
  margin-left: 14px;
  padding: 4px 10px;
  background: color-mix(in srgb, var(--fx-base-100) 88%, #ffffff);
  border: 0;
  border-radius: var(--fx-radius-selector);
  font-size: 11px;
  font-weight: 500;
  color: var(--fx-muted);
  letter-spacing: 0.01em;
}

.mock__body {
  padding: 20px 22px;
  background: var(--fx-base-100);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mock__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.mock__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--fx-base-200);
  border-radius: var(--fx-radius-selector);
  font-size: 11px;
  color: var(--fx-content);
}

.mock__chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  color: currentColor;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  white-space: nowrap;
}

.mock__chip--muted {
  background: var(--fx-base-300);
  color: var(--fx-muted);
}

.mock__bar {
  flex: 1;
  height: 4px;
  background: var(--fx-base-300);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.mock__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--v, 40%);
  background: currentColor;
  border-radius: inherit;
}

.mock__money {
  font-weight: 700;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: -0.01em;
  margin-left: auto;
}

.mock__kpi {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.mock__kpi-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.mock__kpi-delta {
  font-size: 11px;
  font-weight: 700;
  color: currentColor;
}

.mock__spark {
  width: 100%;
  height: 56px;
  color: currentColor;
  display: block;
}

.mock__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mock__card {
  padding: 10px;
  background: var(--fx-base-200);
  border-radius: var(--fx-radius-selector);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mock__card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.mock__check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.mock__check svg {
  width: 8px;
  height: 8px;
  stroke: #fff;
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mock__avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 26%, transparent);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mock__msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.mock__msg-body {
  flex: 1;
  background: var(--fx-base-200);
  padding: 8px 10px;
  border-radius: var(--fx-radius-selector);
  font-size: 11px;
  line-height: 1.4;
  color: #3c4a59;
}

.mock__msg-author {
  font-weight: 700;
  color: var(--ink);
  margin-right: 6px;
}

/* Fade + slide-up when a slide becomes active — triggered via CSS on slide opacity. */
.slide .mock {
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.6s var(--ease-out-soft), opacity 0.5s var(--ease-out-soft);
  transition-delay: 0.08s;
}
.slide[style*="opacity: 1"] .mock,
.slide.is-active .mock {
  transform: translateY(0);
  opacity: 1;
}

/* CTA — modern pill button with animated arrow, sits below bullets */
.slide__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  padding: 16px 26px 16px 30px;
  background: var(--fx-neutral);
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  pointer-events: inherit;
  box-shadow: var(--shadow-cta);
  transition: box-shadow 0.3s var(--ease-out-soft), transform 0.2s var(--ease-out-soft), background 0.3s var(--ease-out-soft);
  align-self: flex-start;
}

.slide__cta:hover {
  background: color-mix(in srgb, var(--fx-neutral) 92%, var(--section-current));
  box-shadow: var(--shadow-cta-hover);
  transform: translateY(-1px);
}

.slide__cta:active {
  transform: translateY(0);
  box-shadow: var(--shadow-cta);
}

.slide__cta-arrow {
  display: block;
  width: 22px;
  height: 22px;
  color: var(--mint);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.slide__cta:hover .slide__cta-arrow {
  transform: translateX(4px);
}

/* ============ responsive — tablet & mobile ============ */

/* Mobile + small tablet: vertical stacked layout.
   Intro = logo top-center, fleetx under, bubble+tagline below.
   Slides = logo top-center, eyebrow/title/sub/bullets/CTA stacked. */
@media (max-width: 767px) {
  /* ---- intro ---- */
  .brand {
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    width: clamp(120px, 38vw, 180px);
  }

  /* Bubble docked to bottom, rotated 90° CW so tails face up.
     Container = final rotated dimensions: 100vw wide × (100vw × 362/559) tall */
  .tagline {
    bottom: 0;
    left: 0;
    top: auto;
    right: auto;
    transform: none;
    width: 100vw;
    /* height = width × (original height / original width) i.e. the short side */
    height: calc(100vw * 362 / 559);
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .tagline__bubble {
    /* Pre-rotation size: swap axes so after rotate(90deg) it fills container exactly */
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(100vw * 362 / 559);  /* will become height after rotation */
    height: 100vw;                    /* will become width after rotation  */
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    /* left center: shows the bumpy/tail side of Union2 — after 90°CW rotation tails face UP */
    -webkit-mask: url("assets/Union2.png") left center / auto 100% no-repeat;
            mask: url("assets/Union2.png") left center / auto 100% no-repeat;
    aspect-ratio: auto;
    filter: drop-shadow(0 -8px 24px rgba(0, 0, 0, 0.18));
  }

  .tagline__text {
    top: 60%;
    left: 50%;
    right: auto;
    width: 70%;
    transform: translate(-50%, -50%);
    white-space: normal;
    text-align: center;
    font-size: clamp(14px, 3.8vw, 18px);
    line-height: 1.3;
  }

  /* ---- slides ---- */
  .slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    justify-content: flex-start;
    align-items: stretch;
    padding: 30vh 6vw 6vh;
    gap: 0;
  }

  .slide__text > * + * {
    margin-top: 10px;
  }

  .slide__eyebrow {
    font-size: 11px;
    gap: 10px;
  }

  .slide__eyebrow::before { width: 20px; }

  .slide__title {
    font-size: clamp(32px, 9.2vw, 48px);
    letter-spacing: -0.035em;
    gap: 0.04em 0.12em;
  }

  .slide__title-logo {
    height: 0.78em;
  }

  .slide__sub {
    max-width: none;
    font-size: 15px;
    line-height: 1.45;
    margin-top: 14px;
  }

  .slide__bullets {
    margin-top: 18px;
    padding-left: 0;
    gap: 8px;
  }

  .slide__bullets li {
    font-size: 15px;
    line-height: 1.4;
    padding-left: 24px;
  }

  .slide__bullets li::before { width: 14px; height: 14px; }
  .slide__bullets li::after { left: 4px; top: calc(0.5em + 4px); width: 6px; height: 6px; }

  .slide__cta {
    margin-top: 24px;
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 15px;
  }

  /* Hide decorative media on mobile — focus on text */
  .slide__media {
    display: none;
  }

  /* Shorter pin on small screens so scroll feels less exhausting.
     Each slide ~100dvh of scroll is still needed for the animation. */
  .hero {
    height: 700vh;
  }

}

/* Tablet (768-1023): keep side-by-side but narrower left padding */
/* Tablet + narrow laptop (768-1279): stacked layout with logo on top, like mobile */
@media (min-width: 768px) and (max-width: 1279px) {
  /* Intro: logo top-center, wordmark below, tagline below that */
  .brand {
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    width: clamp(140px, 18vw, 200px);
  }

  .tagline {
    top: 58%;
    left: auto;
    right: 0;
    transform: translateY(-50%);
    width: min(680px, 72vw);
    aspect-ratio: 559 / 362;
    height: auto;
    max-height: none;
  }

  .tagline__bubble {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    transform: none;
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.22));
  }

  .tagline__text {
    top: 50%;
    left: 68%;
    right: auto;
    transform: translate(-50%, -50%);
    white-space: normal;
    text-align: center;
    font-size: clamp(16px, 2.1vw, 22px);
    line-height: 1.25;
    width: 55%;
  }

  /* Slide: stacked single column, content block centered under the logo */
  .slide {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    justify-content: flex-start;
    align-items: stretch;
    padding: 28vh 7vw 8vh;
    gap: 0;
    max-width: 720px;
    margin: 0 auto;
    inset: 0;
  }

  .slide__media { display: none; }
}

/* ============ Top navigation ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  /* Padding scales with viewport, but inner content caps at 1920px stage width. */
  padding: 18px max(32px, calc((100vw - 1920px) / 2 + 32px));
  background: color-mix(in srgb, var(--fx-base-100) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--fx-content) 8%, transparent);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-soft), transform 0.4s var(--ease-out-soft);
}

.nav.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav__logo {
  display: block;
  line-height: 0;
  color: var(--ink);
}

.nav__logo svg {
  display: block;
  width: 84px;
  height: auto;
  fill: currentColor;
}

.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 20px;
}

.nav__links a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--fx-muted);
  padding: 4px 0;
  transition: color 0.2s var(--ease-out-soft);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out-soft);
}

.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  border-radius: var(--r-pill);
  background: var(--fx-base-200);
  transition: background 0.2s var(--ease-out-soft), color 0.2s var(--ease-out-soft);
}

.nav__cta:hover {
  background: var(--ink);
  color: #fff;
}

/* ============ Chapter nav (vertical rail on right, follows stage edge on widescreens) ============ */
.chapters {
  position: fixed;
  right: max(22px, calc((100vw - 1920px) / 2 + 22px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-soft);
}

.chapters.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.chapters__dot {
  --c: var(--ink);
  position: relative;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}

.chapters__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.32;
  transition: opacity 0.25s var(--ease-out-soft), transform 0.25s var(--ease-out-soft);
}

.chapters__dot:hover::before { opacity: 0.7; transform: scale(1.25); }

.chapters__dot.is-active::before {
  opacity: 1;
  transform: scale(1.45);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent);
}

.chapters__dot span {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translate(6px, -50%);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: color-mix(in srgb, var(--fx-base-100) 96%, transparent);
  border: 0;
  border-radius: var(--fx-radius-selector);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out-soft), transform 0.25s var(--ease-out-soft);
  box-shadow: 0 6px 20px rgba(17, 17, 17, 0.12);
}

.chapters__dot:hover span,
.chapters__dot.is-active span {
  opacity: 1;
  transform: translate(0, -50%);
}

/* ============ Scroll progress bar ============ */
.progress {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(17, 17, 17, 0.06);
  z-index: 18;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-soft);
}

.progress.is-visible { opacity: 1; }

.progress__fill {
  height: 100%;
  width: 0%;
  background: var(--section-current);
  transition: background 0.5s var(--ease-out-soft), width 0.08s linear;
  box-shadow: 0 0 18px color-mix(in srgb, var(--section-current) 60%, transparent);
}

/* ============ Shared below-fold elements ============ */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mint-accent);
  margin: 0 0 18px;
}

.section-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ============ Logo bar (social proof) ============ */
.logobar {
  position: relative;
  padding: 96px 6vw;
  background: var(--fx-base-100);
  border-top: 1px solid color-mix(in srgb, var(--fx-content) 7%, transparent);
  text-align: center;
}

.logobar__lead {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fx-muted);
  margin: 0 0 36px;
}

.logobar__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 48px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
  justify-items: center;
}

.logobar__mark {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #9aa4b0;
  filter: saturate(0.1);
  transition: color 0.25s var(--ease-out-soft), filter 0.25s var(--ease-out-soft);
}

.logobar__mark:hover { color: var(--ink); filter: saturate(1); }

@media (min-width: 960px) {
  .logobar__grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* ============ Feature matrix ============ */
.matrix {
  padding: 120px 6vw;
  background: linear-gradient(180deg, var(--fx-base-100) 0%, var(--fx-base-200) 100%);
  border-top: 1px solid color-mix(in srgb, var(--fx-content) 7%, transparent);
  position: relative;
  overflow: hidden;
}

.matrix::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(17, 17, 17, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000, transparent 90%);
  pointer-events: none;
  opacity: 0.7;
}

/* Decorative brand watermark — big f002 shape peeking from the right edge,
   sits above the matrix grid head, tinted with the brand green at low opacity. */
.matrix::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -120px;
  width: 540px;
  height: 380px;
  background-color: var(--brand-green);
  -webkit-mask: url("assets/union-f002.svg") right center / contain no-repeat;
          mask: url("assets/union-f002.svg") right center / contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.matrix__head,
.matrix__grid,
.matrix__cta {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.matrix__head { text-align: center; margin-bottom: 64px; }

.matrix__title {
  font-weight: 800;
  font-size: clamp(34px, 3.4vw, 56px);
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 20px;
}

.matrix__sub {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--fx-muted);
  max-width: 640px;
  margin: 0 auto;
}

.matrix__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 56px;
}

/* Two-tone brand cards: --c1 fills the surface, --c2 shows through a cropped union-f00x
   bubble peeking from the right edge. --ct sets the title/text contrast color.
   --shape picks one of the four fleetx union shapes; --shape-w/-pos tunes its placement. */
.matrix__card {
  --c1: var(--brand-blue);
  --c2: var(--brand-yellow);
  --ct: var(--brand-dark-green);
  --shape: url("assets/union-f001.svg");
  --shape-w: 78%;
  --shape-h: 130%;
  --shape-top: -10%;
  --shape-right: -28%;
  position: relative;
  padding: 32px 28px;
  min-height: 220px;
  background: var(--c1);
  border: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease-out-soft), box-shadow 0.3s var(--ease-out-soft);
  box-shadow: var(--fx-surface-shadow);
  display: flex;
  flex-direction: column;
}

.matrix__card::before {
  content: "";
  position: absolute;
  top: var(--shape-top);
  right: var(--shape-right);
  width: var(--shape-w);
  height: var(--shape-h);
  background-color: var(--c2);
  -webkit-mask: var(--shape) right center / contain no-repeat;
          mask: var(--shape) right center / contain no-repeat;
  z-index: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out-soft);
}

.matrix__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--fx-surface-shadow-hover);
}

.matrix__card:hover::before {
  transform: translateX(-6px);
}

.matrix__dot {
  display: none; /* replaced by the bubble accent */
}

.matrix__card h3 {
  position: relative;
  z-index: 1;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ct);
  margin: 0 0 12px;
}

.matrix__card p {
  position: relative;
  z-index: 1;
  font-size: 15px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--ct) 78%, transparent);
  margin: 0;
  max-width: 64%;
}

/* Per-section colour combos + union shape. Each card pulls a different fleetx fragment. */
.matrix__card--crm {
  --c1: var(--brand-blue);        --c2: var(--brand-yellow);       --ct: var(--brand-dark-green);
  --shape: url("assets/union-f001.svg"); --shape-w: 75%; --shape-h: 110%; --shape-top: -5%; --shape-right: -22%;
}
.matrix__card--aggregator {
  --c1: var(--brand-purple-light); --c2: var(--brand-green);       --ct: var(--brand-dark-green);
  --shape: url("assets/union-f003.svg"); --shape-w: 62%; --shape-h: 130%; --shape-top: -15%; --shape-right: -14%;
}
.matrix__card--safety {
  --c1: var(--brand-dark-green);  --c2: var(--brand-yellow);       --ct: var(--brand-green);
  --shape: url("assets/union-f004.svg"); --shape-w: 88%; --shape-h: 100%; --shape-top: 0%; --shape-right: -32%;
}
.matrix__card--insurance {
  --c1: var(--brand-purple);      --c2: var(--brand-purple-light); --ct: #FFFFFF;
  --shape: url("assets/union-f002.svg"); --shape-w: 78%; --shape-h: 110%; --shape-top: -5%; --shape-right: -26%;
}
.matrix__card--academy {
  --c1: var(--brand-yellow);      --c2: var(--brand-purple-light); --ct: var(--brand-dark-green);
  --shape: url("assets/union-f001.svg"); --shape-w: 80%; --shape-h: 115%; --shape-top: -8%; --shape-right: -30%;
}
.matrix__card--club {
  --c1: var(--brand-green);       --c2: var(--brand-blue);         --ct: var(--brand-dark-green);
  --shape: url("assets/union-f003.svg"); --shape-w: 60%; --shape-h: 130%; --shape-top: -15%; --shape-right: -10%;
}

.matrix__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  margin: 0 auto;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
  font-size: 16px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-cta);
  transition: box-shadow 0.3s var(--ease-out-soft), transform 0.2s var(--ease-out-soft);
  left: 50%;
  transform: translateX(-50%);
  position: relative;
}

.matrix__cta:hover {
  box-shadow: var(--shadow-cta-hover);
  transform: translate(-50%, -1px);
}

.matrix__cta svg {
  width: 20px;
  height: 20px;
  color: var(--mint);
  transition: transform 0.25s var(--ease-out-soft);
}

.matrix__cta:hover svg { transform: translateX(3px); }

/* ============ Ecosystem schema (CRM nucleus) ============ */
.ecosystem-schema-section {
  padding: 100px 6vw;
  background: var(--fx-base-100);
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Decorative brand watermark — f004 shape on the left, lavender, very subtle */
.ecosystem-schema-section::before {
  content: "";
  position: absolute;
  bottom: -120px;
  left: -160px;
  width: 620px;
  height: 280px;
  background-color: var(--brand-purple-light);
  -webkit-mask: url("assets/union-f004.svg") left center / contain no-repeat;
          mask: url("assets/union-f004.svg") left center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

.ecosystem-schema-section > * {
  position: relative;
  z-index: 1;
}
.ecosystem-schema__head {
  max-width: 720px;
  margin: 0 auto 56px;
}
.ecosystem-schema__title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 18px 0 16px;
}
.ecosystem-schema__sub {
  font-size: 17px;
  line-height: 1.5;
  color: var(--fx-muted);
}
.ecosystem-schema {
  max-width: 1100px;
  margin: 0 auto;
  color: var(--ink);
}
.ecosystem-schema__svg {
  width: 100%;
  height: auto;
  display: block;
}
.ecosystem-schema__svg a {
  cursor: pointer;
  transition: transform 0.3s var(--ease-out-soft);
  transform-origin: center;
  transform-box: fill-box;
}
.ecosystem-schema__svg a:hover circle {
  filter: drop-shadow(0 8px 24px rgba(17, 17, 17, 0.25));
}
.ecosystem-schema__svg a:hover {
  transform: translateY(-3px);
}

/* ============ Final: инфраструктура для системного роста ============ */
.infra-final {
  padding: 96px 6vw;
  margin: 60px 6vw;
  border-radius: calc(var(--fx-radius-box) + 1rem);
  background:
    radial-gradient(ellipse 70% 60% at 88% 10%, color-mix(in srgb, var(--brand-yellow) 24%, transparent), transparent 65%),
    var(--fx-neutral);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.infra-final::before {
  content: "";
  position: absolute;
  right: -100px;
  top: -120px;
  width: 720px;
  height: 720px;
  background-color: var(--brand-yellow);
  -webkit-mask: url("assets/Union2.png") center / contain no-repeat;
          mask: url("assets/Union2.png") center / contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
  transform: rotate(8deg);
}
.infra-final::after {
  content: "";
  position: absolute;
  left: -160px;
  bottom: -200px;
  width: 460px;
  height: 460px;
  background-color: var(--brand-blue);
  -webkit-mask: url("assets/Union2.png") center / contain no-repeat;
          mask: url("assets/Union2.png") center / contain no-repeat;
  opacity: 0.22;
  pointer-events: none;
  transform: rotate(140deg);
}
.infra-final__inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}
.infra-final__eyebrow {
  color: var(--brand-yellow);
  margin: 0 0 16px;
  display: block;
}
.infra-final__title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 22px;
}
.infra-final__sub {
  font-size: 18px;
  line-height: 1.55;
  opacity: 0.82;
  margin: 0 0 36px;
}
.infra-final__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 30px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  border-radius: var(--fx-radius-field);
  text-decoration: none;
  box-shadow: 0 20px 48px -16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease-out-soft);
}
.infra-final__cta:hover {
  transform: translateY(-1px);
}
.infra-final__cta svg {
  width: 20px;
  height: 20px;
  color: var(--brand-blue);
}

@media (max-width: 768px) {
  .ecosystem-schema-section { padding: 64px 5vw; }
  .infra-final { padding: 64px 6vw; margin: 40px 5vw; border-radius: 28px; }
  .infra-final__title { font-size: clamp(28px, 8vw, 40px); }
}

/* ============ Footer ============ */
.foot {
  padding: 80px 6vw 36px;
  background: var(--ink);
  color: #c1cdd5;
}

.foot__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
  .foot__inner { grid-template-columns: 1.2fr 2fr; }
}

.foot__brand { max-width: 340px; }

.foot__logo {
  display: block;
  width: 96px;
  height: auto;
  fill: #ffffff;
  margin-bottom: 18px;
}

.foot__brand p {
  font-size: 14px;
  line-height: 1.55;
  color: #9aa8b2;
  margin: 0;
}

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

.foot__col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 16px;
}

.foot__col a {
  display: block;
  font-size: 14px;
  color: #9aa8b2;
  margin-bottom: 10px;
  transition: color 0.15s var(--ease-out-soft);
}

.foot__col a:hover { color: #ffffff; }

.foot__base {
  max-width: 1120px;
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7a87;
}

/* ============ mobile chrome overrides (after chrome rules so they win cascade) ============ */
@media (max-width: 767px) {
  .chapters { display: none; }
  .nav { padding: 12px 16px; }
  .nav__links { display: none; }
  .nav__cta { padding: 7px 12px; font-size: 13px; }
  .nav__logo svg { width: 72px; }

  /* ---- below-fold: logobar ---- */
  .logobar { padding: 56px 6vw; }
  .logobar__lead { margin-bottom: 24px; font-size: 11px; }
  .logobar__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
  .logobar__mark { font-size: 15px; }

  /* ---- below-fold: matrix ---- */
  .matrix { padding: 72px 6vw; }
  .matrix__head { margin-bottom: 40px; }
  .matrix__title { font-size: clamp(28px, 8vw, 38px); }
  .matrix__sub { font-size: 15px; }
  .matrix__grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 36px; }
  .matrix__card { padding: 22px; }
  .matrix__card h3 { font-size: 18px; }
  .matrix__card p { font-size: 14px; }
  .matrix__cta { width: calc(100% - 12px); max-width: 360px; justify-content: center; font-size: 15px; padding: 14px 22px; }

  /* ---- below-fold: footer ---- */
  .foot { padding: 56px 6vw 28px; }
  .foot__inner { gap: 32px; padding-bottom: 36px; }
  .foot__brand p { font-size: 13px; }
  .foot__cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .foot__col h4 { font-size: 11px; margin-bottom: 12px; }
  .foot__col a { font-size: 13px; margin-bottom: 8px; }
  .foot__base { flex-direction: column; gap: 8px; font-size: 11px; }
}

/* ============ tablet (portrait iPad, narrow laptop) ============ */
@media (min-width: 768px) and (max-width: 1279px) {
  .slide__title { font-size: clamp(42px, 6vw, 68px); }
  .slide__bullets li { font-size: 16px; }
  .matrix__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logobar__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  .hero {
    height: 100vh;
  }

  .hero__stage {
    position: relative;
  }

  .hero__bg {
    background: var(--bg-light);
  }

  .brand,
  .tagline {
    opacity: 0;
  }

  .slide--crm {
    opacity: 1;
  }
}
