/**
 * Magic UI — core animations & components (vanilla port)
 * Shimmer Button · Shine Border · Animated Shiny Text · Aurora Text · Morphing Text
 */

@keyframes mu-shimmer-slide {
  to { transform: translate(calc(100cqw - 100%), 0); }
}

@keyframes mu-spin-around {
  0% { transform: translateZ(0) rotate(0); }
  15%, 35% { transform: translateZ(0) rotate(90deg); }
  65%, 85% { transform: translateZ(0) rotate(270deg); }
  100% { transform: translateZ(0) rotate(360deg); }
}

@keyframes mu-shiny-text {
  0%, 90%, 100% { background-position: calc(-100% - var(--mu-shiny-width, 100px)) 0; }
  30%, 60% { background-position: calc(100% + var(--mu-shiny-width, 100px)) 0; }
}

@keyframes mu-shine-border {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  to { background-position: 0% 0%; }
}

@keyframes mu-aurora-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Shimmer Button */
.mu-shimmer-btn {
  --spread: 90deg;
  --shimmer-color: #ffffff;
  --radius: 999px;
  --speed: 3s;
  --cut: 1px;
  --bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--bg);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.45);
}

.mu-shimmer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.55);
}

.mu-shimmer-btn:active {
  transform: translateY(0);
}

.mu-shimmer-btn__spark {
  position: absolute;
  inset: 0;
  overflow: visible;
  filter: blur(2px);
  pointer-events: none;
}

.mu-shimmer-btn__spark-inner {
  position: absolute;
  inset: 0;
  aspect-ratio: 1;
  height: 100%;
  animation: mu-shimmer-slide var(--speed) ease-in-out infinite;
}

.mu-shimmer-btn__spark-inner::before {
  content: "";
  position: absolute;
  inset: -100%;
  width: auto;
  background: conic-gradient(
    from calc(270deg - (var(--spread) * 0.5)),
    transparent 0,
    var(--shimmer-color) var(--spread),
    transparent var(--spread)
  );
  animation: mu-spin-around calc(var(--speed) * 2) linear infinite;
}

.mu-shimmer-btn__highlight {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 -8px 10px rgba(255, 255, 255, 0.12);
  pointer-events: none;
  transition: box-shadow 300ms ease;
}

.mu-shimmer-btn:hover .mu-shimmer-btn__highlight {
  box-shadow: inset 0 -6px 10px rgba(255, 255, 255, 0.22);
}

.mu-shimmer-btn__backdrop {
  position: absolute;
  inset: var(--cut);
  z-index: -1;
  border-radius: var(--radius);
  background: var(--bg);
}

.mu-shimmer-btn__label {
  position: relative;
  z-index: 1;
}

/* Shine Border wrapper */
.mu-shine-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.mu-shine-card__border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background-image: radial-gradient(transparent, transparent, #7cb8ff, #c4b5fd, #7cb8ff, transparent, transparent);
  background-size: 300% 300%;
  animation: mu-shine-border 14s linear infinite;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Animated Shiny Text pill */
.mu-shiny-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: var(--space-5);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  text-decoration: none;
  transition: background 200ms ease;
}

.mu-shiny-pill:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mu-shiny-pill__text {
  --mu-shiny-width: 120px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(240, 247, 255, 0.85);
  background-image: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.15) 40%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0.15) 60%, transparent 100%);
  background-size: var(--mu-shiny-width) 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  animation: mu-shiny-text 4s ease-in-out infinite;
}

.mu-shiny-pill__arrow {
  color: rgba(184, 217, 255, 0.9);
  transition: transform 200ms ease;
}

.mu-shiny-pill:hover .mu-shiny-pill__arrow {
  transform: translateX(3px);
}

/* Aurora text */
.mu-aurora-text {
  background: linear-gradient(135deg, #ffffff, #b8d9ff, #60a5fa, #c4b5fd, #ffffff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mu-aurora-flow 8s ease infinite;
}

/* Morphing text */
.mu-morph {
  position: relative;
  display: inline-block;
  height: 1.15em;
  min-width: 12ch;
  vertical-align: bottom;
  filter: url(#mu-threshold);
}

.mu-morph span {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: inherit;
  white-space: nowrap;
}

.mu-morph span:last-child {
  opacity: 0;
}

/* Ghost CTA */
.mu-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.mu-ghost-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

/* Trust row */
.mu-trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.mu-trust-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(224, 236, 255, 0.75);
}

@media (prefers-reduced-motion: reduce) {
  .mu-shimmer-btn__spark-inner,
  .mu-shimmer-btn__spark-inner::before,
  .mu-shine-card__border,
  .mu-shiny-pill__text,
  .mu-aurora-text {
    animation: none !important;
  }

  .mu-blur-in [data-mu-blur-target],
  .mu-blur-in [data-mu-from],
  .mu-blur-in [data-mu-slide],
  .mu-blur-in__word {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    animation: none !important;
  }
}

.mu-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Blur-in text (Magic UI Text Animate port) */
.mu-blur-in [data-mu-blur-target] {
  opacity: 0;
  filter: blur(12px);
  transform: translateX(-32px);
}

.mu-blur-in.is-visible [data-mu-blur-target] {
  animation: mu-blur-in-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-blur-delay, 0) * 1ms);
}

.mu-blur-in__word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateX(-24px);
}

.op-scene__content--from-right .mu-blur-in__word,
.op-scene__content--from-right .mu-blur-in__title .mu-blur-in__word {
  transform: translateX(24px);
}

.op-scene__hero-stage .mu-blur-in__title .mu-blur-in__word,
.op-scene__content:not(.op-scene__content--from-right) .mu-blur-in__title .mu-blur-in__word {
  transform: translateX(24px);
}

/* GSAP aktifken CSS keyframe çakışmasını kapat (hero + scroll sahneleri hariç) */
.mu-motion-enhanced .mu-blur-in.is-visible:not(.op-scene__hero-stage):not(.op-scene__content):not(.op-scene__contact-panel) [data-mu-blur-target],
.mu-motion-enhanced .mu-blur-in.is-visible:not(.op-scene__hero-stage):not(.op-scene__content):not(.op-scene__contact-panel) [data-mu-from],
.mu-motion-enhanced .mu-blur-in.is-visible:not(.op-scene__hero-stage):not(.op-scene__content):not(.op-scene__contact-panel) [data-mu-slide],
.mu-motion-enhanced .mu-blur-in.is-visible:not(.op-scene__hero-stage):not(.op-scene__content):not(.op-scene__contact-panel) .mu-blur-in__word {
  animation: none !important;
}

.op-scene__hero-stage .mu-blur-in__word,
.op-scene__hero-stage .mu-blur-in__word--inline {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.op-scene__hero-stage .scene-hero__lead .mu-blur-in__word--inline {
  margin-right: 0.04em;
}

html.is-hero-pending .op-scene__hero-stage > .op-scene__hero-brand,
html.is-hero-pending .op-scene__hero-stage .op-scene__hero-copy {
  opacity: 0;
  visibility: hidden;
}

html.is-hero-pending .op-scene__hero-stage [data-mu-slide] {
  opacity: 0 !important;
  filter: blur(12px) !important;
  transform: translateX(0) !important;
}

.op-scene__hero-stage .mu-hero-word {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.op-scene__hero-stage .scene-hero__lead .mu-hero-word {
  margin-right: 0.04em;
}

.op-scene__hero-stage.is-hero-css-intro > .op-scene__hero-brand {
  opacity: 0;
  animation: mu-hero-brand-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.op-scene__hero-stage.is-hero-css-intro .mu-hero-word[data-hero-side="left"] {
  opacity: 0;
  animation: mu-hero-word-left 0.92s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-i, 0) * 88ms + 180ms);
}

.op-scene__hero-stage.is-hero-css-intro .mu-blur-in__title .mu-hero-word:not(.mu-hero-word--accent),
.op-scene__hero-stage.is-hero-css-intro .scene-hero__lead .mu-hero-word {
  opacity: 0;
  animation: mu-hero-word-right 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-i, 0) * 95ms + 420ms);
}

.op-scene__hero-stage.is-hero-css-intro .mu-hero-word--accent,
.op-scene__hero-stage.is-hero-css-intro .scene-hero__accent.mu-hero-word {
  opacity: 0;
  animation: mu-hero-accent-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 780ms;
}

.op-scene__hero-stage.is-hero-css-intro .op-scene__hero-copy,
.op-scene__hero-stage.is-hero-css-intro > .op-scene__hero-brand {
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .op-scene__hero-stage.is-hero-css-intro .mu-hero-word,
  .op-scene__hero-stage.is-hero-css-intro > .op-scene__hero-brand {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}

@keyframes mu-hero-brand-in {
  from {
    opacity: 0;
    transform: translateX(-220px) scale(0.9);
    filter: blur(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes mu-hero-word-left {
  from {
    opacity: 0;
    transform: translateX(-148px) translateY(32px);
    filter: blur(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }
}

@keyframes mu-hero-word-right {
  from {
    opacity: 0;
    transform: translateX(148px) translateY(32px);
    filter: blur(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }
}

@keyframes mu-hero-accent-in {
  from {
    opacity: 0;
    transform: translateX(160px) translateY(20px) scale(0.88);
    filter: blur(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
}

html:not(.css-scroll-scenes) .mu-blur-in.is-visible .mu-blur-in__title .mu-blur-in__word {
  animation: mu-blur-in-word 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-i, 0) * 55ms);
}

html:not(.css-scroll-scenes) .mu-blur-in.is-visible .mu-blur-in__word {
  animation: mu-blur-in-word 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-i, 0) * 55ms + var(--mu-blur-delay, 0) * 1ms);
}

@keyframes mu-blur-in-rise {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}

@keyframes mu-blur-in-word {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}

/* Directional blur-in (Magic UI Text Animate — left/right) */
.mu-blur-in [data-mu-from="left"] {
  opacity: 0;
  filter: blur(12px);
  transform: translateX(-56px);
}

.mu-blur-in [data-mu-from="right"] {
  opacity: 0;
  filter: blur(12px);
  transform: translateX(56px);
}

.mu-blur-in [data-mu-slide="left"] {
  opacity: 0;
  filter: blur(12px);
  transform: translateX(-72px);
}

.mu-blur-in [data-mu-slide="right"] {
  opacity: 0;
  filter: blur(12px);
  transform: translateX(72px);
}

.mu-blur-in.is-visible [data-mu-from="left"] {
  animation: mu-blur-in-from-left 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-blur-delay, 0) * 1ms);
}

.mu-blur-in.is-visible [data-mu-from="right"] {
  animation: mu-blur-in-from-right 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-blur-delay, 0) * 1ms);
}

.mu-blur-in.is-visible [data-mu-slide="left"] {
  animation: mu-blur-in-from-left 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-blur-delay, 0) * 1ms);
}

.mu-blur-in.is-visible [data-mu-slide="right"] {
  animation: mu-blur-in-from-right 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--mu-blur-delay, 0) * 1ms);
}

@keyframes mu-blur-in-from-left {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}

@keyframes mu-blur-in-from-right {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}
