/* ============ Custom styles on top of Tailwind ============ */

/* Outlined display text */
.text-outline {
  -webkit-text-stroke: 2px #09090b;
  color: transparent;
}

.text-outline-accent {
  -webkit-text-stroke: 2px #2563eb;
  color: transparent;
}

/* Skill chips */
.skill-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(250, 250, 250, 0.15);
  padding: 0.5rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(250, 250, 250, 0.75);
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.skill-chip:hover {
  border-color: #2563eb;
  color: #fafafa;
  background-color: rgba(37, 99, 235, 0.12);
}

/* Scroll reveal (Intersection Observer toggles .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Marquee */
.marquee {
  animation: marquee 28s linear infinite;
  width: max-content;
}

.marquee:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Project card sheen sweep on hover */
.card-sheen {
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.7s ease;
}

.project-card:hover .card-sheen {
  transform: translateX(100%);
}

.project-card {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px -20px rgb(9 9 11 / 0.25);
  border-color: rgba(9, 9, 11, 0.12);
}

/* Custom cursor */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 100;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: #2563eb;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(37, 99, 235, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.cursor-ring.is-active {
  width: 56px;
  height: 56px;
  border-color: rgba(37, 99, 235, 0.9);
  background-color: rgba(37, 99, 235, 0.08);
}

/* Grain texture overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Focus visibility for keyboard nav */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Prevent horizontal scroll */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .marquee {
    animation: none;
  }

  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }

  .project-card,
  .project-card:hover {
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
