/* ==========================================================================
   AVIA — home page
   Replaces the 1440px absolutely-positioned Figma export with a fluid layout
   built on the design-system tokens. Section order and imagery follow
   white-paper-eng.pdf: black hero, ecosystem product grid (p10), Solana
   advantages (p7), ghost watermarks (p3/p7/p23).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hm-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(52px, 7vw, 104px) clamp(56px, 7vw, 112px);
  background: var(--avia-hero-bg);
  border-bottom: 1px solid var(--avia-stroke-soft);
}

.hm-hero__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hm-hero__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
  filter: saturate(0.6) brightness(0.7);
}

/* Keeps the display type legible whatever frame the video is on. */
.hm-hero__video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(0, 8, 23, 0.94) 0%, rgba(1, 26, 44, 0.78) 46%, rgba(3, 56, 86, 0.42) 100%);
}

.hm-hero__glow {
  top: -14%;
  right: -8%;
}

.hm-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

/* Smaller than the global display size: the hero runs in a half-width column,
   so the white paper's full-bleed scale would wrap to five lines. */
.hm-hero__title {
  margin: 0 0 var(--avia-sp-5);
  max-width: 18ch;
  font-size: clamp(2.3rem, 1.15rem + 3.1vw, 4.1rem);
}

.hm-hero__lead {
  margin-bottom: var(--avia-sp-6);
  max-width: 54ch;
}

.hm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--avia-sp-3);
  margin-bottom: var(--avia-sp-6);
}

.hm-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--avia-sp-3);
  font-size: var(--avia-fs-xs);
  color: var(--avia-text-faint);
}

.hm-hero__metaItem {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hm-hero__sep {
  width: 1px;
  height: 12px;
  background: var(--avia-stroke-strong);
}

.hm-hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding-inline: clamp(40px, 7vw, 96px);
}

.hm-hero__phone {
  position: relative;
  z-index: 1;
  width: min(100%, 366px);
  height: auto;
  filter: drop-shadow(0 40px 70px rgba(0, 8, 23, 0.75));
}

/* Cool rim light ties the app screenshot back into the blue palette. */
.hm-hero__visual::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 8%;
  bottom: 8%;
  left: 50%;
  width: min(74%, 300px);
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 174, 244, 0.42) 0%, rgba(12, 174, 244, 0.08) 52%, transparent 72%);
  filter: blur(42px);
}

/* Floating data chips, echoing the wallet UI on white paper page 1.
   They sit clear of the phone so the screenshot stays readable. */
.hm-hero__chip {
  position: absolute;
  z-index: 2;
  gap: 4px;
  padding: 12px 15px;
  background-color: rgba(2, 24, 39, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--avia-inset-top), var(--avia-shadow-md);
}

.hm-hero__chip--balance {
  top: 16%;
  left: 0;
}

.hm-hero__chip--fee {
  bottom: 18%;
  right: 0;
}

.hm-hero__chipValue {
  font-family: var(--avia-font-display);
  font-size: 1.28rem;
  font-weight: var(--avia-fw-display);
  line-height: 1.1;
  color: var(--avia-text);
}

.hm-hero__chip .avia-badge {
  align-self: flex-start;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Metrics band
   -------------------------------------------------------------------------- */

.hm-metrics {
  padding-block: clamp(28px, 3.4vw, 46px);
  background: rgba(0, 12, 22, 0.42);
  border-bottom: 1px solid var(--avia-stroke-soft);
}

.hm-metrics__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--avia-sp-5);
}

.hm-metrics__grid .avia-stat + .avia-stat {
  padding-left: var(--avia-sp-5);
  border-left: 1px solid var(--avia-stroke-soft);
}

/* --------------------------------------------------------------------------
   Partner marquee
   -------------------------------------------------------------------------- */

.hm-marquee {
  position: relative;
  overflow: hidden;
  padding-block: clamp(22px, 2.6vw, 34px);
  border-bottom: 1px solid var(--avia-stroke-soft);
  /* Fades the logos out at both ends instead of cutting them off. */
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.hm-marquee__track {
  display: flex;
  width: max-content;
  animation: hm-marquee 42s linear infinite;
}

.hm-marquee:hover .hm-marquee__track {
  animation-play-state: paused;
}

.hm-marquee .slider-inner {
  display: flex;
  align-items: center;
  gap: clamp(32px, 4.4vw, 68px);
  padding-right: clamp(32px, 4.4vw, 68px);
  /* The Webflow FOUC guard hid this element; the marquee is pure CSS now. */
  visibility: visible !important;
}

.hm-marquee .partner-logo,
.hm-marquee img {
  height: 30px;
  width: auto;
  object-fit: contain;
  opacity: 0.44;
  filter: grayscale(1) brightness(2.6);
  transition: opacity var(--avia-dur) var(--avia-ease), filter var(--avia-dur) var(--avia-ease);
}

.hm-marquee img:hover {
  opacity: 1;
  filter: grayscale(0) brightness(1);
}

@keyframes hm-marquee {
  to {
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   Ecosystem products
   -------------------------------------------------------------------------- */

.hm-eco {
  position: relative;
  overflow: hidden;
}

.hm-eco__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: var(--avia-sp-4);
}

.hm-eco__cta {
  justify-content: flex-start;
  text-decoration: none;
  background-image: linear-gradient(162deg, rgba(12, 174, 244, 0.17) 0%, rgba(12, 174, 244, 0.04) 100%);
  border-color: var(--avia-stroke-accent);
}

.hm-eco__ctaArrow {
  margin-top: auto;
  padding-top: var(--avia-sp-4);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--avia-accent);
  transition: transform var(--avia-dur) var(--avia-ease);
}

.hm-eco__cta:hover .hm-eco__ctaArrow {
  transform: translateX(5px);
}

/* --------------------------------------------------------------------------
   Solana
   -------------------------------------------------------------------------- */

.hm-solana {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0, 8, 23, 0) 0%, rgba(0, 12, 24, 0.5) 100%);
}

.hm-solana__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(28px, 4.4vw, 68px);
  align-items: start;
}

.hm-solana__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 2.8vw, 40px);
}

.hm-solana__item h3 {
  margin-bottom: var(--avia-sp-2);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Marketplace
   -------------------------------------------------------------------------- */

.hm-shop__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--avia-sp-5);
  margin-bottom: var(--avia-sp-5);
}

.hm-shop__headText {
  margin-bottom: 0;
}

.hm-shop__arrows {
  display: flex;
  gap: var(--avia-sp-2);
  flex: 0 0 auto;
}

/* Chip rail — horizontal scroll, arrows nudge it along. */
.hm-shop__chips {
  display: flex;
  gap: var(--avia-sp-2);
  margin-bottom: var(--avia-sp-6);
  padding-bottom: var(--avia-sp-2);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.hm-shop__chips::-webkit-scrollbar {
  display: none;
}

.hm-shop__chips .category-chips {
  display: flex;
  gap: var(--avia-sp-2);
}

/* Injected by js/category-chips-sidebar.js — styled here, not renamed. */
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px 9px 11px;
  font-size: var(--avia-fs-sm);
  font-weight: var(--avia-fw-semi);
  line-height: 1;
  white-space: nowrap;
  color: var(--avia-text-dim);
  background: var(--avia-surface-1);
  border: 1px solid var(--avia-stroke);
  border-radius: var(--avia-r-pill);
  cursor: pointer;
  transition: all var(--avia-dur) var(--avia-ease);
}

.category-chip:hover {
  color: var(--avia-text);
  border-color: var(--avia-stroke-accent);
  background: var(--avia-surface-2);
}

.category-chip.is-active {
  color: var(--avia-text-on-accent);
  background: var(--avia-accent);
  border-color: var(--avia-accent);
}

.category-chip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: currentColor;
}

.category-chip__icon img,
.category-chip__icon svg {
  width: 20px;
  height: 20px;
  object-fit: contain;
  /* Category icons ship as dark-on-transparent art. */
  filter: invert(1) brightness(1.8);
  opacity: 0.8;
}

.category-chip.is-active .category-chip__icon img {
  filter: none;
  opacity: 1;
}

.category-chip__icon svg {
  filter: none;
}

.hm-shop__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: var(--avia-sp-4);
}

.hm-shop__more {
  display: flex;
  justify-content: center;
  margin-top: var(--avia-sp-6);
}

/* Product tiles are generated by the inline Firestore module in index.html;
   the class names below come from that template. */
.hm-shop__grid .product-items {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: rgba(3, 40, 63, 0.42);
  background-image: var(--avia-card-fill);
  border: 1px solid var(--avia-stroke);
  border-radius: var(--avia-r-md);
  box-shadow: var(--avia-inset-top);
  cursor: pointer;
  transition: border-color var(--avia-dur) var(--avia-ease), transform var(--avia-dur) var(--avia-ease),
    box-shadow var(--avia-dur) var(--avia-ease);
}

.hm-shop__grid .product-items:hover {
  border-color: var(--avia-stroke-accent);
  transform: translateY(-3px);
  box-shadow: var(--avia-inset-top), var(--avia-shadow-lg);
}

.hm-shop__grid .product-top-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

.hm-shop__grid .product-top-wrap img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--avia-surface-1);
}

.hm-shop__grid .product-title {
  padding: var(--avia-sp-4) var(--avia-sp-4) 0;
  font-size: var(--avia-fs-sm);
  font-weight: var(--avia-fw-semi);
  line-height: 1.4;
  color: var(--avia-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hm-shop__grid .product-bottom-wrap {
  padding: var(--avia-sp-3) var(--avia-sp-4) var(--avia-sp-4);
  margin-top: auto;
}

.hm-shop__grid .product-price {
  font-family: var(--avia-font-display);
  font-size: 1.12rem;
  font-weight: var(--avia-fw-display);
  color: var(--avia-accent);
  font-variant-numeric: tabular-nums;
}

.hm-shop__grid > p {
  grid-column: 1 / -1;
  padding: var(--avia-sp-7) 0;
  text-align: center;
  color: var(--avia-text-faint) !important;
}

/* --------------------------------------------------------------------------
   Invest
   -------------------------------------------------------------------------- */

.hm-invest__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4.4vw, 64px);
  align-items: center;
}

.hm-invest__copy .avia-btn {
  margin-top: var(--avia-sp-4);
}

.hm-invest__benefits {
  display: grid;
  gap: var(--avia-sp-3);
}

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */

.hm-news__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--avia-sp-5);
  margin-bottom: var(--avia-sp-5);
}

.hm-news__arrows {
  display: flex;
  gap: var(--avia-sp-2);
}

.hm-news__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.hm-news__image {
  min-height: 320px;
  background-size: cover;
  background-position: center;
  transition: opacity var(--avia-dur) var(--avia-ease);
}

.hm-news__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--avia-sp-3);
  padding: clamp(24px, 3vw, 44px);
}

.hm-news__title {
  margin: 0;
  text-transform: none;
}

.hm-news__excerpt {
  margin: 0;
}

.hm-news__body .avia-btn {
  margin-top: auto;
}

/* Cross-fade applied by the slider in index.html. */
.hm-news__image.is-switching,
.hm-news__text.is-switching,
#hpNewsDate.is-switching {
  opacity: 0;
}

.hm-news__text,
#hpNewsDate {
  transition: opacity 0.13s var(--avia-ease);
}

/* --------------------------------------------------------------------------
   Partner
   -------------------------------------------------------------------------- */

.hm-partner__panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(28px, 4vw, 60px);
  padding: clamp(28px, 4vw, 56px);
  border-radius: var(--avia-r-lg);
}

.hm-partner__glow {
  top: -40%;
  left: -14%;
}

.hm-partner__copy,
.hm-partner__benefits {
  position: relative;
  z-index: 1;
}

.hm-partner__actions {
  display: flex;
  align-items: center;
  gap: var(--avia-sp-4);
  flex-wrap: wrap;
  margin-top: var(--avia-sp-5);
}

.hm-partner__note {
  font-size: var(--avia-fs-xs);
}

.hm-partner__benefits {
  display: grid;
  gap: var(--avia-sp-5);
  align-content: center;
}

.hm-partner__benefit h3 {
  margin-bottom: var(--avia-sp-2);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Download
   -------------------------------------------------------------------------- */

.hm-download__panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 4vw, 56px);
  background: linear-gradient(140deg, #064063 0%, #032a44 52%, #01141f 100%);
  border: 1px solid var(--avia-stroke);
  border-radius: var(--avia-r-lg);
  box-shadow: var(--avia-inset-top), var(--avia-shadow-lg);
}

.hm-download__stores {
  display: flex;
  gap: var(--avia-sp-3);
  flex-wrap: wrap;
  margin-top: var(--avia-sp-5);
}

.hm-download__store img {
  height: 46px;
  width: auto;
  display: block;
  border-radius: var(--avia-r-sm);
  transition: transform var(--avia-dur) var(--avia-ease);
}

.hm-download__store:hover img {
  transform: translateY(-2px);
}

.hm-download__phone {
  justify-self: center;
  width: min(100%, 300px);
  height: auto;
  filter: drop-shadow(0 30px 56px rgba(0, 8, 23, 0.7));
}

/* --------------------------------------------------------------------------
   Reveal-on-scroll (observer lives in index.html)
   -------------------------------------------------------------------------- */

.hp [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--avia-ease-out), transform 0.6s var(--avia-ease-out);
}

.hp [data-reveal='left'] {
  transform: translateX(-22px);
}

.hp [data-reveal='right'] {
  transform: translateX(22px);
}

.hp [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .hp [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .hm-marquee__track {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .hm-hero__inner,
  .hm-solana__layout,
  .hm-invest__layout,
  .hm-partner__panel,
  .hm-download__panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-hero__phone {
    width: min(100%, 290px);
  }

  .hm-hero__chip--balance {
    left: 0;
  }

  .hm-hero__chip--fee {
    right: 0;
  }

  .hm-metrics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--avia-sp-4);
  }

  .hm-metrics__grid .avia-stat:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .hm-news__card {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-news__image {
    min-height: 220px;
  }

  .hm-download__phone {
    display: none;
  }
}

@media (max-width: 767px) {
  .hm-hero {
    padding-block: 36px 48px;
  }

  .hm-hero__visual {
    order: -1;
  }

  .hm-hero__phone {
    width: min(58vw, 220px);
  }

  .hm-hero__actions {
    width: 100%;
  }

  .hm-hero__actions .avia-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .hm-solana__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hm-shop__head,
  .hm-news__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hm-metrics__grid .avia-stat + .avia-stat {
    padding-left: 0;
    border-left: 0;
  }

  .hm-hero__chip {
    display: none;
  }

  .avia-watermark {
    font-size: clamp(3.4rem, 19vw, 6rem);
  }
}
