/* index — 글래스모피즘·쇼케이스·페이지 전용 (토큰·공통 UI는 common.css) */

.page-main {
  flex: 1 0 auto;
  padding: var(--space-8) var(--safe-inline) var(--space-16);
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* SPA 섹션 전환 + 페이드인 */
.spa-section:not(.is-active) {
  display: none;
}

.spa-section.is-active {
  display: block;
  animation: spaSectionIn 0.42s var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .spa-section.is-active {
    animation: none;
  }
}

@keyframes spaSectionIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-hero {
  text-align: center;
  margin-bottom: var(--space-10);
}

.page-hero h1 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.page-hero p {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--color-text-secondary);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  word-break: keep-all;
  text-wrap: balance;
}

.page-hero--compact {
  margin-bottom: var(--space-8);
}

.page-hero--compact h1 {
  font-size: var(--text-2xl);
}

.preview-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 300px;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent),
    var(--color-bg-mid);
  background-size: cover;
  background-position: center;
}

/* 떠다니는 색상 도형 — 블러 배경 대비용 */
.preview-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.preview-blob {
  position: absolute;
  filter: saturate(1.15);
}

.preview-blob--pink {
  width: clamp(140px, 42vw, 200px);
  height: clamp(140px, 42vw, 200px);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ff5c9d 0%, #ec4899 45%, #be185d 100%);
  top: 6%;
  left: 4%;
  opacity: 0.92;
  box-shadow: 0 0 80px rgba(236, 72, 153, 0.45);
  animation: blobFloatA 16s ease-in-out infinite;
}

.preview-blob--emerald {
  width: clamp(180px, 48vw, 260px);
  height: clamp(120px, 32vw, 180px);
  border-radius: 50% 55% 48% 52%;
  background: linear-gradient(145deg, #34d399 0%, #059669 55%, #047857 100%);
  bottom: 8%;
  right: 2%;
  opacity: 0.9;
  box-shadow: 0 0 70px rgba(16, 185, 129, 0.4);
  animation: blobFloatB 19s ease-in-out infinite;
}

.preview-blob--violet {
  width: clamp(100px, 28vw, 150px);
  height: clamp(160px, 40vw, 220px);
  border-radius: 42% 58% 45% 55%;
  background: linear-gradient(165deg, #c4b5fd 0%, #7c3aed 50%, #5b21b6 100%);
  top: 38%;
  right: 22%;
  opacity: 0.88;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.42);
  animation: blobFloatC 14s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .preview-blob--pink,
  .preview-blob--emerald,
  .preview-blob--violet {
    animation: none;
  }
}

@keyframes blobFloatA {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(12px, 18px) scale(1.05);
  }
  66% {
    transform: translate(-8px, 10px) scale(0.96);
  }
}

@keyframes blobFloatB {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  40% {
    transform: translate(-16px, -12px) rotate(-3deg);
  }
  70% {
    transform: translate(10px, 8px) rotate(2deg);
  }
}

@keyframes blobFloatC {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-14px, 20px) scale(1.06);
  }
}

.preview-card {
  position: relative;
  z-index: 2;
  width: min(100%, 320px);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
  font-weight: 500;
  color: var(--color-text-primary);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

/* 유리 반사 하이라이트 (미리보기) */
.preview-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.12) 36%,
    transparent 58%
  );
  pointer-events: none;
  z-index: 0;
}

.preview-card__label {
  position: relative;
  z-index: 1;
  text-shadow: var(--preview-label-shadow);
}

.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-glass);
  opacity: 0;
  visibility: hidden;
  transition:
    transform var(--duration-normal) var(--ease-out),
    opacity var(--duration-normal) var(--ease-out),
    visibility var(--duration-normal);
  z-index: 200;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* ——— 쇼케이스 ——— */
.showcase-shell {
  margin-top: var(--space-2);
}

.showcase-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-mid);
  min-height: 520px;
  padding: var(--space-6);
  isolation: isolate;
}

.showcase-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.showcase-blob {
  position: absolute;
  filter: saturate(1.1);
}

.showcase-blob--coral {
  width: clamp(160px, 38vw, 240px);
  height: clamp(160px, 38vw, 240px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fb7185, #e11d48 55%, #9f1239 100%);
  top: 8%;
  left: 6%;
  opacity: 0.9;
  box-shadow: 0 0 90px rgba(251, 113, 133, 0.45);
  animation: blobFloatA 17s ease-in-out infinite;
}

.showcase-blob--cyan {
  width: clamp(200px, 45vw, 280px);
  height: clamp(130px, 28vw, 180px);
  border-radius: 55% 45% 50% 50%;
  background: linear-gradient(145deg, #22d3ee, #0891b2 60%, #0e7490 100%);
  bottom: 10%;
  right: 8%;
  opacity: 0.88;
  box-shadow: 0 0 75px rgba(34, 211, 238, 0.35);
  animation: blobFloatB 20s ease-in-out infinite;
}

.showcase-blob--amber {
  width: clamp(120px, 30vw, 170px);
  height: clamp(180px, 36vw, 240px);
  border-radius: 48% 52% 46% 54%;
  background: linear-gradient(165deg, #fcd34d, #f59e0b 50%, #b45309 100%);
  top: 36%;
  right: 18%;
  opacity: 0.85;
  box-shadow: 0 0 65px rgba(245, 158, 11, 0.38);
  animation: blobFloatC 15s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .showcase-blob--coral,
  .showcase-blob--cyan,
  .showcase-blob--amber {
    animation: none;
  }
}

.showcase-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .showcase-grid {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(120px, auto);
  }

  .showcase-grid > .showcase-card:nth-child(1) {
    grid-column: 1 / -1;
  }

  .showcase-grid > .showcase-card:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .showcase-grid > .showcase-card:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
  }

  .showcase-grid > .showcase-card:nth-child(4) {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: stretch;
  }

  .showcase-grid > .showcase-card:nth-child(5) {
    grid-column: 1 / -1;
  }
}

.showcase-card {
  margin: 0;
  min-height: 0;
}

.showcase-card__glass {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 140px;
  padding: var(--space-5);
  border-radius: var(--live-glass-radius, 16px);
  border: var(--live-glass-border-w, 1px) solid rgba(255, 255, 255, 0.2);
  background: rgba(
    var(--live-glass-r, 255),
    var(--live-glass-g, 255),
    var(--live-glass-b, 255),
    var(--live-glass-opacity, 0.15)
  );
  backdrop-filter: blur(var(--live-glass-blur, 20px));
  -webkit-backdrop-filter: blur(var(--live-glass-blur, 20px));
  box-shadow:
    0 var(--live-glass-shadow-y, 20px) var(--live-glass-shadow-spread, 40px) rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition:
    box-shadow 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    border-radius 0.2s var(--ease-out),
    border-width 0.2s var(--ease-out);
}

html[data-theme="light"] .showcase-card__glass {
  box-shadow:
    0 var(--live-glass-shadow-y, 20px) var(--live-glass-shadow-spread, 40px) rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.showcase-card__glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.1) 38%,
    transparent 58%
  );
  pointer-events: none;
  z-index: 0;
}

.showcase-card__glass > * {
  position: relative;
  z-index: 1;
}

.showcase-card__glass--compact {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.showcase-card__glass--tall {
  min-height: 100%;
}

.showcase-card__row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.showcase-card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

html[data-theme="light"] .showcase-card__dot {
  background: rgba(15, 23, 42, 0.12);
  border-color: rgba(15, 23, 42, 0.15);
}

.showcase-card__kicker {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.showcase-card__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

.showcase-card__stat {
  margin: 0 0 var(--space-2);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-primary);
}

.showcase-card__meta {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.showcase-card__bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 48px;
  margin-top: var(--space-5);
}

.showcase-card__bars span {
  flex: 1;
  max-width: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--color-accent-soft), var(--color-accent));
  opacity: 0.85;
  animation: showcaseBar 1.2s ease-in-out infinite alternate;
}

.showcase-card__bars span:nth-child(1) {
  height: 35%;
  animation-delay: 0s;
}
.showcase-card__bars span:nth-child(2) {
  height: 55%;
  animation-delay: 0.1s;
}
.showcase-card__bars span:nth-child(3) {
  height: 80%;
  animation-delay: 0.2s;
}
.showcase-card__bars span:nth-child(4) {
  height: 50%;
  animation-delay: 0.15s;
}
.showcase-card__bars span:nth-child(5) {
  height: 65%;
  animation-delay: 0.25s;
}

@media (prefers-reduced-motion: reduce) {
  .showcase-card__bars span {
    animation: none;
  }
}

@keyframes showcaseBar {
  from {
    transform: scaleY(0.85);
    opacity: 0.65;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.showcase-list {
  margin: var(--space-3) 0 0;
  padding-left: 1.2rem;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.showcase-list li {
  margin-bottom: var(--space-2);
}

.showcase-list li:last-child {
  margin-bottom: 0;
}

.showcase-login__hint {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.showcase-login__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.showcase-login__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.showcase-login__input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-input-bg);
  color: var(--color-text-primary);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.showcase-login__input::placeholder {
  color: var(--color-text-muted);
}

.showcase-login__input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.showcase-login__submit {
  margin-top: var(--space-2);
}

/* ——— 가이드 ——— */
.guide-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 52rem;
  margin: 0 auto;
}

.guide-block__title {
  margin: 0 0 var(--space-4);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

.guide-block__text {
  margin: 0 0 var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.guide-block__text:last-child {
  margin-bottom: 0;
}

.guide-block__text strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.guide-list {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.guide-list li {
  margin-bottom: var(--space-2);
}

.guide-code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  line-height: 1.35;
  padding: 0.15em 0.45em 0.18em;
  margin: 0 0.12em;
  border-radius: var(--radius-sm);
  background: var(--color-bg-mid);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-accent);
  white-space: normal;
  word-break: break-word;
  vertical-align: middle;
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.guide-pre {
  margin: var(--space-4) 0 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-code-bg);
  overflow-x: auto;
}

.guide-pre code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  white-space: pre;
}
