/* ──────────────────────────────────────────────────────────
   HERO SECTION (v1 base)
   ────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 84vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px 20px 72px;
  color: #fff;
  background: linear-gradient(135deg, #0056b3, #007bff);
  background-size: 300% 300%;
  background-position: 0% 50%;
  animation: gradientShift 12s ease infinite;
  overflow: hidden;
  padding-bottom: clamp(160px, 12vh, 220px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, #004ba0, transparent 70%),
    radial-gradient(circle at 70% 60%, #007bff, transparent 80%),
    radial-gradient(circle at 50% 50%, #1e88e5, #1565c0 80%);
  background-size: 200% 200%;
  animation: backgroundFloat 20s ease-in-out infinite alternate;
  z-index: -1;
  opacity: .9;
  filter: blur(10px);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: particlesMove 40s linear infinite;
  z-index: -2;
}

.hero-content {
  /* กว้างขึ้นเพื่อให้ชิป 5 อันเรียงบรรทัดเดียวได้ */
  max-width: min(1120px, 92vw);
  z-index: 1;
  text-align: center;
  margin-top: 60px;
}


/* Typography / CTA (ย่อ) */
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.35;
  margin: 0;
}

.hero p {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  opacity: .95;
  margin: 16px auto 30px;
}

.hero .cta-btn {
  padding: 12px 28px;
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  transition: background .25s ease, transform .15s ease, box-shadow .25s ease;
}

.hero .cta-btn:hover {
  background: var(--dark-blue);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}

/* ──────────────────────────────────────────────────────────
   HERO SECTION (v2 cinematic & parallax)
   ────────────────────────────────────────────────────────── */
.hero-v2 {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1200px 800px at 70% 20%, rgba(0, 194, 255, .25), transparent 60%),
    linear-gradient(135deg, #0b74e3, #0056b3 45%, #004095 100%);
  padding-bottom: clamp(110px, 14vh, 160px);
}

.hero-v2 .hero-content {
  position: relative;
  z-index: 2;
}

.hero-v2 .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-v2 .eyebrow {
  letter-spacing: .18em;
  font-weight: 700;
  opacity: .9;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .9);
  margin-bottom: 12px;
}

.hero-v2 .display {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  line-height: 1.1;
  font-weight: 800;
}

.hero-v2 .display .accent {
  color: #ffc53d;
  text-shadow: 0 0 22px rgba(255, 197, 61, .25);
}

.hero-v2 .subhead {
  max-width: 820px;
  color: rgba(255, 255, 255, .92);
  margin: 14px auto 22px;
  font-size: clamp(1rem, 1.2vw, 1.15rem);
}

.hero-v2 .cta-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

.hero-v2 .cta-btn.primary {
  background: linear-gradient(90deg, var(--accent-color), #4cc9ff);
  color: #052a41;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.hero-v2 .cta-btn.ghost {
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  background: transparent;
}

.hero-v2 .cta-btn.ghost:hover {
  background: rgba(255, 255, 255, .08);
}

/* Feature chips */
.hero-v2 .feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: clamp(44px, 6vh, 72px);
}

.hero-v2 .chip {
  --fy: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  backdrop-filter: saturate(140%) blur(6px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .12) inset, 0 1px 0 rgba(255, 255, 255, .22);
  font-weight: 600;
  transition: transform .18s ease;
  animation: chipFloat 3.2s ease-in-out infinite;
}

.hero-v2 .chip:hover {
  transform: translateY(-2px);
}

/* Background layers */
.hero-v2 .layer {
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.hero-v2 .bg-gradient {
  position: absolute;
  inset: -20%;
  filter: blur(10px);
  background:
    radial-gradient(60% 60% at 20% 20%, rgba(0, 195, 255, .22), transparent 55%),
    radial-gradient(60% 60% at 85% 35%, rgba(0, 255, 170, .18), transparent 55%);
  animation: bgDrift 28s ease-in-out infinite alternate;
}

.hero-v2 .bg-radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(800px 480px at 30% 75%, rgba(255, 255, 255, .08), transparent 70%);
}

.hero-v2 .bg-grid {
  position: absolute;
  inset: -10%;
  opacity: .18;
  mask-image: radial-gradient(60% 60% at 50% 50%, #000, transparent 70%);
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  animation: gridPan 40s linear infinite;
}

.hero-v2 .bg-orbit {
  position: absolute;
  inset: 0;
  animation: orbitRotate 24s linear infinite;
}

.hero-v2 .bg-orbit::before,
.hero-v2 .bg-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .18);
  inset: 15% 22% 35% 22%;
  transform: rotate(12deg);
}

.hero-v2 .bg-orbit::after {
  inset: 28% 10% 20% 10%;
  transform: rotate(-6deg);
  opacity: .6;
}

.hero-v2 .bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 40% at 70% 30%, rgba(255, 197, 61, .14), transparent 60%);
}

/* ── ALWAYS-ON ENTRANCE (text slides up on page load) ── */
.hero-v2 .hero-content>* {
  opacity: 0;
  transform: translateY(26px);
  animation: heroUp .70s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: var(--d, 0ms);
}

.hero-v2 .hero-content>*:nth-child(1) {
  --d: 0ms;
}

.hero-v2 .hero-content>*:nth-child(2) {
  --d: 120ms;
}

.hero-v2 .hero-content>*:nth-child(3) {
  --d: 240ms;
}

.hero-v2 .hero-content>*:nth-child(4) {
  --d: 360ms;
}

.hero-v2 .hero-content>*:nth-child(5) {
  --d: 480ms;
}

/* Stagger chips */
.hero-v2 .feature-chips .chip:nth-child(1) {
  animation-delay: 0ms;
}

.hero-v2 .feature-chips .chip:nth-child(2) {
  animation-delay: 120ms;
}

.hero-v2 .feature-chips .chip:nth-child(3) {
  animation-delay: 240ms;
}

.hero-v2 .feature-chips .chip:nth-child(4) {
  animation-delay: 360ms;
}

.hero-v2 .feature-chips .chip:nth-child(5) {
  animation-delay: 480ms;
}

/* ── Keyframes ── */
@keyframes heroUp {
  0% {
    opacity: 0;
    transform: translateY(26px)
  }

  60% {
    opacity: 1;
    transform: translateY(-4px)
  }

  100% {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes chipFloat {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(calc(-1 * var(--fy)))
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

@keyframes particlesMove {
  0% {
    background-position: 0 0
  }

  100% {
    background-position: 100px 100px
  }
}

@keyframes backgroundFloat {
  0% {
    background-position: 30% 30%, 70% 60%, 50% 50%
  }

  100% {
    background-position: 50% 60%, 30% 40%, 60% 50%
  }
}

@keyframes bgDrift {
  0% {
    transform: translate3d(-2%, -2%, 0) scale(1.02)
  }

  100% {
    transform: translate3d(2%, 1%, 0) scale(1.03)
  }
}

@keyframes gridPan {
  0% {
    background-position: 0 0, 0 0
  }

  100% {
    background-position: 120px 120px, 120px 120px
  }
}

@keyframes orbitRotate {
  from {
    transform: rotate(0)
  }

  to {
    transform: rotate(360deg)
  }
}

/* ── Respect Reduce Motion, but allow override via .force-anim ── */
@media (prefers-reduced-motion:reduce) {

  html:not(.force-anim) .hero-v2 .layer,
  html:not(.force-anim) .hero-v2 .chip {
    animation: none !important;
    transform: none !important;
  }

  html.force-anim .hero-v2 .hero-content>* {
    animation: heroUp .70s cubic-bezier(.22, 1, .36, 1) both !important;
  }

  html.force-anim .hero-v2 .feature-chips .chip {
    animation: chipFloat 3.2s ease-in-out infinite !important;
  }

  html.force-anim .hero-v2 .bg-gradient {
    animation: bgDrift 28s ease-in-out infinite alternate !important;
  }

  html.force-anim .hero-v2 .bg-grid {
    animation: gridPan 40s linear infinite !important;
  }

  html.force-anim .hero-v2 .bg-orbit {
    animation: orbitRotate 24s linear infinite !important;
  }
}

/* Thai line-height tweak */
html[lang="th"] .hero h1,
html[data-lang="th"] .hero h1 {
  line-height: 1.55;
}

html[lang="th"] .hero-title .tag,
html[data-lang="th"] .hero-title .tag {
  line-height: 1.55;
}

/* Responsive (ย่อ) */
@media (max-width:768px) {
  .hero {
    padding: 96px 18px 120px;
    min-height: 82vh;
  }

  .hero-v2 .feature-chips {
    gap: 8px;
  }

  .hero-v2 .chip {
    font-size: .9rem;
    padding: 7px 12px;
  }
}

/* Desktop: บังคับให้ชิปอยู่บรรทัดเดียว + ย่อ padding/ตัวอักษรเล็กนิดนึงให้พอดี */
@media (min-width: 1024px) {
  .hero-v2 .feature-chips {
    flex-wrap: nowrap;
    gap: 12px;
  }

  .hero-v2 .chip {
    font-size: 0.95rem;
    padding: 7px 12px;
  }
}