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

:root {
  --bg: #050505;
  --bg-secondary: #0a0a0a;
  --surface: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108,92,231,0.4);
  --text: #f0f0f0;
  --text-secondary: #888;
  --text-muted: #555;
  --radius: 20px;
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== Particle Canvas ===== */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* ===== Loader ===== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -2px;
}
.loader-logo span { color: var(--accent); }
.loader-bar {
  width: 200px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.loader-progress {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
}
.loader-progress.animate {
  animation: loadBar 1.4s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes loadBar {
  0% { width: 0%; }
  60% { width: 75%; }
  100% { width: 100%; }
}

/* ===== Cursor ===== */
.cursor {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(108,92,231,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
  mix-blend-mode: difference;
}
.cursor.hover { width: 60px; height: 60px; border-color: var(--accent-light); }
.cursor-dot {
  position: fixed;
  width: 5px;
  height: 5px;
  background: var(--accent-light);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
}
@media (max-width: 992px) {
  .cursor, .cursor-dot { display: none; }
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: var(--transition);
}
.header.scrolled {
  padding: 1rem 0;
  background: rgba(5,5,5,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.header.nav-hidden { transform: translateY(-100%); }

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
}
.logo span { color: var(--accent); }

.menu { display: flex; gap: 2.5rem; }

.menu li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}
.menu li a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}
.menu li a:hover { color: var(--text); }
.menu li a:hover::after, .menu li a.active::after { width: 100%; }
.menu li a.active { color: var(--text); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}
.hamburger span {
  width: 24px; height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .menu {
    position: fixed; top: 0; right: -100%;
    width: 100%; height: 100vh;
    background: rgba(5,5,5,0.97);
    backdrop-filter: blur(30px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: var(--transition);
  }
  .menu.active { right: 0; }
  .menu li a { font-size: 1.2rem; }
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 0 5%;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-text { flex: 1; max-width: 620px; }

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--accent-light);
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.3s forwards;
}

.hero-text h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3.5rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -3px;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.5s forwards;
}

.hero-text h2 {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.7s forwards;
}
.typing-wrapper #element {
  color: var(--accent-light);
  font-weight: 600;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.9s forwards;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s ease 1.1s forwards;
}

/* Hero Image */
.hero-image {
  flex-shrink: 0;
  position: relative;
  opacity: 0;
  animation: fadeUp 1s ease 0.6s forwards;
}
.hero-image-wrapper {
  width: 320px; height: 400px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-image-wrapper::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent), transparent 60%);
  border-radius: calc(var(--radius) + 2px);
  z-index: -1;
}
.hero-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  filter: grayscale(20%);
  transition: filter 0.6s ease;
}
.hero-image:hover img { filter: grayscale(0%); }

@media (max-width: 992px) {
  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 120px;
  }
  .hero-desc { margin-inline: auto; }
  .hero-buttons { justify-content: center; }
  .hero-image-wrapper { width: 250px; height: 300px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  overflow: hidden;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-hover);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(108,92,231,0.08);
  transform: translateY(-3px);
}

/* ===== Sections ===== */
.section-label {
  font-size: 0.8rem;
  color: var(--accent-light);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 1rem;
}
.section-subtitle {
  color: var(--text-muted);
  max-width: 550px;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 4rem;
}
.section-header-center {
  text-align: center;
}
.section-header-center .section-subtitle {
  margin-inline: auto;
}

/* ===== About ===== */
.about {
  padding: 120px 0;
  position: relative;
  z-index: 1;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.stat-item {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  transition: all 0.4s ease;
}
.stat-item:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(108,92,231,0.1);
}
.stat-item .number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-item .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Skills */
.about-skills h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  margin-bottom: 2rem;
  letter-spacing: -0.5px;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.skill-chip:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(108,92,231,0.08);
  transform: translateY(-2px);
}
.skill-chip .skill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

@media (max-width: 992px) {
  .about-content { grid-template-columns: 1fr; gap: 3rem; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .about-stats { grid-template-columns: 1fr; }
}

/* ===== Projects ===== */
.projects {
  padding: 120px 0;
  position: relative;
  z-index: 1;
}

.projects-scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 2rem 0 3rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.projects-scroll::-webkit-scrollbar { display: none; }

.project-card {
  flex: 0 0 380px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16,1,0.3,1);
  cursor: pointer;
  position: relative;
}
.project-card:hover {
  border-color: rgba(108,92,231,0.3);
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(108,92,231,0.08);
}

.project-image {
  height: 220px;
  overflow: hidden;
  position: relative;
}
.project-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
  filter: brightness(0.9);
}
.project-card:hover .project-image img {
  transform: scale(1.08);
  filter: brightness(1);
}
.project-image::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  pointer-events: none;
}

.project-info { padding: 1.5rem; }
.project-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}
.project-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.project-tags span {
  padding: 0.25rem 0.7rem;
  background: rgba(108,92,231,0.1);
  color: var(--accent-light);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(108,92,231,0.2);
}

.project-links { display: flex; gap: 0.8rem; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}
.project-link:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  background: rgba(108,92,231,0.08);
}
.project-link svg { width: 14px; height: 14px; }

/* Scroll indicator */
.scroll-indicator {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.scroll-track {
  flex: 1;
  max-width: 200px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.scroll-thumb {
  width: 30%;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.2s ease;
}

@media (max-width: 768px) {
  .project-card { flex: 0 0 320px; }
}

/* ===== Contact ===== */
.contact {
  padding: 120px 0;
  position: relative;
  z-index: 1;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
}

.contact-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 1rem;
}
.contact-info > p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.contact-item svg {
  width: 20px; height: 20px;
  color: var(--accent-light);
  flex-shrink: 0;
}

.social-links { display: flex; gap: 0.8rem; }
.social-link {
  width: 44px; height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.social-link:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(108,92,231,0.15);
}
.social-link svg { width: 18px; height: 18px; }

/* Form */
.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  backdrop-filter: blur(10px);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: rgba(255,255,255,0.02);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  background: rgba(108,92,231,0.05);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 130px; }

.error-message {
  font-size: 0.8rem;
  color: #e74c3c;
  margin-top: 0.4rem;
  min-height: 1rem;
}
.form-group.error input,
.form-group.error textarea { border-color: #e74c3c; }

.contact-form .btn { width: 100%; justify-content: center; }

@media (max-width: 992px) {
  .contact-content { grid-template-columns: 1fr; gap: 3rem; }
}

/* ===== Footer ===== */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-content p {
  color: var(--text-muted);
  font-size: 0.85rem;
}
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  z-index: 999;
  cursor: pointer;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-3px);
}
.back-to-top svg { width: 20px; height: 20px; }

/* ===== Reveal Animations ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Divider ===== */
.section-divider {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 2rem;
  border-radius: 2px;
}
.section-header-center .section-divider {
  margin-inline: auto;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* ===== Grain Overlay ===== */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}
