/* =====================================================================
   LanternCloud — estrutura. A "cara" vem das vars por direção:
   --lc-ink, --lc-mute, --lc-accent, --lc-glow (cor da luz),
   --lc-head (família do tema), --lc-body (família dos termos),
   --lc-rest-theme / --lc-rest-term (opacidade em repouso),
   --lc-light-size, --lc-light-blend, --lc-light-alpha
   ===================================================================== */
.lc-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 93%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 6%, #000 93%, transparent 100%);
}

.lc-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lc-light {
  position: absolute;
  left: 0; top: 0;
  width: var(--lc-light-size, 30vw);
  height: var(--lc-light-size, 30vw);
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle at center,
    color-mix(in oklab, var(--lc-glow) calc(var(--lc-light-alpha, 0.16) * 100%), transparent) 0%,
    color-mix(in oklab, var(--lc-glow) calc(var(--lc-light-alpha, 0.16) * 38%), transparent) 42%,
    transparent 70%);
  mix-blend-mode: var(--lc-light-blend, screen);
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.lc-on .lc-light { opacity: 1; }

.lc-group { position: absolute; inset: 0; pointer-events: none; }

.lc-theme, .lc-term {
  position: absolute;
  transform: translateY(-50%);
  max-width: 15ch;
}
.lc-theme { max-width: 18ch; }
.lc-theme.is-right, .lc-term.is-right { text-align: right; }

.lc-theme {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--lc-ink);
  font-family: var(--lc-head, Georgia, serif);
  font-size: clamp(15.5px, 1.45vw, 24px);
  letter-spacing: -0.015em;
  line-height: 1.06;
  text-wrap: balance;
  opacity: calc(var(--lc-rest-theme, 0.26) + (var(--lc-max-theme, 0.75) - var(--lc-rest-theme, 0.26)) * var(--lit, 0));
  translate: 0 calc((1 - var(--lit, 0)) * 5px);
}
.lc-theme.is-right { flex-direction: row-reverse; }

.lc-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--lc-accent);
  margin-top: 0.38em;
  opacity: calc(0.3 + 0.7 * var(--lit, 0));
  box-shadow: 0 0 calc(var(--lit, 0) * 14px) color-mix(in oklab, var(--lc-accent) 65%, transparent);
}

.lc-term .lc-in {
  display: inline-block;
  color: var(--lc-mute);
  font-family: var(--lc-body, ui-sans-serif, system-ui, sans-serif);
  font-size: clamp(11.5px, 0.8vw, 15px);
  letter-spacing: 0.01em;
  line-height: 1.32;
  text-wrap: pretty;
  opacity: calc(var(--lc-rest-term, 0.1) + (var(--lc-max-term, 0.55) - var(--lc-rest-term, 0.1)) * var(--lit, 0));
  translate: 0 calc((1 - var(--lit, 0)) * 4px);
}

/* respiração sutil / flutuação orgânica */
@media (prefers-reduced-motion: no-preference) {
  .lc-group:nth-of-type(3n + 1) {
    animation: lc-group-float-1 6.2s ease-in-out infinite;
  }
  .lc-group:nth-of-type(3n + 2) {
    animation: lc-group-float-2 7.6s ease-in-out infinite;
  }
  .lc-group:nth-of-type(3n) {
    animation: lc-group-float-3 9s ease-in-out infinite;
  }

  /* Animação individual do tema (dentro do grupo) */
  .lc-group:nth-of-type(2n + 1) .lc-theme {
    animation: lc-float-theme-1 12s ease-in-out infinite alternate;
  }
  .lc-group:nth-of-type(2n) .lc-theme {
    animation: lc-float-theme-2 15s ease-in-out infinite alternate;
  }

  /* Animação individual dos termos (dentro do grupo) */
  .lc-group:nth-of-type(2n + 1) .lc-term .lc-in {
    animation: lc-float-term-2 13s ease-in-out infinite alternate;
  }
  .lc-group:nth-of-type(2n) .lc-term .lc-in {
    animation: lc-float-term-1 16s ease-in-out infinite alternate;
  }
}

@keyframes lc-group-float-1 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -6px, 0); }
}

@keyframes lc-group-float-2 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 5px, 0); }
}

@keyframes lc-group-float-3 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -4px, 0); }
}

@keyframes lc-float-theme-1 {
  0% { transform: translateY(-50%) translate3d(0, 0, 0); }
  100% { transform: translateY(-50%) translate3d(4px, -5px, 0); }
}

@keyframes lc-float-theme-2 {
  0% { transform: translateY(-50%) translate3d(0, 0, 0); }
  100% { transform: translateY(-50%) translate3d(-4px, 4px, 0); }
}

@keyframes lc-float-term-1 {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(4px, -4px, 0); }
}

@keyframes lc-float-term-2 {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-4px, 4px, 0); }
}

@media (max-width: 640px) {
  .lc-theme { font-size: clamp(18px, 5.2vw, 23px); max-width: 18ch; gap: 9px; }
  .lc-term .lc-in { font-size: 13px; }
  .lc-term { max-width: 38vw; }
  .lc-light { width: var(--lc-light-size-m, 78vw); height: var(--lc-light-size-m, 78vw); }
}

@media (prefers-reduced-motion: reduce) {
  .lc-theme, .lc-term .lc-in { translate: none !important; animation: none !important; }
  .lc-light { display: none; }
}
