/* ==========================================================================
   splash-variants.css — sân khấu cho 3 concept splash mới
   Xem bằng: ?splash=2 | ?splash=3 | ?splash=4   (không tham số = bản cũ)

   Quy ước bắt buộc, đừng phá:
   - Bộ khung mở màn (.intro-curtain, .intro-split-seam, .intro-splash-stage)
     và cú bàn giao sang web chính nằm ở splash-intro.css/js — không đụng.
   - Phần tử nào GSAP sẽ animate `scale`/`rotation` thì KHÔNG đặt transform
     canh giữa bằng CSS rồi mong nó còn: GSAP ghi đè cả thuộc tính transform.
     Vẫn khai báo translate ở CSS để bản không-GSAP canh đúng, còn nhánh GSAP
     khai lại bằng xPercent/yPercent — đúng cách splash-intro.js đang làm.
   ========================================================================== */

/* ---------- 2. Tread Rise — gai lốp dựng lên, vệt vàng quét ngang ---------- */

.intro-tread {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 1.1vw, 13px);
  width: min(760px, 86vw);
  height: min(320px, 36vh);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.intro-tread-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(15, 91, 54, .17), rgba(15, 91, 54, .04));
  transform-origin: bottom center;
  will-change: transform, opacity;
}

/* dáng gai lốp: đối xứng, cao ở giữa */
.intro-tread-bar:nth-child(1),
.intro-tread-bar:nth-child(9) { height: 44%; }
.intro-tread-bar:nth-child(2),
.intro-tread-bar:nth-child(8) { height: 67%; }
.intro-tread-bar:nth-child(3),
.intro-tread-bar:nth-child(7) { height: 53%; }
.intro-tread-bar:nth-child(4),
.intro-tread-bar:nth-child(6) { height: 86%; }
.intro-tread-bar:nth-child(5) { height: 62%; }

.intro-tread-sweep {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 2px;
  background: #0f5b36;
  box-shadow: 0 0 24px rgba(15, 91, 54, .55);
  will-change: transform, opacity;
}

/* ---------- 3. Contact Patch — lốp đặt xuống mặt đường ---------- */

.intro-patch {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(680px, 86vw);
  height: min(260px, 30vh);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.intro-patch-road {
  position: absolute;
  inset-inline: 0;
  bottom: 30%;
  height: 1px;
  background: #0f5b36;
  box-shadow: 0 0 18px rgba(15, 91, 54, .42);
  transform-origin: center;
  will-change: transform, opacity;
}

.intro-patch-arc {
  position: absolute;
  bottom: 30%;
  left: 50%;
  width: min(420px, 62%);
  height: min(190px, 84%);
  border: 1.5px solid rgba(15, 91, 54, .42);
  border-bottom-color: transparent;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  /* KHÔNG canh giữa bằng transform ở đây: GSAP tween arc nên nó phải làm chủ
     transform, còn canh giữa thì khai bằng xPercent. Nếu để translateX(-50%)
     ở CSS thì GSAP cộng dồn -> lệch nửa chiều rộng trên mobile. */
  transform-origin: center bottom;
  will-change: transform, opacity;
}

.intro-patch-glow {
  position: absolute;
  bottom: calc(30% - 34px);
  left: 50%;
  width: min(380px, 58%);
  height: 68px;
  background: radial-gradient(ellipse at center bottom, rgba(15, 91, 54, .32), transparent 68%);
  will-change: opacity;
}

/* ---------- 4. Radial Sweep — vòng quét như lốp radial ---------- */

.intro-radial {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(560px, 80vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.intro-radial-dial {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(15, 91, 54, .15);
  border-radius: 50%;
  will-change: transform, opacity;
}

.intro-radial-dial--inner {
  inset: 22%;
  border-color: rgba(15, 91, 54, .2);
}

.intro-radial-sweep {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
      transparent 0 72%,
      rgba(15, 91, 54, .08) 85%,
      rgba(15, 91, 54, .52) 97%,
      transparent 100%);
  -webkit-mask: radial-gradient(circle, transparent 57%, #000 60%);
          mask: radial-gradient(circle, transparent 57%, #000 60%);
  will-change: transform, opacity;
}

/* vạch chia: quay quanh tâm bằng --a, GSAP chỉ animate opacity nên
   transform rotate ở đây không bị ghi đè */
.intro-radial-tick {
  position: absolute;
  inset: 0;
  transform: rotate(var(--a, 0deg));
  will-change: opacity;
}

.intro-radial-tick::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 13px;
  margin-left: -.5px;
  background: rgba(15, 91, 54, .45);
}

.intro-radial-tick--major::before {
  height: 25px;
  background: #0f5b36;
}

/* ---------- Bản không có GSAP: chỉ mở opacity, KHÔNG chạm transform ----------
   (chạm transform là mất canh giữa của các phần tử dùng translate) */

.intro-splash--static .intro-tread,
.intro-splash--static .intro-tread-bar,
.intro-splash--static .intro-tread-sweep,
.intro-splash--static .intro-patch,
.intro-splash--static .intro-patch-road,
.intro-splash--static .intro-patch-arc,
.intro-splash--static .intro-patch-glow,
.intro-splash--static .intro-radial,
.intro-splash--static .intro-radial-dial,
.intro-splash--static .intro-radial-sweep,
.intro-splash--static .intro-radial-tick { opacity: 1; }

.intro-splash--static .intro-tread-sweep { opacity: 0; }

/* arc/glow bỏ translate ở trên nên nhánh không-GSAP phải tự canh lại */
.intro-splash--static .intro-patch-arc,
.intro-splash--static .intro-patch-glow { transform: translateX(-50%); }

/* ---------- Điện thoại ---------- */

@media (max-width: 600px) {
  .intro-tread {
    width: 92vw;
    height: 30vh;
    gap: 5px;
  }

  .intro-patch {
    width: 92vw;
    height: 26vh;
  }

  /* giữ vòm bẹt như desktop (cao/rộng ~.45), không để thành hình trứng */
  .intro-patch-arc {
    width: 90%;
    height: min(146px, 64%);
  }

  .intro-radial { width: 96vw; }

  .intro-radial-tick::before { height: 10px; }
  .intro-radial-tick--major::before { height: 19px; }
}
