/* FIX Homepage responsive & performance patch (safe additive overrides) */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  text-rendering: optimizeLegibility;
}

img,
video,
svg,
canvas {
  max-width: 100%;
}

section,
.container,
#futos,
.partners,
.partners-track {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header .logo {
  order: 1;
  flex: 0 0 auto;
}

.site-header .site-nav {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
}

.site-header .site-nav ul {
  justify-content: center;
}

.site-header .user-profile {
  order: 3;
  flex: 0 0 auto;
}

.site-header .menu-toggle {
  order: 4;
}

.site-header .header-call-btn {
  display: none;
}

.mobile-login-item {
  display: none;
}

/* Desktop header matches mobile layout (center logo + hamburger + call icon) */
@media (min-width: 769px) {
  .site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    min-height: 64px;
    padding: 8px 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 6px 16px rgba(15, 18, 32, 0.1);
  }

  .site-header .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    position: relative;
    min-height: 64px;
  }

  .site-header .logo {
    order: 1;
    flex: 0 0 auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
  }

  .site-header .logo img {
    height: 44px;
    width: auto;
  }

  .site-header .menu-toggle {
    display: flex !important;
    order: 2;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-inline-start: 0;
    min-height: 44px;
    min-width: 44px;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.45);
    z-index: 3;
  }

  .site-header .header-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: transparent;
    z-index: 3;
  }

  .site-header .header-call-btn i,
  .site-header .menu-toggle i {
    background: linear-gradient(90deg, var(--primary-red) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 1rem;
  }

  .site-header .header-call-btn:hover,
  .site-header .header-call-btn:focus,
  .site-header .menu-toggle:hover,
  .site-header .menu-toggle:focus {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
  }

  .site-header .user-profile {
    display: none !important;
  }

  .site-header .site-nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    pointer-events: none;
  }

  .site-header .site-nav ul {
    display: none;
    position: relative;
    top: 0;
    right: 14px;
    left: 14px;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    z-index: 1001;
    pointer-events: auto;
    margin-top: 10px;
  }

  .site-header .site-nav ul li + li {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
  }

  .site-header nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  body.nav-open .site-header .site-nav ul {
    display: flex;
  }

  .mobile-login-item {
    display: block;
  }

  .mobile-login-item a {
    margin: 8px;
    border-radius: 10px;
    color: #fff !important;
    justify-content: center;
    background: linear-gradient(
      135deg,
      rgba(var(--primary-blue-rgb), 0.88) 0%,
      rgba(var(--primary-red-rgb), 0.95) 100%
    );
  }
}

main section[id] {
  scroll-margin-top: 96px;
}

.hero-mobile-media {
  position: absolute;
  inset: 0;
  display: none;
  z-index: -2;
}

.hero-mobile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.58) saturate(0.95);
}

.hero.hero--video-fallback .hero2 {
  display: none !important;
}

.hero.hero--video-fallback .hero-mobile-media {
  display: block;
}

.rf-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  will-change: opacity, transform;
}

.rf-reveal.rf-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 768px) {
  #differentiation,
  #differentiation .container,
  #differentiation .process-steps {
    overflow: visible !important;
  }

  #differentiation .process-steps.process-steps--three {
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
    width: 100% !important;
    gap: 14px !important;
    margin: 0 !important;
  }

  #differentiation .process-steps .step {
    width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
    opacity: 1 !important;
    transform: none !important;
  }

  #differentiation .process-steps .step .icon {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
  }

  #differentiation .process-steps .step h3 {
    font-size: 1rem !important;
    line-height: 1.45 !important;
    margin-bottom: 4px !important;
    text-align: right !important;
  }

  #differentiation .process-steps .step p {
    font-size: 0.9rem !important;
    line-height: 1.55 !important;
    text-align: right !important;
  }

  #why-choose-us,
  #why-choose-us .container {
    overflow-x: hidden !important;
    overflow-x: clip !important;
  }

  body {
    background-attachment: scroll !important;
  }

  .site-header {
    position: fixed !important;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    min-height: 56px;
    padding: 6px 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .site-header.scrolled {
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 6px 16px rgba(15, 18, 32, 0.1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .site-header .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    position: relative;
    min-height: 56px;
  }

  .site-header .logo {
    order: 1;
    flex: 0 0 auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
  }

  .site-header .logo::after {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(100% - 2px);
    transform: translateX(-50%);
    width: 118%;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      rgba(var(--primary-red-rgb), 0.36) 0%,
      rgba(var(--primary-blue-rgb), 0.34) 100%
    );
    filter: blur(10px);
    opacity: 0.78;
    pointer-events: none;
    z-index: 1;
  }

  .site-header .logo a,
  .site-header .logo img {
    position: relative;
    z-index: 2;
  }

  .site-header .logo img {
    height: 40px !important;
    width: auto;
  }

  .site-header .menu-toggle {
    display: flex !important;
    order: 2;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-inline-start: 0;
    min-height: 44px;
    min-width: 44px;
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    z-index: 3;
  }

  .site-header .header-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: transparent;
    z-index: 3;
  }

  .site-header .header-call-btn i {
    background: linear-gradient(90deg, var(--primary-red) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 1rem;
  }

  .site-header .header-call-btn:hover,
  .site-header .header-call-btn:focus {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
  }

  .site-header .menu-toggle i {
    background: linear-gradient(90deg, var(--primary-red) 0%, var(--primary-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }

  .site-header .menu-toggle:hover,
  .site-header .menu-toggle:focus {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
  }

  .site-header .user-profile {
    display: none !important;
  }

  .site-header .site-nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
  }

  .site-header .site-nav ul {
    right: 12px !important;
    left: 12px !important;
    margin-top: 8px !important;
    max-height: calc(100vh - 92px);
  }

  .site-header nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .mobile-login-item {
    display: block;
  }

  .mobile-login-item a {
    margin: 8px;
    border-radius: 10px;
    color: #fff !important;
    justify-content: center;
    background: linear-gradient(
      135deg,
      rgba(var(--primary-blue-rgb), 0.88) 0%,
      rgba(var(--primary-red-rgb), 0.95) 100%
    );
  }

  .hero {
    min-height: calc(100svh - 56px) !important;
    padding-top: 74px !important;
    align-items: flex-start !important;
  }

  .hero2 {
    opacity: 1;
    filter: brightness(0.8) contrast(1.03) saturate(0.94);
  }

  .hero::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.72)) !important;
  }

  .hero-content {
    width: min(100%, 640px) !important;
    padding-inline: 2px;
    margin-left: auto !important;
    margin-right: 0 !important;
    align-items: flex-start !important;
  }

  .hero-title {
    font-size: clamp(1.65rem, 6.2vw, 2.15rem) !important;
    line-height: 1.2;
  }

  .hero-lead,
  .hero-subline {
    max-width: 100% !important;
  }

  .hero-lead {
    font-size: clamp(0.9rem, 3.2vw, 1rem) !important;
    line-height: 1.5 !important;
  }

  .hero-subline {
    font-size: clamp(0.85rem, 2.9vw, 0.96rem) !important;
    line-height: 1.45 !important;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .hero-actions .cta-container,
  .hero-actions .cta-button {
    width: auto;
    text-align: center;
    max-width: 100%;
  }

  #futos {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding-inline: 6px !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    transform: none !important;
    scrollbar-width: none;
  }

  #futos::-webkit-scrollbar {
    display: none;
  }

  #futos .futo-item {
    min-width: min(78vw, 260px);
    scroll-snap-align: center;
    opacity: 1 !important;
  }

  #futos .futo-item img {
    opacity: 1 !important;
    transform: none !important;
  }

  #futos .futo-item .futo-label {
    opacity: 1 !important;
  }

  #futos .futo-item .futo-reassurance,
  #futos .futo-item .futo-cta {
    opacity: 1 !important;
  }

  #futos .futo-item .futo-reassurance {
    display: block !important;
  }

  #futos .futo-item .futo-cta {
    display: inline-block !important;
  }

  .partners {
    overflow: hidden;
  }

  .partners-track {
    width: max-content;
    min-width: 100%;
    padding-inline-start: 10px !important;
    padding-inline-end: 10px !important;
    animation-name: partners-scroll-mobile !important;
    animation-duration: 19s !important;
    animation-timing-function: linear !important;
    animation-iteration-count: infinite !important;
    transform: translate3d(0, 0, 0);
  }

  .partners img {
    max-width: 110px;
  }

  /* simplify expensive transitions on phones */
  .why-choose-us .card p,
  .why-choose-us .card p::before,
  .why-choose-us .card p .frame-edge,
  #futos,
  #futos .futo-item,
  #futos .futo-item img,
  #futos .futo-item .futo-label,
  #futos .futo-item .futo-reassurance,
  #futos .futo-item .futo-cta {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes partners-scroll-mobile {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(var(--partners-mobile-shift, 50%), 0, 0);
  }
}

@media (max-width: 480px) {
  .site-header .logo img {
    height: 36px !important;
  }

  .hero {
    min-height: calc(84svh - 56px) !important;
  }

  .hero-title {
    font-size: clamp(1.45rem, 7.4vw, 1.9rem) !important;
  }

  .hero-feature {
    font-size: 0.86rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }

  .rf-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero2 {
    display: none !important;
  }

  .partners-track,
  #futos,
  #futos .futo-item,
  #futos .futo-item img {
    animation: none !important;
    transition: none !important;
  }
}
