/* Motion, cursor, and theme polish */

.reveal-init {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal-visible {
  opacity: 1;
  transform: none;
}

/* Custom cursor — desktop / fine pointer only */
@media (pointer: fine) and (min-width: 769px) {
  html.hex-cursor-active,
  html.hex-cursor-active *:not(input):not(textarea):not(select):not([contenteditable="true"]) {
    cursor: none !important;
  }

  html.hex-cursor-active input,
  html.hex-cursor-active textarea,
  html.hex-cursor-active select,
  html.hex-cursor-active [contenteditable="true"] {
    cursor: text !important;
  }
}

.hex-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100000;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  will-change: transform;
  color: rgba(255, 255, 255, 0.95);
}

.hex-cursor.is-visible {
  opacity: 1;
}

.hex-cursor.is-native {
  opacity: 0 !important;
}

.hex-cursor-shape {
  position: absolute;
  left: 0;
  top: 0;
  display: none;
  pointer-events: none;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.hex-cursor:not(.is-mode-link):not(.is-mode-copy):not(.is-mode-interactive) .hex-cursor-shape--arrow {
  display: block;
}

.hex-cursor.is-mode-link .hex-cursor-shape--arrow,
.hex-cursor.is-mode-copy .hex-cursor-shape--arrow,
.hex-cursor.is-mode-interactive .hex-cursor-shape--arrow {
  display: none;
}

.hex-cursor.is-mode-link .hex-cursor-shape--link,
.hex-cursor.is-mode-copy .hex-cursor-shape--copy,
.hex-cursor.is-mode-interactive .hex-cursor-shape--arrow {
  display: block;
}

.hex-cursor-arrow {
  width: 28px;
  height: 28px;
  margin: -2px 0 0 -2px;
  transform: translate(-1px, -1px);
  filter: drop-shadow(0 0 6px rgba(61, 186, 165, 0.85)) drop-shadow(0 0 14px rgba(15, 122, 106, 0.45));
}

.hex-cursor-link-icon {
  margin: -18px 0 0 -18px;
  color: #5ed4c0;
  filter: drop-shadow(0 0 8px rgba(94, 212, 192, 0.85)) drop-shadow(0 0 16px rgba(61, 186, 165, 0.5));
  animation: hex-cursor-link-spin 4s linear infinite;
}

.hex-cursor-copy-icon {
  margin: -15px 0 0 -12px;
  color: #3dd68c;
  filter: drop-shadow(0 0 8px rgba(61, 214, 140, 0.85)) drop-shadow(0 0 14px rgba(35, 165, 89, 0.45));
}

.hex-cursor-tip {
  position: absolute;
  left: 22px;
  top: -6px;
  padding: 0.2rem 0.5rem;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0d1210;
  background: #3dd68c;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(4px) scale(0.9);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(61, 214, 140, 0.45);
  white-space: nowrap;
}

.hex-cursor.is-mode-copy .hex-cursor-tip {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hex-cursor.is-mode-copy.is-copied .hex-cursor-tip {
  background: var(--success, #3ba55d);
}

.hex-cursor.is-mode-interactive .hex-cursor-arrow {
  transform: translate(-1px, -1px) scale(1.12);
  filter: drop-shadow(0 0 10px rgba(94, 212, 192, 1)) drop-shadow(0 0 20px rgba(61, 186, 165, 0.7));
}

.hex-cursor-glow {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 212, 192, 0.55) 0%, rgba(61, 186, 165, 0.2) 45%, transparent 70%);
  animation: hex-cursor-pulse 2s ease-in-out infinite;
}

.hex-cursor-glow--outer {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  left: 8px;
  top: 8px;
  background: radial-gradient(circle, rgba(61, 186, 165, 0.25) 0%, transparent 65%);
  animation: hex-cursor-pulse-outer 2.4s ease-in-out infinite;
  animation-delay: 0.35s;
}

.hex-cursor.is-mode-link .hex-cursor-glow,
.hex-cursor.is-mode-copy .hex-cursor-glow {
  animation-duration: 1s;
}

.hex-cursor.is-mode-link .hex-cursor-glow {
  background: radial-gradient(circle, rgba(94, 212, 192, 0.65) 0%, rgba(61, 186, 165, 0.25) 50%, transparent 70%);
}

.hex-cursor.is-mode-copy .hex-cursor-glow {
  background: radial-gradient(circle, rgba(61, 214, 140, 0.55) 0%, rgba(35, 165, 89, 0.2) 50%, transparent 70%);
}

.hex-cursor.is-click .hex-cursor-shape {
  transform: scale(0.88);
}

@keyframes hex-cursor-link-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes hex-cursor-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

@keyframes hex-cursor-pulse-outer {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.15);
  }
}

[data-theme="light"] .hex-cursor-arrow {
  filter: drop-shadow(0 0 6px rgba(15, 122, 106, 0.75)) drop-shadow(0 0 12px rgba(15, 122, 106, 0.35));
}

@media (prefers-reduced-motion: reduce) {
  .reveal-init,
  .hero-content,
  .app-view.is-exiting,
  .app-view.is-entering,
  .cmd-list.is-swapping,
  .sk-line,
  .hex-cursor-glow,
  .hex-cursor-glow--outer,
  .hex-cursor-link-icon {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hex-cursor-glow,
  .hex-cursor-glow--outer {
    opacity: 0.5 !important;
  }
}
