
:root {
  --bg-dark: #f1f5f9;
  --bg-darker: #f1f5f9;
  --downloadText: #fff;
  --text: #0f172a;
  --accent: #7c3aed;
  --accent-dark: #6d28d9;
  --text-light: #0f172a;
  --text-muted: #475569;
  --card-bg: linear-gradient(135deg, var(--accent), #a78bfa);
  --border: #cbd5e1;
  --hover-glow: rgba(124, 58, 237, .3);
  --textNav: #0f172a;
  --borderLeft: #0f172a;  
  --textNav: #0f172a;
  --chat-status: #fff;
   --theme-toggle-bg: #0f172a;
   --chatBotClose: #fff;
    --textHeaderContact: #fff;
    --card-section: rgba(255,255,255,.12);
    --card-border: rgba(10, 10, 10, 0.18);
}

body.dark {
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --downloadText: #fff;
  --text: #fff;
  --accent: #8b5cf6;
  --accent-dark: #7c3aed;
  --text-light: #fff;
  --text-muted: #cbd5e1;
  --card-bg: #111827;
  --border: #1e293b;
  --hover-glow: rgba(56, 189, 248, .4);
  --borderLeft: rgba(56, 189, 248, .4);
  --textNav: #fff;
  --chat-status: #0f172a;
  --theme-toggle-bg: #7c3aed;
  --chatBotClose: #020617;
   --textHeaderContact: #fff;
      --card-section: linear-gradient(135deg, rgba(15, 23, 42, .68), rgba(15, 23, 42, .28));
      --card-border: rgba(255,255,255,.18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Poppins;
  transition: background-color 1s, color 1s, border-color 1s
}

html {
  scroll-behavior: smooth
}

body {
    background:
        radial-gradient(circle at 10% 10%, rgba(124,58,237,.25), transparent 35%),
        radial-gradient(circle at 90% 80%, rgba(59,130,246,.2), transparent 35%),
        var(--bg-darker);
  color: var(--text)
}

section {
  padding: 100px 8%;
  scroll-margin-top: 90px;
  position: relative;
  z-index: 1
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: transparent;
  backdrop-filter: blur(10px)
}

#tsparticles {
  position: fixed;
  inset: 0;
  z-index: 0
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 0, 0, .1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08)
}

body.dark nav {
  background: linear-gradient(135deg, rgba(15, 23, 42, .68), rgba(15, 23, 42, .28));
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 12px 35px rgba(2, 6, 23, .35)
}

nav h1 {
  font-size: clamp(20px, 4vw, 30px);
  color: var(--text-light)
}

.gradient-text {
  background: linear-gradient(360deg, var(--hover-glow), var(--accent), var(--accent-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
  margin: 0;
  padding: 0;
  font-weight: 700
}

.nav-links a {
  text-decoration: none;
  color: var(--textNav);
  position: relative;
  display: inline-block
}

.nav-links a:hover {
  transform: translateY(-1px) scale(1.04);
  background: rgba(124, 58, 237, .16)
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -5px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width .3s
}

/* lightmode/darkmode toggle */
#theme-toggle {
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  color: white;
  height: 44px;
  font-size: 18px;
  font-weight: 700;
  background: var(--theme-toggle-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#theme-toggle:hover {
  transform: translateY(-1px) scale(1.04);

}

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

.nav-links a.active {
  color: var(--accent)
}

.handsome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10rem, 8vw, 25rem);
   width: 100%;
    max-width: 2000px;
    margin: 0 auto;
}

.handsome-text h1 {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid black;

  animation: typing 4s steps(42, end) infinite,
             blink .7s step-end infinite;

  border-right: 3px solid var(--text);
  animation: typing 5s steps(13, end) infinite, blink .7s step-end infinite
}

@keyframes typing {
  from {
    width: 0
  }

  to {
    width: 13ch
  }
}

@keyframes blink {
  50% {
    border-color: transparent
  }
}

.handsome img {
  width: min(320px, 100%);
  height: auto;
  border-radius: 10px
}

.resume {
  display: inline-block;
  padding: 10px 18px;
  border-left: 10px solid var(--borderLeft);
  border-radius: 5px 20px 20px 5px;
  background: linear-gradient(360deg, var(--hover-glow), 
  var(--accent), var(--accent-dark));
   box-shadow: 0 6px 20px var(--hover-glow);
}

.resumeDl {
  text-decoration: none;
  color: var(--downloadText);
  font-weight: 700
}

.contact {
  padding: 12px 20px;
  border: 2px solid var(--textNav);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #fff;
  cursor: pointer;
  
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(5px);
  z-index: 2000
}
#closeModal{
  font-size: 22px;
  font-weight: 700;
  cursor: pointer
}

#sendButton {
  background-color: var(--accent-dark);
  color: #fff;
  font-weight: 700;
  font-size:  clamp(10px, 4vw, 15px);
  border: none;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;

}

.modal-content {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 15px;
  width: min(350px, 90%);
  color: var(--textHeaderContact);
  animation: pop .3s
}

@keyframes pop {
  from {
    transform: scale(.7);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

.close {
  float: right;
  font-size: 22px;
  cursor: pointer
}

.modal-content input,
.modal-content textarea,
.modal-content button {
  width: 100%;
  padding: 10px;
  margin: 10px 0
}

.social-icons {
  display: flex;
  gap: 20px
}

.social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  text-decoration: none
}

.social-icons .fa-brands {
  color: var(--text-light)
}

.card {
    background: var(--card-section);
    border: 4px solid var(--card-border);
    box-shadow:
        0 8px 32px rgba(0,0,0,.25),
        inset 0 1px 1px rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 2rem;
    color: var(--text);
    width: min(900px, 100%);
    margin: 0 auto;
    font-size: 0.8em;
  
    text-align: center;

}

 /* ---- floating launcher button ---- */
  #chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--hover-glow);
    transition: transform .2s ease, background .3s;
    z-index: 1000;
  }
  #chat-launcher:hover { transform: scale(1.08); }

  /* ---- chat window ---- */
  #chat-window {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: min(340px, 90vw);
    height: min(460px, 70vh);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
    z-index: 1000;
    animation: pop .25s ease;
  }
  #chat-window.open { display: flex; }

  @keyframes pop {
    from { transform: scale(.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
  }

  #chat-header {
    background: var(--text-light);
    color: var(--chatBotClose);
    padding: 14px 16px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
 .chat-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
  }

  #chat-close {
    background: none;
    border: none;
    color: var(--chatBotClose);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
  }

  #chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .msg {
    max-width: 80%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
  }
  .msg.bot {
    background: var(--bg-darker);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
  }
  .msg.user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
  }

  #chat-input-row {
    display: flex;
    border-top: 1px solid var(--border);
  }
  

  .chat-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--chat-status); 
  margin-left: 10px;
  margin-right: 0px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}
  #chat-input {
    flex: 1;
    border: none;
    padding: 12px;
    background: var(--bg-dark);
    color: var(--text);
    font-size: 14px;
    outline: none;
  }
  #chat-send {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 700;
    border-top-right-radius: 14px;
    cursor: pointer;
  }
  #chat-send:hover { background: var(--accent-dark); }

  .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
  }
  .chip {
    border: 1px solid var(--border);
    background: transparent;
    color: #fff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
  }
  .chip:hover { border-color: var(--accent); color: var(--accent); }

  .reveal {
    opacity: 0;
    transform: translateY(40px) scale(.95);
    filter: blur(10px);

    transition:
        opacity .8s ease,
        transform 1.4s ease,
        filter .5s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.reveal:nth-child(1) {
    transition-delay: .1s;
}

.reveal:nth-child(2) {
    transition-delay: .3s;
}

.reveal:nth-child(3) {
    transition-delay: .5s;
}

@media(max-width:748px) {
  nav {
    padding: 12px;
    flex-wrap: wrap
  }

  nav h1 {
    font-size: 18px
  }

  .nav-links {
    gap: 10px;
    font-size: 10px;
    justify-content: center;
    flex-wrap: wrap
  }

  .handsome {
    flex-direction: column-reverse;
    text-align: center;
    gap: 20px;
    
  }

  .handsome-text h1 {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid black;

  animation: typing 4s steps(42, end) infinite,
             blink .7s step-end infinite;

  border-right: 3px solid var(--text);
  animation: typing 5s steps(13, end) infinite, blink .7s step-end infinite
}

@keyframes typing {
  from {
    width: 0
  }

  to {
    width: 13ch
  }
}

@keyframes blink {
  50% {
    border-color: transparent
  }
}

  .social-icons {
    justify-content: center
  }

  .contact {
    font-size: 12px;
    padding: 6px 10px
  }
  
  .modal-content {
    margin-top: 100px;
    width: 85%;
  }
  
  .projects{
    display: flex;
    justify-content: center;
    flex-direction: column;
    background-color: white;
    color: black;
    border-radius: 10px;
  }
  #chat-input {
    width: 0%;
  }
  #chat-send {
    padding: 15px;
    border-left: 3px solid var(--textNav);
  }
}

/* for modal z index*/
.swal2-container {
  z-index: 3000 !important;
}

/* for error toast fire*/

.swal2-toast {
    background: var(--card-bg) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    font-family: "Poppins", sans-serif;
}

.swal2-toast .swal2-title {
    color: var(--downloadText) !important;
    font-size: clamp(15px, 4vw, 20px);
    font-weight: 700;
}

.swal2-toast .swal2-html-container {
    color: var(--downloadText) !important;
}

.swal2-timer-progress-bar {
    background: linear-gradient(
        90deg,
        var(--accent),
        var(--accent-dark)
    ) !important;
}

.swal2-success-ring,
.swal2-success-fix,
.swal2-success-circular-line-left,
.swal2-success-circular-line-right {
    background: transparent !important;
}

/* for success swal  fire*/
.swal2-confirm {
  border-radius: 10px !important;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}

.swal2-success-line-tip {
  animation: swal2-animate-success-line-tip 2s !important;
}