/* Modernized Bento Design */

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Stack vertically */
  padding: 0;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Effects */
.bg-glow-1 {
  position: fixed;
  top: -20%;
  left: -20%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  opacity: 0.15;
  filter: blur(100px);
  z-index: -1;
  animation: float 20s infinite ease-in-out;
}

.bg-glow-2 {
  position: fixed;
  bottom: -20%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%);
  opacity: 0.15;
  filter: blur(80px);
  z-index: -1;
  animation: float 15s infinite ease-in-out reverse;
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(50px, 50px);
  }
}

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

body.light-mode .text-gradient {
  background: var(--text-gradient-light);
  -webkit-background-clip: text;
  background-clip: text;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Bento Grid Layout */
.bento-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, minmax(200px, auto));
  gap: var(--space-md);
  /* Reduced gap slightly for density */
  width: 100%;
  max-width: 1600px;
  /* Constrained Wide Width */
  margin: 0 auto;
  /* Center the grid */
  padding: var(--space-md);
  /* Minimal safety padding */
  min-height: 100vh;
  /* Allow growth */
  padding-top: 100px;
  /* Space for fixed navbar */
  padding-bottom: var(--space-xl);
  /* Space for scrolling */
  box-sizing: border-box;
  flex: 1;
  /* Push footer down */
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(5, 5, 5, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-glass);
}

.hamburger {
  display: none;
  font-size: 2rem;
  color: var(--text-main);
  cursor: pointer;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 1;
  /* Allow menu to take available space */
  justify-content: flex-end;
  /* Default right align */
}

/* Center links on desktop - REVERTED to Right Align */
@media (min-width: 769px) {
  .nav-links {
    margin: 0;
    /* Reset margin */
    margin-left: auto;
    /* Push to right if needed, though nav-menu handles it */
  }
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    /* Below navbar */
    left: 0;
    width: 100%;
    background: var(--bg-color);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .nav-menu.active {
    transform: translateY(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
}

body.light-mode .navbar {
  background: rgba(240, 242, 245, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .nav-logo {
  color: #000;
}

body.light-mode .nav-links a {
  color: #444;
}

body.light-mode .nav-links a:hover {
  color: #000;
}

body.light-mode .theme-btn {
  color: #444;
}

body.light-mode .theme-btn:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .theme-btn.active {
  background: #000;
  color: #fff;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

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

/* Theme Selector */
.theme-selector {
  display: flex;
  gap: 0.5rem;
  background: var(--surface-glass);
  padding: 4px;
  border-radius: 100px;
  border: 1px solid var(--border-glass);
}

.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.theme-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.theme-btn.active {
  background: var(--text-main);
  color: var(--bg-color);
}

/* Footer */
.footer {
  margin-top: auto;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  border-top: 1px solid var(--border-glass);
  border-top: 1px solid var(--border-glass);
  background: var(--footer-bg);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-link:hover {
  color: #000;
  background: #fff;
  border-color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.separator {
  display: none;
  /* Hide separator as we use buttons now */
}

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

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.footer-socials a {
  color: var(--text-main);
  font-size: 1.2rem;
  transition: color 0.3s;
}

.footer-socials a:hover {
  color: var(--accent-purple);
}



/* Card Base Styles */
.bento-card {
  background: var(--surface-glass);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.bento-card:hover {
  background: var(--surface-glass-hover);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

/* Specific Cards */
.hero-card {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: center;
  align-items: center;
  /* Center content horizontally */
  text-align: center;
  /* Ensure text is centered */
  padding: var(--space-xl);
}

.status-pill {
  position: absolute;
  top: var(--space-lg);
  left: var(--space-lg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  font-size: var(--small-size);
  border: 1px solid var(--border-glass);
  z-index: 10;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  background: #00FF41;
  border-radius: 50%;
  box-shadow: 0 0 5px #00FF41;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.cursor {
  animation: blink 1s infinite;
  color: var(--accent-purple);
}

.hero-subtitle {
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  max-width: 90%;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  /* Center buttons */
}

.btn-primary {
  padding: 12px 24px;
  background: var(--text-main);
  color: var(--bg-color);
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
}

.btn-primary:hover {
  transform: scale(1.05);
}

.btn-glass {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-radius: 100px;
  text-decoration: none;
  border: 1px solid var(--border-glass);
  transition: background 0.2s;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bio-card {
  grid-column: span 1;
  grid-row: span 2;
  align-items: center;
  text-align: center;
  justify-content: center;
}

.profile-img-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: var(--space-md);
  border: 2px solid var(--border-glass);
  box-shadow: 0 0 20px rgba(123, 44, 191, 0.3);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bio-text h3 {
  font-family: var(--font-display);
  font-size: var(--h3-size);
  margin-bottom: var(--space-xs);
}

.bio-text p {
  color: var(--text-muted);
  font-size: var(--small-size);
  margin-bottom: var(--space-md);
}

.location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--small-size);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 100px;
}

.map-card {
  grid-column: span 1;
  grid-row: span 1;
  padding: 0;
}

.map-bg {
  width: 100%;
  height: 100%;
  background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=1000&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.map-card:hover .map-bg {
  opacity: 0.8;
}

.card-arrow {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.card-arrow:hover {
  background: var(--text-main);
  color: var(--bg-color);
  transform: rotate(-45deg);
}

.card-label {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding: 6px 12px;
  border-radius: 100px;
  font-size: var(--small-size);
  border: 1px solid var(--border-glass);
}

.social-card {
  grid-column: span 1;
  grid-row: span 1;
  justify-content: center;
  align-items: center;
}

.social-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.social-links a {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border-glass);
}

.social-links a:hover {
  background: var(--text-main);
  color: var(--bg-color);
}

.work-card {
  grid-column: span 2;
  grid-row: span 2;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: var(--h3-size);
}

.link-arrow {
  font-size: var(--small-size);
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  overflow-y: auto;
  max-height: 300px;
  padding-right: 8px;
  /* Increased padding for scrollbar space */
  scrollbar-width: thin;
  /* Firefox */
  scrollbar-color: var(--accent-purple) transparent;
  /* Firefox */
}

.project-list::-webkit-scrollbar {
  width: 6px;
  /* Slightly wider */
}

.project-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.project-list::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
  transition: background 0.3s;
}

.project-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
  /* match theme on hover */
}

.project-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: background 0.2s;
  cursor: pointer;
}

.project-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.project-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: #222;
}

.project-info h3 {
  font-size: 1rem;
  font-weight: 500;
}

.project-info p {
  font-size: var(--small-size);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: var(--text-muted);
  border: 1px solid var(--border-glass);
}

.project-arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s;
}

.project-item:hover .project-arrow {
  opacity: 1;
  transform: translateX(0);
}

.stack-card {
  grid-column: span 2;
  grid-row: span 1;
  overflow: hidden;
  padding: 0;
}

.stack-card .card-header {
  padding: var(--space-lg);
  margin-bottom: 0;
}

.stack-marquee {
  display: flex;
  padding: var(--space-md) 0;
  background: rgba(255, 255, 255, 0.02);
}

.marquee-content {
  display: flex;
  gap: var(--space-xl);
  animation: scroll 20s linear infinite;
  padding: 0 var(--space-xl);
}

.marquee-content i {
  font-size: 2rem;
  color: var(--text-muted);
}

.service-card {
  grid-column: span 1;
  grid-row: span 1;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
  color: var(--accent-purple);
}

/* Contact Form Card (Dynamic) */
.contact-form-card {
  grid-column: span 4;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(50px);
  margin-top: var(--space-md);
}

.contact-form-wrapper {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(123, 44, 191, 0.1);
}

.form-submit-btn {
  padding: 16px 32px;
  background: var(--text-main);
  /* Match btn-primary */
  color: var(--bg-color);
  border: none;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-submit-btn:hover {
  transform: scale(1.05);
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 20000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-color);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-main);
}

/* Responsive */
@media (max-width: 1024px) {
  .bento-container {
    margin-top: 60px;
    grid-template-columns: 1fr;
    /* Single column */
    padding: var(--space-md);
  }

  .bento-card {
    grid-column: span 1 !important;
    /* Force all cards to span 1 column */
    grid-row: auto !important;
  }

  .hero-card {
    min-height: 400px;
  }

  .contact-form-card {
    grid-column: span 1 !important;
  }

  .bio-card {
    grid-column: span 2;
    grid-row: span 1;
    flex-direction: row;
    text-align: left;
    gap: var(--space-lg);
  }

  .profile-img-wrapper {
    margin-bottom: 0;
    width: 80px;
    height: 80px;
  }

  .work-card {
    grid-column: span 2;
  }

  .stack-card {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .bento-container {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-sm);
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .bio-card {
    flex-direction: column;
    text-align: center;
  }

  .theme-toggle-btn {
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  /* Mobile Spacing Fixes */
  .hero-card {
    margin-top: 2rem;
    /* Clear navbar */
    padding-top: 4rem;
    /* Space for pill */
  }

  /* Smaller Mobile Buttons */
  .btn-primary,
  .btn-glass {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .status-pill {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: 1rem;
    display: inline-flex;
    transform: none;
  }

  .hero-title {
    margin-top: 0;
  }
}