:root {
  --bg-color: #f7f9fa;
  --white: #ffffff;
  --text-dark: #111827;
  --text-gray: #6b7280;
  --primary-blue: #6366f1;
  --accent-cyan: #0ea5e9;
  --primary-hover: #4f46e5;
  --border-light: #e5e7eb;
  
  --gradient-main: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
  
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 20px 40px rgba(99, 102, 241, 0.08);
  --shadow-btn: 0 8px 25px rgba(99, 102, 241, 0.35);
  
  --font-main: 'Poppins', sans-serif;
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --white: #1e293b;
  --text-dark: #f8fafc;
  --text-gray: #94a3b8;
  --border-light: #334155;
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 20px 40px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background floating shapes */
.bg-shape {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
}
.bg-large-white {
  background: var(--white);
  width: 900px;
  height: 900px;
  top: -200px;
  left: 50%;
  transform: translateX(-60%);
  filter: blur(100px);
}
.bg-orb {
  background: var(--white);
  box-shadow: var(--shadow-float);
}
.orb-1 { width: 40px; height: 40px; top: 15%; left: 10%; animation: float 6s infinite ease-in-out; }
.orb-2 { width: 25px; height: 25px; top: 40%; right: 15%; animation: float 5s infinite ease-in-out alternate; }
.orb-3 { width: 60px; height: 60px; bottom: -100px; left: 20%; filter: blur(5px); }

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0); }
}

/* Layout Utilities */
.site-wrapper {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 10;
}
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-3 { margin-bottom: 30px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-gray); }
.hidden { display: none !important; }

/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0;
  width: 100%;
}
.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
  margin-left: 50px;
}
.nav-btn {
  background: none;
  border: none;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-gray);
  cursor: pointer;
  transition: color 0.3s;
}
.nav-btn.active, .nav-btn:hover { color: var(--primary-blue);font-weight: 600;}

/* BUTTONS */
.btn-primary {
  background: var(--gradient-main);
  color: var(--white);
  border: none;
  padding: 12px 30px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.3s, box-shadow 0.3s;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.45);
}
.btn-ghost {
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  padding: 10px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: var(--shadow-soft);
}
.btn-ghost:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* HERO SECTION - EXACT REPLICA OF THE IMAGE */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80vh;
  margin-top: 20px;
  gap: 40px;
  width: 100%;
}

/* Left Hero (Text) */
.hero-left {
  flex: 1;
  max-width: 400px;
}
.greeting-box {
  position: relative;
  background: var(--white);
  padding: 40px;
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
}
.hello-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: -5px;
}
.main-name {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 20px;
}
.hero-description {
  font-size: 0.9rem;
  color: var(--text-gray);
  line-height: 1.7;
  margin-bottom: 40px;
}
.contact-pill-container {
  margin-bottom: 25px;
}
.email-pill {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--border-light);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-gray);
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.social-row {
  display: flex;
  align-items: center;
  gap: 15px;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: var(--shadow-soft);
}
.social-btn:hover { transform: translateY(-3px); }
.primary-social {
  background: var(--gradient-main);
  color: var(--white);
  box-shadow: var(--shadow-btn);
}
.ghost-social {
  background: var(--white);
  color: var(--text-gray);
}

/* Center Hero (Portrait) */
.hero-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end; /* Align bottom like in image */
  height: 550px;
  position: relative;
}
.portrait-wrapper {
  width: 380px;
  height: 580px;
  /* Organic blob shape to break away from standard boxy reference layout */
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  overflow: hidden;
  box-shadow: var(--shadow-float);
  background: var(--white);
  display: flex;
  align-items: flex-end;
  animation: morph 8s ease-in-out infinite;
  border: 8px solid var(--white);
}
@keyframes morph {
  0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  33% { border-radius: 60% 40% 50% 50% / 50% 60% 40% 60%; }
  66% { border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%; }
  100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}
.main-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* keep face in center */
}

/* Right Hero (Floating Cards) */
.hero-right {
  flex: 1;
  max-width: 380px;
  display: flex;
  justify-content: flex-end;
  position: relative;
}
.floating-items-container {
  display: block;
  position: relative;
  width: 100%;
  height: 550px;
}
.float-card {
  position: absolute;
  background: var(--white);
  padding: 20px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 140px;
  height: 150px;
  cursor: pointer;
  transition: transform 0.3s;
}
.float-card:hover {
  transform: scale(1.05);
}

/* Scattered / Organic Blob Alignments */
.card-1 {
  top: 50px;
  right: 15px;
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  animation: floatRandom1 8s ease-in-out infinite;
}
.card-2 {
  top: 220px;
  left: 10px;
  border-radius: 60% 40% 50% 50% / 50% 60% 40% 60%;
  animation: floatRandom2 7s ease-in-out infinite;
}
.card-3 {
  bottom: 80px;
  right: 40px;
  border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%;
  animation: floatRandom3 9s ease-in-out infinite;
}

@keyframes floatRandom1 {
  0% { transform: translate(0px, 0px) rotate(2deg); }
  50% { transform: translate(-10px, -15px) rotate(-1deg); }
  100% { transform: translate(0px, 0px) rotate(2deg); }
}
@keyframes floatRandom2 {
  0% { transform: translate(0px, 0px) rotate(-3deg); }
  50% { transform: translate(15px, -10px) rotate(1deg); }
  100% { transform: translate(0px, 0px) rotate(-3deg); }
}
@keyframes floatRandom3 {
  0% { transform: translate(0px, 0px) rotate(1deg); }
  50% { transform: translate(-8px, -20px) rotate(3deg); }
  100% { transform: translate(0px, 0px) rotate(1deg); }
}

.card-img-wrapper {
  width: 100%;
  border-radius: 0; 
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.full-wrapper { padding: 0; }
.card-img-wrapper img {
  width: 100%;
  max-height: 80px; 
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(99, 102, 241, 0.2));
  transition: transform 0.3s ease;
}
.float-card:hover .card-img-wrapper img {
  transform: scale(1.15) translateY(-5px);
}
.card-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* MAIN CONTENT SECTIONS */
.page-content {
  margin-top: 100px;
}
.content-section {
  padding: 120px 0;
  margin-bottom: 20px;
  scroll-margin-top: 80px; /* precise navbar offset alignment */
  border-bottom: 1px solid var(--border-light);
}
.content-section:last-child {
  border-bottom: none;
}
.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
}

/* Animations & Toggles */
.theme-toggle-btn {
  padding: 10px 14px !important;
  font-size: 1.1rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-btn);
}
.theme-toggle-btn:hover {
  transform: rotate(20deg) translateY(-2px);
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Projects */
.projects-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.work-card {
  background: var(--white);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s;
  cursor: pointer;
}
.work-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-float); }
.work-img {
  width: 100%;
  height: 250px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}
.work-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.work-card:hover .work-img img { transform: scale(1.05); }

.work-txt h3 { font-size: 1.25rem; margin-bottom: 10px; }
.work-txt p { font-size: 0.9rem; color: var(--text-gray); }

/* Galleries / Details inside projects */
.work-detail-box {
  background: var(--white);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-soft);
  margin-top: 30px;
}
.work-detail-box h3 { margin-bottom: 15px; }
.work-detail-box p { font-size: 0.95rem; color: var(--text-gray); line-height: 1.8; margin-bottom: 20px; }

/* Detail Navigations */
.detail-anchors {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-anchor-btn {
  background: var(--bg-color);
  color: var(--primary-blue);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
}
.detail-anchor-btn:hover {
  background: var(--primary-blue);
  color: var(--white);
}
.detail-segment {
  scroll-margin-top: 100px; /* Ensures anchor links don't get hidden under navbar */
}

/* Lightbox Base & Triggers */
.lightbox-trigger {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
  margin-left: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: none;
  border: none;
  transition: color 0.3s;
}
.lightbox-trigger:hover {
  text-decoration: underline;
  color: var(--primary-blue);
}

.lightbox {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(17, 24, 39, 0.95);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}
.lightbox.hidden {
  display: none !important;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.lightbox-close {
  position: absolute;
  top: 30px; right: 40px;
  color: white;
  font-size: 3.5rem;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s;
}
.lightbox-close:hover { color: var(--accent-cyan); }
.work-gallery img {
  width: 150px; height: 100px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.cv-modal-content {
  background: var(--white);
  padding: 30px;
  border-radius: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  background: var(--white);
  padding: 50px;
  border-radius: 30px;
  box-shadow: var(--shadow-soft);
  align-items: center;
}
.about-text-content p {
  color: var(--text-gray);
  margin-bottom: 15px;
  line-height: 1.8;
}
.about-img-content img {
  width: 100%;
  border-radius: 20px;
  max-height: 400px;
  object-fit: cover;
  box-shadow: var(--shadow-float);
}

/* Contact form */
.contact-box {
  background: var(--white);
  padding: 60px;
  border-radius: 30px;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-soft);
}
.clean-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.clean-input {
  width: 100%;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: var(--bg-color);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: 0.3s;
}
.clean-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(24, 130, 255, 0.1);
}
.form-submit-row { text-align: center; margin-top: 10px; }

/* CHATBOT */
.chatbot-container {
  position: fixed;
  bottom: 40px;
  right: calc(max(40px, (100vw - 1600px) / 2 + 40px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
}
.chat-fab-btn {
  width: auto;
  height: 50px;
  padding: 0 24px;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: 99px;
  display: flex;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.3s, box-shadow 0.3s;
}
.chat-fab-btn:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.45);
}

.chat-panel {
  width: 360px;
  height: 500px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.chat-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.online-dot { width: 10px; height: 10px; background: #10b981; border-radius: 50%; }
.chat-close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-gray); cursor: pointer; }

.chat-messages-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--bg-color);
}
.chat-bubble {
  max-width: 85%;
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.ai-bubble {
  background: var(--white);
  color: var(--text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.user-bubble {
  background: var(--gradient-main);
  color: var(--white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-btn);
}

.chat-input-row {
  padding: 15px;
  display: flex;
  gap: 10px;
  background: var(--white);
  border-top: 1px solid var(--border-light);
}
.chat-clean-input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: 99px;
  padding: 10px 15px;
  font-family: var(--font-main);
  background: var(--bg-color);
}
.chat-clean-input:focus { outline: none; border-color: var(--primary-blue); background: var(--white); }
.chat-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s;
}
.chat-send-btn:hover {
  transform: translateY(-2px);
}

.quick-query-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 15px 10px 15px;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
.quick-query-row::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}
.quick-query-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: 0.3s;
}
.quick-query-btn:hover {
  background: var(--gradient-main);
  color: white;
  border-color: transparent;
}

/* Footer */
footer { text-align: center; padding: 40px; color: var(--text-gray); font-size: 0.9rem; }

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 40px;
  left: 40px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.45);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .hero-section { flex-direction: column; gap: 60px; }
  .greeting-box { max-width: 100%; text-align: center; }
  .social-row { justify-content: center; }
  .hero-right { max-width: 100%; justify-content: center; width: 100%; }
  .floating-items-container { flex-direction: row; flex-wrap: wrap; justify-content: center; padding-left: 0; }
  .card-2 { transform: translateY(20px); }
  .projects-container { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .navbar { flex-direction: column; gap: 20px; }
  .nav-links { margin-left: 0; }
  .main-name { font-size: 2.5rem; }
  .portrait-wrapper { width: 100%; height: 400px; }
  .form-row { grid-template-columns: 1fr; }
  
  .chatbot-container { 
    right: 20px; 
    left: 20px;
    bottom: 20px; 
    align-items: flex-end;
    pointer-events: none;
  }
  .chat-fab-btn {
    pointer-events: auto;
  }
  .chat-panel { 
    pointer-events: auto;
    width: 100%; 
    height: 400px;
    max-height: calc(100vh - 120px);
  }
  
  .scroll-top-btn { left: 20px; bottom: 20px; width: 45px; height: 45px; z-index: 9998; pointer-events: auto; }
}
