/*
 * M TEK — Premium Layout Polish 2026-09-22
 * Final visual pass for homepage desktop + mobile.
 * Purpose: remove oversized dead space, keep cards compact and complete,
 * enforce mobile two-up utilities / market cards and three-up app cards,
 * center media, and create a tighter exchange-style rhythm.
 */

/* ---------- Global rhythm / overflow ---------- */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

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

section {
  padding-block: 64px;
}

section + section {
  padding-top: 54px;
}

.container {
  width: min(92%, 1240px);
}

.section-title {
  margin-bottom: 38px;
}

.section-title h2 {
  letter-spacing: -0.025em;
}

/* Make the transition between sections intentional rather than empty. */
section::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(360px, 42vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255,215,0,.14), transparent);
  pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
  width: min(92%, 1300px);
  padding: 112px 0 62px;
  gap: 48px;
}

.hero-left,
.hero-right {
  min-width: 0;
}

.hero-right img {
  display: block;
  width: min(100%, 540px);
  margin-inline: auto;
  object-fit: contain;
}

.hero p {
  line-height: 1.7;
}

.hero-buttons {
  margin-bottom: 18px;
}

/* ---------- Live market ---------- */
.live-market {
  padding-top: 54px;
  padding-bottom: 52px;
}

.live-market-title {
  margin-bottom: 25px;
}

.market-toolbar {
  margin-bottom: 16px;
  padding: 11px 14px;
}

.market-grid {
  gap: 14px;
}

.market-card {
  padding: 16px;
  min-height: 188px;
  display: flex;
  flex-direction: column;
}

.market-card-top {
  margin-bottom: 7px;
}

.market-price {
  margin-top: 18px;
  margin-bottom: 8px;
}

.market-meta {
  margin-top: 7px;
}

.market-spark {
  bottom: 12px;
}

.market-note {
  margin-top: 10px;
}

/* ---------- Compact desktop cards ---------- */
.feature-grid,
.service-grid,
.steps-grid,
.why-grid,
.contact-grid,
.mission-grid,
.ecosystem-grid {
  gap: 16px;
  margin-top: 32px;
  align-items: stretch;
}

.feature-card,
.service-card,
.step-card,
.why-card,
.contact-card,
.mission-card,
.ecosystem-card {
  min-width: 0;
  overflow: hidden;
}

.feature-card,
.service-card,
.step-card,
.why-card,
.contact-card {
  padding: 26px 21px;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.feature-card i,
.service-card i,
.step-card i,
.why-card i,
.contact-card i {
  flex: 0 0 auto;
}

.feature-card h3,
.service-card h3,
.step-card h3,
.why-card h3,
.contact-card h3 {
  margin-bottom: 8px;
}

.feature-card p,
.service-card p,
.step-card p,
.why-card p,
.contact-card p,
.contact-card a {
  line-height: 1.65;
}

.mission-grid {
  gap: 18px;
}

.mission-card {
  padding: 30px;
}

/* ---------- Ecosystem ---------- */
.ecosystem-section {
  padding-block: 58px;
}

.ecosystem-heading {
  margin-bottom: 30px;
}

.ecosystem-card {
  padding: 22px 20px 20px;
  min-height: 180px;
}

.ecosystem-card h3 {
  font-size: 17px;
}

.ecosystem-card p {
  font-size: 11px;
}

/* ---------- AI / investment story ---------- */
.ai-earning-section,
.investment-story {
  padding-block: 62px;
}

.ai-heading,
.investment-story-heading {
  margin-bottom: 32px !important;
}

/* ---------- FAQ ---------- */
.faq {
  padding-block: 58px;
}

.faq-item {
  padding: 18px 20px;
  margin-bottom: 12px;
}

/* ---------- Contact ---------- */
.contact {
  padding-top: 58px;
  padding-bottom: 54px;
}

.contact-grid {
  margin-top: 30px;
}

.contact-card {
  min-height: 174px;
}

.contact-card i {
  margin-bottom: 13px;
}

/* Telegram brand accent */
.contact-card:nth-child(2) i,
.contact-card:nth-child(2) a:hover {
  color: #229ED9;
}

.contact-card:nth-child(2) i {
  filter: drop-shadow(0 8px 18px rgba(34,158,217,.22));
}

.contact-card:nth-child(2):hover {
  border-color: rgba(34,158,217,.55);
  box-shadow: 0 18px 40px rgba(34,158,217,.08);
}

/* ---------- App strip ---------- */
.mtek-app-downloads {
  padding: 30px 18px 18px;
}

.mtek-app-downloads-inner {
  max-width: 1200px;
  gap: 20px;
}

.mtek-app-downloads-heading h2 {
  font-size: 22px;
}

.mtek-app-store-grid {
  gap: 9px;
}

.mtek-app-store-link {
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 13px;
}

/* Footer should visually close the page without a giant void. */
.site-footer {
  margin-top: 0 !important;
  padding: 16px 14px !important;
}

/* ---------- Desktop / laptop ---------- */
@media (min-width: 901px) {
  .hero {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .service-grid,
  .steps-grid,
  .why-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .contact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .market-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .mtek-app-store-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ---------- Tablet ---------- */
@media (min-width: 681px) and (max-width: 1100px) {
  section {
    padding-block: 58px;
  }

  section + section {
    padding-top: 48px;
  }

  .hero {
    padding-top: 98px;
    padding-bottom: 50px;
  }

  .feature-grid,
  .service-grid,
  .steps-grid,
  .why-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ---------- Mobile: two-up cards + three-up apps ---------- */
@media (max-width: 680px) {
  :root {
    --mtek-mobile-gutter: 14px;
  }

  section {
    padding-block: 42px !important;
  }

  section + section {
    padding-top: 32px !important;
  }

  .container {
    width: calc(100% - (var(--mtek-mobile-gutter) * 2)) !important;
    max-width: none !important;
  }

  .section-title {
    margin-bottom: 23px !important;
  }

  .section-title h2 {
    font-size: clamp(24px, 7vw, 30px) !important;
    line-height: 1.16 !important;
  }

  .section-title p {
    font-size: 11px !important;
    line-height: 1.66 !important;
  }

  /* Hero: one clean centered column and no dead air below the art. */
  .hero {
    width: calc(100% - (var(--mtek-mobile-gutter) * 2)) !important;
    padding: 62px 0 34px !important;
    gap: 18px !important;
    text-align: center;
  }

  .hero-right {
    order: -1;
  }

  .hero-right img {
    width: min(100%, 360px) !important;
    margin-inline: auto !important;
  }

  .hero h1 {
    font-size: clamp(29px, 8.5vw, 36px) !important;
  }

  .hero p {
    font-size: 12px !important;
    line-height: 1.66 !important;
    margin-bottom: 14px !important;
  }

  .hero-buttons {
    width: 100%;
    gap: 8px !important;
    margin-bottom: 0 !important;
  }

  /* Every compact utility/card family is strictly two-up. */
  .feature-grid,
  .service-grid,
  .steps-grid,
  .why-grid,
  .contact-grid,
  .mission-grid,
  .ecosystem-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-top: 22px !important;
  }

  .feature-card,
  .service-card,
  .step-card,
  .why-card,
  .contact-card,
  .mission-card,
  .ecosystem-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 158px !important;
    padding: 17px 11px !important;
    border-radius: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }

  .feature-card i,
  .step-card i {
    width: 48px !important;
    height: 48px !important;
    margin: 0 auto 10px !important;
    font-size: 19px !important;
  }

  .service-card i,
  .why-card i,
  .contact-card i,
  .mission-card i,
  .ecosystem-card i {
    width: 46px !important;
    height: 46px !important;
    margin: 0 auto 10px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 21px !important;
  }

  .feature-card h3,
  .service-card h3,
  .step-card h3,
  .why-card h3,
  .contact-card h3,
  .mission-card h2,
  .ecosystem-card h3 {
    width: 100%;
    max-width: 100%;
    font-size: 13px !important;
    line-height: 1.25 !important;
    margin: 0 0 7px !important;
  }

  .feature-card p,
  .service-card p,
  .step-card p,
  .why-card p,
  .contact-card p,
  .contact-card a,
  .mission-card p,
  .ecosystem-card p {
    width: 100%;
    max-width: 100%;
    font-size: 9px !important;
    line-height: 1.48 !important;
    margin: 0;
  }

  .feature-card .feature-link {
    margin-top: 7px !important;
    font-size: 8px !important;
  }

  /* Contact: Telegram uses its recognizable blue logo/accent. */
  .contact-card:nth-child(2) i {
    color: #229ED9 !important;
    filter: drop-shadow(0 7px 15px rgba(34,158,217,.24));
  }

  .contact-card:nth-child(2) {
    border-color: rgba(34,158,217,.22);
  }

  .contact-card:nth-child(2):hover {
    border-color: rgba(34,158,217,.55);
  }

  /* Step numbers stay subtle, never collide with copy. */
  .step-number {
    top: 7px !important;
    right: 8px !important;
    font-size: 28px !important;
  }

  /* About media always centered and contained. */
  .about-image,
  .about-image img {
    width: 100% !important;
    margin-inline: auto !important;
    text-align: center !important;
  }

  .about-image img {
    display: block !important;
    width: min(100%, 370px) !important;
    object-fit: contain !important;
  }

  /* Market: exactly two cards per row on mobile, including very small phones. */
  .live-market {
    padding-top: 38px !important;
    padding-bottom: 38px !important;
  }

  .market-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
    width: 100% !important;
  }

  .market-grid > .market-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 148px !important;
    padding: 11px !important;
    border-radius: 15px !important;
  }

  .market-card-top {
    margin-bottom: 5px !important;
  }

  .asset-icon-wrap,
  .market-symbol-icon {
    width: 32px !important;
    height: 32px !important;
    flex-basis: 32px !important;
  }

  .asset-icon-wrap img,
  .market-symbol-icon img {
    width: 21px !important;
    height: 21px !important;
  }

  .asset-name strong,
  .market-symbol strong {
    font-size: 10px !important;
    line-height: 1.12 !important;
  }

  .asset-name span,
  .market-symbol small {
    font-size: 6px !important;
    margin-top: 2px !important;
  }

  .market-price,
  .market-card .market-price {
    font-size: 16px !important;
    line-height: 1.1 !important;
    margin-top: 13px !important;
    margin-bottom: 5px !important;
  }

  .market-meta {
    margin-top: 4px !important;
    font-size: 6.5px !important;
  }

  .market-note {
    font-size: 7px !important;
    line-height: 1.5 !important;
  }

  /* App strip: three cards across on the same row. */
  .mtek-app-downloads {
    padding: 25px 10px 12px !important;
  }

  .mtek-app-downloads-inner {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    align-items: stretch !important;
  }

  .mtek-app-downloads-heading {
    text-align: center !important;
  }

  .mtek-app-downloads-heading h2 {
    font-size: clamp(18px, 5.4vw, 22px) !important;
    line-height: 1.16 !important;
  }

  .mtek-app-downloads-heading p {
    max-width: 340px !important;
    margin-inline: auto !important;
    font-size: 9px !important;
    line-height: 1.5 !important;
  }

  .mtek-app-downloads .mtek-app-store-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    flex: none !important;
  }

  .mtek-app-downloads .mtek-app-store-link {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 78px !important;
    padding: 9px 7px !important;
    gap: 6px !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: left !important;
    border-radius: 12px !important;
  }

  .mtek-app-downloads .mtek-app-store-icon {
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
    font-size: 16px !important;
  }

  .mtek-app-downloads .mtek-app-store-copy {
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 30px) !important;
    align-items: flex-start !important;
    text-align: left !important;
    white-space: normal !important;
    line-height: 1.08 !important;
  }

  .mtek-app-downloads .mtek-app-store-copy small {
    max-width: 100% !important;
    font-size: 5px !important;
    letter-spacing: .45px !important;
    white-space: normal !important;
  }

  .mtek-app-downloads .mtek-app-store-copy strong {
    max-width: 100% !important;
    font-size: 8px !important;
    line-height: 1.12 !important;
    white-space: normal !important;
  }

  .site-footer {
    text-align: center !important;
    padding: 12px 10px !important;
    margin: 0 !important;
    font-size: 8px !important;
    line-height: 1.55 !important;
  }
}

/* Extra-small phones: preserve 2-up/3-up layout instead of collapsing. */
@media (max-width: 370px) {
  .feature-grid,
  .service-grid,
  .steps-grid,
  .why-grid,
  .contact-grid,
  .mission-grid,
  .ecosystem-grid,
  .market-grid {
    gap: 7px !important;
  }

  .feature-card,
  .service-card,
  .step-card,
  .why-card,
  .contact-card,
  .mission-card,
  .ecosystem-card {
    min-height: 150px !important;
    padding-inline: 8px !important;
  }

  .feature-card h3,
  .service-card h3,
  .step-card h3,
  .why-card h3,
  .contact-card h3,
  .mission-card h2,
  .ecosystem-card h3 {
    font-size: 12px !important;
  }

  .feature-card p,
  .service-card p,
  .step-card p,
  .why-card p,
  .contact-card p,
  .contact-card a,
  .mission-card p,
  .ecosystem-card p {
    font-size: 8px !important;
  }

  .mtek-app-downloads .mtek-app-store-link {
    min-height: 74px !important;
    padding-inline: 5px !important;
    gap: 5px !important;
  }

  .mtek-app-downloads .mtek-app-store-icon {
    width: 22px !important;
    height: 22px !important;
    flex-basis: 22px !important;
    font-size: 15px !important;
  }

  .mtek-app-downloads .mtek-app-store-copy strong {
    font-size: 7.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  section::after {
    opacity: .8;
  }
}

/* Remove oversized intrinsic placeholders on the homepage. The page is already
   lightweight enough to render normally, which avoids visible blank bands and
   layout shifts between sections. */
.about,
.features,
.services,
.ecosystem-section,
.ai-earning-section,
.investment-story,
.how-it-works,
.why-us,
.mission,
.faq,
.contact,
.mtek-app-downloads {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

/* CTA used to keep its own 110px padding and therefore escaped the compact rhythm. */
.cta-section {
  padding: 66px 0 !important;
}

@media (max-width: 680px) {
  .cta-section {
    padding: 42px 0 !important;
  }
}

/* =========================================================
   FINAL HOMEPAGE GRID / MOBILE APP STRIP OVERRIDES
   Keep six feature cards balanced as 3 + 3 on laptop/desktop,
   keep contact cards 2-up on phones, and keep app buttons 3-up
   in the compact App Store / Google Play / APK style.
   ========================================================= */
@media (min-width: 1200px) {
  .container {
    width: min(94%, 1500px) !important;
    max-width: 1500px !important;
  }

  .features .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

@media (max-width: 680px) {
  .contact#contact .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-top: 22px !important;
  }

  .contact#contact .contact-card {
    min-width: 0 !important;
    min-height: 156px !important;
    padding: 17px 9px !important;
  }
}

@media (max-width: 350px) {
  .contact#contact .contact-grid {
    gap: 8px !important;
  }

  .contact#contact .contact-card {
    min-height: 148px !important;
    padding-inline: 7px !important;
  }
}
