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

/* --- THEME VARIABLES --- */
:root {
  /* Default Dark Mode */
  --bg-color: #0a0a0a;
  --secondary-bg: #111;
  --border-color: #222;
  --text-color: #fff;
  --secondary-text: #aaa;
  --highlight-color: #667eea;
  /* Button Gradient (Standard) */
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  /* Text Gradient (Brighter for Dark Mode visibility) */
  --text-gradient: linear-gradient(135deg, #84a9ff 0%, #9c82e6 100%);
  --card-hover-shadow: rgba(118, 75, 162, 0.5);
  --button-text: #fff;
  --chat-launcher-bg: #f4f2ff;
  --chat-launcher-border: #ffffff;
  --chat-launcher-shadow: rgba(0, 0, 0, 0.45);
  --chat-launcher-say-bg: #5b4bdb;
  --chat-launcher-say-color: #ffffff;
  --chat-launcher-focus: #c4b5fd;
  --chat-launcher-bot-bg: var(--accent-gradient);
  /*
   * Chat UI stays light in both site themes.
   * Hardcoded so dark mode site colors do not leak into the widget.
   */
  --chat--color--primary: #128C7E;
  --chat--color--secondary: #25D366;
  --chat--color-white: #ffffff;
  --chat--color-light: #f2f4f8;
  --chat--color-dark: #2d3748;
  --chat--header--background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  --chat--header--color: #ffffff;
  --chat--body--background: #f2f4f8;
  --chat--footer--background: #f2f4f8;
  --chat--footer--color: #2d3748;
  --chat--message--bot--background: #ffffff;
  --chat--message--bot--color: #2d3748;
  --chat--message--user--background: #25D366;
  --chat--message--user--color: #ffffff;
  --chat--input--background: #ffffff;
  --chat--input--text-color: #2d3748;
  --chat--input--container--background: #ffffff;
  --chat--toggle--background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  --chat--toggle--color: #ffffff;
  --chat--font-family: "Poppins", sans-serif;
  --chat--spacing: 1rem;
  --chat--border-radius: 0.25rem;
  --chat--window--width: 400px;
  --chat--window--height: 600px;
  --chat--window--bottom: 1rem;
  --chat--window--right: 1rem;
  --chat--window--z-index: 9999;
  --chat--window--border: 1px solid #e6e9f1;
  --chat--color-light-shade-50: #e6e9f1;
  --chat--color-light-shade-100: #c2c5cc;
  --chat--color-typing: #404040;
  --chat--heading--font-size: 2em;
  --chat--subtitle--font-size: inherit;
  --chat--subtitle--line-height: 1.8;
  --chat--message--font-size: 1rem;
  --chat--message--padding: 1rem;
  --chat--message--border-radius: 0.25rem;
  --chat--message-line-height: 1.5;
  --chat--message--margin-bottom: 1rem;
  --chat--messages-list--padding: 1rem;
  --chat--toggle--size: 64px;
  --chat--textarea--height: 50px;
  --chat--input--send--button--color: #25D366;
}


/* Light Mode Overrides */
[data-theme="light"] {
  --bg-color: #f8f9fa;
  --secondary-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-color: #2d3748;
  --secondary-text: #4a5568;
  --highlight-color: #3a84c6;
  /* In Light Mode, Text matches Button exactly */
  --accent-gradient: #3a84c6;
  --text-gradient: #3a84c6;
  --card-hover-shadow: rgba(58, 132, 198, 0.2);
  --button-text: #fff;
  --chat-launcher-bg: #ffffff;
  --chat-launcher-border: #e6eef6;
  --chat-launcher-shadow: rgba(37, 78, 122, 0.16);
  --chat-launcher-say-bg: #3a84c6;
  --chat-launcher-say-color: #ffffff;
  --chat-launcher-focus: #3a84c6;
  --chat-launcher-bot-bg: #3a84c6;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background-color: var(--secondary-bg);
  padding: 20px 0;
  border-right: 1px solid var(--border-color);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease-in-out, background-color 0.3s ease, border-color 0.3s ease;
}

.profile,
.nav-item:not(#theme-toggle) {
  width: 90%;
}

a.profile {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.profile:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 4px;
  border-radius: 8px;
}

.profile {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.profile-logo {
  width: 45px;
  height: 65px;
  /* Fixed height to match text roughly */
  object-fit: contain;
  margin-right: -8px;
  /* Pull text slightly closer if needed, or adjust */
  filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.8));
}

[data-theme="light"] .profile-logo {
  /* Use invert to make white text black, then apply a strong color filter to get the purple/blue brand color */
  filter: invert(30%) sepia(90%) saturate(3000%) hue-rotate(240deg) brightness(90%) contrast(110%);
}

.profile-info {
  flex: 1;
  margin-left: 15px;
}

.profile-info h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-info p {
  font-size: 0.85rem;
  color: var(--secondary-text);
}

.profile-info .certified-tag {
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 0.6rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  margin-bottom: 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  width: 90%;
  color: var(--secondary-text);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
  color: var(--text-color);
}

[data-theme="light"] .nav-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border-left: 3px solid var(--highlight-color);
}

[data-theme="light"] .nav-item.active {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-item .icon {
  margin-right: 15px;
  font-size: 1.1rem;
  min-width: 20px;
  text-align: center;
}

.nav-item[data-section="contact"] {
  margin-bottom: 18px;
}

/* --- THEME TOGGLE BUTTON STYLES --- */
#theme-toggle {
  margin-top: auto;
  /* Push to bottom */
  margin-bottom: 20px;
  /* Space from bottom edge */
  width: 80%;
  /* Slightly narrower than full width for button look */
  background: var(--accent-gradient);
  /* Gradient background */
  color: #fff !important;
  /* Force white text */
  border: none;
  border-radius: 8px;
  /* Rounded corners */
  justify-content: center;
  /* Center text */
  padding: 8px 16px;
  align-self: center;
  /* Center in sidebar */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

#theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  background: var(--accent-gradient);
  color: #fff;
}

#theme-toggle .icon {
  color: #fff !important;
  margin-right: 8px;
  font-size: 0.9rem;
}

[data-theme="light"] #theme-toggle:hover,
[data-theme="light"] .btn-primary:hover {
  background: #3a84c6;
  color: #fff;
  box-shadow: 0 5px 15px rgba(58, 132, 198, 0.4);
}

/* --- SIDEBAR FOOTER (CTRL + K Hint) --- */
.sidebar-footer {
  padding-bottom: 15px;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--secondary-text);
}

.sidebar-footer kbd {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "Consolas", monospace;
  font-size: 0.75rem;
  box-shadow: 0 2px 0 var(--border-color);
  margin: 0 2px;
  color: var(--text-color);
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 40px 60px;
  transition: margin-left 0.3s ease;
}

.section {
  display: none;
  animation: fadeIn 0.8s ease-in-out;
  scroll-margin-top: 80px;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(20px);
  }

  100% {
    transform: translateY(0);
  }
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 60px;
  gap: 40px;
  flex-wrap: wrap-reverse;
}

.hero-text {
  flex: 1;
  min-width: 300px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 .intro-line {
  font-size: 3rem;
}

.hero h1 .title-line {
  font-size: 2.2rem;
  display: inline-block;
  margin-top: 0.3rem;

}

/* UPDATED: Uses --text-gradient for brightness control */
.hero .highlight {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1rem;
  color: var(--secondary-text);
  line-height: 1.8;
  max-width: 600px;
  margin-bottom: 2rem;
  text-align: left;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn i {
  margin-right: 8px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--highlight-color);
  color: var(--highlight-color);
}

.btn-primary:hover {
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.btn-secondary:hover {
  background-color: var(--highlight-color);
  color: #fff;
  transform: translateY(-2px);
}

.hero-image {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--secondary-bg);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  animation: float 4s ease-in-out infinite;
}

.skills-section {
  margin-top: 60px;
}

.skills-section h3 {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--text-color);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.skill-card {
  background-color: var(--secondary-bg);
  padding: 20px;
  border-radius: 12px;
  border: 2px solid transparent;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  z-index: 0;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  mask-composite: exclude;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 25px var(--card-hover-shadow);
}

.skill-card .icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

[data-theme="dark"] .skill-card .icon i,
[data-theme="dark"] .skill-card .icon img {
  filter: brightness(0) invert(1);
}

[data-theme="light"] .skill-card .icon i,
[data-theme="light"] .skill-card .icon img {
  filter: brightness(0);
  color: #000;
}

/* LangChain icon sizing; color follows the shared skill theme filters */
.skill-card .icon img.langchain-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.skill-card[data-skill="langchain"] p {
  font-size: 0.85rem;
}

.modal-icon img.langchain-icon {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.skill-card:hover .icon {
  transform: scale(1.1);
}

.skill-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.skill-modal.active {
  display: flex;
  animation: simpleFade 0.3s ease;
}

.modal-content {
  background-color: var(--secondary-bg);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
  border: none;
  overflow: hidden;
  z-index: 0;
  box-shadow: 0 0 25px var(--card-hover-shadow);
  animation: simpleFade 0.3s ease;
  color: var(--text-color);
}

.modal-icon {
  font-size: 5rem;
  /* Increased from 3rem */
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.modal-icon img,
.modal-icon svg {
  width: 80px;
  /* Force image scaling */
  height: 80px;
}

[data-theme="dark"] .modal-icon i,
[data-theme="dark"] .modal-icon img {
  filter: brightness(0) invert(1);
}

[data-theme="light"] .modal-icon i,
[data-theme="light"] .modal-icon img {
  filter: brightness(0);
  color: #000;
}

.modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.modal-content p {
  color: var(--secondary-text);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- CERTIFICATE MODAL STYLES --- */
.cert-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.cert-modal.active {
  display: flex;
  animation: simpleFade 0.3s ease;
}

.cert-modal .modal-content {
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
}

.cert-modal-issuer {
  color: var(--highlight-color);
  font-weight: 500;
  margin-bottom: 5px;
}

.cert-modal-date {
  font-size: 0.85rem;
  color: var(--secondary-text);
  margin-bottom: 20px;
}

.cert-modal-image-container {
  width: 100%;
  margin-bottom: 25px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.cert-modal-image-container img {
  width: 100%;
  height: auto;
  max-height: 350px;
  display: block;
  object-fit: contain;
}

.cert-modal-buttons {
  display: flex;
  justify-content: center;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.3rem;
  color: var(--secondary-text);
  cursor: pointer;
  transition: color 0.2s ease;
}

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

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

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

@keyframes simpleFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.projects-grid,
.certificates-grid,
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.project-card.hidden,
.certificate-card.hidden,
.blog-card.hidden {
  display: none;
}

.project-card,
.certificate-card,
.blog-card {
  background-color: var(--secondary-bg);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.4s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.project-card {
  cursor: default;
}

.project-card:hover,
.certificate-card:hover,
.blog-card:hover {
  transform: translateY(-8px);
  border-color: var(--highlight-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-color: #000;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card>a {
  display: block;
  text-decoration: none;
  color: inherit;
}

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

.project-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-description {
  font-size: 0.875rem;
  color: var(--secondary-text);
  line-height: 1.6;
  margin-bottom: 15px;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--secondary-text);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.project-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  flex-grow: 1;
  justify-content: center;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.blog-card {
  background-color: var(--secondary-bg);
  border-radius: 12px;
  padding: 25px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--highlight-color);
}

.blog-date {
  color: var(--highlight-color);
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.blog-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.3;
}

.blog-excerpt {
  color: var(--secondary-text);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1;
}

.read-more {
  color: var(--highlight-color);
  font-size: 0.8125rem;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  margin-top: auto;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.video-card {
  background-color: var(--secondary-bg);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-card:hover {
  transform: translateY(-8px);
  border-color: var(--highlight-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.video-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: #000;
}

.video-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .video-overlay {
  opacity: 1;
}

.video-overlay i {
  color: #fff;
  font-size: 3rem;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.video-platform-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-platform-tag i {
  font-size: 0.9rem;
}

.video-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.video-type-tag {
  color: var(--highlight-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.video-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.video-description {
  font-size: 0.9rem;
  color: var(--secondary-text);
  line-height: 1.6;
}

.experience-timeline {
  margin-top: 30px;
  position: relative;
  padding-left: 20px;
}

.experience-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 27px;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--highlight-color) 0%, var(--border-color) 100%);
  animation: timelineGrow 1s ease-out forwards;
  transform-origin: top;
}

@keyframes timelineGrow {
  from {
    transform: scaleY(0);
    opacity: 0;
  }

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

.timeline-item {
  display: flex;
  margin-bottom: 50px;
  position: relative;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}



.timeline-item:nth-child(1) {
  transition-delay: 0.1s;
}

.timeline-item:nth-child(2) {
  transition-delay: 0.2s;
}

.timeline-item:nth-child(3) {
  transition-delay: 0.3s;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background-color: var(--highlight-color);
  border-radius: 50%;
  position: absolute;
  left: 20px;
  top: 6px;
  z-index: 2;
  border: 3px solid var(--bg-color);
  transition: all 0.3s ease;
  box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1);
  animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(102, 126, 234, 0);
  }
}

.timeline-content {
  flex: 1;
  padding-left: 40px;
}

.job-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.job-type-tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  color: var(--highlight-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--highlight-color);
}

.company {
  color: var(--highlight-color);
  font-size: 1.05rem;
  margin-bottom: 8px;
  font-weight: 500;
}

.job-duration {
  color: var(--secondary-text);
  font-size: 0.875rem;
  margin-bottom: 20px;
  font-weight: 400;
}

.job-description {
  color: var(--secondary-text);
  line-height: 1.6;
  font-size: 0.9rem;
}

.job-description-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, margin-top 0.3s ease;
}

/* Expanded state - reveal description */
.timeline-item.expanded .job-description-list {
  max-height: 600px;
  opacity: 1;
  margin-top: 15px;
}

.job-bullet {
  color: var(--secondary-text);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
  opacity: 0;
  transform: translateX(-20px);
  animation: bulletFadeIn 0.5s ease forwards;
}

.job-bullet::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--highlight-color);
  font-weight: bold;
  font-size: 1.1rem;
}

@keyframes bulletFadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Ensure bullets animate when parent is visible */
.timeline-item.animate-in .job-bullet {
  animation: bulletFadeIn 0.5s ease forwards;
}

/* Expand/Collapse Indicator */
.expand-indicator {
  position: absolute;
  right: 15px;
  top: 10px;
  color: var(--highlight-color);
  font-size: 0.75rem;
  opacity: 0.6;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.timeline-item:hover .expand-indicator {
  opacity: 1;
}

.timeline-item.expanded .expand-indicator {
  transform: rotate(180deg);
}



.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.certificate-card {
  background-color: var(--secondary-bg);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  transition: all 0.4s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  padding: 30px;
  overflow: hidden;
}

.certificate-card:hover {
  transform: translateY(-8px);
  border-color: var(--highlight-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.certificate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.certificate-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.certificate-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-gradient);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.certificate-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.certificate-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-color);
}

.certified-tag {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 2px;
  vertical-align: middle;
}

.certificate-issuer {
  color: var(--highlight-color);
  font-size: 0.9rem;
  font-weight: 500;
}

.certificate-date {
  color: var(--secondary-text);
  font-size: 0.8rem;
  margin-bottom: 20px;
}

.certificate-description {
  color: var(--secondary-text);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 25px;
  flex-grow: 1;
}

.certificate-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.certificate-skill-tag {
  background-color: var(--bg-color);
  color: var(--secondary-text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.certificate-links {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.certificate-link {
  padding: 10px 18px;
  background-color: var(--bg-color);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.certificate-link:hover {
  background-color: var(--highlight-color);
  color: #fff;
}

.certificate-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.contact-card {
  background-color: var(--secondary-bg);
  padding: 30px;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-card:hover {
  transform: translateY(-8px);
  border-color: var(--highlight-color);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.1);
}

.contact-card .icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  display: block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-card .icon i {
  color: var(--text-color);
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--text-color);
  background-clip: unset;
}

.contact-card h4 {
  font-size: 1.125rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.contact-card p {
  color: var(--secondary-text);
  font-size: 0.875rem;
}

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

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--secondary-text);
  max-width: 600px;
}

.load-more-btn {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.load-more-btn button {
  background: var(--secondary-bg);
  color: var(--highlight-color);
  border: 2px solid var(--highlight-color);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.load-more-btn button:hover {
  background: var(--highlight-color);
  color: #fff;
}

.mobile-menu-toggle {
  display: none;
}

.certificate-image-container img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* --- COMMAND PALETTE STYLES (Updated for High Z-Index) --- */
.cmd-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  z-index: 9999;
  /* Ensure top visibility */
  animation: fadeIn 0.2s ease;
}

.cmd-overlay.open {
  display: flex !important;
}

.cmd-palette {
  width: 500px;
  max-width: 90%;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#cmdInput {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1rem;
  padding: 10px 5px;
  margin-bottom: 10px;
  font-family: inherit;
}

#cmdInput:focus {
  outline: none;
  border-bottom-color: var(--highlight-color);
}

#cmdList {
  max-height: 300px;
  overflow-y: auto;
}

.cmd-item {
  padding: 12px 15px;
  cursor: pointer;
  color: var(--secondary-text);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmd-item:hover {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-left: 20px;
}

.cmd-shortcut {
  font-size: 0.7rem;
  opacity: 0.5;
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }

  .mobile-menu-toggle {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1001;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    cursor: default;
    font-weight: 600;
    gap: 12px;
  }

  .mobile-home-title {
    flex: 1;
    text-align: left;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    min-width: 0;
  }

  .mobile-home-title:focus-visible {
    outline: 2px solid var(--highlight-color);
    outline-offset: 2px;
    border-radius: 4px;
  }

  .mobile-menu-toggle .menu-icon {
    font-size: 1.5rem;
    transition: transform 0.3s;
    cursor: pointer;
    flex-shrink: 0;
    padding: 8px;
    margin: -8px -8px -8px 0;
  }

  .sidebar {
    /* Sidebar settings: 60% width, right side */
    width: 60%;
    /* FIXED: Calculated height to fit exactly in viewport below the header */
    height: calc(100vh - 60px);
    min-height: 0;
    /* Reset min-height so it doesn't force overflow */
    position: fixed;
    top: 60px;
    left: auto;
    right: 0;
    padding: 0;
    /* Add padding at bottom to ensure button is safe */
    padding-bottom: 20px;
    z-index: 1000;
    background-color: var(--secondary-bg);
    border-right: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    overflow-x: hidden;
  }

  .sidebar.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    overflow-y: auto;
  }

  /* Ensure profile and other nav items are centered in mobile view */
  .profile,
  .nav-item:not(#theme-toggle) {
    width: 100%;
  }

  .nav-item {
    width: 100%;
    padding: 15px 25px;
    margin-bottom: 0;
    /* FIX: Changed from flex-end to flex-start to align icons vertically */
    justify-content: flex-start;
    border-radius: 0;
  }

  /* --- MOBILE THEME TOGGLE UPDATE (Tightened bottom margin) --- */
  #theme-toggle {
    margin-top: 20px;
    /* Space below Contact button */
    margin-bottom: 30px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .nav-item .icon {
    display: inline-block;
  }

  .nav-item:hover {
    transform: none;
  }

  .nav-item.active {
    border-left: 3px solid var(--highlight-color);
    border-right: none;
    border-bottom: none;
  }

  .profile {
    display: none;
  }

  /* Hide footer (Ctrl + K text) on mobile */
  .sidebar-footer {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
    padding-top: 80px;
  }

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

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero-text {
    margin-right: 0;
  }

  .hero p {
    text-align: center;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero h1 .intro-line {
    font-size: 2.25rem;
  }

  .hero h1 .title-line {
    font-size: 1.6rem;
  }

  .hero-image {
    width: 250px;
    height: 250px;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .projects-grid,
  .blog-grid,
  .contact-grid,
  .certificates-grid {
    grid-template-columns: 1fr;
  }

  /* --- BEGIN MODIFICATION FOR HORIZONTAL BUTTONS --- */
  .job-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hero-buttons {
    gap: 10px;
    /* Slight reduction in gap */
  }

  .hero-buttons a.btn {
    /* Force them to be side-by-side, sharing space */
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
    font-size: 0.9rem;
    /* Smaller text */
    padding: 10px 10px;
    /* Reduced padding */
    min-width: 140px;
    /* Minimum width to prevent them from becoming too small */
    justify-content: center;
    /* Center the content inside the button */
  }

  .hero-buttons a.btn i {
    margin-right: 5px;
    /* Reduced space before icon */
  }

  /* --- END MODIFICATION FOR HORIZONTAL BUTTONS --- */
}

@media (max-width: 500px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .skill-card {
    padding: 15px 10px;
  }

  .skill-card h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
  }

  .skill-card p {
    font-size: 0.7rem;
  }

  .skill-card .icon {
    font-size: 2rem;
    margin-bottom: 5px;
  }
}

/* Added a more aggressive breakpoint for very small phones to ensure fit */
@media (max-width: 480px) {
  .hero-buttons a.btn {
    font-size: 0.8rem;
    /* Even smaller text for tiny screens */
    padding: 8px 8px;
    /* Further reduced padding */
    min-width: 120px;
  }
}

/* --- CHAT LAUNCHER --- */
@keyframes chat-bot-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes chat-bot-blink {
  0%,
  42%,
  48%,
  100% {
    transform: scaleY(1);
  }
  45% {
    transform: scaleY(0.12);
  }
}

.chat-window-wrapper {
  position: fixed;
  bottom: var(--chat--window--bottom);
  right: var(--chat--window--right);
  z-index: var(--chat--window--z-index);
  max-width: calc(100% - 2rem);
  max-height: calc(100% - 2rem);
  display: flex;
  flex-direction: column;
  font-family: var(--chat--font-family);
}

.chat-window-wrapper .chat-window {
  display: none;
  width: var(--chat--window--width);
  height: var(--chat--window--height);
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  margin-bottom: var(--chat--spacing);
  border: var(--chat--window--border);
  border-radius: var(--chat--border-radius);
  background: var(--chat--body--background);
  overflow: hidden;
  transform-origin: 100% 100%;
}

.chat-window-wrapper.is-open .chat-window {
  display: flex;
}

.chat-window-wrapper .chat-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
  background: var(--chat--body--background);
  color: var(--chat--color-dark);
}

.chat-window-wrapper .chat-header {
  padding: var(--chat--spacing);
  background: var(--chat--header--background);
  color: var(--chat--header--color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4em;
}

.chat-window-wrapper .chat-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.chat-window-wrapper .chat-header h1 {
  font-size: var(--chat--heading--font-size);
  font-weight: 600;
  line-height: 1.2;
  color: var(--chat--header--color);
}

.chat-window-wrapper .chat-header p {
  font-size: var(--chat--subtitle--font-size);
  line-height: var(--chat--subtitle--line-height);
}

.chat-window-wrapper .chat-close-button {
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--chat--header--color);
  display: flex;
  padding: 4px;
  flex-shrink: 0;
}

.chat-window-wrapper .chat-close-button:hover,
.chat-window-wrapper .chat-close-button:focus-visible {
  color: #e8fff2;
}

.chat-window-wrapper .chat-body {
  background: var(--chat--body--background);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.chat-window-wrapper .chat-messages-list {
  padding: var(--chat--messages-list--padding);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.chat-window-wrapper .chat-suggestions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 0 1rem 1rem;
}

.chat-window-wrapper .chat-suggestions-label {
  margin: 0 0 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #128c7e;
}

.chat-window-wrapper .chat-suggestion {
  appearance: none;
  width: 100%;
  text-align: left;
  font-family: var(--chat--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f6b5c;
  background: #ffffff;
  border: 1.5px solid #25d366;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chat-window-wrapper .chat-suggestion:hover,
.chat-window-wrapper .chat-suggestion:focus-visible {
  background: #e9fbf1;
  transform: translateY(-1px);
}

.chat-window-wrapper .chat-suggestion:focus-visible {
  outline: 2px solid #128c7e;
  outline-offset: 2px;
}

.chat-window-wrapper .chat-suggestion:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .chat-window-wrapper .chat-suggestion {
    transition: none;
  }

  .chat-window-wrapper .chat-suggestion:hover,
  .chat-window-wrapper .chat-suggestion:focus-visible {
    transform: none;
  }
}

.chat-window-wrapper .chat-message {
  max-width: 85%;
  font-size: var(--chat--message--font-size);
  padding: var(--chat--message--padding);
  border-radius: var(--chat--message--border-radius);
  display: block;
  overflow: hidden;
}

.chat-window-wrapper .chat-message + .chat-message {
  margin-top: var(--chat--message--margin-bottom);
}

.chat-window-wrapper .chat-message p {
  line-height: var(--chat--message-line-height);
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-window-wrapper .chat-message-from-bot {
  background-color: var(--chat--message--bot--background);
  color: var(--chat--message--bot--color);
  border-bottom-left-radius: 0;
}

.chat-window-wrapper .chat-message-from-user {
  background-color: var(--chat--message--user--background);
  color: var(--chat--message--user--color);
  border-bottom-right-radius: 0;
  margin-left: auto;
}

.chat-window-wrapper .chat-footer {
  background: var(--chat--footer--background);
  color: var(--chat--footer--color);
  border-top: 1px solid var(--chat--color-light-shade-100);
}

.chat-window-wrapper .chat-input-form {
  width: 100%;
}

.chat-window-wrapper .chat-inputs {
  width: 100%;
  background: var(--chat--input--container--background);
  display: flex;
  align-items: flex-end;
}

.chat-window-wrapper .chat-input-text {
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  min-height: var(--chat--textarea--height);
  height: var(--chat--textarea--height);
  max-height: 8rem;
  padding: 0.8rem;
  resize: none;
  background: var(--chat--input--background);
  color: var(--chat--input--text-color);
  line-height: 1.5;
  border: none;
  outline: none;
}

.chat-window-wrapper .chat-inputs-controls {
  display: flex;
}

.chat-window-wrapper .chat-input-send-button {
  height: var(--chat--textarea--height);
  width: var(--chat--textarea--height);
  background: var(--chat--color-white);
  cursor: pointer;
  color: var(--chat--input--send--button--color);
  border: none;
  border-radius: 16px;
  margin: 8px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.chat-window-wrapper .chat-input-send-button:hover:not([disabled]),
.chat-window-wrapper .chat-input-send-button:focus-visible:not([disabled]) {
  background: #0000000d;
}

.chat-window-wrapper .chat-input-send-button[disabled],
.chat-window-wrapper .chat-input-text:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.chat-window-wrapper .chat-message-typing {
  max-width: 80px;
  padding: 0.85rem 1rem;
}

.chat-window-wrapper .chat-message-typing-body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.chat-window-wrapper .chat-message-typing-circle {
  background-color: var(--chat--color-typing);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  margin: 3px;
  display: block;
  animation: chat-message-typing-animation-bouncing 0.8s ease-in-out infinite;
}

.chat-window-wrapper .chat-message-typing-circle:nth-child(2) {
  animation-delay: 0.333s;
}

.chat-window-wrapper .chat-message-typing-circle:nth-child(3) {
  animation-delay: 0.666s;
}

@keyframes chat-message-typing-animation-bouncing {
  0%,
  33% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

.chat-window-wrapper .chat-window-toggle {
  align-self: flex-end;
  background: var(--chat-launcher-bg) !important;
  color: #ffffff;
  cursor: pointer;
  width: auto;
  height: auto;
  border: 1px solid var(--chat-launcher-border);
  border-radius: 999px;
  margin-left: auto;
  padding: 6px 14px 6px 6px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 24px var(--chat-launcher-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.chat-window-wrapper .chat-window-toggle:hover,
.chat-window-wrapper .chat-window-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px var(--chat-launcher-shadow) !important;
}

.chat-window-wrapper .chat-window-toggle:focus-visible {
  outline: 2px solid var(--chat-launcher-focus);
  outline-offset: 3px;
}

.chat-launcher-bot {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  background: var(--chat-launcher-bot-bg);
  color: #ffffff;
  animation: chat-bot-bob 2.6s ease-in-out infinite;
}

.chat-launcher-bot .bot-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: chat-bot-blink 4.2s ease-in-out infinite;
}

.chat-launcher-bot .bot-eye-late {
  animation-delay: 0.08s;
}

.chat-launcher-say {
  position: relative;
  background: var(--chat-launcher-say-bg);
  color: var(--chat-launcher-say-color);
  font-family: var(--chat--font-family);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  padding: 9px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

[data-theme="light"] .chat-launcher-say {
  border-radius: 999px;
  padding: 10px 14px;
}

.chat-launcher-say::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid var(--chat-launcher-say-bg);
}

.chat-window-wrapper.is-open .chat-window-toggle {
  display: none;
}

.chat-window-wrapper .chat-window-footer {
  display: none !important;
}

@media (max-width: 480px) {
  .chat-window-wrapper .chat-window {
    width: calc(100vw - 2rem);
    height: calc(100vh - 7rem);
  }
}

@media (max-width: 480px) {
  .chat-launcher-say {
    font-size: 0.84rem;
    padding: 8px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-launcher-bot,
  .chat-launcher-bot .bot-eye,
  .chat-launcher-bot .bot-eye-late {
    animation: none;
  }
}

/* --- BLOG POST PAGE --- */
.blog-post-page {
  --blog-body-text: #c8c8d0;
  --blog-code-bg: #161618;
  --blog-inline-code-bg: rgba(102, 126, 234, 0.12);
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="light"] .blog-post-page {
  --blog-body-text: #3d4858;
  --blog-code-bg: #f1f5f9;
  --blog-inline-code-bg: rgba(79, 70, 229, 0.08);
}

/* Header */
.blog-post-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 32px);
  background-color: rgba(17, 17, 17, 0.92);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="light"] .blog-post-header {
  background-color: rgba(255, 255, 255, 0.92);
}

.blog-post-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  min-width: 0;
}

.blog-post-brand:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 4px;
  border-radius: 8px;
}

.blog-post-brand-logo {
  width: 36px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.8));
}

[data-theme="light"] .blog-post-brand-logo {
  filter: invert(30%) sepia(90%) saturate(3000%) hue-rotate(240deg) brightness(90%) contrast(110%);
}

.blog-post-brand-info {
  min-width: 0;
}

.blog-post-brand-name {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 2px;
}

.blog-post-brand-title {
  font-size: 0.75rem;
  color: var(--secondary-text);
  line-height: 1.35;
  margin: 0;
}

.blog-post-brand-info .certified-tag {
  margin-left: 3px;
  padding: 1px 5px;
  font-size: 0.55rem;
}

.blog-post-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.blog-post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-color);
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.blog-post-back:hover {
  border-color: var(--highlight-color);
  color: var(--highlight-color);
}

.blog-post-back:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
}

.blog-post-back i {
  font-size: 0.8rem;
  color: var(--highlight-color);
}

/* Theme toggle matches sidebar #theme-toggle */
.blog-post-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.blog-post-theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.blog-post-theme-toggle:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
}

.blog-post-theme-toggle .icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* Article shell */
.blog-post-container {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 56px) clamp(20px, 4vw, 28px) 80px;
}

.blog-post-meta {
  color: var(--highlight-color);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.blog-post-container > h1 {
  font-size: clamp(1.875rem, 4.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  color: var(--text-color);
}

.blog-post-cover {
  margin: 0 0 32px;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background-color: var(--secondary-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.blog-post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-post-lead {
  font-size: 1.125rem;
  color: var(--blog-body-text);
  line-height: 1.75;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

/* Table of contents */
.blog-post-toc {
  position: relative;
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 44px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

.blog-post-toc::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--accent-gradient);
}

.blog-post-toc h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-color);
  margin-bottom: 14px;
}

.blog-post-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}

.blog-post-toc li {
  margin: 0;
}

.blog-post-toc a {
  display: block;
  padding: 6px 10px;
  margin: 0 -10px;
  border-radius: 6px;
  color: var(--blog-body-text);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.blog-post-toc a:hover {
  color: var(--highlight-color);
  background-color: rgba(102, 126, 234, 0.08);
}

[data-theme="light"] .blog-post-toc a:hover {
  background-color: rgba(79, 70, 229, 0.06);
}

.blog-post-toc a:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 1px;
}

/* Body typography */
.blog-post-body {
  font-size: 1.0625rem;
  line-height: 1.78;
}

.blog-post-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 48px 0 18px;
  padding-top: 8px;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.blog-post-body h2:first-child {
  margin-top: 0;
}

.blog-post-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 32px 0 14px;
  color: var(--text-color);
}

.blog-post-body p {
  color: var(--blog-body-text);
  font-size: inherit;
  line-height: inherit;
  margin-bottom: 1.25em;
}

.blog-post-body ul,
.blog-post-body ol {
  color: var(--blog-body-text);
  font-size: inherit;
  line-height: inherit;
  margin: 0 0 1.25em 1.4em;
  padding: 0;
}

.blog-post-body li {
  margin-bottom: 0.5em;
}

.blog-post-body li::marker {
  color: var(--highlight-color);
}

.blog-post-body strong {
  color: var(--text-color);
  font-weight: 600;
}

.blog-post-body a {
  color: var(--highlight-color);
  text-decoration: underline;
  text-decoration-color: rgba(102, 126, 234, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

[data-theme="light"] .blog-post-body a {
  text-decoration-color: rgba(79, 70, 229, 0.35);
}

.blog-post-body a:hover {
  text-decoration-color: var(--highlight-color);
}

.blog-post-body a:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Inline code */
.blog-post-body code:not(pre code) {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.875em;
  padding: 0.15em 0.45em;
  border-radius: 5px;
  background-color: var(--blog-inline-code-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

/* Example callouts */
.blog-post-example {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--highlight-color);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 20px 0 28px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.blog-post-example .label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent-gradient);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.blog-post-example p {
  font-size: 1rem;
  color: var(--blog-body-text);
  margin: 0;
  line-height: 1.7;
}

.blog-post-example code {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 0.9375rem;
  color: var(--text-color);
}

/* Code blocks */
.blog-post-body pre {
  background-color: var(--blog-code-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 20px 0 28px;
  -webkit-overflow-scrolling: touch;
}

.blog-post-body pre code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.875rem;
  color: var(--blog-body-text);
  line-height: 1.65;
  white-space: pre;
  display: block;
}

/* Summary box */
.blog-post-summary {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  margin-top: 56px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

.blog-post-summary h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.375rem;
  color: var(--text-color);
}

.blog-post-summary p,
.blog-post-summary li {
  color: var(--blog-body-text);
}

.blog-post-summary ul {
  margin-bottom: 1.25em;
}

/* Footer nav */
.blog-post-footer-nav {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
}

.blog-post-footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--secondary-bg);
  color: var(--highlight-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-post-footer-nav a:hover {
  border-color: var(--highlight-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.blog-post-footer-nav a:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 640px) {
  .blog-post-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .blog-post-brand {
    flex: 1;
    min-width: 0;
  }

  .blog-post-brand-title {
    font-size: 0.6875rem;
  }

  .blog-post-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .blog-post-back span {
    display: none;
  }

  .blog-post-back {
    padding: 8px 12px;
  }

  .blog-post-theme-toggle span {
    display: none;
  }

  .blog-post-theme-toggle {
    padding: 8px 12px;
  }

  .blog-post-container {
    padding: 28px 16px 64px;
  }

  .blog-post-toc {
    padding: 20px 18px;
  }

  .blog-post-body h2 {
    font-size: 1.3rem;
    margin-top: 40px;
  }

  .blog-post-body pre {
    padding: 16px;
    border-radius: 10px;
  }

  .blog-post-body pre code {
    font-size: 0.8125rem;
  }

  .blog-post-summary {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-post-back,
  .blog-post-theme-toggle,
  .blog-post-footer-nav a,
  .blog-post-toc a {
    transition: none;
  }

  .blog-post-theme-toggle:hover,
  .blog-post-footer-nav a:hover {
    transform: none;
  }
}