/* ==================================================================
   Pranit Daphale — Portfolio
   Custom styling layer (sits on top of Tailwind CDN utilities)
   ================================================================== */

::selection {
  background: #90c67c;
  color: #020617;
}

html {
  scrollbar-color: #334155 transparent;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #020617;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(#8e7dbe, #90c67c);
  border-radius: 999px;
  border: 2px solid #020617;
}

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

/* ---------------- Custom cursor (desktop only) ---------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot {
  width: 7px;
  height: 7px;
  background: #90c67c;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.cursor-ring.is-active {
  width: 60px;
  height: 60px;
  background: rgba(144, 198, 124, 0.12);
  border-color: #90c67c;
}

@media (pointer: coarse) {

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

/* ---------------- Preloader ---------------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

#preloader .loader-word {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  overflow: hidden;
}

#preloader .loader-bar {
  width: min(60vw, 260px);
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  border-radius: 999px;
}

#preloader .loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffb22c, #90c67c, #8e7dbe);
}

/* ---------------- Gradient text ---------------- */
.text-gradient {
  background: linear-gradient(90deg, #ffb22c, #90c67c 55%, #8e7dbe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------- Split text lines ---------------- */
.split-line {
  display: block;
  overflow: hidden;
}

.split-line>span {
  display: inline-block;
  will-change: transform;
}

/* ---------------- Magnetic buttons ---------------- */
.magnetic {
  display: inline-flex;
}

/* ---------------- Spotlight project cards ---------------- */
.spotlight-card {
  position: relative;
  isolation: isolate;
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(320px circle at var(--x, 50%) var(--y, 50%),
      rgba(144, 198, 124, 0.16),
      transparent 60%);
}

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

/* ---------------- Marquee ---------------- */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 26s linear infinite;
}

.marquee-track.reverse {
  animation-direction: reverse;
  animation-duration: 32s;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0%);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ---------------- Filter pills ---------------- */
.filter-pill[data-active="true"] {
  background: #90c67c;
  color: #020617;
  border-color: #90c67c;
}

/* ---------------- Card fade/scale entrance target (JS toggles) ---------------- */
.project-card {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.filter-group.is-hidden {
  display: none;
}

/* ---------------- Bento client tiles ---------------- */
.client-tile {
  position: relative;
  overflow: hidden;
}

.client-tile img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
  filter: saturate(0.9);
}

.client-tile:hover img {
  transform: scale(1.08);
  filter: saturate(1.1);
}

.client-tile .tile-overlay {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.35) 55%, rgba(2, 6, 23, 0.92) 100%);
}

/* ---------------- Wordmark tile (for brand-asset only cards) ---------------- */
.wordmark-tile {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    #0b0b0c;
}

/* ---------------- Back to top ---------------- */
#back-to-top {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.hide {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* ---------------- Scroll reveal (IntersectionObserver-driven) ---------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0s);
}

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

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {

  .marquee-track {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
