/* ============================================================
   PORTFOLIO — STYLE.CSS
   Modern dark portfolio with animations
   ============================================================ */

/* --- Reset & Custom Properties --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --surface: #16161f;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --accent: #a78bfa;
  --accent-dim: rgba(167, 139, 250, 0.15);
  --accent-glow: rgba(167, 139, 250, 0.3);
  --accent-secondary: #818cf8;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Spacing */
  --section-pad: clamp(80px, 10vh, 140px) 0;
  --container-w: 1100px;
  --nav-h: 72px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.5s;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul {
  list-style: none;
}

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

strong {
  color: var(--accent);
  font-weight: 600;
}

.container {
  width: min(var(--container-w), 90%);
  margin: 0 auto;
}


/* --- Animated Background --- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}

.bg-glow--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  top: -200px;
  right: -200px;
}

.bg-glow--2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  bottom: -150px;
  left: -150px;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(30px, -40px) scale(1.05); }
  50%      { transform: translate(-20px, 20px) scale(0.95); }
  75%      { transform: translate(15px, 35px) scale(1.02); }
}


/* --- Navigation --- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 60px);
  z-index: 100;
  transition: background var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease),
              backdrop-filter var(--duration) var(--ease);
}

#navbar.scrolled {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  box-shadow: 0 1px 0 var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.nav-logo .accent {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 36px;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s var(--ease);
}

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

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

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* --- Hero --- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
}

.hero-content {
  max-width: 720px;
}

.hero-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-dim);
  margin: 0 auto 24px;
  display: block;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.hero-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px var(--accent-glow);
}

.hero-greeting {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent-secondary) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.8;
}

/* Hero CTA */
.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
}

.btn-primary:hover {
  background: #b49bff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-hover);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.05rem;
  border-radius: 12px;
}

/* Hero Socials */
.hero-socials {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.3s var(--ease);
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-3px);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: fade-bounce 2.5s ease-in-out infinite;
}

.scroll-indicator span {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--text-dim);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.wheel {
  width: 3px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scroll-wheel 2s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0%       { opacity: 1; transform: translateY(0); }
  100%     { opacity: 0; transform: translateY(12px); }
}

@keyframes fade-bounce {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-6px); }
}


/* --- Hero text stagger animation --- */
.anim-text {
  opacity: 0;
  transform: translateY(30px);
  animation: text-up 0.8s var(--ease) forwards;
}
.anim-text:nth-child(1) { animation-delay: 0.1s; }
.anim-text:nth-child(2) { animation-delay: 0.25s; }
.anim-text:nth-child(3) { animation-delay: 0.4s; }
.anim-text:nth-child(4) { animation-delay: 0.55s; }
.anim-text:nth-child(5) { animation-delay: 0.7s; }
.anim-text:nth-child(6) { animation-delay: 0.85s; }

@keyframes text-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* --- Sections --- */
.section {
  position: relative;
  z-index: 1;
  padding: var(--section-pad);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
  letter-spacing: -1px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 16px auto 0;
}


/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 18px;
  font-size: 1.02rem;
}

.about-stats {
  display: grid;
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  transition: all 0.4s var(--ease);
}

.stat-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}


/* --- Skills --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.skill-card ul {
  position: relative;
  z-index: 1;
}

.skill-card li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 5px 0;
  transition: color 0.3s;
}

.skill-card:hover li {
  color: var(--text);
}


/* --- Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.project-card:hover::after {
  transform: scaleX(1);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.project-folder {
  color: var(--accent);
}

.project-links {
  display: flex;
  gap: 14px;
}

.project-links a {
  color: var(--text-dim);
  transition: color 0.3s, transform 0.3s;
}

.project-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  transition: color 0.3s;
}

.project-card:hover .project-title {
  color: var(--accent);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.project-tags li {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}


/* --- Contact --- */
.contact-content {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.contact-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 36px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn {
  align-self: center;
  margin-top: 8px;
}

.contact-or {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 20px 0 12px;
  position: relative;
}

.contact-or::before,
.contact-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: var(--border);
}

.contact-or::before {
  left: 0;
}

.contact-or::after {
  right: 0;
}


/* --- Footer --- */
#footer {
  position: relative;
  z-index: 1;
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  text-align: center;
}

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

.footer-sub {
  margin-top: 6px;
  font-size: 0.8rem !important;
  color: var(--text-dim) !important;
}


/* --- Reveal Animations (Intersection Observer) --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of projects grid */
.projects-grid .project-card.reveal:nth-child(1) { transition-delay: 0.05s; }
.projects-grid .project-card.reveal:nth-child(2) { transition-delay: 0.15s; }
.projects-grid .project-card.reveal:nth-child(3) { transition-delay: 0.25s; }
.projects-grid .project-card.reveal:nth-child(4) { transition-delay: 0.35s; }
.projects-grid .project-card.reveal:nth-child(5) { transition-delay: 0.45s; }
.projects-grid .project-card.reveal:nth-child(6) { transition-delay: 0.55s; }

/* Stagger skill cards */
.skills-grid .skill-card:nth-child(1) { transition-delay: 0.05s; }
.skills-grid .skill-card:nth-child(2) { transition-delay: 0.15s; }
.skills-grid .skill-card:nth-child(3) { transition-delay: 0.25s; }
.skills-grid .skill-card:nth-child(4) { transition-delay: 0.35s; }


/* --- Custom cursor glow (created via JS) --- */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}

body:hover .cursor-glow {
  opacity: 0.5;
}


/* --- Toast notification --- */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: #0a0a0f;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Style the email button to look like the social links */
button.social-link {
  cursor: pointer;
  font: inherit;
  background: none;
  color: var(--text-muted);
}


/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.3rem;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 2;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-controls {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px 20px;
  z-index: 2;
}

.lightbox-controls button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-controls button:hover {
  background: rgba(255, 255, 255, 0.12);
}

#zoom-level {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  min-width: 48px;
  text-align: center;
}

.lightbox-img-wrap {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.lightbox-img-wrap:active {
  cursor: grabbing;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  transition: transform 0.3s var(--ease);
  user-select: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 100px 40px 40px;
    gap: 28px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    border-left: 1px solid var(--border);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    letter-spacing: -1px;
  }
}

@media (max-width: 480px) {
  .about-stats {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
}
