/* ========================
   JAMES DEEP - PORTFOLIO
   Design System & Shared CSS
======================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@400;700;900&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ========================
   CSS VARIABLES
======================== */
:root {
  --primary: #6c63ff;
  --primary-dark: #4b44cc;
  --secondary: #00d9ff;
  --accent: #ff6b6b;
  --accent2: #ffd166;
  --text: #e8eaf6;
  --text-muted: #9da3c0;
  --bg: #0a0b1a;
  --bg-2: #0f1028;
  --bg-3: #141535;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.09);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(108, 99, 255, 0.3);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 70px;
}

/* ========================
   RESET & BASE
======================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ========================
   SCROLLBAR
======================== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}

/* ========================
   PAGE TRANSITION OVERLAY
======================== */
#page-transition {
  position: fixed;
  inset: 0;
  background: var(--primary);
  z-index: 9999;
  transform: translateY(100%);
  pointer-events: none;
}

/* ========================
   NAVBAR
======================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(10, 11, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo .logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 10px var(--accent2);
  animation: pulse 2s infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition);
  letter-spacing: 0.02em;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white !important;
  transition: var(--transition) !important;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 99, 255, 0.6) !important;
}

.nav-cta::after {
  display: none !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

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

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

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

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 26, 0.97);
  backdrop-filter: blur(20px);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu a {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}

.mobile-menu a:hover {
  color: var(--primary);
}

/* ========================
   SECTION LAYOUT
======================== */
.section {
  padding: 100px 5%;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 70px;
}

.section-tag {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text), #a0a8d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  max-width: 550px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ========================
   GLASS CARD
======================== */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.glass-card:hover {
  background: var(--glass-hover);
  border-color: rgba(108, 99, 255, 0.3);
  box-shadow: var(--shadow), 0 0 30px rgba(108, 99, 255, 0.15);
  transform: translateY(-4px);
}

/* ========================
   GRADIENT TEXT
======================== */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================
   BUTTONS
======================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(108, 99, 255, 0.6);
}

.btn-outline {
  border: 2px solid var(--glass-border);
  color: var(--text);
  background: var(--glass);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(108, 99, 255, 0.2);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), #0090aa);
  color: #0a0b1a;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 217, 255, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 217, 255, 0.5);
}

/* ========================
   SKILL TAGS
======================== */
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.skill-tag:hover {
  background: rgba(108, 99, 255, 0.2);
  border-color: var(--primary);
  color: var(--text);
  transform: translateY(-2px);
}

/* ========================
   FOOTER
======================== */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--glass-border);
  padding: 60px 5% 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.8;
  max-width: 280px;
}

.footer-brand .footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--primary);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 0.8rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
  color: var(--text-muted);
}

.social-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.4);
}

/* ========================
   ANIMATED BACKGROUND BLOBS
======================== */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 15s ease-in-out infinite alternate;
  will-change: transform;
}

.bg-blob-1 {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -200px;
  left: -200px;
  animation-duration: 12s;
}

.bg-blob-2 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  top: 50%;
  right: -150px;
  animation-duration: 18s;
  animation-delay: -5s;
}

.bg-blob-3 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  bottom: 10%;
  left: 20%;
  animation-duration: 20s;
  animation-delay: -10s;
}

/* ========================
   ANIMATIONS
======================== */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.8);
  }
}

@keyframes blobFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(50px, 30px) scale(1.1);
  }

  100% {
    transform: translate(-30px, 60px) scale(0.95);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes typewriter {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/* ========================
   PARTICLES CANVAS
======================== */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ========================
   DIVIDERS
======================== */
.section-divider {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  margin: 0.5rem auto 0;
}

/* ========================
   GRID UTILITIES
======================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

/* ========================
   RESPONSIVE
======================== */
.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  /* Reduce padding on mobile */
  .section {
    padding: 60px 5%;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .footer-brand {
    display: none;
  }

  .footer-col h4 {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .footer-col a {
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* Disable expensive glass blur on mobile for speed */
  .glass-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.07);
  }

  .navbar.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 11, 26, 0.95);
  }

  /* Hide blobs on mobile */
  .bg-blob {
    display: none;
  }

  /* Hero mobile layout — in-flow compact photo below text */
  .hero-visual {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    padding: 0;
  }

  .hero-photo-wrap img {
    width: 180px !important;
    height: 220px !important;
  }

  .hero-photo-wrap .floating-card {
    display: none !important;
  }

  /* Page hero less height on mobile */
  .page-hero {
    min-height: 35vh !important;
  }

  /* Footer social center */
  .footer-brand .social-links {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 50px 4%;
  }

  .section-header {
    margin-bottom: 30px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.88rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-photo-wrap img {
    width: 220px !important;
    height: 270px !important;
  }
}

/* ========================
   AOS OVERRIDES
======================== */
[data-aos] {
  will-change: transform, opacity;
}

/* ========================
   AOS SAFETY FALLBACK
   Prevents invisible content if AOS
   doesn't fire (file:// protocol, etc.)
======================== */
body.aos-ready [data-aos]:not(.aos-animate) {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Reduce motion for accessibility / low-power */
@media (prefers-reduced-motion: reduce) {

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

  .bg-blob {
    animation: none;
  }
}