:root {
  /* Cosmic Dark Theme */
  --bg-deep: #020617;
  /* Very deep blue-black */
  --bg-accent: #1e1b4b;
  /* Dark indigo */
  --card-bg: rgba(15, 23, 42, 0.6);
  --card-border: rgba(94, 234, 212, 0.1);
  /* Subtle teal glow border */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-cyan: #22d3ee;
  --accent-purple: #a855f7;

  /* Gradients */
  --gradient-bg: radial-gradient(circle at top right, #1e1b4b, #020617 60%);
  --gradient-text: linear-gradient(135deg, #22d3ee 0%, #a855f7 100%);

  /* Spacing & Radius */
  --radius-lg: 24px;
  --radius-md: 16px;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background: transparent;
  /* Moved to canvas */
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--bg-deep);
  background-image: var(--gradient-bg);
}

/* Ensure content sits above background */
.container,
footer {
  position: relative;
  z-index: 1;
}

/* Typography */
h1,
h2,
h3 {
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: 64px;
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 700;
}

h2 {
  font-size: 32px;
  margin-bottom: 40px;
  font-weight: 600;
  color: #ffffff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 16px;
  display: inline-block;
}

h3 {
  font-size: 20px;
  margin-bottom: 8px;
  font-weight: 600;
}

p {
  font-size: 16px;
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

/* Utilities */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: center;
  /* Centered by default */
  align-items: center;
  width: 100%;
  position: relative;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  padding: 0 16px;
  justify-content: center;
}

.nav-links li a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  /* Prevent wrapping */
}

.nav-socials {
  display: flex;
  gap: 16px;
  position: absolute;
  /* Position absolute to not affect centering of links if possible, or usually flex is better */
  right: 0;
}

/* Redefine for simple flex layout per user existing design but cleaner */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-socials {
  position: static;
  /* Reset */
}

.nav-links li a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

/* Hero Section */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  /* Left align for tech feel */
  padding-top: 80px;
}

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

.profile-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 32px;
  border: 2px solid var(--card-border);
}

.subtitle {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 16px;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.bento-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.2);
}

.bento-item:hover {
  transform: translateY(-8px);
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 48px rgba(34, 211, 238, 0.15);
}

/* Featured Project */
.col-span-12 {
  grid-column: span 12;
}

.col-span-8 {
  grid-column: span 8;
}

.col-span-6 {
  grid-column: span 6;
}

.col-span-4 {
  grid-column: span 4;
}

.project-feature {
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  min-height: 350px;
}

.project-feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
}

.feature-tag {
  width: fit-content;
  display: inline-block;
  padding: 6px 16px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 24px;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

.project-link-btn:hover {
  color: #f0f0f0;
}

.project-link-btn::after {
  content: '→';
  margin-left: 8px;
  transition: transform 0.2s;
}

.project-link-btn:hover::after {
  transform: translateX(4px);
}

/* Skills Cards */
.skill-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  color: var(--text-secondary);
}

.skill-card:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* Contact */
.contact-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-form {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

input,
textarea {
  width: 100%;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

button {
  padding: 16px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

/* Footer */
footer {
  padding: 60px 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
}

/* Responsiveness */
@media (max-width: 768px) {
  h1 {
    font-size: 40px;
    text-align: center;
  }

  .subtitle {
    font-size: 18px;
    text-align: center;
  }

  .hero-container {
    flex-direction: column !important;
    text-align: center !important;
    gap: 40px;
    padding-top: 80px !important;
  }

  .hero-content {
    max-width: 100%;
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  .hero-buttons {
    justify-content: center;
  }

  .bento-grid {
    display: flex;
    flex-direction: column;
  }

  /* Force full width on mobile */
  .col-span-12,
  .col-span-6,
  .col-span-4 {
    grid-column: span 12;
    width: 100%;
  }

  /* Project Cards Mobile */
  .project-card-row {
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
  }

  .project-content {
    padding: 24px !important;
  }

  .project-visual {
    position: relative !important;
    width: 100% !important;
    height: 250px !important;
  }

  /* Profile Pic Mobile */
  .profile-wrapper {
    width: 280px !important;
    height: 280px !important;
    order: -1;
    margin-bottom: 24px;
  }

  .profile-img {
    width: 280px !important;
    height: 280px !important;
  }

  .profile-border {
    width: 100% !important;
    height: 100% !important;
  }

  /* Mobile Navbar Overrides */
  .nav-links {
    gap: 16px !important;
    /* Smaller gap */
    padding: 0 !important;
  }

  .nav-links li a {
    font-size: 12px !important;
    /* Smaller text */
  }

  .nav-socials {
    gap: 12px !important;
    margin-left: 12px;
    /* Ensure collision safety */
  }
}

/* Extra small devices (phones, less than 370px) */
@media (max-width: 370px) {
  .nav-socials {
    display: none !important;
    /* Hide icons on very small screens to preserve menu */
  }

  .nav-links {
    width: 100%;
    justify-content: space-between !important;
  }
}

/* Utilities for Refactoring - Desktop Defaults */
.hero-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 140px 0;
}

.hero-buttons {
  margin-top: 48px;
  display: flex;
  gap: 24px;
}

.project-card-row {
  padding: 0;
  min-height: 400px;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.project-content {
  flex: 1;
  padding: 40px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-visual {
  position: absolute;
  top: 0;
  right: 0;
  width: 65%;
  height: 100%;
  z-index: 1;
}

.finance-visual-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
}

.finance-visual-box {
  width: 80%;
  height: 60%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}