/* ============================================================
   Aceternity-style components — styles
   Themed via design tokens (var(--background) etc.)
   ============================================================ */

/* ---------- FlipWords ---------- */
[data-flipwords]{
  position: relative;
  display: inline-block;
  white-space: nowrap;
  vertical-align: baseline;
  color: var(--foreground);
}
[data-flipwords] .fw-word{
  display: inline-block;
  transition: transform .6s cubic-bezier(.22,.61,.36,1), opacity .6s cubic-bezier(.22,.61,.36,1), filter .6s;
  will-change: transform, opacity;
}
[data-flipwords] .fw-enter{
  opacity: 0;
  transform: translateY(0.55em);
  filter: blur(8px);
  position: absolute;
  left: 0; top: 0;
}
[data-flipwords] .fw-in{
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  position: relative;
}
[data-flipwords] .fw-leave{
  opacity: 0;
  transform: translateY(-0.6em) scale(0.98);
  filter: blur(8px);
  position: absolute;
  left: 0; top: 0;
}

/* ---------- Carousel ---------- */
.ac-carousel{
  position: relative;
  width: 100%;
  height: clamp(360px, 60vh, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  overflow: hidden;
}
.ac-carousel__track{
  position: relative;
  list-style: none;
  margin: 0; padding: 0;
  width: 100%;
  height: 100%;
}
.ac-slide{
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(260px, 70vw, 520px);
  height: clamp(320px, 70vw, 520px);
  margin-left: calc(clamp(260px, 70vw, 520px) / -2);
  margin-top: calc(clamp(320px, 70vw, 520px) / -2);
  transition: transform .8s cubic-bezier(.22,.61,.36,1), opacity .8s, filter .8s;
  --off: 0;
  transform: translateX(calc(var(--off) * 92%)) scale(calc(1 - min(1, abs(var(--off))) * 0.18));
  opacity: calc(1 - min(1, abs(var(--off))) * 0.55);
  filter: blur(calc(min(1, abs(var(--off))) * 4px));
  cursor: pointer;
  z-index: calc(10 - abs(var(--off, 0)));
}
.ac-slide.is-active{ cursor: default; }
.ac-slide__inner{
  position: relative;
  width: 100%; height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--muted);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.35);
}
.ac-slide__inner .ac-slide__media{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  background: #0e0e0e;
}
.ac-slide__overlay{
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0) 100%);
  color: #fff;
  padding: 24px;
  opacity: 0;
  transition: opacity .4s;
}
.ac-slide.is-active .ac-slide__overlay{ opacity: 1; }
.ac-slide__kicker{
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  backdrop-filter: blur(6px);
}
.ac-slide__title{
  font-family: var(--font-heading, inherit);
  font-size: clamp(20px, 3.4vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 18px rgba(0,0,0,0.4);
  margin: 0;
}
.ac-slide__btn{
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.ac-slide__btn:hover{ background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.7); }
.ac-carousel__nav{
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
}
.ac-nav{
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.ac-nav:hover{ background: var(--muted); transform: translateY(-1px); }
.ac-nav svg{ width: 18px; height: 18px; }

/* ---------- WorldMap ---------- */
.ac-worldmap{
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  color: var(--foreground);
}
.ac-worldmap__bg{
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}
.ac-worldmap__svg{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.ac-arc path{
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: ac-draw 2s cubic-bezier(.22,.61,.36,1) forwards;
  animation-delay: calc(var(--i) * 0.5s);
}
@keyframes ac-draw{
  to { stroke-dashoffset: 0; }
}
.ac-arc circle.ac-pulse{
  transform-origin: center;
  transform-box: fill-box;
  animation: ac-pulse 2.6s ease-out infinite;
  animation-delay: calc(var(--i) * 0.5s + 1s);
  opacity: 0.6;
}
@keyframes ac-pulse{
  0% { transform: scale(1); opacity: 0.7; }
  80% { transform: scale(6); opacity: 0; }
  100% { transform: scale(6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce){
  .ac-arc path{ animation: none; stroke-dashoffset: 0; }
  .ac-arc circle.ac-pulse{ animation: none; opacity: 0; }
}

/* ---------- MultiStepLoader ---------- */
.ac-loader{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.ac-loader.is-open{ display: flex; }
.ac-loader__backdrop{
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--background) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: ac-fade .35s ease both;
}
@keyframes ac-fade{ from{ opacity: 0; } to{ opacity: 1; } }
.ac-loader__panel{
  position: relative;
  z-index: 1;
  width: min(92vw, 440px);
  padding: 28px 28px 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.35);
  animation: ac-rise .45s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes ac-rise{
  from{ opacity: 0; transform: translateY(20px) scale(0.97); }
  to{ opacity: 1; transform: none; }
}
.ac-loader__steps{
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  /* Mask gradient so far-away steps fade — like Aceternity's */
  mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 78%, transparent 100%);
}
.ac-step{
  display: flex; align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted-foreground);
  transition: opacity .4s, color .4s, transform .4s;
  opacity: 0.4;
}
.ac-step.is-done{ opacity: 0.7; color: var(--foreground); }
.ac-step.is-active{
  opacity: 1;
  color: var(--foreground);
  transform: translateX(2px);
}
.ac-step__icon{
  position: relative;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--background);
  flex-shrink: 0;
}
.ac-step__dot{
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--muted-foreground);
  opacity: 0.6;
}
.ac-step__check{
  position: absolute;
  width: 14px; height: 14px;
  color: var(--foreground);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity .3s, transform .3s;
}
.ac-step.is-done .ac-step__icon{
  border-color: var(--foreground);
  background: var(--foreground);
}
.ac-step.is-done .ac-step__dot{ opacity: 0; }
.ac-step.is-done .ac-step__check{
  opacity: 1; transform: scale(1);
  color: var(--background);
}
.ac-step.is-active .ac-step__icon{
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--foreground) 12%, transparent);
}
.ac-step.is-active .ac-step__dot{
  background: var(--foreground); opacity: 1;
  animation: ac-blink 1.2s ease-in-out infinite;
}
@keyframes ac-blink{ 50%{ opacity: 0.3; } }
.ac-step__text{ line-height: 1.4; }
.ac-loader__close{
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ac-loader__close:hover{ background: var(--muted); color: var(--foreground); border-color: var(--border); }
.ac-loader__close svg{ width: 16px; height: 16px; }

/* ---------- ImagesSlider ---------- */
.ac-slider{
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ac-slider__layer{
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease, transform 6s ease;
  transform: scale(1.05);
  z-index: 0;
}
.ac-slider__layer.is-active{
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.ac-slider__overlay{
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.7) 100%);
  z-index: 2;
}
.ac-slider__content{
  position: relative;
  z-index: 3;
  color: #fff;
  text-align: center;
  padding: 24px;
}
