/* ============================================================
   Brijcode — Index page responsive styles
   ============================================================ */

.wrap,
.engines-inner {
  width: 100%;
  max-width: 1350px;
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 24px);
  padding-right: clamp(16px, 4vw, 24px);
}

@media (max-width: 991px) {
  .hero {
    padding: 100px 0 44px;
  }

  .hero-title {
    font-size: clamp(2rem, 6vw, 2.6rem);
  }

  .hero-visual {
    margin-top: 28px;
    max-width: min(430px, 100%);
  }

  .hero-video {
    height: clamp(240px, 42vw, 320px);
  }

  .about-scroll {
    padding: 36px 0 0;
    overflow-x: clip;
  }

  .about-marquee {
    margin-top: 32px;
    height: 420px;
  }

  .tools {
    padding-top: 32px;
  }

  .tools h1 {
    font-size: clamp(1.45rem, 4.5vw, 2rem);
    padding: 0 8px;
  }

  .tools-sub {
    padding: 0 8px;
  }

  .retail-img {
    margin-top: 0;
    padding: 0 12px;
  }

  .retail-img .img-first {
    margin-right: 0;
  }

  .loop-cardgrid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .loop-card.card-1,
  .loop-card.card-2,
  .loop-card.card-3,
  .loop-card.card-4 {
    left: 0;
    transform: none;
  }

  .loop-card:hover {
    transform: translateY(-4px);
  }

  .engines-scroll {
    height: auto;
    padding: 50px 0;
  }

  .engines-sticky {
    position: relative;
    height: auto;
    overflow: visible;
    align-items: stretch;
  }

  .engines-inner {
    height: auto;
    display: block;
    padding-top: 0;
    padding-bottom: 0;
  }

  .engines-inner .section-head {
    margin-bottom: 28px;
  }

  .engine-stage {
    height: auto;
    flex: none;
    min-height: 0;
  }

  .engine-scene {
    position: relative;
    inset: auto;
    display: grid !important;
    grid-template-columns: 1fr;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    gap: 24px;
    margin-bottom: 48px;
    max-width: 100%;
    padding: 0 4px;
  }

  .engine-scene:last-child {
    margin-bottom: 0;
  }

  .engine-phone {
    order: -1;
    height: auto;
    width: 100%;
    margin-left: 0;
  }

  .phone-frame {
    height: auto;
  }

  .phone-frame img {
    height: auto;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  .engine-cards {
    position: static;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .hcard {
    position: static;
    width: 100%;
    transform: none !important;
    margin-left: 0;
  }

  .engine-copy {
    padding: 0 8px;
  }

  .industry-section {
    padding: 36px 0;
  }

  .why-scatter {
    padding-top: 32px;
  }

  .why-scatter h2 {
    font-size: clamp(1.55rem, 4.5vw, 2rem);
    padding: 0 12px;
  }

  .why-scatter .lede {
    font-size: 1rem;
    padding: 0 12px;
  }

  .why-wrap {
    padding: 0 20px;
  }

  .why-layout {
    grid-template-columns: 1fr;
    row-gap: 8px;
    column-gap: 0;
  }

  .why-col + .why-col {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 8px;
  }

  .why-h2 {
    font-size: clamp(2rem, 6vw, 2.8rem);
  }

  .faq-section {
    padding-bottom: 36px;
  }

  .faq-head h2 {
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  }
}

@media (max-width: 767px) {
  .hero {
    padding: 88px 0 36px;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7.5vw, 2.25rem);
  }

  .loop-h2 {
    font-size: clamp(1.5rem, 2vw, 2.5rem);
  }

  .lede {
    font-size: 0.95rem;
  }

  .hero-ctas {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero-ctas .btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    width: auto;
    padding: 0.72em 0.85em;
    font-size: clamp(0.72rem, 3.2vw, 0.88rem);
    white-space: nowrap;
  }

  .hero-ctas .btn .ico {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .hero-visual {
    overflow: hidden;
    padding: 0 4px;
  }

  .congrats-card:not(.tick-card) {
    top: auto;
    bottom: 6%;
    right: 0;
    width: 132px;
    padding: 8px 10px;
  }

  .tick-card {
    top: 10%;
    left: 0;
    right: auto;
    bottom: auto;
    width: auto;
    max-width: 150px;
    padding: 8px 10px;
    animation: none;
  }

  .tick-card .fc-row {
    margin-bottom: 0;
  }

  .fc-amount {
    font-size: 1.15rem;
  }

  .hero-scribble {
    display: none;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .stat-subtext {
    font-size: 0.82rem;
  }

  .about-h2 {
    font-size: clamp(1.65rem, 6vw, 2.2rem);
  }

  .about-marquee {
    grid-template-columns: 1fr;
    height: 360px;
    margin-top: 28px;
  }

  .about-track-down {
    display: none;
  }

  .features-strip .swiper::before,
  .features-strip .swiper::after {
    width: 36px;
  }

  .feature-chip {
    font-size: 0.86rem;
    padding: 10px 16px;
  }

  .retail-img img {
    width: 100%;
    max-width: 420px;
  }

  .scroll-video-section {
    height: auto;
  }

  .scroll-video-sticky-wrap {
    position: relative;
    height: auto;
    min-height: 0;
    padding: 44px 12px 40px;
    gap: 22px;
    overflow: visible;
  }

  .scroll-video-content {
    padding: 0 8px;
    margin-bottom: 0 !important;
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible;
  }

  .scroll-video-content h2 {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .scroll-video-content p {
    font-size: 0.92rem;
  }

  .scroll-video-frame {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border-radius: 20px !important;
  }

  .scroll-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .why-scatter-stage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 10px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 12px 24px;
  }

  .scatter-badge {
    position: static;
    width: auto;
    transform: none !important;
    animation: none;
  }

  .why-scatter-center {
    grid-column: 1 / -1;
    max-width: 320px;
    margin-top: 8px;
  }

  .why-scatter-glow {
    width: min(420px, 90vw);
    height: min(420px, 90vw);
  }

  .why-item {
    padding: 18px 0;
  }

  .why-item h3 {
    font-size: 1.05rem;
  }

  .faq-item summary {
    font-size: 0.98rem;
    padding: 1.1rem 0;
  }
}

@media (max-width: 575px) {
  .loop-cardgrid {
    grid-template-columns: 1fr;
  }

  .loop-card {
    padding: 1.35rem 1.25rem;
  }

  .engine-copy h3 {
    font-size: 1.35rem;
  }

  .phone-frame img {
    max-width: 240px;
  }

  .bento-card {
    padding: 18px 16px 20px;
  }

  .bento-visual {
    min-height: 150px;
    padding: 14px;
  }

  .why-scatter-stage {
    grid-template-columns: repeat(2, 1fr);
    max-width: 360px;
  }

  .scatter-badge .ico-badge {
    width: 46px;
    height: 46px;
  }

  .scatter-badge b {
    font-size: 0.7rem;
  }
}

@media (max-width: 575.98px) {
  #homeCta .loyalty-cta__content {
    padding: 24px 18px 32px;
  }

  #homeCta .loyalty-cta__button {
    width: auto;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.72rem;
  }
}

@media (max-width: 480px) {
  html {
    overflow-x: hidden;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .congrats-card:not(.tick-card) {
    width: 118px;
  }

  .fc-label {
    font-size: 0.74rem;
  }

  .about-marquee {
    height: 320px;
  }

  .about-card {
    padding: 14px;
    min-height: 96px;
  }

  .tools h1 br,
  .tools-sub br {
    display: none;
  }

  .loop-h2 br {
    display: none;
  }

  .why-h2 br {
    display: none;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .hero-visual {
    max-width: min(400px, 100%);
  }

  .loop-cardgrid {
    gap: 1.25rem;
  }

  .loop-card.card-1,
  .loop-card.card-2,
  .loop-card.card-3,
  .loop-card.card-4 {
    left: 0;
    transform: none;
  }

  .loop-card:hover {
    transform: translateY(-4px);
  }

  .why-layout {
    column-gap: 40px;
  }

  .why-col + .why-col {
    padding-left: 40px;
  }
}

/* ============================================================
   Homepage — tablet breakpoint fixes (≤991px)
   ============================================================ */

@media (max-width: 991.98px) {
  .about-marquee {
    max-width: 100%;
    overflow: hidden;
  }

  .scroll-video-section {
    height: auto;
  }

  .scroll-video-sticky-wrap {
    position: relative;
    height: auto;
    min-height: 0;
    padding: 48px 16px 44px;
    gap: 24px;
    overflow: visible;
  }

  .scroll-video-content {
    padding: 0 12px;
    margin-bottom: 0 !important;
    max-height: none !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible;
  }

  .scroll-video-frame {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border-radius: 20px !important;
  }

  .scroll-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .why-scatter-stage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 10px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 12px 24px;
  }

  .scatter-badge {
    position: static;
    width: auto;
    transform: none !important;
    animation: none;
  }

  .why-scatter-center {
    grid-column: 1 / -1;
    max-width: 320px;
    margin-top: 8px;
  }

  #homeCta .loyalty-cta__visual {
    right: -6%;
    bottom: -16%;
    width: min(48%, 340px);
    max-width: 340px;
  }

  #homeCta .loyalty-cta__content {
    max-width: 52%;
  }

  #homeCta .loyalty-cta__title {
    max-width: none;
  }
}

@media (max-width: 767.98px) {
  /* Match Field Sales Automation CTA on mobile */
  #homeCta {
    padding: 28px 0 0;
    overflow-x: clip;
    overflow-y: visible;
  }

  #homeCta .loyalty-cta__inner {
    display: block;
    min-height: 0;
    margin-bottom: -64px;
    overflow: visible;
  }

  #homeCta .loyalty-cta__content {
    position: relative;
    z-index: 3;
    max-width: none;
    width: 100%;
    padding: 28px 22px 36px;
  }

  #homeCta .loyalty-cta__title {
    max-width: 18ch;
    font-size: clamp(1.4rem, 6vw, 1.75rem);
  }

  #homeCta .loyalty-cta__description {
    max-width: none;
    margin-bottom: 20px;
  }

  #homeCta .loyalty-cta__visual {
    display: none;
  }

  #homeCta .loyalty-cta__button {
    width: auto;
    max-width: 100%;
    min-height: 36px;
    padding: 8px 14px;
    font-size: 0.75rem;
    border-radius: 9px;
  }

  .site-footer {
    padding-top: 5.5rem;
  }
}
