/* ==========================================================================
   NAYEEM PORTFOLIO — DESIGN SYSTEM
   Dark mode, glassmorphism, cyan → purple accent gradient
   ========================================================================== */

:root {
  --color-bg: #0a0f1e;
  --color-bg-alt: #0d1526;
  --color-accent: #1E8EB3;
  --color-accent-2: #16407a;
  --color-text: #e5e7eb;
  --color-text-dim: #9ca3af;
  --color-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius: 1.25rem;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Poppins', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: radial-gradient(circle at 20% 0%, #16213e 0%, var(--color-bg) 45%, #0a0f1e 100%);
  color: var(--color-text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/* Native cursor is only hidden on pages that render the custom glow cursor
   (they add this class to <body>). Without it — e.g. login/dashboard — the
   real cursor stays visible instead of vanishing. */
body.has-custom-cursor {
  cursor: none;
}

@media (max-width: 768px) {
  body.has-custom-cursor { cursor: auto; }
}

/* ---------- Marquee ticker ---------- */
.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 26s linear infinite;
}
.marquee-track span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0 2rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-dim);
}
.marquee-track span i {
  color: var(--color-accent);
  font-size: 0.7rem;
  margin-right: 2rem;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

h1, h2, h3, h4, .font-display { font-family: var(--font-display); }

/* ---------- Profile avatar ---------- */
.avatar-ring {
  position: relative;
  border-radius: 9999px;
  padding: 4px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  flex-shrink: 0;
}
.avatar-ring img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
  background: var(--color-bg-alt);
}
.avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: var(--color-bg-alt);
  color: var(--color-accent);
}

/* ---------- Gradient text / accent utilities ---------- */
.text-gradient {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glow-btn {
  position: relative;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  color: #04141a;
  font-weight: 600;
  box-shadow: 0 0 25px rgba(30, 142, 179, 0.35);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.glow-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(22, 64, 122, 0.5);
}

.outline-btn {
  border: 1px solid var(--glass-border);
  color: var(--color-text);
  backdrop-filter: blur(10px);
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.outline-btn:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 20px rgba(30, 142, 179, 0.25);
  transform: translateY(-3px);
}

/* ---------- Glass card ---------- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease, box-shadow 0.5s ease;
}
.glass-card:hover {
  transform: translateY(-10px);
  border-color: rgba(30, 142, 179, 0.35);
  box-shadow: 0 20px 60px -20px rgba(30, 142, 179, 0.25);
}

.gradient-border {
  position: relative;
  border-radius: var(--radius);
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--color-accent), transparent 40%, var(--color-accent-2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Custom cursor ---------- */
#cursor-dot, #cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
#cursor-dot { width: 6px; height: 6px; background: var(--color-accent); }
#cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(30, 142, 179, 0.6);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.cursor-hover #cursor-ring {
  width: 56px; height: 56px;
  background: rgba(30, 142, 179, 0.08);
  border-color: var(--color-accent-2);
}
@media (max-width: 768px) {
  #cursor-dot, #cursor-ring { display: none; }
}

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--color-border);
}
.nav-link { position: relative; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0%; height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: #fff; }

/* ---------- Scroll progress bar ---------- */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  z-index: 9998;
  box-shadow: 0 0 12px rgba(30, 142, 179, 0.8);
}

/* ---------- Section right-side scroll indicator ---------- */
#section-dots {
  position: fixed;
  right: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}
.section-dot.active {
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
  transform: scale(1.4);
}
@media (max-width: 1024px) { #section-dots { display: none; } }

/* ---------- Skill chip / progress ---------- */
.skill-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); }
.skill-bar-track { background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; height: 6px; }
.skill-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-2));
  width: 0%;
  transition: width 1.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0;
  background: var(--color-bg);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hide { opacity: 0; visibility: hidden; }
.loader-ring {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--color-accent);
  border-right-color: var(--color-accent-2);
  animation: loader-spin 0.9s linear infinite;
}
@keyframes loader-spin { to { transform: rotate(360deg); } }

/* ---------- Reveal animation base state (GSAP takes over) ---------- */
.reveal-up { opacity: 0; transform: translateY(60px); }
.reveal-fade { opacity: 0; }

/* ---------- Canvas background ---------- */
#bg-canvas { position: fixed; inset: 0; z-index: -1; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--color-accent), var(--color-accent-2)); border-radius: 10px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.2,0.9,0.3,1);
}
#toast.show { transform: translateY(0); }

/* ---------- Utility ---------- */
.section-eyebrow {
  letter-spacing: 4px;
  font-size: 0.75rem;
  color: var(--color-accent);
  font-family: var(--font-display);
}

/* ==========================================================================
   PROJECT CARD - Fixed visibility
   ========================================================================== */

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #101726;
  border: 1px solid rgba(255,255,255,.08);
  transition: .45s;
  display: block;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  opacity: 1 !important; /* Force show */
  transform: translateY(0) !important; /* Force show */
}

/* Force show all reveal elements */
.reveal-up {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Only apply animation if GSAP is available */
.gsap-ready .reveal-up {
  opacity: 0;
  transform: translateY(40px);
}

.project-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 30px 70px rgba(0,180,255,.18);
}

.project-image {
  position: relative;
  height: 320px;
  overflow: hidden;
  background: #000;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 1s;
}

.project-card:hover img {
  transform: scale(1.08);
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.75));
  opacity: 0;
  transition: .45s;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-overlay span {
  padding: 14px 32px;
  border-radius: 50px;
  background: #1E8EB3;
  color: white;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(30,142,179,.5);
}

.project-content {
  padding: 28px;
}

.project-category {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  color: #55D8FF;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.project-content h3 {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.project-content p {
  font-size: 15px;
  line-height: 1.8;
  color: #A6AFC3;
  margin-bottom: 24px;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-tech span {
  padding: 8px 18px;
  border-radius: 50px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
  color: #DDE6F5;
  transition: .35s;
}

.project-tech span:hover {
  background: #1E8EB3;
  color: white;
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* GPU Acceleration for all animated elements */
.project-card,
.glass-card,
img,
.reveal-up,
.reveal-fade {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Image loading optimization */
img {
  content-visibility: auto;
  contain: paint;
}

/* Reduce repaints */
.glass-card {
  contain: content;
}

/* Scroll performance */
body {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}