/* ==== Shared utility for sections ==== */
.reveal {
  content-visibility: auto;
  contain-intrinsic-size: 800px 600px;
}

.section-title {
  text-align: center;
  margin: 0 0 18px;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

/* ==== Trust Row (marquee) ==== */
.trust-row {
  background: linear-gradient(180deg, #f7fbff, #fff);
  padding: 28px 0;
}

.trust-row .container {
  max-width: min(1120px, 92vw);
  margin: 0 auto;
}

.trust-title {
  text-align: center;
  margin: 0 0 16px;
  color: #053a63;
  font-weight: 700;
}

.logo-marquee {
  --spd: 36s;
  display: flex;
  gap: 36px;
  align-items: center;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  animation: marquee var(--spd) linear infinite;
}

.logo-marquee img {
  height: 28px;
  width: auto;
  filter: saturate(0) opacity(.75);
}

.logo-marquee:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee {
    animation: none;
  }
}

/* ==== Value Metrics ==== */
.value-metrics {
  padding: 40px 0 24px;
}

.metrics-grid {
  max-width: min(1120px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric {
  background: #fff;
  border: 1px solid #e5eff9;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(2, 54, 88, .06);
}

.metric .num {
  font-weight: 900;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  color: #053a63;
}

.metric .suffix {
  font-size: .6em;
  opacity: .7;
  margin-left: 4px;
}

.metric p {
  margin: 6px 0 0;
  color: #285e86;
}

/* ==== Top Solutions (section container only; cards styled later) ==== */
.top-solutions {
  padding: 42px 0 6px;
}

.top-solutions .container {
  max-width: min(1120px, 92vw);
  margin: 0 auto;
}

/* ==== Case Studies: Scroll-snap Carousel ==== */
.case-carousel {
  padding: 40px 0;
  background: linear-gradient(180deg, #fff, #f7fbff);
}

.case-carousel .container {
  max-width: min(1120px, 92vw);
  margin: 0 auto;
}

.snap-wrap {
  position: relative;
}

.snap-track {
  display: flex;
  gap: 12px;
  overflow: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 16px;
  padding: 10px 0 22px;
  -webkit-overflow-scrolling: touch;
}

.snap-slide {
  flex: 0 0 86%;
  scroll-snap-align: center;
  background: #fff;
  border: 1px solid #e5eff9;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 26px rgba(2, 54, 88, .08);
}

.snap-slide h3 {
  margin: 0 0 8px;
}

.slide-cta {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.snap-nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #cfe4fa;
  background: #fff;
  box-shadow: 0 6px 18px rgba(2, 54, 88, .12);
  cursor: pointer;
  font-size: 1.2rem;
}

.snap-nav[disabled] {
  opacity: .4;
  cursor: default;
}

.snap-nav.prev {
  left: -6px;
}

.snap-nav.next {
  right: -6px;
}

.snap-progress {
  height: 3px;
  background: #e9f2fd;
  border-radius: 999px;
  overflow: hidden;
}

.snap-progress span {
  display: block;
  height: 100%;
  width: 33.33%;
  background: linear-gradient(90deg, #00d8ff, #0b74e3);
  transition: transform .25s ease;
  transform: translateX(0%);
}

/* ==== Data Sources & Tech ==== */
.data-tech {
  padding: 34px 0;
}

.data-tech .container {
  max-width: min(1120px, 92vw);
  margin: 0 auto;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.tech-grid li {
  background: #fff;
  border: 1px solid #e5eff9;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(2, 54, 88, .06);
}

/* ==== How We Work ==== */
.how-we-work {
  padding: 40px 0;
  background: linear-gradient(180deg, #f7fbff, #fff);
}

.steps {
  max-width: min(1120px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.step {
  background: #fff;
  border: 1px solid #e5eff9;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 26px rgba(2, 54, 88, .06);
}

.step h3 {
  margin: 0 0 8px;
}

/* ==== Big CTA ==== */
.big-cta {
  padding: 46px 0 60px;
}

.big-cta .container {
  max-width: min(960px, 92vw);
  margin: 0 auto;
  text-align: center;
}

.big-cta h2 {
  margin: 0 0 14px;
  font-weight: 900;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

/* ==== Responsive ==== */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .snap-slide {
    flex-basis: 92%;
  }
}

@media (max-width: 680px) {

  .metrics-grid,
  .tech-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .snap-nav.prev {
    left: 4px;
  }

  .snap-nav.next {
    right: 4px;
  }
}

/* ==== A11y tweaks ==== */
.skiplink {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skiplink:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid #0b74e3;
  border-radius: 10px;
  z-index: 9999;
}

/* === Solutions sub-navbar (sticky pills) ===================== */
.solutions-subnav {
  position: sticky;
  top: calc(var(--nav-h, 88px) + 6px);
  z-index: 20;
  margin: 8px auto 18px;
  padding: 8px 10px;
  border-radius: 14px;
  background: color-mix(in oklab, white 85%, var(--accent-color, #0ea5e9) 2%);
  backdrop-filter: saturate(140%) blur(8px);
  box-shadow: 0 6px 24px rgba(2, 6, 23, .06);
}

.solutions-subnav ul {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 0;
  margin: 0;
  list-style: none;
  scroll-snap-type: x proximity;
}

.solutions-subnav .pill {
  --pad: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .95rem;
  text-decoration: none;
  color: #0b2942;
  background: #fff;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  scroll-snap-align: center;
}

.solutions-subnav .pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(2, 6, 23, .10);
}

.solutions-subnav .pill.active {
  color: #052a41;
  border-color: transparent;
  background: linear-gradient(90deg, var(--accent-color, #22b8ff), #4cc9ff);
  box-shadow: 0 8px 26px rgba(34, 184, 255, .35);
}

@media (max-width:768px) {
  .solutions-subnav {
    padding: 6px 8px;
    border-radius: 12px;
  }

  .solutions-subnav .pill {
    padding: 8px 12px;
    font-size: .9rem;
  }
}

/* ให้การ์ดถูกเลื่อนมาแล้วไม่โดน navbar + subnav ทับ */
#sol-outbreak,
#sol-riskmap,
#sol-supply,
#sol-geollm {
  scroll-margin-top: calc(var(--nav-h, 88px) + 62px);
}

/* ===== Top Solutions — Polished Grid Cards ===== */
.top-solutions .solutions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 280px));
  gap: 22px;
  justify-content: center;
}

.top-solutions .solution-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 10px 26px rgba(2, 6, 23, .06);
  border: 1px solid #e5eff9;
  transition: transform .18s ease, box-shadow .2s ease;
  color: inherit;
  text-decoration: none;
}

.top-solutions .solution-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(2, 6, 23, .12);
}

.top-solutions .solution-card h3 {
  margin: 0 0 8px;
  font-weight: 900;
  font-size: 1.05rem;
}

.top-solutions .solution-card p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
  font-size: .95rem;
}

@media (max-width:1024px) {
  .top-solutions .solutions-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width:560px) {
  .top-solutions .solutions-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Solutions: Tabs + Panels (center + layout) ===== */
#solutions {
  padding: clamp(72px, 12vh, 128px) 0 72px;
  background: linear-gradient(180deg, #fff, #f9fbff 65%, #fff 100%);
}

#solutions .container,
#solutions .sol-tabs,
#solutions .sol-panels,
#solutions .sol-grid {
  max-width: min(1120px, 92vw);
  margin-left: auto;
  margin-right: auto;
}

#solutions .section-subtext {
  margin-top: -6px;
  opacity: .9;
  text-align: center;
}

.sol-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  background: #f6f8fb;
  border-radius: 14px;
  padding: 8px;
  margin: 16px auto 18px;
}

.sol-tab {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 800;
  color: #334155;
  transition: background .18s ease, box-shadow .18s ease, color .18s ease, transform .12s ease;
}

.sol-tab:hover {
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
  transform: translateY(-1px);
}

.sol-tab.active {
  background: linear-gradient(90deg, var(--accent-color, #22b8ff), #4cc9ff);
  color: #052a41;
  box-shadow: 0 6px 18px rgba(34, 184, 255, .25);
}

.sol-panels {
  position: relative;
}

.sol-panel {
  display: none;
  opacity: 0;
  transform: translateY(12px);
}

.sol-panel.active {
  display: block;
  animation: solFade .45s ease forwards;
}

@keyframes solFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sol-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width:900px) {
  .sol-grid {
    grid-template-columns: 1fr;
  }
}

.sol-copy h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  margin: 2px 0 8px;
}

.sol-copy .lead {
  font-size: 1rem;
  color: #334155;
  margin: 0 0 14px;
  line-height: 1.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 14px;
  padding: 0;
  list-style: none;
}

.chips li {
  background: rgba(12, 114, 255, .06);
  color: #0b74e3;
  border: 1px solid rgba(12, 114, 255, .15);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
}

.breakout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 8px 0 12px;
}

.breakout h4 {
  font-size: .9rem;
  margin: 0 0 4px;
  color: #111827;
}

.breakout p {
  margin: 0;
  color: #4b5563;
  font-size: .92rem;
}

@media (max-width:720px) {
  .breakout {
    grid-template-columns: 1fr;
  }
}

.cta-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  color: #0b74e3;
  background: #fff;
  transition: transform .15s ease, box-shadow .2s ease;
}

.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

.cta-btn.primary {
  color: #052a41;
  border-color: transparent;
  background: linear-gradient(90deg, var(--accent-color, #22b8ff), #4cc9ff);
  box-shadow: 0 8px 22px rgba(34, 184, 255, .28);
}

.sol-media .metric-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px 16px;
  box-shadow: 0 8px 28px rgba(2, 20, 40, .06), 0 2px 6px rgba(2, 20, 40, .06);
  border: 1px solid #eef2f7;
}

.metric-card .m-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #e8edf5;
}

.metric-card .m-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric-card span {
  color: #64748b;
  font-size: .9rem;
}

.metric-card strong {
  color: #0f172a;
  font-size: .98rem;
}

/* ===== Solutions Intro Animation (single trigger: #solutions.is-intro) ===== */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.98);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.93);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Triggered when JS adds .is-intro to #solutions */
#solutions.is-intro .section-title {
  animation: riseIn 520ms cubic-bezier(.22, 1, .36, 1) both;
}

#solutions.is-intro .section-subtext {
  animation: riseIn 520ms cubic-bezier(.22, 1, .36, 1) 80ms both;
}

#solutions.is-intro .sol-tabs,
#solutions.is-intro .solutions-subnav {
  animation: riseIn 560ms cubic-bezier(.22, 1, .36, 1) 140ms both;
}

/* Main content (left) */
#solutions.is-intro .sol-panel.active .sol-copy {
  animation: riseIn 560ms cubic-bezier(.22, 1, .36, 1) 180ms both;
}

#solutions.is-intro .sol-panel.active .sol-copy .lead {
  animation: riseIn 560ms cubic-bezier(.22, 1, .36, 1) 220ms both;
}

/* Chips with stagger */
#solutions.is-intro .chips li {
  animation: popIn 420ms ease-out both;
}

#solutions.is-intro .chips li:nth-child(1) {
  animation-delay: 240ms;
}

#solutions.is-intro .chips li:nth-child(2) {
  animation-delay: 280ms;
}

#solutions.is-intro .chips li:nth-child(3) {
  animation-delay: 320ms;
}

#solutions.is-intro .chips li:nth-child(4) {
  animation-delay: 360ms;
}

#solutions.is-intro .chips li:nth-child(5) {
  animation-delay: 400ms;
}

#solutions.is-intro .chips li:nth-child(6) {
  animation-delay: 440ms;
}

/* Right metrics card */
#solutions.is-intro .sol-media .metric-card {
  animation: riseIn 600ms cubic-bezier(.22, 1, .36, 1) 260ms both;
}

/* CTA stagger */
#solutions.is-intro .cta-group .cta-btn {
  animation: popIn 400ms ease-out both;
}

#solutions.is-intro .cta-group .cta-btn:nth-child(1) {
  animation-delay: 260ms;
}

#solutions.is-intro .cta-group .cta-btn:nth-child(2) {
  animation-delay: 300ms;
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #solutions.is-intro * {
    animation: none !important;
  }
}


/* ===== Thai font (TH Sarabun) ===== */
:root {
  --font-th: 'Sarabun', 'TH Sarabun New', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, system-ui, sans-serif;
}

/* ใช้ฟอนต์ Sarabun เมื่อสลับเป็นภาษาไทย (สคริปต์ i18n ตั้ง html[lang="th"] ให้แล้ว) */
html[lang="th"],
html[data-lang="th"] {
  font-family: var(--font-th);
  letter-spacing: 0;
  /* ตัวไทยไม่ต้องเพิ่ม spacing */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* น้ำหนักตัวหนาให้ชัดขึ้นสำหรับหัวข้อภาษาไทย */
html[lang="th"] h1,
html[lang="th"] h2,
html[lang="th"] h3,
html[lang="th"] .section-title {
  font-weight: 700;
}

/* (มีอยู่แล้ว) ปรับ line-height ภาษาไทยในฮีโร่ */
html[lang="th"] .hero h1,
html[data-lang="th"] .hero h1 {
  line-height: 1.55;
}