/* Lower homepage & shared site footer: keeps PC/tablet/mobile rules together
   and provides the canonical enterprise multi-column footer across all pages. */
#ai-flow, #solutions, #contact, .site-footer {
  --lower-ink: #092750;
  --lower-copy: #3c597c;
  --lower-blue: #087aff;
  --lower-edge: #d2e5fc;
  --lower-radius: 14px;
  --lower-shadow: 0 6px 18px rgb(24 94 188 / 10%);
}

/* Enterprise multi-column footer */
.site-footer {
  display: block;
  color: #b7cae4;
  background:
    radial-gradient(ellipse at 18% 0%, rgb(16 116 238 / 16%), transparent 46%),
    linear-gradient(180deg, #0a203e 0%, #07162b 100%);
  border-top: 1px solid rgb(96 168 232 / 26%);
}

.site-footer .footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.3fr);
  gap: 36px clamp(24px, 3vw, 48px);
  padding: 46px 0 36px;
}

.site-footer .footer-brand-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgb(255 255 255 / 95%);
  box-shadow: 0 6px 18px rgb(0 12 36 / 26%);
}

.site-footer .footer-brand img {
  display: block;
  width: 112px;
  height: auto;
}

.site-footer .footer-desc {
  margin: 0;
  max-width: 310px;
  color: #b6cbe6;
  font-size: 13.5px;
  line-height: 1.75;
}

.site-footer .footer-tagline {
  margin: 2px 0 0;
  padding: 5px 12px;
  border: 1px solid rgb(98 184 255 / 30%);
  border-radius: 999px;
  background: rgb(18 122 238 / 14%);
  color: #8fd7ff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.site-footer .footer-col h3 {
  margin: 0 0 15px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}

.site-footer .footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.site-footer .footer-col li a {
  display: inline-flex;
  align-items: center;
  color: #b9cde6;
  font-size: 13.5px;
  line-height: 1.5;
  transition: color .18s ease, transform .18s ease;
}

.site-footer .footer-col li a:hover {
  color: #fff;
  transform: translateX(3px);
}

.site-footer .footer-contact-list {
  gap: 9px;
}

.site-footer .footer-contact-list li {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.6;
}

.site-footer .footer-contact-list span {
  color: #7ea0c6;
  font-size: 12px;
}

.site-footer .footer-contact-list a,
.site-footer .footer-contact-list b {
  color: #dbeaff;
  font-weight: 600;
}

.site-footer .footer-contact-list a:hover {
  color: #7ce2ff;
  transform: none;
}

.site-footer .footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgb(104 205 255 / 45%);
  border-radius: 999px;
  color: #e8f7ff;
  background: rgb(20 132 246 / 20%);
  font-size: 13px;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.site-footer .footer-cta-btn:hover {
  border-color: #69d8ff;
  background: rgb(20 132 246 / 34%);
  color: #fff;
  transform: translateY(-1px);
}

.site-footer .footer-legal-wrap {
  border-top: 1px solid rgb(116 178 240 / 16%);
  background: rgb(4 14 29 / 46%);
}

.site-footer .footer-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-block: 16px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.8;
  color: #96b0d1;
}

.site-footer .copyright { margin: 0; text-wrap: balance; }
.site-footer .record-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 26px; }
.site-footer .record-links a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 30px; color: #9eb7d6; }
.site-footer .record-links img { flex: 0 0 20px; display: block; width: 20px; height: 20px; object-fit: contain; }
.site-footer a:hover { color: #fff; }
.site-footer a:focus-visible,
.site-footer button:focus-visible { outline: 2px solid #53bcff; outline-offset: 4px; border-radius: 4px; }

/* AI Flow dynamic detail bar (shared across viewports) */
#ai-flow .flow-stage {
  display: grid;
  gap: 14px;
  min-width: 0;
}
#ai-flow .flow-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding: 12px 18px;
  border: 1px solid #cde2fb;
  border-radius: 14px;
  background: linear-gradient(110deg, #fff, #f2f8ff);
  box-shadow: 0 4px 14px rgb(24 94 188 / 7%);
}
#ai-flow .flow-detail-badge {
  flex: 0 0 auto;
  padding: 4px 11px;
  border-radius: 999px;
  background: #e8f3ff;
  color: #066ee2;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
#ai-flow .flow-detail p {
  margin: 0;
  flex: 1 1 auto;
  color: #36547c;
  font-size: 13px;
  line-height: 1.6;
}
#ai-flow .flow-detail-output {
  flex: 0 0 auto;
  font-style: normal;
  color: #0b7b59;
  background: #eaf8f2;
  border: 1px solid #bce8d7;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

#contact .stats-demo-note { color: #d5e9ff; font-size: 12px; line-height: 1.4; }
#contact .cta-block h2 { text-wrap: balance; }
#contact .stat:first-child span { white-space: nowrap; }

@media (min-width: 1181px) {
  #contact .stats-demo-note { grid-column: 1 / 5; }
}

@media (max-width: 1024px) {
  .site-footer .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 28px;
    padding: 38px 0 30px;
  }
}

@media (min-width: 641px) and (max-width: 1180px) {
  #ai-flow, #solutions { padding-block: 36px; background: transparent; }
  #ai-flow .ai-flow-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
  #ai-flow .section-intro, #solutions .section-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 24px; align-items: end; margin: 0; padding: 0; }
  #ai-flow .section-label, #solutions .section-label { grid-column: 1 / -1; }
  #ai-flow .section-intro h2, #solutions .section-intro h2 { font-size: 25px; line-height: 1.3; }
  #ai-flow .section-intro > p:not(.section-label), #solutions .section-intro > p:not(.section-label) { margin: 0; font-size: 13.5px; line-height: 1.65; }
  /* Clean 2x2 S-curve loop on tablet to avoid cramped vertical text wrapping */
  #ai-flow .flow-track {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
    grid-template-rows: auto 22px auto;
    gap: 10px 8px;
    min-height: 0;
    margin: 0;
  }
  #ai-flow .flow-step[data-flow="data"] { grid-column: 1; grid-row: 1; }
  #ai-flow .flow-step[data-flow="ai"] { grid-column: 3; grid-row: 1; }
  #ai-flow .flow-step[data-flow="process"] { grid-column: 3; grid-row: 3; }
  #ai-flow .flow-step[data-flow="insight"] { grid-column: 1; grid-row: 3; }
  #ai-flow .flow-arrow[data-flow-arrow="data-ai"] { grid-column: 2; grid-row: 1; transform: none; }
  #ai-flow .flow-arrow[data-flow-arrow="ai-process"] { grid-column: 3; grid-row: 2; transform: rotate(90deg); }
  #ai-flow .flow-arrow[data-flow-arrow="process-insight"] { grid-column: 2; grid-row: 3; transform: rotate(180deg); }
  #ai-flow .flow-step {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    min-height: 76px;
    height: 100%;
    padding: 12px 16px;
    gap: 3px 12px;
    border-radius: 16px;
    border: 1px solid #cfe3fb;
    background: linear-gradient(120deg, #fff, #eef6ff);
  }
  #ai-flow .flow-step.is-active {
    border-color: #1c8cff;
    background: linear-gradient(120deg, #fff, #e5f3ff);
    box-shadow: 0 8px 20px rgb(12 114 240 / 16%);
  }
  #ai-flow .flow-step > span {
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
    border: 1px solid #d8ebff;
    border-radius: 50%;
    background: #eaf5ff;
    color: #087aff;
  }
  #ai-flow .flow-step.is-active > span {
    border-color: transparent;
    background: linear-gradient(135deg, #16c2f5, #0875ee);
    color: #fff;
  }
  #ai-flow .flow-step > span svg { width: 20px; height: 20px; display: block !important; }
  #ai-flow .flow-step > span::before { display: none !important; }
  #ai-flow .flow-step b { font-size: 14px; line-height: 1.35; white-space: normal; }
  #ai-flow .flow-step small { font-size: 12px; line-height: 1.45; white-space: normal; margin: 0; }
  #ai-flow .flow-arrow { display: grid; place-items: center; align-self: center; justify-self: center; width: 24px; height: 24px; font-size: 22px; line-height: 1; }
  #ai-flow .flow-detail { flex-wrap: wrap; }
  #solutions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
  #solutions .solution-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  #solutions .solution-card { grid-template-columns: 32px minmax(0, 1fr) 34%; grid-template-rows: minmax(84px, 1fr); gap: 8px; min-height: 102px; padding: 10px 0 10px 12px; border-radius: 15px; }
  #solutions .solution-card b { font-size: 14.5px; }
  #solutions .solution-card small { font-size: 12px; line-height: 1.5; margin-top: 4px; }
  #solutions .solution-icon { width: 32px; height: 32px; border-radius: 9px; background: #e8f3ff; }
  #solutions .solution-icon svg { width: 18px; height: 18px; display: block !important; }
  #solutions .solution-icon::before { display: none !important; }
  #solutions .solution-art { display: block; position: relative; grid-column: 3; grid-row: 1; align-self: stretch; margin-block: -10px; background: #dcebfa; }
  #solutions .solution-card img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; border-radius: 0; }
  #solutions > .demo-note { grid-column: 1 / -1; margin: 8px 0 0; }
  #contact { padding-block: 26px; }
  #contact .stats-inner { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 16px; }
  #contact .stat { flex-direction: column; gap: 5px; min-height: 65px; }
  #contact .stat strong { font-size: 32px; }
  #contact .stat span { font-size: 12.5px; }
  #contact .stat span br { display: none; }
  #contact .stat:nth-child(4) { border-right: 0; }
  #contact .cta-block { grid-column: 1 / -1; grid-row: 2; padding: 16px 0 0; border-top: 1px solid #397ac0; }
  #contact .cta-block h2 { font-size: 20px; }
  #contact::before { inset: auto 0 0; width: 100%; height: 140px; border: 0; border-radius: 0; transform: none; box-shadow: none; background: url('assets/footer-waves-reference-pc.webp') center bottom / 100% auto no-repeat; }
  #contact::after { display: none; }
}

@media (max-width: 640px) {
  #ai-flow, #solutions { padding-block: 32px; background: transparent; }
  #ai-flow .ai-flow-inner, #solutions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #ai-flow .section-intro, #solutions .section-intro { display: block; padding: 0; margin: 0; }
  #ai-flow .section-label, #solutions .section-label { margin: 0 0 8px; font-size: 11px; }
  #ai-flow .section-intro h2, #solutions .section-intro h2 { margin: 0; font-size: 24px; line-height: 1.3; }
  #ai-flow .section-intro > p:not(.section-label), #solutions .section-intro > p:not(.section-label) { margin: 10px 0 0; font-size: 13.5px; line-height: 1.68; }
  #ai-flow .flow-track { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); grid-template-rows: auto 18px auto; gap: 6px 4px; min-height: 0; margin: 0; }
  #ai-flow .flow-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: 3px 7px; min-height: 82px; height: 100%; padding: 10px 8px; border-radius: 14px; border: 1px solid #cfe3fb; background: linear-gradient(120deg, #fff, #eff7ff); }
  #ai-flow .flow-step.is-active { border-color: #1c8cff; background: linear-gradient(120deg, #fff, #e5f3ff); box-shadow: 0 6px 16px rgb(12 114 240 / 16%); }
  #ai-flow .flow-step > span { grid-row: 1 / 3; width: 30px; height: 30px; border: 1px solid #d6eaff; border-radius: 50%; background: #eaf5ff; color: #087aff; }
  #ai-flow .flow-step.is-active > span { border-color: transparent; background: linear-gradient(135deg, #16c2f5, #0875ee); color: #fff; }
  #ai-flow .flow-step > span svg { width: 17px; height: 17px; }
  #ai-flow .flow-step b { font-size: 12.5px; line-height: 1.35; white-space: normal; }
  #ai-flow .flow-step small { margin: 0; font-size: 11px; line-height: 1.4; white-space: normal; }
  #ai-flow .flow-arrow { display: grid; place-items: center; align-self: center; justify-self: center; width: 20px; height: 20px; font-size: 20px; line-height: 1; }
  #ai-flow .flow-detail { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; }
  #ai-flow .flow-detail p { font-size: 12.5px; }
  #solutions { padding-top: 34px; }
  #solutions .solution-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #solutions .solution-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) 34%; grid-template-rows: minmax(76px, 1fr); gap: 8px; align-items: center; min-height: 98px; padding: 10px 0 10px 11px; border-radius: 14px; background: linear-gradient(110deg, #fff, #e8f2ff); box-shadow: var(--lower-shadow); }
  #solutions .solution-icon { grid-column: 1; grid-row: 1; align-self: start; margin: 4px 0 0; width: 30px; height: 30px; border: 0; border-radius: 8px; background: #e7f2ff; }
  #solutions .solution-card > span:nth-of-type(2) { align-self: center; }
  #solutions .solution-card b { font-size: 14.5px; line-height: 1.35; }
  #solutions .solution-card small { font-size: 12px; line-height: 1.5; margin-top: 4px; }
  #solutions .solution-art { display: block; position: relative; grid-column: 3; grid-row: 1; align-self: stretch; margin-block: -10px; background: #dcebfa; }
  #solutions .solution-card img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; border-radius: 0; object-fit: cover; object-position: center; opacity: 1; mask-image: linear-gradient(90deg, transparent, #000 13%); }
  #solutions .solution-card > strong { right: 6px; top: auto; bottom: 8px; width: 22px; height: 22px; transform: none; font-size: 20px; }
  #solutions > .demo-note { grid-column: 1; margin: 0; color: #506d8e; font-size: 11px; line-height: 1.6; }
  #contact { padding-block: 26px 28px; background: linear-gradient(140deg, #064391, #03245d 55%, #063d83); }
  #contact .stats-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 0; }
  #contact .stat { flex-direction: column; justify-content: center; gap: 5px; min-height: 54px; border-right: 1px solid #5780af; }
  #contact .stat:nth-child(4) { border: 0; }
  #contact .stat strong { font-size: clamp(23px, 6.2vw, 28px); line-height: 1.1; }
  #contact .stat span { font-size: 11.5px; line-height: 1.4; white-space: nowrap; }
  #contact .stat span br { display: none; }
  #contact .cta-block { grid-column: 1 / -1; grid-row: 2; padding: 16px 0 0; border-top: 1px solid #3d77ba; }
  #contact .cta-block h2 { margin: 0 0 12px; font-size: 20px; line-height: 1.45; }
  #contact .cta-block .button { min-height: 44px; padding-inline: 24px; font-size: 13.5px; }
  #contact::before { inset: auto 0 0; width: 100%; height: 160px; border: 0; border-radius: 0; transform: none; box-shadow: none; background: url('assets/footer-waves-reference-mobile.webp') center bottom / 100% auto no-repeat; }
  #contact::after { display: none; }

  .site-footer .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 32px 0 26px;
  }
  .site-footer .footer-col ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 14px;
  }
  .site-footer .footer-contact-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .site-footer .footer-legal { padding-block: 14px; gap: 4px; font-size: 12px; line-height: 1.8; }
  .site-footer .record-links { flex-direction: column; gap: 6px; }
  .site-footer .record-links a { flex-wrap: wrap; column-gap: 6px; min-height: 32px; overflow-wrap: anywhere; }
  .site-footer .record-links img { flex-basis: 18px; width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  #ai-flow .flow-step,
  #solutions .solution-card,
  .site-footer .footer-col li a,
  .site-footer .footer-cta-btn { transition: none; }
}
