:root {
  --bg-obsidian: #09090b;
  --bg-surface: #111114;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  --timeline-gradient: linear-gradient(180deg, #bae6fd 0%, #38bdf8 45%, #1d4ed8 100%);
  --card-gradient: linear-gradient(145deg, rgba(56, 189, 248, 0.12) 0%, rgba(17, 17, 20, 0.96) 45%, rgba(37, 99, 235, 0.14) 100%);
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
  color: #fafafa;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-obsidian);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Primary cohesive gradient utilities */
.accent-gradient-bg {
  background: var(--accent-gradient);
}

.accent-gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.timeline-gradient-bar {
  background: var(--timeline-gradient);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

/* Cursor-following ambient gradient */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 540px;
  height: 540px;
  border-radius: 9999px;
  pointer-events: none;
  z-index: 1;
  transform: translate3d(-50%, -50%, 0);
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.14) 0%,
    rgba(37, 99, 235, 0.07) 38%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}

body.has-pointer #cursor-glow {
  opacity: 1;
}

/* Subtle top ambient glow */
.hero-ambient-glow {
  background: radial-gradient(
    ellipse 60% 45% at 50% 0%,
    rgba(56, 189, 248, 0.08) 0%,
    rgba(37, 99, 235, 0.03) 45%,
    transparent 75%
  );
}

/* Masked kinetic text reveal wrapper */
.reveal-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.reveal-line {
  display: inline-block;
  will-change: transform, opacity;
}

/* Rotating hero category ticker */
.ticker-word {
  display: inline-block;
  transition: opacity 0.32s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ticker-word.is-exiting {
  opacity: 0;
  transform: translateY(-14px);
}

.ticker-word.is-entering {
  opacity: 0;
  transform: translateY(14px);
}

/* 3D Card & 3D Animated Outline System */
.card-3d-scene {
  perspective: 1100px;
}

.card-3d {
  position: relative;
  transform-style: preserve-3d;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow:
    0 14px 36px -18px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.28s ease,
    box-shadow 0.32s ease,
    background-color 0.28s ease;
  will-change: transform;
}

/* Animated 3D outline ring around card */
.card-3d::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    var(--outline-angle, 135deg),
    rgba(125, 211, 252, 0.55) 0%,
    rgba(56, 189, 248, 0.14) 35%,
    rgba(255, 255, 255, 0.04) 65%,
    rgba(37, 99, 235, 0.5) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.42;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Subtle cursor-reactive card inner sheen */
.card-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(56, 189, 248, 0.11),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-3d:hover {
  background-color: #141419;
  box-shadow:
    0 24px 48px -20px rgba(0, 0, 0, 0.92),
    0 0 26px -12px rgba(56, 189, 248, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.card-3d:hover::before {
  opacity: 0.95;
  animation: outline-orbit 3.2s linear infinite;
}

.card-3d:hover::after {
  opacity: 1;
}

.card-3d-content {
  transform: translateZ(18px);
}

@keyframes outline-orbit {
  0% {
    --outline-angle: 0deg;
  }
  100% {
    --outline-angle: 360deg;
  }
}

@property --outline-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 135deg;
}

/* Gradient Carousel Card styling */
.skill-carousel-card {
  background: var(--card-gradient);
}

/* Toned-down blue (less blue / slate-steel) filter buttons with clean motion */
.filter-btn {
  position: relative;
  border: 1px solid transparent;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.24s ease,
    border-color 0.24s ease,
    color 0.24s ease,
    box-shadow 0.24s ease;
}

.filter-btn:hover {
  transform: translateY(-2px);
}

.filter-btn:active {
  transform: scale(0.97);
}

.filter-btn.is-active {
  background-color: #1e293b;
  border-color: rgba(148, 163, 184, 0.38);
  color: #f8fafc;
  box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.9);
}

/* Reel card aspect & hover */
.reel-media-wrap {
  aspect-ratio: 9 / 16;
  background-color: #0d0d10;
}

.reel-card:hover .reel-poster {
  transform: scale(1.03);
}

.reel-poster {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

/* Hide carousel scrollbar cleanly while preserving scroll */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Glowing green WhatsApp CTA */
.whatsapp-glow-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow:
    0 0 28px rgba(34, 197, 94, 0.45),
    0 10px 25px -10px rgba(22, 163, 74, 0.7);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, filter 0.25s ease;
}

.whatsapp-glow-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 38px rgba(34, 197, 94, 0.65),
    0 14px 32px -10px rgba(22, 163, 74, 0.85);
  filter: brightness(1.05);
}

/* Custom slim page scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #09090b;
}

::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reel-poster,
  .card-3d,
  .ticker-word,
  .filter-btn,
  .whatsapp-glow-btn {
    transition: none !important;
    animation: none !important;
  }
  .card-3d:hover::before {
    animation: none !important;
  }
}
