/* ==========================================================================
   SMK Web Design — Premium Motion System
   Editorial luxury × technical precision
   ========================================================================== */

/* ——— Loading state ——— */
html.is-loading {
  overflow: hidden;
}

html.is-loading body {
  overflow: hidden;
}

/* ——— Custom cursor (desktop fine pointer only) ——— */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--mist);
  pointer-events: none;
  z-index: var(--z-cursor);
  mix-blend-mode: difference;
  transition:
    width 0.35s var(--ease-out-expo),
    height 0.35s var(--ease-out-expo),
    margin 0.35s var(--ease-out-expo),
    background 0.25s,
    opacity 0.25s;
  opacity: 0;
  will-change: transform;
}

.cursor__ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(245, 245, 240, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: calc(var(--z-cursor) - 1);
  opacity: 0;
  transition:
    width 0.4s var(--ease-out-expo),
    height 0.4s var(--ease-out-expo),
    margin 0.4s var(--ease-out-expo),
    border-color 0.3s,
    opacity 0.3s,
    background 0.3s;
  will-change: transform;
}

html.has-cursor .cursor,
html.has-cursor .cursor__ring {
  opacity: 1;
}

html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}

html.has-cursor a,
html.has-cursor button,
html.has-cursor .btn,
html.has-cursor .project-card,
html.has-cursor .service-card,
html.has-cursor .bento__item,
html.has-cursor .floating-nav__item,
html.has-cursor input,
html.has-cursor textarea,
html.has-cursor select {
  cursor: none !important;
}

.cursor.is-hover {
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  background: var(--signal);
  mix-blend-mode: normal;
}

.cursor__ring.is-hover {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-color: rgba(200, 255, 0, 0.45);
  background: rgba(200, 255, 0, 0.06);
}

.cursor.is-click {
  transform: scale(0.7);
}

/* ——— Scroll progress ——— */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: calc(var(--z-cursor) + 1);
  background: linear-gradient(90deg, var(--signal), #fff 80%);
  box-shadow: 0 0 12px var(--signal-glow);
  pointer-events: none;
  transform-origin: left;
}

/* ——— Preloader ——— */
.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ——— Page enter ——— */
.page-enter main,
.page-enter .nav,
.page-enter .floating-nav,
.page-enter .whatsapp-float {
  animation: page-fade-in 0.9s var(--ease-out-expo) both;
}

.page-enter .nav { animation-delay: 0.05s; }
.page-enter main { animation-delay: 0.12s; }
.page-enter .floating-nav { animation-delay: 0.35s; }
.page-enter .whatsapp-float { animation-delay: 0.45s; }

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ——— Ambient orbs ——— */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  will-change: transform;
}

.ambient__orb--1 {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  top: -10%;
  right: -5%;
  background: radial-gradient(circle, rgba(200, 255, 0, 0.14), transparent 70%);
  animation: orb-drift-1 22s ease-in-out infinite;
}

.ambient__orb--2 {
  width: min(45vw, 420px);
  height: min(45vw, 420px);
  bottom: 10%;
  left: -8%;
  background: radial-gradient(circle, rgba(45, 74, 255, 0.12), transparent 70%);
  animation: orb-drift-2 28s ease-in-out infinite;
}

.ambient__orb--3 {
  width: min(35vw, 320px);
  height: min(35vw, 320px);
  top: 45%;
  left: 40%;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.08), transparent 70%);
  animation: orb-drift-3 18s ease-in-out infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 60px) scale(1.1); }
}

@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -40px) scale(1.08); }
}

@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(30px, -20px); }
  66% { transform: translate(-20px, 30px); }
}

/* ——— Enhanced scroll reveals ——— */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.9s var(--ease-out-expo),
    transform 0.9s var(--ease-out-expo),
    filter 0.9s var(--ease-out-expo);
  filter: blur(4px);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

[data-reveal="scale"] {
  transform: scale(0.94) translateY(24px);
  filter: blur(6px);
}

[data-reveal="scale"].is-visible {
  transform: none;
  filter: blur(0);
}

[data-reveal="left"] {
  transform: translateX(-36px);
}

[data-reveal="right"] {
  transform: translateX(36px);
}

[data-reveal="left"].is-visible,
[data-reveal="right"].is-visible {
  transform: none;
}

[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }
[data-reveal-delay="5"] { transition-delay: 0.4s; }
[data-reveal-delay="6"] { transition-delay: 0.48s; }

/* ——— Text split (word reveal) ——— */
.split-line {
  display: block;
  overflow: hidden;
}

.split-word {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform 0.85s var(--ease-out-expo),
    opacity 0.85s var(--ease-out-expo);
  will-change: transform, opacity;
}

.split-word.is-in {
  transform: translateY(0);
  opacity: 1;
}

/* Char stagger for overlines / small labels */
.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.45s var(--ease-out-expo),
    transform 0.45s var(--ease-out-expo);
}

.split-char.is-in {
  opacity: 1;
  transform: none;
}

/* ——— Button shine (enhanced) ——— */
.btn--accent {
  transition:
    transform 0.35s var(--ease-out-expo),
    background 0.25s,
    box-shadow 0.35s var(--ease-out-expo) !important;
}

.btn--accent:hover {
  box-shadow:
    0 0 0 1px var(--signal-strong),
    0 8px 32px rgba(200, 255, 0, 0.25),
    0 0 60px rgba(200, 255, 0, 0.12);
}

/* ——— Card spotlight (mouse follow) ——— */
.fx-spotlight {
  position: relative;
  overflow: hidden;
}

.fx-spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(200, 255, 0, 0.09),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 1;
}

.fx-spotlight:hover::before {
  opacity: 1;
}

.fx-spotlight > * {
  position: relative;
  z-index: 2;
}

/* ——— Project card tilt ——— */
.project-card.is-tilting {
  transition: transform 0.08s linear !important;
}

/* ——— Floating nav hidden ——— */
.floating-nav.is-hidden {
  transform: translateX(-50%) translateY(120%);
  opacity: 0;
  pointer-events: none;
}

/* ——— Image load fade ——— */
img {
  transition: opacity 0.5s var(--ease-out-expo);
}

img:not([src]),
img[src=""] {
  opacity: 0;
}

/* ——— Service Card Icon Animations ——— */

@keyframes icon-bounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.18) rotate(-6deg); }
  60% { transform: scale(1.06) rotate(2deg); }
}

@keyframes icon-pulse-ring {
  0% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 0.1; }
  100% { transform: scale(1); opacity: 0.4; }
}

@keyframes card-glow-pulse {
  0%, 100% { box-shadow: var(--glass-shadow); }
  50% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--card-accent-dim, var(--signal-dim)); }
}

.service-card:hover .service-card__icon svg {
  animation: icon-bounce 0.6s var(--ease-spring) forwards;
}

.service-card:hover .service-card__icon-ring {
  animation: icon-pulse-ring 1.2s var(--ease-out-expo) infinite;
}

/* ——— Project Card Image Skeleton Load ——— */
@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.project-card__img.is-loaded {
  animation: image-fade-in 0.5s var(--ease-out-expo) both;
}

@keyframes image-fade-in {
  from { opacity: 0; filter: blur(8px); }
  to { opacity: 1; filter: blur(0); }
}

/* ——— Project Modal Animations ——— */
.project-modal--open .project-modal__content {
  animation: modal-content-in 0.5s var(--ease-out-expo) both;
}

@keyframes modal-content-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.project-modal__backdrop {
  animation: modal-backdrop-in 0.4s var(--ease-out-expo) both;
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ——— Filter button active pulse ——— */
.filter-btn--active {
  animation: filter-pop 0.35s var(--ease-spring);
}

@keyframes filter-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ——— About Page: Timeline Dot Pulse ——— */
.timeline__dot {
  animation: timeline-dot-pulse 3s ease-in-out infinite;
}

@keyframes timeline-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--signal-dim), 0 0 20px var(--signal-glow); }
  50% { box-shadow: 0 0 0 6px var(--signal-dim), 0 0 30px var(--signal-glow); }
}

/* ——— About Page: Counter Value Glow ——— */
.about-counter.is-visible .about-counter__value {
  animation: counter-glow-in 0.6s var(--ease-out-expo) both;
}

@keyframes counter-glow-in {
  from { text-shadow: 0 0 0 transparent; }
  to { text-shadow: 0 0 24px var(--signal-glow); }
}

/* ——— About Page: Profile Ring Subtle Float ——— */
@keyframes about-ring-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(6px, -8px) rotate(3deg); }
}

/* ——— About Page: Achievement Card Icon Glow ——— */
.achievement-card:hover .achievement-card__icon {
  animation: achievement-icon-glow 0.6s var(--ease-spring) forwards;
}

@keyframes achievement-icon-glow {
  0% { box-shadow: 0 0 0 0 var(--signal-dim); }
  100% { box-shadow: 0 0 20px 4px var(--signal-dim); transform: scale(1.08); }
}

/* ——— About Page: Skill Fill Smooth ——— */
.skill__fill {
  will-change: width;
}

/* ——— Field shake (form validation) ——— */
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ——— Floating element (ambient drift) ——— */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.float {
  animation: float 4s ease-in-out infinite;
}

.float--slow { animation-duration: 6s; }
.float--fast { animation-duration: 2.5s; }

/* ——— Ping pulse (map pin, notification dots) ——— */
@keyframes ping {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
  .preloader,
  .cursor,
  .cursor__ring,
  .ambient__orb,
  .whatsapp-float,
  .whatsapp-float::before,
  .cta__panel::after,
  .hero__float,
  .page-enter main,
  .page-enter .nav,
  .page-enter .floating-nav,
  .page-enter .whatsapp-float {
    animation: none !important;
  }

  [data-reveal],
  .split-word,
  .split-char {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .preloader { display: none !important; }
  html.is-loading { overflow: auto; }

  .about-profile__ring,
  .timeline__dot {
    animation: none !important;
  }

  .skill__fill {
    transition: none !important;
  }
}

@media (pointer: coarse) {
  .cursor,
  .cursor__ring {
    display: none !important;
  }

  html.has-cursor,
  html.has-cursor * {
    cursor: auto !important;
  }
}
