/* Premium custom scrollbar — visible on both light & dark sections */
html {
  scrollbar-width: thin;
  scrollbar-color: #ff7b00 rgba(0,0,0,0.08);
}
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
}
::-webkit-scrollbar-thumb {
  background: #ff7b00;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: #00b4d8;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Glassmorphism Styles */
.glass-panel-light {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-card-light {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.015);
  transition: border-color 0.4s, box-shadow 0.4s, background-color 0.4s;
}
.glass-card-light:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 180, 216, 0.3);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.04), 0 0 30px rgba(0, 180, 216, 0.04);
}

.glass-panel-dark {
  background: rgba(18, 18, 18, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-card-dark {
  background: rgba(255, 255, 255, 0.015);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.4s, box-shadow 0.4s, background-color 0.4s;
}
.glass-card-dark:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 123, 0, 0.3);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25), 0 0 30px rgba(255, 123, 0, 0.05);
}

/* Film Grain Noise overlay */
.filmic-grain {
  position: fixed;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200%;
  background: transparent url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E') repeat;
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
  animation: grain-animation 8s steps(10) infinite;
}
@keyframes grain-animation {
  0%, 100% { transform:translate(0, 0); }
  10% { transform:translate(-5%, -10%); }
  20% { transform:translate(-15%, 5%); }
  30% { transform:translate(7%, -25%); }
  40% { transform:translate(-5%, 25%); }
  50% { transform:translate(-15%, 10%); }
  65% { transform:translate(15%, -10%); }
  80% { transform:translate(3%, 35%); }
  90% { transform:translate(-10%, 10%); }
}

/* Card metallic shine sweep & premium z-depth */
.glass-card-light, .glass-card-dark {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.glass-card-light::before, .glass-card-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.02) 30%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.02) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: left 0.75s ease;
  z-index: 5;
  pointer-events: none;
}
.glass-card-light:hover::before, .glass-card-dark:hover::before {
  left: 150%;
}

/* Ambient blurs */
.ambient-glow {
  background: radial-gradient(circle, rgba(0, 180, 216, 0.08) 0%, transparent 70%);
}
.ambient-glow-orange {
  background: radial-gradient(circle, rgba(255, 123, 0, 0.08) 0%, transparent 70%);
}

/* Individual 3D perspective to avoid grid alignment distortion */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* HUD grid overlay */
.hud-grid {
  background-size: 45px 45px;
  background-image: linear-gradient(to right, rgba(0, 180, 216, 0.015) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(0, 180, 216, 0.015) 1px, transparent 1px);
}

/* Cinematic cursor styling (Desktop only) */
@media (min-width: 1024px) {
  .custom-cursor {
    width: 8px;
    height: 8px;
    background: #1a1a1a;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
  }
  .custom-cursor-follower {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(0, 180, 216, 0.4);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease-out, width 0.3s, height 0.3s, border-color 0.3s;
  }
}

/* Infinite Marquee Ticker */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 25s linear infinite;
}

/* Loop text background in Hero */
@keyframes watermarkScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.watermark-scroll {
  animation: watermarkScroll 60s linear infinite;
  white-space: nowrap;
}

/* Dynamic Border Sweep Animation */
.sweep-border {
  position: relative;
}
.sweep-border::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, transparent 40%, rgba(0, 180, 216, 0.4), rgba(255, 123, 0, 0.4), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background-size: 200% 200%;
  background-position: 0% 0%;
  transition: background-position 0.6s ease;
  pointer-events: none;
}
.sweep-border:hover::after {
  background-position: 100% 100%;
}

/* Chatbot styling extensions */
.chat-sug-chip {
  cursor: pointer;
}
.chat-message-bot {
  border-top-left-radius: 0 !important;
}
.chat-message-user {
  border-top-right-radius: 0 !important;
}
#chatMessages::-webkit-scrollbar {
  width: 4px;
}
#chatMessages::-webkit-scrollbar-track {
  background: transparent;
}
#chatMessages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

/* Portfolio Tabbed Gallery */
.portfolio-tab-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #9ca3af;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.portfolio-tab-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.portfolio-tab-btn.active {
  background: #ff7b00;
  color: #fff;
  border-color: #ff7b00;
  box-shadow: 0 8px 24px rgba(255,123,0,0.3);
}

.portfolio-grid-item {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.portfolio-grid-item:hover {
  transform: scale(1.03);
  border-color: rgba(255,123,0,0.45);
  box-shadow: 0 16px 40px rgba(255,123,0,0.12);
}
.portfolio-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
  display: block;
}
.portfolio-grid-item:hover img {
  transform: scale(1.1);
}
.portfolio-grid-item .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.portfolio-grid-item:hover .overlay {
  opacity: 1;
}
.portfolio-grid-item .overlay-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(12px);
  transition: transform 0.3s;
}
.portfolio-grid-item:hover .overlay-icon {
  transform: translateY(0);
}

/* Portfolio Lightbox */
#portfolio-lightbox {
  display: none;
  align-items: center;
  justify-content: center;
}
#portfolio-lightbox.active {
  display: flex;
}

/* Portfolio grid fade-in animation */
@keyframes portfolioFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.portfolio-grid-item {
  animation: portfolioFadeIn 0.4s ease both;
}
