@import url("./home-system-explainer-legacy.css");
@import url("./home-discovery.css");

/* Final Chinese heading tone: intentionally lighter than Ant's default title color
 * because the Home page uses large display-scale headings. */
html[lang="zh-CN"] .template-gallery-heading h2,
html[lang="zh-CN"] #capabilities .section-heading h2 {
  color: rgba(0, 0, 0, .68) !important;
  font-weight: 400 !important;
  letter-spacing: -.008em !important;
  line-height: 1.24 !important;
}

html[lang="zh-CN"] .showcase-copy h2,
html[lang="zh-CN"] .system-explainer-heading h2,
html[lang="zh-CN"] .featured-cases-heading h2 {
  color: rgba(255, 255, 255, .86) !important;
  font-weight: 400 !important;
  letter-spacing: -.008em !important;
  line-height: 1.24 !important;
}

/* Learn / design-system explainer: use a real interface case instead of the CSS-built dashboard mockup.
 * Keep the existing annotation callouts around the canvas so the section still teaches how to read a UI. */
#design-system-live .system-app {
  overflow: hidden !important;
  border-color: rgba(115, 242, 167, .24) !important;
  background-color: #050806 !important;
  background-image: url("../../../assets/home/case-hackathon-20260831.png") !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-size: cover !important;
  box-shadow: 0 42px 120px rgba(0, 0, 0, .58), 0 0 0 1px rgba(115, 242, 167, .05) !important;
}

/* Remove the synthetic dashboard layers; the real screenshot is now the content. */
#design-system-live .system-app-topbar,
#design-system-live .system-app-sidebar,
#design-system-live .system-app-hero,
#design-system-live .system-app-section-title,
#design-system-live .system-projects,
#design-system-live .system-activity {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#design-system-live .system-app::before,
#design-system-live .system-app::after {
  display: none !important;
  content: none !important;
}

@media (hover: hover) and (pointer: fine) {
  #design-system-live .system-explainer-stage:hover .system-app {
    border-color: rgba(115, 242, 167, .38) !important;
    box-shadow: 0 48px 140px rgba(0, 0, 0, .64), 0 0 48px rgba(115, 242, 167, .06) !important;
  }

  #design-system-live .system-explainer-stage:hover .system-app-topbar,
  #design-system-live .system-explainer-stage:hover .system-app-sidebar,
  #design-system-live .system-explainer-stage:hover .system-app-hero,
  #design-system-live .system-explainer-stage:hover .system-app-section-title,
  #design-system-live .system-explainer-stage:hover .system-projects,
  #design-system-live .system-explainer-stage:hover .system-activity {
    opacity: 0 !important;
    visibility: hidden !important;
  }
}

/* Discovery heading should stay optically centered at every viewport width. */
.template-gallery-heading {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  text-align: center !important;
}

.template-gallery-heading h2,
.template-gallery-heading p {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

/* The full-bleed preview rail used to expand the grid track itself, which pulled
 * the heading and tabs off the viewport center. Keep the track constrained. */
#templates > .project-container {
  grid-template-columns: minmax(0, 1fr) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

#templates .template-gallery-heading,
#templates .template-filters {
  justify-self: center !important;
}

#templates .template-grid {
  min-width: 0 !important;
}

/* Desktop discovery: enlarge the image-based previews without letting that size
 * leak into the vocabulary grid. Vocabulary remains a stable, left-aligned rail. */
@media (min-width: 981px) {
  #templates {
    --discovery-card: clamp(220px, 16vw, 260px) !important;
    --discovery-gap: clamp(20px, 2.2vw, 32px) !important;
    padding-block: clamp(50px, 6vh, 68px) clamp(42px, 5vh, 58px) !important;
  }

  #templates .template-gallery-heading h2,
  html[lang="zh-CN"] #templates .template-gallery-heading h2 {
    font-size: clamp(56px, 5vw, 82px) !important;
  }

  #templates .template-gallery-heading > p:last-child {
    margin-top: 18px !important;
  }

  #templates .template-filters {
    margin-top: 26px !important;
  }

  #templates .template-grid {
    margin-top: 42px !important;
  }

  #templates.discovery-strip .template-card:is(:nth-child(1), :nth-child(3), :nth-child(4)).is-active-discovery {
    width: min(calc(100vw - 72px), 1560px) !important;
    max-width: none !important;
    justify-content: center !important;
    gap: var(--discovery-gap) !important;
    margin-left: 50% !important;
    padding: 8px 0 18px !important;
    overflow-x: hidden !important;
    transform: translateX(-50%);
  }

  #templates.discovery-strip .template-card:is(:nth-child(1), :nth-child(3), :nth-child(4)).is-active-discovery > :is(img, .template-card-shade, small, div) {
    flex: 0 0 clamp(286px, 20.8vw, 338px) !important;
  }

  #templates .template-grid .template-card.home-vocab-host > .home-vocab-strip {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: start !important;
    gap: var(--discovery-gap) !important;
    margin-left: 0 !important;
    padding: 8px 0 18px !important;
    overflow-x: auto !important;
    transform: none !important;
    scroll-padding-inline: 0;
  }

  #templates .discovery-footer {
    margin-top: 2px !important;
  }
}
