/* Brand Icon Masks (Toolbox) */
.tool-icon {
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Hero Animated Background */
.hero-canvas {
  z-index: 0;
  filter: blur(60px);
  opacity: 0.9;
}

.noise-overlay {
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Custom Select (Contact Form) */
.custom-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.custom-select::-ms-expand {
  display: none;
}

.custom-select option {
  background-color: #0a0a0a;
  color: #ffffff;
}

/* Service Pill (Contact Form) */
.service-pill.active {
  background-color: #dfff4f;
  color: #0a0a0a;
  border-color: #dfff4f;
  font-weight: 600;
}

/* About Me — Narrative Chapters */
.about-chapter {
  position: relative;
}

.about-chapter > * {
  position: relative;
  z-index: 1;
}

.chapter-number {
  position: absolute;
  top: -0.75rem;
  left: -0.25rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.05);
  line-height: 1;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

@media (min-width: 768px) {
  .chapter-number {
    font-size: 6rem;
    top: -1.25rem;
    left: -0.5rem;
  }
}

.about-underline {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.5, 0, 0, 1) 0.3s;
}

.reveal.active .about-underline {
  transform: scaleX(1);
}

/* Trusted By Logo Marquee */
.logo-marquee-mask {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 12%,
    black 88%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    black 12%,
    black 88%,
    transparent
  );
}

.animate-logo-marquee {
  animation: logo-marquee 45s linear infinite;
  width: max-content;
}

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

.animate-logo-marquee-reverse {
  animation: logo-marquee 45s linear infinite reverse;
  width: max-content;
}

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

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

.logo-item {
  display: inline-flex;
  align-items: center;
  color: #6b7280;
  padding: 0 2.5rem;
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
  opacity: 0.6;
}

.logo-item:hover {
  color: #dfff4f;
  opacity: 1;
}

/* Testimonials — Dual Marquee */
.testimonial-mask {
  overflow: hidden;
  padding: 14px 0;
  margin: -14px 0;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 6%,
    black 94%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    black 6%,
    black 94%,
    transparent
  );
}

.animate-testimonial-ltr,
.animate-testimonial-rtl {
  --testimonial-distance: 50%;
  display: flex;
  width: max-content;
  will-change: transform;
}

.testimonial-track {
  display: flex;
  flex: 0 0 auto;
  gap: 1.5rem;
  padding-right: 1.5rem;
}

.animate-testimonial-ltr {
  animation: testimonial-scroll-ltr 55s linear infinite;
}

.animate-testimonial-rtl {
  animation: testimonial-scroll-rtl 60s linear infinite;
}

.animate-testimonial-ltr:hover,
.animate-testimonial-rtl:hover {
  animation-play-state: paused;
}

@keyframes testimonial-scroll-rtl {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(var(--testimonial-distance) * -1), 0, 0);
  }
}

@keyframes testimonial-scroll-ltr {
  from {
    transform: translate3d(calc(var(--testimonial-distance) * -1), 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

.testimonial-card {
  flex: 0 0 min(20rem, calc(100vw - 3rem));
  width: min(20rem, calc(100vw - 3rem));
  margin-right: 0 !important;
  transition:
    border-color 0.3s ease,
    transform 0.3s ease;
}

.testimonial-card:hover {
  border-color: rgba(198, 242, 117, 0.4);
  transform: translateY(-4px);
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid transparent;
}

.platform-badge.fiverr {
  color: #1dbf73;
  background: rgba(29, 191, 115, 0.1);
  border-color: rgba(29, 191, 115, 0.3);
}

.platform-badge.upwork {
  color: #14a800;
  background: rgba(20, 168, 0, 0.1);
  border-color: rgba(20, 168, 0, 0.3);
}

.platform-badge.direct {
  color: #dfff4f;
  background: rgba(223, 255, 79, 0.1);
  border-color: rgba(223, 255, 79, 0.3);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
}

/* Custom Cursor */
body {
  cursor: none;
  background-color: #0a0a0a;
  color: white;
  max-width: 100%;
  position: relative;
}

.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: #dfff4f;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(223, 255, 79, 0.5);
  transition:
    width 0.2s,
    height 0.2s,
    background-color 0.2s;
}

/* Hover states for cursor */
body:hover .cursor-outline.hovered {
  width: 60px;
  height: 60px;
  background-color: rgba(223, 255, 79, 0.1);
  border-color: #dfff4f;
}

#scroll-progress {
  transform-origin: left;
}

/* Utility */
.glass-nav {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Floating Pill Navbar */
.nav-glass {
  background: rgba(18, 18, 18, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#navbar.scrolled #nav-inner {
  background: rgba(10, 10, 10, 0.85);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

.nav-link {
  position: relative;
  padding: 0.6rem 0.62rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.62rem;
  right: 0.62rem;
  bottom: 0.4rem;
  height: 1px;
  background: #dfff4f;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Animated Hamburger */
.hamburger {
  width: 22px;
  height: 16px;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  margin-right: 0.5rem;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #ffffff;
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Links */
.mobile-link {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 8vw, 2.45rem);
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  transition-delay: calc(var(--i, 0) * 80ms);
  padding: 0.5rem 0;
  line-height: 1.1;
}

.mobile-link-index {
  font-size: 0.8rem;
  font-family: monospace;
  color: #dfff4f;
}

#mobile-menu.open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

.gradient-text {
  background: linear-gradient(to right, #ffffff, #999999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Gradient Blob Background */
.blob-bg {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(223, 255, 79, 0.15) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  top: -200px;
  right: -200px;
  z-index: -1;
  pointer-events: none;
}

/* Mobile Menu */
#mobile-menu {
  transition: transform 0.3s ease-in-out;
  transform: translateX(100%);
}
#mobile-menu.open {
  transform: translateX(0);
}

body.mobile-menu-open {
  overflow: hidden;
}

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

/* Hide Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #dfff4f;
}

/* Contact Form — Animated Border Beam */
.border-beam-wrap {
  position: relative;
  isolation: isolate;
}

.border-beam-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250%;
  height: 250%;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 265deg,
    #dfff4f 300deg,
    #f4ffb0 320deg,
    #dfff4f 340deg,
    transparent 360deg
  );
  animation: border-beam-spin 6s linear infinite;
  z-index: 0;
}

@keyframes border-beam-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .border-beam-glow {
    animation: none;
  }
}

@media (max-width: 768px) {
  body {
    cursor: auto;
  }
  .cursor-dot,
  .cursor-outline {
    display: none;
  }
}

/* Portfolio Image Preview Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-img {
  transform: scale(0.85);
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s ease;
}

.lightbox.active .lightbox-img {
  transform: scale(1);
  opacity: 1;
}

/* Magnify icon shown on portfolio card hover */
.project-zoom-icon {
  transform: scale(0.7);
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease;
}

.project-item:hover .project-zoom-icon,
.project-item:focus-visible .project-zoom-icon {
  transform: scale(1);
}
