/* Responsive — prevent horizontal scroll while keeping desktop Figma layout. */

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

.site-shell,
.pricing-page,
.about-page,
.news-page,
.post-page,
.solution-page,
.platform-page {
  width: 100%;
  max-width: 1920px;
  margin-inline: auto;
  overflow-x: clip;
}

.header-pill {
  width: min(1503px, calc(100% - 32px));
}

.pricing-header-inner,
.pricing-hero-content,
.pricing-compare-wrap,
.pricing-cta-panel,
.news-shell,
.post-shell,
.solution-shell,
.platform-shell,
.about-hero-container,
.about-vision-container,
.about-team-container,
.about-contact-container,
.about-capability-container {
  width: min(1288px, calc(100% - 64px));
  max-width: 100%;
}

.hero-copy h1,
.hero-copy p,
.section-heading h2,
.section-heading p,
.modules-section .section-heading h2,
.pricing-hero-copy h1,
.pricing-hero-copy p,
.pricing-compare-heading h2,
.pricing-compare-heading p,
.pricing-cta-panel h2,
.pricing-cta-panel p,
.platform-hero p,
.platform-intro,
.platform-quote p,
.contact-copy,
.difference-header h2,
.about-hero-heading,
.about-hero-copy {
  width: 100%;
  max-width: 100%;
}

.hero-grid {
  width: 100%;
  max-width: 1920px;
  background-size: cover;
  background-position: center top;
}

@media (max-width: 1024px), (prefers-reduced-motion: reduce) {
  .hero-video-wrap,
  .hero-video-scrim {
    display: none;
  }

  .hero-grid {
    inset: 0;
    height: 1091px;
    background:
      url("/gtrace-media/styles/hero-bg-0703.webp") center top / cover no-repeat;
  }
}

/* Clip decorative bleed that caused page-level horizontal scroll */
.section,
.hero-stage,
.data-flow-section,
.modules-section,
.difference-section,
.faq-section,
.about-hero-section,
.about-team-section,
.pricing-hero-section,
.platform-hero,
.testimonials-section {
  overflow-x: clip;
  max-width: 100%;
}

.scroll-top {
  position: fixed;
  right: 24px;
  top: auto;
  bottom: 24px;
  z-index: 50;
}

/* Wide Figma boards: scale to fit viewport, no page scroll */
.flow-board-scale,
.modules-graphic-scale {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.flow-board-scale .flow-board,
.modules-graphic-scale .modules-graphic {
  transform-origin: top left;
  will-change: transform;
}

/* —— ≤1280 —— */
@media (max-width: 1280px) {
  .header-pill {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-nav,
  .pricing-header-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
  }

  .nav-item{padding: 10px 6px}

  .pricing-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-grid,
  .news-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .capability-content {
    flex-direction: column;
    align-items: stretch;
  }

  .capability-steps,
  .capability-stack {
    width: 100%;
  }

  .capability-stack {
    height: auto;
    min-height: 420px;
    margin-inline: auto;
  }

  .stack-item {
    width: 100%;
    max-width: 572px;
    left: 50%;
    transform: translateX(-50%);
  }

  .capability-section {
    margin-top: 0;
    padding-top: 48px;
  }

  .hero-stage {
    min-height: 0;
  }

  .news-featured {
    grid-template-columns: 1fr;
  }

  .solution-core-grid,
  .solution-contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .solution-benefit-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .solution-core-cards,
  .platform-tech-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-module-card {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    flex-direction: row;
    gap: 32px;
  }

  .gt-home-contact .contact-copy h2{font-size: 25px; line-height: 1.5;}

  .contact-copy,
  .contact-form,
  .about-contact-form {
    width: 100%;
    max-width: 100%;
  }

  .gt-register-modal__dialog {
    width: min(1080px, 100%);
    padding: 48px 32px 32px;
  }

  .gt-register-modal__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .gt-register-modal__copy h2 {
    font-size: 48px;
  }

  .gt-register-modal__meta {
    margin-top: 32px;
  }

  .gt-register-modal__form,
  .gt-register-modal__form .contact-form {
    width: 100%;
    max-width: 100%;
  }

  .platform-float {
    display: none;
  }

  .platform-dashboard-wrap {
    width: 100%;
  }

  .footer-main,
  .footer-links {
    flex-wrap: wrap;
    gap: 32px;
  }

  .footer-divider {
    width: 100%;
  }

  .section-deco,
  .faq-deco-left,
  .faq-deco-right,
  .difference-deco-left,
  .difference-deco-right,
  .about-team-deco {
    display: none;
  }
}

@media (max-width: 767px) {
  .gt-register-modal {
    padding: 16px;
  }

  .gt-register-modal__dialog {
    max-height: calc(100vh - 32px);
    padding: 40px 20px 24px;
    border-radius: 24px;
  }

  .gt-register-modal__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 30px;
  }

  .gt-register-modal__copy h2 {
    font-size: 36px;
    line-height: 1.14;
  }

  .gt-register-modal__meta {
    gap: 20px;
  }

  .gt-register-modal__meta-row {
    align-items: flex-start;
  }
}

/* Modules diagram: stack cards below Figma artboard width */
@media (max-width: 1279px) {
  .modules-graphic {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 40px;
  }

  .modules-bg,
  .modules-core,
  .module-curve,
  .module-line {
    display: none;
  }

  .module-card,
  .module-card-1,
  .module-card-2,
  .module-card-3,
  .module-card-4,
  .module-card-5,
  .module-card-6,
  .module-card-center {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    padding: 20px;
    border: 1px solid #eaecf0;
    border-radius: 16px;
    background: #fff;
    text-align: left;
    flex-direction: row;
    align-items: flex-start;
  }

  .module-card-left {
    text-align: left;
  }

  .module-card img {
    width: 40px;
    height: auto;
  }
}

/* Flow board: scale via JS; fallback scroll containment */
@media (max-width: 1279px) {
  .flow-board {
    width: 1288px;
    max-width: none;
  }
}

/* —— ≤768 —— */
@media (max-width: 768px) {
  .container,
  .pricing-header-inner,
  .pricing-hero-content,
  .pricing-compare-wrap,
  .pricing-cta-panel,
  .news-shell,
  .post-shell,
  .solution-shell,
  .platform-shell,
  .about-hero-container,
  .about-vision-container,
  .about-team-container,
  .about-contact-container,
  .about-capability-container {
    width: calc(100% - 24px);
  }

  .header-pill,
  .pricing-header-inner {
    height: auto;
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
  }

  .header-nav,
  .pricing-header-nav {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .pricing-card-grid,
  .news-grid,
  .news-grid-3,
  .solution-core-cards,
  .platform-tech-grid,
  .difference-grid,
  .modules-graphic {
    grid-template-columns: 1fr;
  }

  .news-tabs {
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: flex-start;
  }

  .news-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 416 / 277;
  }

  .pricing-cta-panel {
    padding: 40px 20px;
  }

  .pricing-cta-form {
    width: 100%;
  }

  /* Compare table: horizontal scroll, keep desktop column geometry */
  .pricing-compare-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .pricing-compare-table {
    width: 1288px;
    min-width: 1288px;
    max-width: none;
    margin: 0;
    transform: none !important;
  }

  .pricing-compare-header,
  .pricing-compare-row {
    grid-template-columns: 280px repeat(4, 1fr);
  }

  .pricing-compare-scale {
    overflow: visible;
    height: auto !important;
  }

  .pricing-compare-scale .pricing-compare-table {
    transform: none !important;
  }

  /* —— Global footer (homepage canon) —— */
  .site-footer .footer-hero {
    width: 100%;
    max-width: 810px;
    height: auto;
    aspect-ratio: 810 / 261;
  }

  .site-footer .footer-content {
    padding: 48px 16px;
  }

  .site-footer .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .site-footer .footer-brand {
    width: 100%;
  }

  .site-footer .footer-links {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 32px;
    width: 100%;
  }

  .site-footer .footer-divider {
    width: 100%;
    margin: 40px 0;
  }

  .site-footer .footer-bottom {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
  }

  .site-footer .footer-bottom > .footer-legal,
  .site-footer .footer-bottom > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .faq-content {
    padding-right: 0;
  }

  .faq-deco-image {
    display: none;
  }

  .about-hero-collage {
    grid-template-columns: 1fr 1fr;
  }

  .about-team-track {
    overflow-x: auto;
  }

  .testimonials-track {
    overflow-x: auto;
  }

  .post-layout,
  .post-content-grid {
    display: block;
  }

  .scroll-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .hero-copy h1,
  .pricing-hero-copy h1,
  .news-hero-section h1,
  .platform-hero h1,
  .capability-title h2,
  .section-heading h2 {
    font-size: 32px;
    line-height: 40px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn,
  .btn {
    width: 100%;
  }

  .about-hero-collage {
    grid-template-columns: 1fr;
  }
}

/* Data flow — mobile (Figma 4083:2583) */
@media (max-width: 768px) {
  .data-flow-section {
    padding: 48px 12px;
  }

  .data-flow-section .data-flow-heading h2,
  .data-flow-section .data-flow-heading p {
    width: auto;
    max-width: 100%;
  }

  .data-flow-section .data-flow-heading h2 {
    font-size: 28px;
    line-height: 36px;
  }

  .flow-board-scale {
    height: auto !important;
    overflow: visible;
  }

  .flow-board {
    width: min(381px, 100%) !important;
    height: auto !important;
    padding: 32px 16px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: none !important;
    overflow: visible;
  }

  .flow-group {
    width: 100%;
    max-width: 317px;
    height: auto;
    padding: 16px;
    border: 1px dashed #fff;
    border-radius: 24px;
    box-sizing: border-box;
  }

  .flow-group__border,
  .flow-link,
  .flow-link--retail-down {
    display: none;
  }

  .flow-trace-loop {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 105px;
    height: auto;
    max-height: 100%;
    pointer-events: none;
    z-index: 0;
  }

  .flow-chain-band,
  .flow-actor,
  .flow-consumption,
  .flow-traceback {
    position: relative;
    left: auto;
    top: auto;
    z-index: 1;
  }

  .flow-chain-band {
    width: 100%;
    height: auto;
    padding: 20px 20px 20px 128px;
    border-radius: 16px;
  }

  .flow-chain {
    flex-direction: column;
    align-items: center;
  }

  .flow-chain__step {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 197px;
    height: auto;
    min-height: 49px;
    flex: none;
  }

  .flow-chain__icon {
    width: 49px;
    height: 49px;
    flex: 0 0 49px;
  }

  .flow-chain__text {
    position: static;
    transform: none;
    flex: 1 1 auto;
    text-align: right;
    width: auto !important;
  }

  .flow-chain__step--label-top .flow-chain__text,
  .flow-chain__step--label-bottom .flow-chain__text {
    top: auto;
  }

  .flow-chain__title,
  .flow-chain__desc {
    font-size: 10px;
    line-height: 12px;
  }

  .flow-chain__connector img {
    width: 6px;
    height: 40px;
    transform: rotate(90deg);
  }

  .flow-actor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: 203px;
    margin: 0 auto;
  }

  .flow-actor img {
    width: 49px;
    height: 49px;
  }

  .flow-actor figcaption {
    margin-top: 0;
  }

  .flow-actor figcaption strong,
  .flow-actor figcaption span {
    font-size: 10px;
    line-height: 12px;
  }

  .flow-actor--supplier {
    order: 1;
    margin-top: 8px;
  }

  .flow-consumption {
    order: 2;
    width: 198px;
    max-width: 100%;
    height: auto;
    margin: 8px auto 0;
    padding: 20px;
    border-radius: 12px;
  }

  .flow-actor--user {
    order: 3;
    width: 120px;
    margin-top: 8px;
  }

  .flow-consumption__title,
  .flow-consumption__note {
    font-size: 10px;
    line-height: 12px;
  }

  .flow-consumption__icons {
    justify-content: center;
    gap: 8px;
  }

  .flow-consumption__icons img {
    width: 49px;
    height: 49px;
  }

  .flow-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-left: 48px;
  }

  .flow-traceback {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 292px;
    margin: 0;
  }

  .flow-traceback img:first-child,
  .flow-traceback img:last-child {
    display: none;
  }

  .flow-traceback p {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 292px;
    transform: translate(-50%, -50%) rotate(-90deg);
    white-space: nowrap;
  }

  .flow-governance {
    position: static;
    width: 100%;
    max-width: 317px;
    margin-top: 8px;
  }
}


@media (max-width: 480px) {
  .hero-copy h1,
  .pricing-hero-copy h1,
  .news-hero-section h1,
  .platform-hero h1,
  .capability-title h2,
  .section-heading h2 {
    font-size: 32px;
    line-height: 40px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn,
  .btn {
    width: 100%;
  }

  .about-hero-collage {
    grid-template-columns: 1fr;
  }
}

/* Data flow — mobile (Figma 4083:2583) */
@media (max-width: 768px) {
  .data-flow-section {
    padding: 48px 12px;
  }

  .data-flow-section .section-heading h2,
  .data-flow-section .section-heading p {
    width: auto;
    max-width: 100%;
  }

  .data-flow-section .section-heading h2 {
    font-size: 28px;
    line-height: 36px;
  }

  .flow-board-scale {
    height: auto !important;
    overflow: visible;
  }

  .flow-board {
    width: min(381px, 100%) !important;
    max-width: 100%;
    height: auto !important;
    margin: 0 auto;
    padding: 32px 16px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "dash"
      "gov";
    align-items: start;
    justify-items: center;
    gap: 8px;
    transform: none !important;
    overflow: visible;
  }

  .flow-board-dash {
    grid-area: dash;
    position: relative;
    width: 100%;
    max-width: 317px;
    height: auto;
    padding: 16px;
    border: 1px dashed #fff;
    border-radius: 24px;
    box-sizing: border-box;
  }

  .flow-board-dash::before {
    display: none;
  }

  .flow-board-diagram {
    position: relative;
    width: 285px;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 48px;
    box-sizing: border-box;
  }

  .flow-trace-loop {
    position: absolute;
    left: 0;
    top: 0;
    width: 105px;
    height: auto;
    max-height: 100%;
    pointer-events: none;
    z-index: 0;
  }

  .flow-box.flow-top,
  .flow-middle,
  .flow-bottom .flow-trace {
    position: relative;
    left: auto;
    top: auto;
    z-index: 1;
  }

  .flow-box.flow-top {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 20px 20px 20px 128px;
    border-radius: 16px;
    box-sizing: border-box;
  }

  .flow-board-diagram {
    height: auto;
  }

  .flow-top-track {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .flow-top-item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 197px;
    height: auto;
    min-height: 49px;
  }

  .flow-top-item img {
    width: 49px;
    height: 49px;
    flex: 0 0 49px;
  }

  .flow-top-item > div {
    position: static;
    transform: none;
    flex: 1 1 auto;
    text-align: right;
    width: auto !important;
  }

  .flow-top-item strong,
  .flow-top-item span {
    font-size: 10px;
    line-height: 12px;
  }

  .flow-separator {
    width: 6px;
    height: 40px;
    transform: rotate(90deg);
    margin: 0;
  }

  .flow-middle {
    width: 100%;
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .flow-middle-line,
  .flow-governance-line {
    display: none;
  }

  .flow-middle-side,
  .flow-middle-core {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    max-width: 203px;
  }

  .flow-middle-supplier {
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0 0;
  }

  .flow-middle-core {
    order: 2;
    margin-top: 8px;
    padding: 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--primary-50);
    box-sizing: border-box;
    width: 198px;
    max-width: 100%;
  }

  .flow-middle-user {
    order: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    width: 120px;
  }

  .flow-middle-side img {
    width: 49px;
    height: 49px;
    margin: 0;
  }

  .flow-middle-side strong,
  .flow-middle-side span,
  .flow-middle-title,
  .flow-middle-sub {
    font-size: 10px;
    line-height: 12px;
  }

  .flow-middle-title {
    margin-bottom: 8px;
  }

  .flow-middle-items {
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .flow-middle-items img {
    width: 49px;
    height: 49px;
  }

  .flow-middle-supplier::before,
  .flow-middle-core::before,
  .flow-middle-user::before {
    content: "";
    display: block;
    width: 6px;
    height: 32px;
    margin: 0 auto 8px;
    background: url("gtrace-media/styles/flow-trace-vert.svg") center / contain no-repeat;
  }

  .flow-middle-supplier::before {
    margin-top: 8px;
  }

  .flow-bottom {
    display: contents;
  }

  .flow-trace {
    grid-area: dash;
    position: relative;
    justify-self: start;
    align-self: center;
    width: 16px;
    height: 292px;
    margin-left: 20px;
    z-index: 2;
    gap: 0;
    pointer-events: none;
  }

  .flow-trace img:first-child,
  .flow-trace img:last-child {
    display: none;
  }

  .flow-trace p {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 292px;
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    transform: translate(-50%, -50%) rotate(-90deg);
    white-space: nowrap;
  }

  .flow-governance {
    grid-area: gov;
    position: static;
    width: 100%;
    max-width: 317px;
    padding: 0;
    text-align: center;
  }

  .flow-governance strong {
    font-size: 14px;
    line-height: 20px;
  }

  .flow-governance p:last-child {
    font-size: 12px;
    line-height: 16px;
  }
}
