/* === HOMEPAGE REDESIGN ===
   Scope: .homepage-redesign only. Loaded after design-system.css. */

/* Homepage tokens and rail */
.ds-credibility > .container,
.ds-news-live-section > .container,
.ds-products-section > .container,
.ds-company-section > .container,
.ds-events-section > .container {
  width: 100% !important;
  max-width: none !important;
  padding-right: var(--ft-shell-pad) !important;
  padding-left: var(--ft-shell-pad) !important;
}


/* Hero */
.ds-home-hero {
  position: relative;
  isolation: isolate;
  min-height: 700px;
  margin-top: 0 !important;
  overflow: hidden;
  padding: 0;
  background: var(--ft-dark) !important;
}

.ds-home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--ft-dark) 0%, rgba(5, 7, 8, .96) 31%, rgba(5, 7, 8, .60) 52%, rgba(5, 7, 8, 0) 76%),
    linear-gradient(180deg, rgba(5, 7, 8, .10) 0%, rgba(5, 7, 8, 0) 58%, var(--ft-dark) 100%);
}

.ds-home-hero-media {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 37%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
}

.ds-home-hero-media picture {
  display: block;
  width: auto;
  height: 100%;
}

.ds-home-hero-media img {
  display: block;
  width: auto;
  max-width: none;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
}

.ds-home-hero-inner {
  position: relative;
  z-index: 2;
  min-height: 700px;
  display: flex;
  align-items: center;
  width: 100% !important;
  max-width: none !important;
  padding-right: var(--ft-shell-pad) !important;
  padding-left: var(--ft-shell-pad) !important;
}

.ds-home-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 630px;
  padding: 90px 0 88px;
  margin-left: 0 !important;
  transform: translateY(-26px) !important;
}

.ds-home-hero .ds-h1 {
  max-width: 760px !important;
  margin: 0 0 24px;
  color: #fff;
  font-size: clamp(54px, 3.4vw, 62px) !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  letter-spacing: 0;
}

.ds-home-hero .ds-h1 .ds-h1-nowrap {
  color: #fff !important;
  white-space: nowrap !important;
}

.ds-home-hero .ds-h1 .ds-h1-accent {
  color: var(--ft-green) !important;
}

.ds-home-hero .ds-lead {
  max-width: 590px !important;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 18px !important;
  line-height: 29px !important;
}

.ds-home-hero .ds-hero-actions {
  margin-top: 30px;
}

/* Credibility */
.ds-credibility {
  padding: 50px 0 64px !important;
  background: #f7f7f6 !important;
}

.ds-powered {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto 42px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

.ds-powered-title {
  width: 100% !important;
  margin: 0 auto 22px !important;
  color: #33383c !important;
  font-size: 30px !important;
  line-height: 38px !important;
  font-weight: 500 !important;
  text-align: center !important;
  transform: translateX(clamp(-50px, -2.2vw, -28px)) !important;
}

.ds-powered-lockup {
  width: fit-content !important;
  max-width: 100% !important;
  margin: 0 auto 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 46px !important;
  flex-wrap: nowrap !important;
}

.ds-powered-logo,
.ds-powered-logo-fintastico-green,
.ds-powered-logo-fairtile {
  display: block !important;
  height: auto !important;
  object-fit: contain !important;
}

.ds-powered-logo-fintastico-green {
  width: min(29vw, 365px) !important;
  min-width: 260px !important;
}

.ds-powered-logo-fairtile {
  width: min(43vw, 537px) !important;
  min-width: 380px !important;
}

.ds-powered-x {
  flex: 0 0 auto !important;
  color: #111 !important;
  font-size: 42px !important;
  line-height: 1 !important;
  font-weight: 300 !important;
}

.ds-powered-copy {
  max-width: 640px !important;
  margin: 0 auto;
  color: #404348 !important;
  font-size: 18px !important;
  line-height: 26px !important;
  letter-spacing: 0 !important;
}

.ds-stat-panel {
  width: 100% !important;
  max-width: none !important;
  min-height: 200px !important;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(18, 24, 28, .08) !important;
  border-radius: 28px !important;
  background: #fff;
  box-shadow: none !important;
}

.ds-stat-item {
  min-height: 198px !important;
  padding: 34px 56px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  border-right: 1px solid var(--ft-line);
  text-align: center;
}

.ds-stat-item:last-child {
  border-right: 0;
}

.ds-stat-item strong {
  display: block;
  color: var(--ft-green);
  font-size: 40px !important;
  line-height: 48px !important;
  font-weight: 700 !important;
  letter-spacing: 0;
}

.ds-stat-item span {
  display: block;
  margin-top: 8px !important;
  color: #3f4247 !important;
  font-size: 14px !important;
  line-height: 20px !important;
  font-weight: 500 !important;
  letter-spacing: .02em !important;
  text-transform: uppercase;
}

/* News and product carousels */
.ds-news-live-section,
.ds-company-section {
  background: #fff !important;
}

.ds-products-section,
.ds-events-section {
  background: #f7f7f6 !important;
}

.ds-products-section {
  padding: 76px 0 88px;
}

.ds-news-carousel,
.ds-product-carousel {
  position: relative !important;
}

.ds-news-card-list,
.ds-product-grid {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 40px !important;
  margin: 0 -2px !important;
  padding: 2px 2px 36px !important;
  overflow-x: auto !important;
  scroll-behavior: smooth;
  scroll-padding: 2px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.ds-product-carousel,
.ds-product-carousel .ds-product-grid {
  padding-bottom: 0 !important;
}

.ds-news-card-list::-webkit-scrollbar,
.ds-product-grid::-webkit-scrollbar {
  display: none;
}

.ds-news-card,
.ds-product-carousel .product-card {
  flex: 0 0 calc((100% - 80px) / 3) !important;
  min-width: 0;
  scroll-snap-align: start;
}

.ds-news-card {
  border-radius: 8px;
  background: #fff;
}

.ds-news-card-image {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #e8edea;
  aspect-ratio: 16 / 10;
  text-decoration: none !important;
}

.ds-news-card-image picture,
.ds-news-card-image img {
  display: block;
  width: 100%;
  height: 100%;
}

.ds-news-card-image img {
  object-fit: cover;
  transition: transform .18s ease;
}

.ds-news-card:hover .ds-news-card-image img {
  transform: scale(1.035);
}

.ds-news-category {
  position: absolute;
  right: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ft-green-dark);
  font-size: 12px;
  line-height: 18px;
  font-weight: 800;
  padding: 5px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ds-news-card-meta {
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ft-muted);
  font-size: 13px;
  line-height: 18px;
}

.ds-news-card h3,
.ds-event-card h3 {
  margin: 0;
  color: var(--ft-ink-2);
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.ds-news-card h3 a,
.ds-event-card h3 a {
  color: inherit !important;
  text-decoration: none !important;
}

.ds-event-card p,
.ds-empty-panel p {
  margin: 16px 0 0;
  color: var(--ft-muted);
  font-size: 17px;
  line-height: 27px;
}

.ds-empty-panel {
  flex: 1 0 100%;
  border: 1px solid var(--ft-line);
  border-radius: 24px;
  background: #fff;
  padding: 30px;
  box-shadow: var(--ft-shadow-soft);
}

/* Carousel arrows */
.ds-section-arrow {
  position: absolute;
  z-index: 2;
  top: 46% !important;
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 24, 39, .08) !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96) !important;
  color: #0f1717 !important;
  box-shadow: var(--ft-shadow-soft) !important;
  cursor: pointer !important;
  opacity: 1;
  pointer-events: auto !important;
  transform: translateY(-50%);
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease, visibility .18s ease;
}

.ds-news-carousel .ds-section-arrow {
  top: 32% !important;
}

.ds-section-arrow::before,
.ds-section-arrow::after {
  display: none !important;
  content: none !important;
}

.ds-section-arrow svg {
  width: 24px !important;
  height: 24px !important;
  display: block !important;
  flex: 0 0 auto !important;
  color: currentColor !important;
  fill: none !important;
  pointer-events: none;
}

.ds-section-arrow svg path {
  display: block !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
  fill: none !important;
}

.ds-section-arrow:hover {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 22px 52px rgba(17, 24, 39, .18) !important;
}

.ds-section-arrow:disabled {
  visibility: hidden;
  opacity: 0;
  pointer-events: none !important;
  cursor: default !important;
  transform: translateY(-50%) scale(.92);
}

.ds-section-arrow-prev {
  left: -24px !important;
}

.ds-section-arrow-next {
  right: -24px !important;
}

/* Company discovery section */
.ds-company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.ds-company-card {
  min-height: 250px;
  padding: 30px;
  border: 1px solid var(--ft-line);
  border-radius: 24px !important;
  background: #fff;
  box-shadow: var(--ft-shadow-soft);
}

.ds-company-icon {
  width: 58px !important;
  height: 58px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ft-green-soft);
  color: var(--ft-green-dark);
  font-size: 0 !important;
}

.ds-company-icon svg {
  width: 28px !important;
  height: 28px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.ds-company-card:nth-child(1) .ds-company-icon {
  background: #e1fbf1 !important;
  color: #04a878 !important;
}

.ds-company-card:nth-child(2) .ds-company-icon {
  background: #f0ebff !important;
  color: #6652ff !important;
}

.ds-company-card:nth-child(3) .ds-company-icon {
  background: #eaf5ff !important;
  color: #1d8cff !important;
}

.ds-company-card h3 {
  margin: 34px 0 12px;
  color: var(--ft-ink-2);
  font-size: 20px;
  line-height: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.ds-company-card p {
  margin: 0;
  color: var(--ft-muted);
  font-size: 14px;
  line-height: 22px;
}

.ds-company-card::after {
  content: "";
  display: block;
  width: 58px;
  height: 3px;
  margin-top: 28px;
  background: var(--ft-green);
}

.ds-company-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--ft-line);
  border-radius: 28px !important;
  background: var(--ft-line);
}

.ds-company-stat-item {
  min-height: 88px !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 22px 26px !important;
  background: #fff;
}

.ds-company-stat-icon {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  background: #e1fbf1 !important;
  color: #04a878 !important;
  font-size: 0 !important;
}

.ds-company-stat-icon svg {
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.ds-company-stat-content {
  display: block !important;
  min-width: 0 !important;
}

.ds-company-stat-content strong {
  display: block;
  margin: 0 !important;
  color: var(--ft-green);
  font-size: 20px;
  line-height: 26px;
  font-weight: 900;
}

.ds-company-stat-content span {
  display: block;
  margin-top: 2px !important;
  color: var(--ft-muted);
  font-size: 12px;
  line-height: 18px;
}

/* Events */
.ds-event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.ds-event-card {
  padding: 30px;
  border: 1px solid var(--ft-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--ft-shadow-soft);
}

.ds-event-date {
  margin-bottom: 16px;
  color: var(--ft-green-dark);
  font-size: 12px;
  line-height: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ds-event-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--ft-green-dark) !important;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none !important;
}

/* Tablet and compact laptop */
@media (max-width: 1199px) {
  .ds-news-card-list,
  .ds-product-grid {
    gap: 28px !important;
  }

  .ds-news-card,
  .ds-product-carousel .product-card {
    flex-basis: calc((100% - 28px) / 2) !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .ds-home-hero > .container.ds-home-hero-inner,
  .ds-credibility > .container,
  .ds-news-live-section > .container,
  .ds-products-section > .container,
  .ds-company-section > .container,
  .ds-events-section > .container {
    max-width: none !important;
    width: 100% !important;
    padding-right: 32px !important;
    padding-left: 32px !important;
  }
}

@media (max-width: 991px) {
  .ds-home-hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .ds-home-hero::before {
    display: none;
  }

  .ds-home-hero-inner {
    min-height: auto;
    display: block;
    order: 1;
  }

  .ds-home-hero-copy {
    padding: 64px 0 40px;
    transform: none !important;
  }

  .ds-home-hero-media {
    position: relative;
    inset: auto;
    width: 100%;
    height: 420px;
    order: 2;
    flex: 0 0 420px;
    justify-content: center;
  }

  .ds-home-hero-media picture,
  .ds-home-hero-media img {
    width: 100%;
    height: 100%;
  }

  .ds-home-hero-media img {
    object-fit: cover;
    object-position: 73% center;
  }

  .ds-company-grid,
  .ds-event-grid {
    grid-template-columns: 1fr;
  }

  .ds-stat-panel,
  .ds-company-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ds-company-stat-item:last-child {
    grid-column: 1 / -1;
  }

  .ds-stat-item:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--ft-line);
  }

  .ds-stat-item:nth-child(2) {
    border-right: 0;
  }

  .ds-news-card,
  .ds-product-carousel .product-card {
    flex-basis: min(72%, 540px) !important;
  }

  .ds-section-arrow {
    display: none !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .ds-home-hero > .container.ds-home-hero-inner,
  .ds-credibility > .container,
  .ds-news-live-section > .container,
  .ds-products-section > .container,
  .ds-company-section > .container,
  .ds-events-section > .container {
    padding-right: 16px !important;
    padding-left: 16px !important;
  }

  .ds-home-hero-copy {
    padding: 48px 0 32px;
  }

  .ds-home-hero .ds-h1 {
    max-width: 100% !important;
    font-size: 38px !important;
    line-height: 1.14 !important;
  }

  .ds-home-hero .ds-h1 .ds-h1-nowrap {
    white-space: normal !important;
  }

  .ds-home-hero .ds-lead {
    font-size: 16px !important;
    line-height: 26px !important;
  }

  .ds-home-hero-media {
    height: 310px;
    flex: 0 0 310px;
    background: var(--ft-dark);
  }

  .ds-powered-title {
    font-size: 24px !important;
    line-height: 32px !important;
    transform: none !important;
  }

  .ds-powered-copy {
    font-size: 15px !important;
    line-height: 23px !important;
  }

  .ds-powered-lockup {
    width: 100% !important;
    max-width: 360px !important;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
  }

  .ds-powered-logo-fintastico-green {
    width: min(72vw, 240px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .ds-powered-logo-fairtile {
    width: min(84vw, 300px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .ds-powered-x {
    font-size: 28px !important;
  }

  .ds-stat-panel,
  .ds-company-stats {
    grid-template-columns: 1fr;
  }

  .ds-stat-panel,
  .ds-stat-item {
    min-height: 0 !important;
  }

  .ds-stat-item,
  .ds-stat-item:nth-child(2),
  .ds-stat-item:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--ft-line);
    padding-right: 24px !important;
    padding-left: 24px !important;
  }

  .ds-stat-item:last-child {
    border-bottom: 0;
  }

  .ds-stat-item strong {
    font-size: 34px !important;
    line-height: 42px !important;
  }

  .ds-news-card-list,
  .ds-product-grid {
    gap: 18px !important;
    padding-bottom: 24px !important;
  }

  .ds-news-card,
  .ds-product-carousel .product-card {
    flex-basis: 86% !important;
  }

  .ds-company-card,
  .ds-event-card,
  .ds-empty-panel {
    padding: 24px;
  }

  .ds-company-stat-item {
    min-height: 76px !important;
    gap: 13px !important;
    padding: 18px 20px !important;
  }

  .ds-company-stat-icon {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px !important;
  }

  .ds-company-stat-icon svg {
    width: 20px !important;
    height: 20px !important;
  }
}

@media (max-width: 374px) {
  .ds-home-hero .ds-h1 {
    font-size: 34px !important;
  }

  .ds-home-hero-media {
    height: 280px;
    flex-basis: 280px;
  }
}
