/* === Preloader === */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader__logo {
  width: 100px;
  height: 100px;
  opacity: 0;
  animation: preloaderFade 0.6s ease forwards;
}

.preloader__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 24px rgba(43, 42, 40, 0.15);
}

.preloader__bar {
  width: 120px;
  height: 2px;
  background-color: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: preloaderFade 0.6s ease 0.2s forwards;
}

.preloader__bar-fill {
  width: 0%;
  height: 100%;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

@keyframes preloaderFade {
  to { opacity: 1; }
}

/* === Custom Cursor === */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  transform: translate(-50%, -50%);
  opacity: 0;
  background-color: rgba(94, 107, 87, 0.08);
  box-shadow: 0 0 12px rgba(94, 107, 87, 0.15);
}

.custom-cursor.visible {
  opacity: 1;
}

.custom-cursor.hover {
  width: 52px;
  height: 52px;
  border-color: var(--color-accent);
  background-color: rgba(94, 107, 87, 0.15);
  box-shadow: 0 0 20px rgba(94, 107, 87, 0.25);
}

.custom-cursor.click {
  transform: translate(-50%, -50%) scale(0.8);
}

/* Hide custom cursor on touch devices */
@media (hover: none) {
  .custom-cursor {
    display: none;
  }
}

/* Hide default cursor when custom is active */
@media (hover: hover) {
  body.custom-cursor-active {
    cursor: none;
  }

  body.custom-cursor-active a,
  body.custom-cursor-active button,
  body.custom-cursor-active input,
  body.custom-cursor-active textarea,
  body.custom-cursor-active select,
  body.custom-cursor-active [role="button"] {
    cursor: none;
  }
}
