/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1629;
  --bg-card: rgba(15, 22, 41, 0.6);
  --text-primary: #f0f2f8;
  --text-secondary: #c0c6d2;
  --accent-blue: #4e7cff;
  --accent-violet: #7c3aed;
  --accent-cyan: #06d6a0;
  --glow-blue: rgba(78, 124, 255, 0.4);
  --glow-violet: rgba(124, 58, 237, 0.3);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'DM Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  overflow-x: hidden;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--accent-cyan);
}

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

/* ========================================
   Aurora Canvas Background
   ======================================== */
#star-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ========================================
   Aurora Gradient (Hero background)
   ======================================== */
.aurora {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(124, 58, 237, 0.18), transparent),
    radial-gradient(ellipse 70% 50% at 70% 80%, rgba(78, 124, 255, 0.15), transparent);
  background-size: 200% 200%;
  animation: auroraShift 12s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% {
    background-position: 0% 0%;
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    background-position: 100% 100%;
    opacity: 0.8;
  }
}

/* ========================================
   Navbar
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.navbar.scrolled {
  background: rgba(10, 14, 26, 0.92);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-logo {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: lowercase;
  letter-spacing: 0.3px;
  position: relative;
  padding: 0.25rem 0;
}

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

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.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);
}

/* ========================================
   Sections
   ======================================== */
section {
  position: relative;
  z-index: 1;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 2.5rem;
  color: var(--text-primary);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 50%, var(--accent-violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--text-secondary);
  min-height: 2rem;
}

.hero-tagline .cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent-blue);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: gentleBounce 2.5s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-blue);
  fill: none;
  stroke-width: 2;
}

@keyframes gentleBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ========================================
   About Section
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

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

.about-text p:last-child {
  margin-bottom: 0;
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.detail-card:hover {
  border-color: rgba(78, 124, 255, 0.2);
  box-shadow: 0 0 20px rgba(78, 124, 255, 0.08);
}

.detail-card h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-blue);
  margin-bottom: 0.4rem;
}

.detail-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========================================
   Projects Section
   ======================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet));
  opacity: 0;
  transition: opacity 0.35s;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(78, 124, 255, 0.25);
  box-shadow: 0 8px 40px rgba(78, 124, 255, 0.1), 0 0 60px rgba(124, 58, 237, 0.06);
}

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

.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(78, 124, 255, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(78, 124, 255, 0.15);
}

.project-link {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.project-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.3s;
}

.project-link:hover svg {
  transform: translate(2px, -2px);
}

/* ========================================
   Blog Section
   ======================================== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  text-decoration: none;
}

.blog-item:hover {
  transform: translateX(6px);
  border-color: rgba(78, 124, 255, 0.2);
  box-shadow: 0 4px 24px rgba(78, 124, 255, 0.08);
}

.blog-item-content {
  flex: 1;
  min-width: 0;
}

.blog-item h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.blog-item .blog-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========================================
   Contact Section
   ======================================== */
.contact-content {
  text-align: center;
}

.contact-content > p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent-blue);
  display: inline-block;
  margin-bottom: 2.5rem;
  position: relative;
}

.contact-email::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-blue);
  opacity: 0.3;
  transition: opacity 0.3s;
}

.contact-email:hover::after {
  opacity: 1;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.social-links a {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.social-links a:hover {
  color: var(--accent-blue);
  border-color: rgba(78, 124, 255, 0.3);
  box-shadow: 0 0 20px rgba(78, 124, 255, 0.15);
  transform: translateY(-2px);
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--glass-border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ========================================
   Scroll Reveal Animations
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(10, 14, 26, 0.97);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    border-left: 1px solid var(--glass-border);
  }

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

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .blog-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .section-inner {
    padding: 4rem 1.25rem;
  }

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

  /* Disable aurora animation on mobile */
  .aurora {
    animation: none;
    opacity: 0.7;
  }

  .detail-card,
  .project-card,
  .blog-item {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(15, 22, 41, 0.7);
  }

  .navbar {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

@media (max-width: 480px) {
  .contact-email {
    font-size: 1rem;
  }

  .section-heading {
    font-size: 1.5rem;
  }
}
