/* Hero "chữ đổi + số liệu + quỹ đạo logo". Mọi rule nằm trong .lava-orbit-hero, không đụng phần còn lại của site.
   Quỹ đạo dùng --n (số logo) và --i (thứ tự) nên thêm/bớt logo chỉ cần sửa HTML. Cần trình duyệt hỗ trợ container query units (cqw). */

.lava-orbit-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--lava-text, #20211e);
  font-family: inherit;
  background:
    radial-gradient(ellipse at 5% 90%, rgba(205, 250, 235, .4), transparent 44%),
    radial-gradient(ellipse at 100% 45%, rgba(249, 225, 249, .48), transparent 44%),
    linear-gradient(115deg, #f0fbf8, #f4f5f9 52%, #fbf2fb);
}
.lava-orbit-hero *, .lava-orbit-hero *::before, .lava-orbit-hero *::after { box-sizing: border-box; }
.lava-orbit-hero a { text-decoration: none; color: inherit; }
.lava-orbit-hero a:focus-visible { outline: 3px solid var(--lava-primary, #4938f5); outline-offset: 3px; }

.lava-orbit-hero__inner {
  width: min(100% - 48px, 1320px);
  min-height: clamp(420px, 45vw, 720px);
  margin-inline: auto;
  padding-block: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

/* ---------- Nội dung ---------- */
.lava-orbit-hero__title {
  margin: 0 0 24px;
  font-size: clamp(26px, 3vw, 72px);
  font-weight: 750;
  line-height: 1.16;
  letter-spacing: -.04em;
}
.lava-orbit-hero__line { display: block; }
.lava-orbit-hero__line--rotating { display: flex; flex-wrap: wrap; column-gap: .23em; }

/* Mọi cụm chữ xếp chồng cùng một ô lưới: chiều rộng = cụm dài nhất, không nhảy layout, không cần JS đo. */
.lava-orbit-hero__words { display: inline-grid; color: var(--lava-primary, #4938f5); white-space: nowrap; }
.lava-orbit-hero__word {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease;
}
.lava-orbit-hero__word.is-active,
.lava-orbit-hero:not(.is-ready) .lava-orbit-hero__word:first-child { opacity: 1; transform: none; } /* không có JS: hiện cụm đầu */

.lava-orbit-hero__desc {
  max-width: 62ch;
  margin: 0 0 40px;
  color: var(--lava-muted, #686a64);
  font-size: clamp(15px, 1.25vw, 20px);
  line-height: 1.75;
}

.lava-orbit-hero__stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 0; list-style: none; }
.lava-stat {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  border-radius: 100px;
  background: var(--lava-card, #fff);
  box-shadow: 0 12px 36px rgba(53, 78, 84, .07);
}
.lava-stat__icon {
  display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
  border-radius: 50%; background: #ece9ff;   color: var(--lava-primary, #4938f5);
  font-size: 16px;
}
.lava-stat__body { display: flex; flex-direction: column; gap: 2px; }
.lava-stat strong {
  font-size: 24px; font-weight: 650; line-height: 1.2; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lava-stat__body > span { color: #6b6e72; font-size: 14px; line-height: 1.4; white-space: nowrap; }

/* ---------- Quỹ đạo ---------- */
.lava-orbit-hero__visual { min-width: 0; }
.lava-orbit {
  container-type: inline-size;
  position: relative;
  width: min(100%, 580px);
  aspect-ratio: 1;
  margin-inline: auto;
}
.lava-orbit__ring {
  position: absolute; inset: 8%; border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 70px rgba(255, 255, 255, .35);
}
.lava-orbit__brand,
.lava-orbit__center {
  position: absolute; z-index: 2; inset: 31.5%;
  display: grid; place-items: center;
  border: 2.2cqw solid #d6d0ff; border-radius: 50%;
  background: var(--lava-primary, #4938f5);
  color: #fff;
  font-size: 9cqw; font-weight: 800; letter-spacing: -.04em;
  transition: transform .3s ease;
}
.lava-orbit__brand:hover,
.lava-orbit__center:hover { transform: scale(1.05); }

.lava-orbit__list { margin: 0; padding: 0; list-style: none; }
.lava-orbit__item {
  --a: calc(360deg / var(--n) * var(--i) - 90deg); /* logo đầu tiên nằm ở đỉnh */
  position: absolute; z-index: 3; top: 50%; left: 50%;
  width: 17cqw; aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--a)) translateX(var(--orbit-r, 41cqw)) rotate(calc(var(--a) * -1));
}
.lava-orbit__item:hover, .lava-orbit__item:focus-within { z-index: 5; }

.lava-orbit__logo {
  position: relative; display: grid; place-items: center;
  width: 100%; height: 100%; padding: 4%;
  border: 1.2cqw solid #fff; border-radius: 50%;
  background: #fff; box-shadow: 0 8px 35px rgba(41, 45, 70, .08);
  transition: transform .3s ease, box-shadow .3s ease;
}
.lava-orbit__logo:hover { transform: scale(1.1); box-shadow: 0 12px 38px rgba(41, 45, 70, .16); }
.lava-orbit__logo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.lava-orbit__ph { /* chỗ giữ logo: thay bằng  */
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: hsl(calc(var(--i) * 45) 85% 92%); color: hsl(calc(var(--i) * 45) 55% 34%);
  font-size: 5cqw; font-weight: 700;
}

.lava-orbit__tip {
  position: absolute; top: calc(100% + 8px); left: 50%;
  padding: 6px 12px; border-radius: 7px;
  background: #202026; color: #fff; font-size: 12px; line-height: 1.3; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -4px); transition: .2s ease;
}
.lava-orbit__logo:focus-visible .lava-orbit__tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (hover: hover) {
  .lava-orbit__logo:hover .lava-orbit__tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .lava-orbit-hero__inner { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-block: 48px 40px; gap: 40px; }
  .lava-orbit { width: min(100%, 440px); }
}
@media (max-width: 600px) {
  .lava-orbit-hero__inner { width: min(100% - 32px, 560px); }
  .lava-orbit-hero__words { white-space: normal; }
  .lava-orbit-hero__desc { margin-bottom: 28px; }
  .lava-orbit-hero__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lava-stat { gap: 10px; padding: 12px; border-radius: 18px; }
  .lava-stat:last-child { grid-column: 1 / -1; }
  .lava-stat__icon { flex-basis: 28px; width: 28px; height: 28px; font-size: 13px; }
  .lava-stat strong { font-size: 19px; }
  .lava-stat__body > span { font-size: 12px; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .lava-orbit-hero *, .lava-orbit-hero *::before, .lava-orbit-hero *::after { transition: none !important; }
  .lava-orbit-hero__word { transform: none; }
}

/* ---------- Fallback cho trình duyệt không hỗ trợ container query (cqw) ---------- */
@supports not (width: 1cqw) {
  .lava-orbit__brand,
  .lava-orbit__center { border-width: 2.2px; font-size: 10px; }
  .lava-orbit__item { width: 17%; }
  .lava-orbit__item { transform: translate(-50%, -50%) rotate(var(--a)) translateX(41%) rotate(calc(var(--a) * -1)); }
  .lava-orbit__logo { border-width: 1.2px; }
  .lava-orbit__ph { font-size: 5px; }
  .lava-orbit__tip { display: none; }
}
