/* Hero legacy — หน้าแรก 2026 (ไม่พึ่ง bootstrap / style.css หลัก) */
.hero-section.hero-section--space {
  position: relative;
  background-color: #070b14;
  min-height: clamp(440px, 52vw, 620px);
  overflow: hidden;
}

.hero-section--space .hero-content {
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0 clamp(72px, 9vw, 110px);
  z-index: 1;
}

.hero-section--space .hero-content .container {
  width: min(var(--container, 1200px), 92vw);
  margin-inline: auto;
  padding-inline: 16px;
}

/* Bootstrap grid emulation (เฉพาะใน hero) */
.hero-section--space .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 -12px;
  row-gap: 1.5rem;
}

.hero-section--space .row > [class*="col-"] {
  padding: 0 12px;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 992px) {
  .hero-section--space .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .hero-section--space .text-lg-end {
    text-align: right;
  }

  .hero-section--space .ms-lg-auto {
    margin-left: auto;
  }
}

.hero-section--space .position-relative { position: relative; }
.hero-section--space .overflow-hidden { overflow: hidden; }
.hero-section--space .d-flex { display: flex; }
.hero-section--space .d-inline-flex { display: inline-flex; }
.hero-section--space .flex-wrap { flex-wrap: wrap; }
.hero-section--space .align-items-center { align-items: center; }
.hero-section--space .text-center { text-align: center; }
.hero-section--space .img-fluid { max-width: 100%; height: auto; display: block; }
.hero-section--space .mb-2 { margin-bottom: 0.5rem; }
.hero-section--space .mb-3 { margin-bottom: 1rem; }
.hero-section--space .mb-4 { margin-bottom: 1.5rem; }
.hero-section--space .me-2 { margin-right: 0.5rem; }
.hero-section--space .p-2 { padding: 0.5rem; }
.hero-section--space .gap-1 { gap: 0.25rem; }
.hero-section--space .rounded { border-radius: 0.375rem; }
.hero-section--space .rounded-circle { border-radius: 50%; }
.hero-section--space .bg-white { background-color: #fff; }
.hero-section--space .bg-warning { background-color: #fdb10e; color: #3a2400; }
.hero-section--space .fw-medium { font-weight: 500; }
.hero-section--space .fw-normal { font-weight: 400; }
.hero-section--space .fs-14 { font-size: 14px; }

.hero-section--space .hero-space-title {
  color: #f5f8ff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.28;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 42px rgba(120, 170, 255, 0.22);
}

.hero-section--space .hero-space-title .typed {
  position: relative;
  color: #dbe7ff;
  font-weight: 600;
}

.hero-section--space .hero-space-title .typed::before {
  content: "";
  background: var(--grad-brand);
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 4px;
  box-shadow: 0 0 14px rgba(110, 200, 255, 0.55);
}

.hero-section--space .ityped-cursor {
  display: none !important;
}

.hero-section--space .hero-space-lead {
  color: rgba(226, 234, 255, 0.92);
  font-size: clamp(15px, 1.7vw, 17px);
  line-height: 1.65;
  max-width: 34rem;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero-section--space .hero-space-lead.sub-title {
  font-size: 17px;
}

.hero-section--space .hero-space-label {
  color: #c8daf8;
  font-weight: 600;
}

.hero-section--space .badge {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.hero-section--space .badge.badge-dark-transparent {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f5ff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.hero-section--space .badge.badge-dark-transparent:hover {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
}

.hero-section--space .hero-space-stack {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 520px);
  max-width: 100%;
}

@media (min-width: 992px) {
  .hero-section--space .hero-space-stack {
    align-items: flex-end;
  }
}

.hero-section--space .hero-space-scene {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-section--space .hero-space-mascot {
  width: min(68%, 360px);
  max-width: 94%;
  margin-top: clamp(-26%, -10vw, -140px);
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.35));
}

.hero-section--space .hero-space-deco-floats {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-section--space .hero-space-floater {
  position: absolute;
  width: clamp(52px, 7.5vw, 104px);
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(80, 140, 255, 0.45));
}

.hero-section--space .hero-space-floater--a {
  top: 16%;
  right: 6%;
  animation: hero-legacy-drift-a 16s ease-in-out infinite;
}

.hero-section--space .hero-space-floater--b {
  bottom: 22%;
  right: 14%;
  animation: hero-legacy-drift-b 19s ease-in-out infinite;
  animation-delay: -6s;
}

.hero-section--space .hero-image {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.hero-section--space .hero-space-chip {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.hero-section--space .hero-image .shape-01 {
  right: 10%;
  top: 7%;
  position: absolute;
}

.hero-section--space .hero-image .shape-01.shape-01--consult {
  right: 35%;
  top: 10%;
}

.hero-section--space .hero-image .shape-033 {
  right: auto;
  left: 5%;
  bottom: 28px;
  position: absolute;
}

.hero-section--space .hero-image .shape-01 .border-edge {
  border-style: solid;
  border-width: 22px 25px 0 0;
  border-color: transparent #fff transparent transparent;
  position: absolute;
  bottom: -5px;
  right: 20px;
  transform: rotate(40deg);
}

.hero-section--space .hero-image .shape-03 {
  bottom: 0;
  left: 0;
  z-index: -1;
  position: absolute;
}

.hero-section--space .hero-image .shape-04 {
  top: 0;
  left: 0;
  z-index: -1;
  position: absolute;
}

.hero-section--space .hero-image .shape-05 {
  top: 0;
  right: 35%;
  z-index: -1;
  position: absolute;
}

.hero-section--space .avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-section--space .avatar.avatar-md {
  width: 2rem;
  height: 2rem;
  font-size: 0.8rem;
}

.hero-section--space .avatar.avatar-md svg,
.hero-section--space .avatar.avatar-md i {
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
  line-height: 1;
}

.hero-section--space .animation-float {
  animation: hero-legacy-float 3s ease-in-out 0.5s infinite alternate both;
}

.hero-section--space .floating-x {
  animation: hero-legacy-float-x 3s linear infinite;
}

@keyframes hero-legacy-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-7deg) scale(1); opacity: 0.88; }
  50% { transform: translate3d(10px, -20px, 0) rotate(-4deg) scale(0.96); opacity: 0.9; }
}

@keyframes hero-legacy-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(8deg) scale(1); opacity: 0.9; }
  66% { transform: translate3d(-22px, 12px, 0) rotate(6deg) scale(0.94); opacity: 0.85; }
}

@keyframes hero-legacy-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(16px); }
}

@keyframes hero-legacy-float-x {
  0%, 100% { transform: translateX(24px); }
  50% { transform: translateX(8px); }
}

@media (max-width: 991.98px) {
  .hero-section--space .hero-content {
    padding: clamp(40px, 6vw, 56px) 0 clamp(56px, 8vw, 72px);
  }

  .hero-section--space .hero-space-lead.sub-title {
    font-size: 16px;
  }

  .hero-section--space .hero-image .shape-01,
  .hero-section--space .hero-image .shape-033 {
    display: none !important;
  }

  .hero-section--space .hero-image .shape-03,
  .hero-section--space .hero-image .shape-04,
  .hero-section--space .hero-image .shape-05 {
    display: none;
  }

  .hero-section--space .hero-space-floater--a {
    top: 10%;
    right: 2%;
    width: clamp(44px, 16vw, 80px);
  }

  .hero-section--space .hero-space-floater--b {
    bottom: 36%;
    right: 4%;
    width: clamp(40px, 14vw, 72px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-section--space .hero-space-floater,
  .hero-section--space .animation-float,
  .hero-section--space .floating-x {
    animation: none !important;
  }
}

/* มือถือ — ให้ hero ชิดใต้ header fixed */
@media (max-width: 1024px) {
  .hero-section.hero-section--space {
    margin-top: calc(-1 * (var(--header-h) + env(safe-area-inset-top, 0)));
    padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0));
  }
}
