/* ============================================================
   홈 쇼케이스 — 루트 랜딩 페이지 전용 스타일
   공용 모듈 styles/app-showcase.css(히어로·마키·진행 바 등) 위에 얹어 쓴다.
   모션은 scripts/app-showcase.js가 담당(카드 스택·배경 색 전환).
   - 앱 카드·아이콘마다 data-theme를 달아 theme.css의 앱별 악센트를 요소 단위로 적용
   ============================================================ */

/* ---------- 0. 배경 앰비언트 ---------- */
/* 쇼케이스 구간에서 현재 앱 색으로 화면 전체가 은은하게 물드는 빛 (색·투명도는 JS가 전환) */
.hs-ambient {
  --hs-ambient: var(--accent);
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    65% 60% at 72% 48%,
    color-mix(in srgb, var(--hs-ambient) 16%, transparent),
    transparent 72%
  );
  opacity: 0;
}

/* 고정 앰비언트 위로 본문이 오도록 */
.hs-main {
  position: relative;
  z-index: 1;
}

/* ---------- 2. 앱 쇼케이스 (카드 스택) ---------- */
.hs-showcase {
  position: relative;
  padding: 120px 0 120px;
}

.hs-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hs-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 32px;
  min-height: 560px;
  padding: clamp(28px, 4vw, 56px);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: clamp(24px, 3vw, 40px);
  background:
    radial-gradient(
      80% 90% at 88% 70%,
      color-mix(in srgb, var(--accent) 24%, transparent),
      transparent 70%
    ),
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--accent) 7%, var(--bg-secondary)),
      #0e0e11 65%
    );
  transform-origin: 50% 0;
}

.hs-card-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  max-width: 460px;
}

.hs-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hs-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 12px 30px -10px var(--sc-glow), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hs-card-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hs-card-meta {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hs-card-tagline {
  font-size: clamp(36px, 4.6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.hs-card-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.hs-card-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 22px;
  border-radius: 980px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.25s ease, box-shadow 0.25s ease;
}

.hs-card-link:hover {
  gap: 16px;
  box-shadow: 0 10px 30px -8px var(--sc-glow);
}

/* 카드 오른쪽 스크린샷: 앞 카드는 아래로 넘치게, 뒤 카드는 왼쪽 위로 기울여 겹침 */
.hs-card-visual {
  position: relative;
  align-self: stretch;
  min-height: 380px;
}

.hs-shot {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border-radius: var(--sc-card-radius);
  box-shadow: var(--sc-card-shadow);
}

.hs-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hs-shot--front {
  z-index: 2;
  right: 8%;
  top: 10%;
  height: 104%;
  aspect-ratio: 1320 / 2868;
}

.hs-shot--back {
  right: 46%;
  top: 18%;
  height: 84%;
  aspect-ratio: 1320 / 2868;
  transform: rotate(-8deg);
}

/* 가로 4:3 화면 (Hoverly) */
.hs-card-visual--landscape .hs-shot {
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: clamp(14px, 1.6vw, 22px);
}

.hs-card-visual--landscape .hs-shot--front {
  right: -6%;
  top: 26%;
  width: 96%;
}

.hs-card-visual--landscape .hs-shot--back {
  right: auto;
  left: 0;
  top: 4%;
  width: 64%;
}

/* 캡션 없는 원본 앱 화면 (Harmony Pocket): 기기 베젤 */
.hs-card-visual--device .hs-shot {
  border: 7px solid #050506;
  border-radius: clamp(26px, 3vw, 40px);
  background: #050506;
  box-shadow: 0 50px 100px -35px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* 다음 카드가 덮을 때 어둡게 눌리는 막 (투명도는 JS가 조절) */
.hs-card-shade {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.hs-stack-foot {
  display: flex;
  justify-content: center;
  margin-top: 64px;
}

/* 데스크톱 + 모션: 카드를 sticky로 붙여 위로 겹쳐 쌓음. 뒤 카드의 윗변이 16px씩 비치도록 top을 계단식으로 */
.hs-card:nth-child(2) {
  --hs-i: 1;
}

.hs-card:nth-child(3) {
  --hs-i: 2;
}

.hs-card:nth-child(4) {
  --hs-i: 3;
}

/* 화면 높이가 낮으면(가로로 든 휴대폰, 1366×768 노트북 등) 카드 높이가 내용보다 작아져
   overflow: hidden에 잘리고, 화면보다 긴 sticky 카드는 아랫부분이 끝내 보이지 않는다.
   그래서 높이 700px 미만에서는 쌓기를 끄고 일반 흐름으로 표시 (JS의 CARD_STACK과 같은 조건) */
@media (min-width: 901px) and (min-height: 700px) {
  html.motion .hs-stack {
    gap: 16vh;
    /* 마지막 카드까지 쌓인 뒤 잠시 머무는 구간 */
    padding-bottom: 12vh;
  }

  html.motion .hs-card {
    position: sticky;
    top: calc(var(--sc-header) + 24px + var(--hs-i, 0) * 16px);
    height: min(calc(100vh - var(--sc-header) - 120px), 720px);
    min-height: 0;
  }
}

/* ---------- 4. 반응형 ---------- */
@media (max-width: 900px) {
  .hs-card {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    padding: 28px 24px 0;
  }

  .hs-card-visual {
    min-height: 0;
    height: clamp(300px, 88vw, 440px);
  }

  .hs-shot--front {
    right: 10%;
    top: 8%;
    height: 100%;
  }

  .hs-shot--back {
    right: 46%;
    top: 16%;
    height: 82%;
  }

  .hs-card-visual--landscape .hs-shot--front {
    right: -4%;
    top: 30%;
    width: 94%;
  }

  .hs-card-visual--landscape .hs-shot--back {
    top: 6%;
    width: 66%;
  }
}
