:root {
  --primary: #5b21b6;
  --secondary: #9333ea;
  --accent: #22d3ee;

  --bg: #f0f0f0;
  --bg-dark: #0b0c10;

  --text: #111;
  --text-light: #e5e7eb;
  --text-muted: #9ca3af;

  --card-bg: #111321;
  --border: rgba(255,255,255,0.08);
}

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

body {
  font-family: 'Segoe UI', sans-serif;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

a {
  text-decoration: none;
}

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

/* ========================
   NAVBAR
======================== */
header {
  background: var(--primary);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  position: relative;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  z-index: 1001;
}

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

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

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

/* Hamburger Button */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Hamburger → X animation */
.hamburger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========================
   HOME SECTION
======================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.home {
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to right, #f0f9ff, #e0f7fa);
  padding: 2rem;
}

.home-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
}

.intro-text {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#welcome-message {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 500;
  animation: fadeIn 1s ease-in;
}

.home h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--primary);
}

.home h1 span {
  color: var(--accent);
}

.tagline {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: #555;
  max-width: 600px;
}

.profile-photo {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 200px;
}

.profile-photo img {
  width: clamp(180px, 25vw, 250px);
  height: clamp(180px, 25vw, 250px);
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Resume Button */
.resume-btn {
  display: inline-block;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1.6rem;
  background-color: var(--primary);
  color: #fff;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.resume-btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.resume-btn:hover:not(.disabled) {
  background-color: var(--accent);
  transform: translateY(-3px);
}

/* CTA Buttons */
.home .cta-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.home .intro-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home .cta-buttons .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.home .cta-buttons .primary-btn {
  background-color: var(--primary);
  color: #fff;
  border: none;
}

.home .cta-buttons .primary-btn:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.home .cta-buttons .secondary-btn {
  background-color: #f0f0f0;
  color: var(--primary);
  border: 2px solid var(--primary);
  transition: all 0.3s ease;
}

.home .cta-buttons .secondary-btn:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.home .cta-buttons .secondary-btn:hover span,
.home .cta-buttons .secondary-btn:hover i {
  color: #fff;
}

.home .cta-buttons .btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.home .cta-buttons .btn:hover i {
  transform: translateX(4px);
}

/* Social Links */
.home .social-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.home .social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #494747;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.home .social-links a:hover {
  background-color: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

/* ========================
   ABOUT SECTION
======================== */
.about {
  padding: 4rem 2rem;
}

.about-card h2 {
  text-align: center;
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

.about-subtitle {
  text-align: center;
  color: #555;
  margin-bottom: 2.5rem;
}

.about-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  align-items: stretch;
  margin-top: 40px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.about-photo {
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.about-photo img {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  object-fit: cover;
}

.about-info {
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Info Cards */
.info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.info-card {
  background: #f9fafb;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: 0.3s ease;
  min-height: 170px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: center;
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.info-card .icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.info-card p {
  margin: 4px 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

.info-card p:first-of-type {
  font-weight: 600;
}

.about-text p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 15px;
}

/* ========================
   PROJECTS SECTION
======================== */
.projects h2 {
  padding: 4rem 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.projects .project-list {
  padding: 1rem 2rem 4rem;
  max-width: 900px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  cursor: pointer;
  border-left: 1px solid var(--primary);
  border-right: 1px solid var(--primary);
}

.project-card:hover {
  transform: scale(1.03);
}

.project-card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: #232323;
  list-style: none;
}

.tech {
  display: inline-block;
  margin-top: 0.5rem;
  background: var(--secondary);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.project-card .project-img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.project-card:hover .project-img {
  transform: scale(1.05);
}

/* PROJECT MODAL */
.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-content {
  background: white;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  border-radius: 14px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  animation: scaleIn 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes scaleIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary);
}

.modal-tech {
  margin-top: 1rem;
  font-weight: 500;
  color: var(--secondary);
}

.modal-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-links a {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 0.6rem;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s;
}

.modal-links a:hover {
  background: var(--accent);
}

.project-modal .modal-img {
  max-height: 250px;
  object-fit: cover;
  width: 100%;
  border-radius: 12px;
  margin-bottom: 15px;
}

/* ========================
   EXPERIENCE & EDUCATION
======================== */
.experience-section {
  padding: 4rem 2rem;
}

.section-header.center {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header.center .section-subtitle {
  color: var(--secondary);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.section-header.center .section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 auto;
}

.section-header.center .section-title span {
  color: var(--secondary);
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50px;
  width: 4px;
  height: 100%;
  background: #2563eb;
}

.timeline-item {
  position: relative;
  margin-bottom: 50px;
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.timeline-date {
  font-weight: 600;
  color: #ffffff;
  background: #2563eb;
  padding: 6px 14px;
  border-radius: 12px;
  text-align: center;
  min-width: 100px;
  white-space: nowrap;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
  margin-left: 40px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border: 1.5px solid var(--accent);
}

.timeline-content h4 {
  margin-bottom: 5px;
  color: #2563eb;
}

.timeline-content h5 {
  margin-bottom: 10px;
  opacity: 0.8;
}

.timeline-content p {
  line-height: 1.6;
  opacity: 0.9;
}

/* ========================
   CONTACT SECTION
======================== */
.contact-section {
  background: var(--bg);
  padding: 80px 20px;
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: auto;
}

.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 60px;
  color: var(--text);
}

.section-title span {
  color: var(--accent);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-card,
.contact-info .info-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  min-height: unset;
  text-align: left;
}

.contact-card:hover,
.contact-info .info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
}

.contact-info .info-card .icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  max-width: 48px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  flex-grow: 0;
  aspect-ratio: 1 / 1;
}

.contact-info .info-card > div {
  flex: 1;
  min-width: 0;
}

.contact-info .info-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.contact-info .info-card p {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  word-break: break-all;
  line-height: 1.4;
}

.contact-info .info-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}

/* Form */
.contact-form {
  background: white;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  padding: 32px;
  color: var(--text);
  box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.form-group label {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 5px rgba(34,211,238,0.3);
}

.contact-form button {
  margin-top: 10px;
  padding: 14px;
  width: 100%;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.contact-form button:hover {
  opacity: 0.9;
  background: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* ========================
   FOOTER
======================== */
footer {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 1rem;
}

/* ========================
   SCROLL TO TOP
======================== */
#scrollTopBtn {
  position: fixed;
  bottom: 95px;
  right: 25px;
  width: 50px;
  height: 50px;
  background-color: var(--secondary);
  color: white;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
}

#scrollTopBtn:hover {
  background-color: var(--accent);
  transform: translateY(-5px);
}

/* ========================
   CHATBOT
======================== */
#chat-toggle {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: var(--primary);
  color: #fff;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 9999;
}

.chatbot-container {
  position: fixed;
  bottom: 90px;
  right: 25px;
  width: min(300px, calc(100vw - 40px));
  max-height: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

.chat-header {
  background-color: var(--primary);
  color: white;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header .bot-avatar {
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 50%;
}

.chat-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  font-size: 0.95rem;
  scroll-behavior: smooth;
}

.chat-input-area {
  display: flex;
  border-top: 1px solid #ccc;
}

.chat-input-area input {
  flex: 1;
  border: none;
  padding: 0.6rem;
  font-size: 1rem;
  min-width: 0;
}

.chat-input-area button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 0 1rem;
  cursor: pointer;
  white-space: nowrap;
}

.chat-message {
  margin-bottom: 0.6rem;
}

.chat-message.user {
  text-align: right;
  color: var(--primary);
}

.chat-message.bot {
  text-align: left;
  color: #333;
}

/* ========================
   RESPONSIVE BREAKPOINTS
======================== */

/* Tablet: ≤ 900px */
@media (max-width: 900px) {
  .about-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

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

  .timeline::before {
    left: 40px;
  }
}

/* Mobile: ≤ 768px */
@media (max-width: 768px) {

  /* --- Navbar --- */
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 0.5rem 0 1rem;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li a {
    display: block;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* --- Home --- */
  .home-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
    padding-top: 2rem;
  }

  .intro-text {
    align-items: center;
  }

  .home .cta-buttons {
    justify-content: center;
  }

  .home .social-links {
    justify-content: center;
  }

  .profile-photo img {
    width: 180px;
    height: 180px;
  }

  /* --- About --- */
  .about {
    padding: 3rem 1rem;
  }

  .about-container {
    margin-top: 20px;
    gap: 20px;
  }

  .info-cards {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .info-card {
    min-height: 140px;
    padding: 14px;
  }

  /* --- Projects --- */
  .projects h2 {
    padding: 3rem 1rem 1rem;
  }

  .projects .project-list {
    padding: 1rem 1rem 3rem;
    grid-template-columns: 1fr;
  }

  /* --- Timeline --- */
  .experience-section {
    padding: 3rem 1rem;
    overflow-x: hidden;
  }

  .timeline {
    padding: 0;
    width: 100%;
  }

  .timeline::before {
    left: 16px;
    width: 3px;
  }

  .timeline-item {
    flex-direction: column;
    gap: 8px;
    padding-left: 36px;
    margin-bottom: 30px;
  }

  .timeline-date {
    margin-left: 0;
    align-self: flex-start;
    font-size: 0.78rem;
    min-width: unset;
    padding: 4px 10px;
  }

  .timeline-content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .timeline-content:hover {
    transform: translateY(-3px);
  }

  /* --- Contact --- */
  .contact-section {
    padding: 50px 15px;
  }

  .contact-form {
    padding: 20px;
  }

  .contact-info .info-card {
    padding: 16px 18px;
    gap: 14px;
  }

  /* --- Modal --- */
  .modal-content {
    padding: 1.5rem 1.2rem;
    width: 95%;
  }

  .modal-links {
    flex-direction: column;
  }

  /* --- Chatbot --- */
  .chatbot-container {
    right: 10px;
    bottom: 85px;
    width: calc(100vw - 20px);
  }

  #scrollTopBtn {
    right: 15px;
    bottom: 85px;
    width: 42px;
    height: 42px;
  }

  #chat-toggle {
    right: 15px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }
}

/* Small mobile: ≤ 480px */
@media (max-width: 480px) {
  header {
    padding: 0.8rem 1rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  .home .cta-buttons .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .resume-btn {
    font-size: 0.9rem;
    padding: 0.7rem 1.2rem;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .section-title {
    margin-bottom: 40px;
  }

  .contact-info .info-card p {
    font-size: 0.82rem;
  }

  .modal-links a {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}