/* ============== BASE & RESET ============== */
:root {
  --bg-main: #0a0a0f;
  --bg-surface: rgba(19, 19, 26, 0.6);
  --bg-surface-elevated: rgba(26, 26, 36, 0.8);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --accent-1: #7c3aed;
  --accent-2: #06b6d4;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  cursor: none; /* Custom cursor */
}

body.loading {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  cursor: none;
}

button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-pad {
  padding: 100px 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
}

.dot {
  color: var(--accent-2);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============== GLASSMORPHISM ============== */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* ============== CUSTOM CURSOR ============== */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  background: var(--accent-2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-trail {
  position: fixed;
  top: 0; left: 0;
  width: 40px; height: 40px;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9998;
  transition: width 0.2s, height 0.2s, border-color 0.2s, transform 0.1s ease-out;
}

.cursor.hover {
  width: 16px; height: 16px;
  background: var(--accent-1);
}

.cursor-trail.hover {
  width: 60px; height: 60px;
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.1);
}

/* ============== PRELOADER ============== */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 10000;
  display: grid;
  place-items: center;
  transition: opacity 0.8s ease-out, visibility 0.8s;
}

.loader-content {
  text-align: center;
}

.glitch {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  position: relative;
  letter-spacing: 4px;
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin: 20px auto 0;
  overflow: hidden;
  border-radius: 2px;
}

.loader-progress {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.3s;
}

/* ============== NAVBAR ============== */
.navbar {
  position: fixed;
  top: 0; left: 0; width: 100%;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: background 0.3s, backdrop-filter 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.btn-primary-sm {
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-radius: 8px;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
}
.mobile-menu-btn span {
  width: 24px; height: 2px;
  background: #fff;
  transition: 0.3s;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(16px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mobile-nav.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav a {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
}

/* ============== HERO ============== */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.canvas-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.8;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none; /* Let clicks pass through to 3D scene */
}

.hero-content * {
  pointer-events: auto; /* Re-enable for content */
}

.hero-greet {
  color: var(--accent-2);
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: 2px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.8s forwards;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 1s forwards;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  height: 30px;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 20px;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 1.2s forwards;
}

.btn-primary, .btn-secondary {
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeUp 0.8s 1.5s forwards;
}

.mouse {
  width: 26px; height: 42px;
  border: 2px solid var(--text-secondary);
  border-radius: 20px;
  position: relative;
}

.mouse::before {
  content: '';
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px;
  background: var(--accent-2);
  border-radius: 2px;
  animation: scroll 1.5s infinite;
}

@keyframes scroll {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 15px); opacity: 0; }
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ============== ABOUT ============== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 60px;
  align-items: center;
}

.about-card {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: 20px;
  transform-style: preserve-3d;
}

.card-inner {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(20,20,30,0.8), rgba(10,10,15,0.9));
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  position: relative;
  display: grid; place-items: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

.profile-img-placeholder {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: translateZ(50px);
}

.card-glow {
  position: absolute;
  inset: -20px;
  background: conic-gradient(from 0deg, transparent, var(--accent-1), transparent, var(--accent-2), transparent);
  filter: blur(30px);
  opacity: 0.3;
  z-index: -1;
  animation: rotateGlow 10s linear infinite;
}

@keyframes rotateGlow {
  100% { transform: rotate(360deg); }
}

.about-text h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--accent-2);
}

.about-text p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.stats-row {
  display: flex;
  gap: 40px;
}

.stat-item h4 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.stat-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============== SKILLS ============== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.skill-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: border-color 0.3s, background 0.3s;
}

.skill-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  background: var(--bg-surface-elevated);
}

.skill-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-1);
  display: grid; place-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
}

.skill-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}

.skill-progress {
  height: 100%;
  width: 0; /* Animated via JS */
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 3px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============== PROJECTS ============== */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.project-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}

.project-card:nth-child(even) {
  grid-template-columns: 1fr 1.2fr;
}

.project-card:nth-child(even) .browser-mockup {
  order: 2;
}

.browser-mockup {
  background: #1e1e28;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transform-style: preserve-3d;
}

.browser-dots {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.browser-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.browser-dots span:nth-child(1) { background: #ff5f56; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:nth-child(3) { background: #27c93f; }

.project-img {
  width: 100%;
  height: auto;
  transform: translateZ(30px);
}

.project-info {
  padding: 40px;
}

.project-info h3 {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 15px;
}

.project-info p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.tags {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tags span {
  font-size: 0.85rem;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  color: var(--accent-2);
}

.project-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-outline {
  padding: 10px 24px;
  border: 1px solid var(--accent-1);
  border-radius: 8px;
  font-weight: 500;
  transition: 0.3s;
}

.btn-outline:hover {
  background: rgba(124, 58, 237, 0.1);
}

.btn-text {
  font-weight: 500;
  color: var(--text-secondary);
  transition: 0.3s;
}

.btn-text:hover {
  color: var(--text-primary);
}

/* ============== TIMELINE ============== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(255,255,255,0.1);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: 50%;
  position: relative;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(30px);
  transition: 0.6s ease-out;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: 50%;
}

.timeline-dot {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 4px solid var(--accent-2);
  z-index: 2;
  box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-content {
  width: 90%;
  padding: 30px;
}

.timeline-date {
  font-weight: 600;
  color: var(--accent-1);
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: block;
}

.timeline-content h3 {
  margin-bottom: 10px;
}

.timeline-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============== CONTACT ============== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.contact-info h3 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px 20px;
  transition: 0.3s;
}

.social-item:hover {
  background: var(--bg-surface-elevated);
  transform: translateX(5px);
  border-color: rgba(6, 182, 212, 0.4);
}

.social-icon {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-1);
}

.contact-form {
  padding: 40px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  transition: 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(0,0,0,0.4);
}

.w-full {
  width: 100%;
}

/* ============== FOOTER ============== */
.footer {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 40px 0;
  margin-top: 50px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 10px;
}

.footer-links {
  display: flex;
  gap: 30px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: 0.3s;
}

.footer-links a:hover {
  color: var(--accent-2);
}

/* ============== RESPONSIVE ============== */
@media (max-width: 1024px) {
  .hero-title { font-size: 4rem; }
  .about-grid { grid-template-columns: 1fr; }
  .about-card { max-width: 400px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .nav-links, .btn-primary-sm { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero-title { font-size: 3rem; }
  .projects-grid { gap: 60px; }
  .project-card, .project-card:nth-child(even) { grid-template-columns: 1fr; }
  .project-card:nth-child(even) .browser-mockup { order: 0; }
  .timeline::before { left: 20px; }
  .timeline-dot { left: 20px; }
  .timeline-item, .timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-left: 50px;
    padding-right: 0;
  }
  .timeline-content { width: 100%; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; gap: 20px; text-align: center; }
}

@media (max-width: 375px) {
  .hero-title { font-size: 2.5rem; }
  .section-pad { padding: 60px 0; }
  .stats-row { flex-direction: column; gap: 20px; }
}

.profile-photo { width:100%; height:100%; object-fit:cover; object-position:58% 72%; transform:translateZ(50px) scale(1.5); transform-origin:100% 100%; }
.profile-photo-label { position:absolute; left:18px; right:18px; bottom:18px; z-index:2; padding:12px 14px; border:1px solid rgba(255,255,255,.18); border-radius:12px; background:rgba(8,9,16,.62); backdrop-filter:blur(10px); color:#f4f4f5; font:500 13px Inter,sans-serif; letter-spacing:.06em; transform:translateZ(70px); }

