/* ========== THEME VARIABLES ========== */
:root {
  --bg-1: #f8fafc;
  --bg-2: #ffffff;
  --text: #0f172a;
  --text-light: #334155;
  --muted: #64748b;
  --accent-1: #6b21a8;
  --accent-2: #4f46e5;
  --accent-3: #06b6d4;
  --accent-4: #ec4899;
  --card: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(79, 70, 229, 0.12);
  --radius: 16px;
  --maxw: 1200px;
  --section-gap: 56px;
  --focus: 3px solid rgba(79, 70, 229, 0.2);
  --header-h: 84px;
  --header-h-sm: 56px;
  --footer-h: 58px;
  --shadow-strong: 0 20px 50px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --glass-blur: 12px;
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

[data-theme="dark"] {
  --bg-1: #071126;
  --bg-2: #071022;
  --text: #e6eefc;
  --muted: #b8c6e0;
  --card: rgba(255, 255, 255, 0.03);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow-strong: 0 20px 48px rgba(2, 6, 23, 0.6);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.6);
  --glass-blur: 6px;
}

/* ========== BASE ========== */
* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-h) + 20px);
}

html,
body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

/* ========== PAGE LOADER ========== */
#pageLoader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#pageLoader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(79, 70, 229, 0.1);
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spinLoader 0.8s linear infinite;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.loader-text {
  position: absolute;
  bottom: 30%;
  color: #4f46e5;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  line-height: 1.65;
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  position: relative;
  font-size: 15px;
}

/* AI-themed background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
    linear-gradient(45deg, transparent 30%, rgba(79, 70, 229, 0.02) 50%, transparent 70%),
    linear-gradient(-45deg, transparent 30%, rgba(34, 211, 238, 0.02) 50%, transparent 70%);
  background-size: 100% 100%, 100% 100%, 300px 300px, 300px 300px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

a {
  color: var(--accent-2);
  transition: var(--transition-smooth);
  text-decoration: none;
}

a:hover {
  color: var(--accent-3);
  text-decoration: underline;
}

/* Keyboard focus visibility (accessibility + UX) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role='button']:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  body {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 16px 0;
}

/* Breadcrumb + first section spacing (prevents large blank area before H1) */
nav[aria-label='Breadcrumb'] {
  padding: 12px 0 !important;
  margin-bottom: 16px !important;
}

.wrap > nav[aria-label='Breadcrumb'] + .section {
  margin-top: 0;
  padding-top: 24px !important;
}

/* When sections are nested (e.g., inside Work/Contact content), avoid compounded top spacing */
.section .section {
  margin-top: 40px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 18px 32px;
  padding-top: calc(var(--header-h) + 18px);
}

/* ========== STICKY HEADER ========== */
header.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 70;
  background: transparent;
  padding: 16px 22px;
  transition: backdrop-filter 0.22s ease, padding 0.22s ease, background-color 0.22s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

header.site-header .inner {
  max-width: var(--maxw);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header.site-header.shrink {
  padding: 8px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

header.site-header a.brand:hover,
header.site-header a.brand:focus,
header.site-header a.brand:focus-visible {
  text-decoration: none;
}

.brand:hover {
  transform: translateY(-2px);
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 24px;
  box-shadow: var(--shadow-soft);
  transition: width 0.22s ease, height 0.22s ease, transform 0.22s ease;
}

header.site-header.shrink .logo {
  width: 44px;
  height: 44px;
  transform: translateY(-1px);
}

.brand .title {
  font-weight: 900;
  font-size: 16px;
  line-height: 1.1;
}

.brand .subtitle {
  font-size: 12px;
  color: var(--muted);
}

nav.top-nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

nav.top-nav a {
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition-smooth);
  position: relative;
}

nav.top-nav a.active {
  color: var(--accent-2);
  font-weight: 800;
}

nav.top-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-2);
  transition: width 0.3s ease, left 0.3s ease;
  transform: translateX(-50%);
}

nav.top-nav a.active::after {
  width: 20px;
}

nav.top-nav a:hover,
nav.top-nav a:focus-visible {
  color: var(--accent-2);
}

nav.top-nav a:hover::after,
nav.top-nav a:focus-visible::after {
  width: 20px;
}

/* ========== DROPDOWN NAVIGATION ========== */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.nav-dropdown-btn:hover {
  color: var(--accent-2);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-2);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 10px;
  padding: 8px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  margin-top: 8px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.nav-dropdown-menu a:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent-2);
  padding-left: 24px;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  z-index: 80;
}

.hamburger-menu span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition-smooth);
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-nav {
  display: none;
}

@media (max-width: 760px) {
  nav.top-nav {
    display: none;
  }

  .hamburger-menu {
    display: flex;
  }

  .mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100vw;
    background: var(--bg-2);
    border-top: 1px solid var(--glass-border);
    padding: 16px 18px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 75;
    backdrop-filter: blur(6px);
  }

  .mobile-nav.active {
    display: flex;
  }

  .mobile-nav a {
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    transition: var(--transition-smooth);
    display: block;
  }

  .mobile-nav a.active {
    background: var(--card);
    color: var(--accent-2);
    font-weight: 700;
  }

  .mobile-nav a:hover {
    background: var(--card);
    color: var(--accent-2);
  }
}

/* ========== HERO ========== */
.hero-wrap {
  /* padding handled by .wrap */
}

header.site-header.shrink ~ main .hero-wrap {
  /* shrink animation handled by .wrap */
}

.expertise-banner {
  margin-bottom: 32px;
  background: linear-gradient(
    90deg,
    rgba(79, 70, 229, 0.1),
    rgba(6, 182, 212, 0.08)
  );
  border-radius: 16px;
  padding: 24px 28px;
  border: 1px solid rgba(79, 70, 229, 0.15);
  backdrop-filter: blur(var(--glass-blur));
  animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.expertise-items {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 14px;
}

.expertise-items .badge-ai,
.expertise-items .badge-llm,
.expertise-items .badge-mlops,
.expertise-items .badge-prod {
  padding: 8px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--accent-2);
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.expertise-items .badge-ai:hover,
.expertise-items .badge-llm:hover,
.expertise-items .badge-mlops:hover,
.expertise-items .badge-prod:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(6, 182, 212, 0.12));
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.expertise-items .divider {
  color: rgba(79, 70, 229, 0.3);
  font-weight: 400;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 6px;
}

@media (min-width: 980px) {
  .hero {
    grid-template-columns: 1fr 420px;
  }
}

.intro {
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  animation: fadeInLeft 0.6s ease-out 0.1s both;
}

.intro::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08), transparent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.intro > * {
  position: relative;
  z-index: 1;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

h1 {
  font-size: 32px;
  margin: 8px 0 10px;
  line-height: 1.03;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (min-width: 480px) {
  h1 {
    font-size: 36px;
  }
}

@media (min-width: 980px) {
  h1 {
    font-size: 42px;
    letter-spacing: -0.5px;
  }
}

.lead {
  color: var(--muted);
  margin-bottom: 14px;
  max-width: 64ch;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 480px) {
  .cta-row {
    flex-direction: column;
  }

  .cta-row .btn {
    width: 100%;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 15px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
  z-index: 0;
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: white;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.18);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(-1px);
}

.btn-ghost {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(6, 182, 212, 0.04));
  border: 1.5px solid rgba(79, 70, 229, 0.2);
  color: var(--accent-2);
}

.btn-ghost:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(6, 182, 212, 0.08));
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-2px);
}

.meta-caps {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}

.meta-caps > div {
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.05), rgba(6, 182, 212, 0.02));
  border-left: 3px solid var(--accent-2);
  transition: var(--transition-smooth);
}

.meta-caps > div:hover {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.08), rgba(6, 182, 212, 0.04));
  border-left-color: var(--accent-3);
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.chip {
  padding: 10px 16px;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(6, 182, 212, 0.04));
  font-weight: 600;
  color: var(--accent-2);
  font-size: 13px;
  border: 1.5px solid rgba(79, 70, 229, 0.25);
  transition: var(--transition-smooth);
  display: inline-block;
  white-space: nowrap;
}

.chip:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(6, 182, 212, 0.1));
  border-color: rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12);
}

.hero-decor {
  pointer-events: none;
  position: absolute;
  right: -36px;
  top: -36px;
  width: 420px;
  height: 420px;
  z-index: 0;
  opacity: 0.9;
  display: none;
}

@media (min-width: 980px) {
  .hero-decor {
    display: block;
  }
}

.avatar-card {
  border-radius: 18px;
  padding: 20px;
  background: var(--card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 480px;
  animation: fadeInRight 0.6s ease-out 0.2s both;
  position: relative;
  overflow: hidden;
}

.avatar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-3), transparent);
  opacity: 0.5;
}

.avatar-card > * {
  position: relative;
  z-index: 1;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #eef2ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 18px;
  overflow: hidden;
  border: 2px solid var(--glass-border);
}

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

.badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
  color: white;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ========== SECTIONS ========== */
.section {
  margin-top: var(--section-gap);
  position: relative;
  padding-top: 20px;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
  border-radius: 4px;
  opacity: 0.3;
}

.section h2 {
  margin: 0;
  animation: fadeInUp 0.6s ease-out both;
  background: linear-gradient(135deg, var(--text), rgba(79, 70, 229, 0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .section h2 {
    font-size: 36px;
  }
}

.section h3 {
  margin: 0;
  animation: fadeInUp 0.6s ease-out both;
  color: var(--accent-2);
  font-size: 18px;
  font-weight: 700;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: linear-gradient(135deg, var(--card), rgba(255, 255, 255, 0.5));
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent-3), transparent);
  opacity: 0.6;
}

.card:hover {
  box-shadow: 0 20px 60px rgba(79, 70, 229, 0.15);
  transform: translateY(-6px);
  border-color: rgba(79, 70, 229, 0.4);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 760px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  overflow: hidden;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(79, 70, 229, 0.1);
  background: linear-gradient(
    180deg,
    rgba(79, 70, 229, 0.04),
    rgba(6, 182, 212, 0.02)
  );
  transition: var(--transition-smooth);
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
}

.project-card:hover {
  border-color: var(--accent-2);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.1);
  transform: translateY(-4px);
}

.project-card:hover::before {
  left: 100%;
}

.project-card h4 {
  margin: 0 0 8px 0;
  color: var(--text);
}

/* clients */
.clients {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.client {
  width: 140px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(11, 17, 32, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
  padding: 6px;
  transition: var(--transition-smooth);
}

.client:hover {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.15);
}

/* testimonials */
.testi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 880px) {
  .testi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.testi {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.testi-avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, #EC4899, #F97316);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15);
}

.quote {
  font-style: italic;
  color: var(--muted);
  margin-top: 6px;
}

.quote::before {
  content: '"';
  font-weight: 900;
  font-size: 24px;
  opacity: 0.3;
}

/* timeline */
.timeline {
  border-left: 3px solid var(--accent-2);
  padding-left: 28px;
  margin-left: 0;
}

.entry {
  margin-bottom: 32px;
  position: relative;
  padding: 16px 20px 16px 24px;
  border-radius: 12px;
  transition: var(--transition-smooth);
  word-break: break-word;
  overflow: visible;
}

.entry:hover {
  background: var(--card);
}

.entry::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 6px var(--bg-2), 0 0 0 8px var(--accent-2);
  transition: var(--transition-smooth);
}

.entry:hover::before {
  transform: scale(1.2);
}

.entry h4 {
  margin: 0 0 6px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.entry .meta {
  color: var(--accent-2);
  font-size: 13px;
  margin: 4px 0 10px 0;
  font-weight: 600;
}

/* contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 980px) {
  .contact-grid {
    grid-template-columns: 1fr 360px;
  }
}

form input,
form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(11, 17, 32, 0.08);
  margin-top: 8px;
  font-size: 14px;
  background: transparent;
  color: var(--text);
  transition: var(--transition-smooth);
  font-family: inherit;
}

form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

form textarea {
  min-height: 120px;
  resize: vertical;
}

.form-message {
  padding: 12px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 14px;
  display: none;
}

.form-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.form-message.show {
  display: block;
}

.small {
  font-size: 14px;
  color: var(--muted);
}

/* FAQ removed - see complete definition below at line ~1506 */

/* sticky footer */
.sticky-footer {
  position: static;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  transition: height 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(6px);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.85),
    rgba(255, 255, 255, 0.95)
  );
  box-shadow: 0 -6px 24px rgba(2, 6, 23, 0.06);
  border-top: 1px solid rgba(11, 17, 32, 0.04);
  padding: 24px 20px;
  margin-top: 48px;
}

[data-theme="dark"] .sticky-footer {
  background: linear-gradient(
    180deg,
    rgba(7, 17, 38, 0.95),
    rgba(7, 16, 34, 0.98)
  );
}

.sticky-footer .inner {
  max-width: var(--maxw);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .sticky-footer .inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* new professional footer */
.site-footer {
  background: linear-gradient(135deg, 
    rgba(79, 70, 229, 0.03) 0%, 
    rgba(6, 182, 212, 0.02) 100%);
  border-top: 2px solid rgba(79, 70, 229, 0.15);
  padding: 60px 20px 24px;
  margin-top: 80px;
  backdrop-filter: blur(8px);
}

.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
}

.footer-section {
  animation: fadeInUp 0.6s ease-out;
}

.footer-section h4 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-2);
  margin-bottom: 16px;
}

.footer-section p {
  font-size: 14px;
  line-height: 1.7;
}

.footer-section ul li a:hover,
.footer-section a:hover {
  color: var(--accent-2) !important;
  text-decoration: underline;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--accent-2);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(6, 182, 212, 0.06));
  transition: var(--transition-smooth);
  text-decoration: none;
  border: 1px solid rgba(79, 70, 229, 0.15);
}

.social-icon:hover {
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: white;
  transform: translateY(-3px);
  border-color: var(--accent-2);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

.footer-bottom {
  border-top: 1px solid rgba(79, 70, 229, 0.1);
  padding: 24px 20px;
  margin-top: 32px;
  text-align: center;
}

@media (max-width: 760px) {
  .site-footer {
    padding: 40px 18px 20px;
    margin-top: 60px;
  }

  .site-footer .inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-section h4 {
    font-size: 13px;
  }
}

.sticky-footer:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 1)
  );
  box-shadow: 0 -8px 32px rgba(2, 6, 23, 0.12);
}

.sticky-footer .links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sticky-footer .links a {
  transition: var(--transition-smooth);
}

.sticky-footer .links a:hover {
  color: var(--accent-2);
}

@media (max-width: 760px) {
  .sticky-footer .links {
    display: none;
  }
}

/* FAQ styling - consolidated single definition */
.faq-item {
  border-bottom: 1px solid rgba(79, 70, 229, 0.1);
  padding: 20px 0;
  transition: all 0.3s ease;
}

.faq-item:hover {
  background: rgba(79, 70, 229, 0.03);
  padding: 20px;
  margin: 0 -20px;
  border-radius: 8px;
  border-bottom: 1px solid rgba(79, 70, 229, 0.2);
}

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s ease;
  font-size: 15px;
}

.faq-q:hover {
  color: var(--accent-2);
}

.toggle {
  font-size: 18px;
  color: var(--accent-2);
  transition: transform 0.3s ease;
  font-weight: 300;
}

.faq-item.open .toggle {
  transform: rotate(45deg);
}

.faq-a {
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  display: block;
}

.faq-item.open .faq-a {
  max-height: 500px;
}

#contactForm {
  display: flex;
  flex-direction: column;
}

#contactForm label {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 6px;
}

#contactForm input[type="text"],
#contactForm input[type="email"],
#contactForm textarea,
#contactForm select {
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  transition: var(--transition-smooth);
}

#contactForm input[type="text"]:focus,
#contactForm input[type="email"]:focus,
#contactForm textarea:focus,
#contactForm select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: white;
}

/* ========== FLOATING CONTACT BUTTON ========== */
.floating-contact-btn {
  position: fixed;
  left: 20px;
  bottom: 32px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.22);
  cursor: pointer;
  z-index: 79;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  border: none;
  padding: 0;
  animation: slideInLeft 0.6s ease-out 0.3s both;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.floating-contact-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.28);
}

.floating-contact-btn:active {
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .floating-contact-btn {
    width: 44px;
    height: 44px;
    left: 16px;
    bottom: 28px;
  }
}

/* ========== BACK TO TOP ========== */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 32px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.18);
  cursor: pointer;
  z-index: 80;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
  border: none;
  padding: 0;
}

.to-top:hover {
  transform: translateY(8px);
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.25);
}

.to-top:active {
  transform: translateY(10px);
}

.to-top.visible {
  opacity: 1;
  transform: none;
}

/* reveal helper */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .to-top,
  .hero-decor,
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== STICKY CTA BUTTON ========== */
.sticky-cta {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-cta.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sticky-cta a {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  padding: 14px 24px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.sticky-cta a:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(79, 70, 229, 0.4);
}

.sticky-cta a:active {
  transform: translateY(-1px);
}

/* ========== ENHANCED CARD ANIMATIONS ========== */
/* (removed) duplicated card animations – caused flicker with .reveal + base .card transitions */

/* ========== SCROLL-TRIGGERED FADE-IN ========== */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* small responsive tweaks */
@media (max-width: 480px) {
  .wrap {
    padding: 12px 12px 32px;
    padding-top: calc(var(--header-h-sm) + 12px);
    padding-bottom: calc(32px + 96px);
  }

  html {
    scroll-padding-top: calc(var(--header-h-sm) + 20px);
  }

  h1 {
    font-size: 22px;
    line-height: 1.15;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  header.site-header {
    padding: 8px;
  }

  .expertise-banner {
    padding: 16px 12px;
  }

  .expertise-items {
    font-size: 13px;
    gap: 8px;
  }

  .avatar-card {
    min-height: auto;
  }

  .sticky-social {
    display: none;
  }
}

/* Sticky Social Buttons */
.sticky-social {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.sticky-social a {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: -1px 0 6px rgba(0, 0, 0, 0.08);
}

.sticky-social a:hover {
  transform: translateX(-3px);
  box-shadow: -3px 0 12px rgba(0, 0, 0, 0.16);
}

.sticky-social a svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .sticky-social {
    display: none;
  }

  .sticky-cta {
    bottom: 20px;
    right: 20px;
  }

  .sticky-cta a {
    padding: 12px 16px;
    font-size: 12px;
    gap: 6px;
  }
}

/* ========== PROFESSIONAL ENHANCEMENTS ========== */
.card {
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

.card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: scale(0.98);
}

.chip {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(6, 182, 212, 0.06));
  border: 1px solid rgba(79, 70, 229, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.chip:hover {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(6, 182, 212, 0.1));
  border-color: rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.1);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.entry {
  animation: slideInLeft 0.5s ease-out;
  padding-left: 12px;
  border-left: 3px solid transparent;
  transition: border-color 0.3s ease, padding-left 0.3s ease;
}

.entry:hover {
  border-left-color: var(--accent-2);
  padding-left: 16px;
}

.projects-grid .project-card {
  animation: slideInRight 0.5s ease-out;
  animation-fill-mode: both;
}

.projects-grid .project-card:nth-child(1) { animation-delay: 0.05s; }
.projects-grid .project-card:nth-child(2) { animation-delay: 0.1s; }
.projects-grid .project-card:nth-child(3) { animation-delay: 0.15s; }
.projects-grid .project-card:nth-child(4) { animation-delay: 0.05s; }
.projects-grid .project-card:nth-child(5) { animation-delay: 0.1s; }
.projects-grid .project-card:nth-child(6) { animation-delay: 0.15s; }

a[href^="#"] {
  scroll-behavior: smooth;
}

h2 {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 38px;
  font-weight: 800;
  margin: 0 0 28px 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

h3 {
  color: #0f172a;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  letter-spacing: -0.3px;
}

h4 {
  color: #0f172a;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

::selection {
  background: var(--accent-2);
  color: white;
}

::-moz-selection {
  background: var(--accent-2);
  color: white;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent-2);
  color: white;
  padding: 8px 12px;
  text-decoration: none;
  z-index: 999;
  border-radius: 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 8px;
  left: 8px;
}
/* ========== BLOG PAGES ========== */
.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 124px 20px 60px;
}

.article-container {
  max-width: 850px;
  margin: 0 auto;
  padding: 124px 20px 60px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.blog-card {
  background: var(--card);
  border: 1px solid rgba(79, 70, 229, 0.1);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: var(--accent-2);
}

.blog-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.blog-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: var(--text);
  line-height: 1.4;
}

.blog-excerpt {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.blog-tag {
  display: inline-block;
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  margin-right: 8px;
  margin-bottom: 8px;
}

.read-more {
  display: inline-block;
  color: var(--accent-2);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  margin-top: 12px;
  transition: var(--transition-smooth);
}

.read-more:hover {
  transform: translateX(4px);
}

.article-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(79, 70, 229, 0.1);
}

.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.article-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}

.article-content h2 {
  font-size: 28px;
  font-weight: 800;
  margin: 40px 0 20px 0;
  color: var(--accent-2);
}

.article-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 16px 0;
  color: var(--text);
}

.article-content p {
  margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
  margin: 20px 0;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 12px;
  line-height: 1.7;
}

.article-content code {
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: var(--font-mono);
}

.back-link {
  display: inline-block;
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 24px;
  transition: var(--transition-smooth);
}

.back-link:hover {
  transform: translateX(-4px);
}

@media (max-width: 768px) {
  .blog-container,
  .article-container {
    padding: 100px 16px 40px;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .article-content {
    font-size: 16px;
  }
}

/* ========== PROFESSIONAL ENHANCEMENTS ========== */

/* Focus Indicators for Accessibility */
*:focus-visible {
  outline: 3px solid #4f46e5;
  outline-offset: 2px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Enhanced Card Hover Effects */
.card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.12);
}

/* Button Pulse Effect */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0);
  transition: transform 0.6s ease-out;
  pointer-events: none;
}

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

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background: rgba(79, 70, 229, 0.2);
  color: #0f172a;
}

::-moz-selection {
  background: rgba(79, 70, 229, 0.2);
  color: #0f172a;
}

/* Loading Animation Enhancement */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal.in-view {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Professional Code Blocks */
pre code {
  display: block;
  background: #1e293b;
  color: #e2e8f0;
  padding: 24px;
  border-radius: 12px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Breadcrumb Enhancement */
nav[aria-label="Breadcrumb"] a {
  transition: all 0.2s ease;
  position: relative;
}

nav[aria-label="Breadcrumb"] a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #4f46e5;
  transition: width 0.3s ease;
}

nav[aria-label="Breadcrumb"] a:hover::after {
  width: 100%;
}

@media (max-width: 768px) {
  :root {
    --section-gap: 56px;
  }
}

/* ========== SITEMAP TREE (HIERARCHY DIAGRAM) ========== */
.sitemap-tree {
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.sitemap-tree ul {
  padding-top: 16px;
  position: relative;
  padding-left: 0;
  margin: 0;
  display: table;
  margin-left: auto;
  margin-right: auto;
}

.sitemap-tree li {
  list-style-type: none;
  position: relative;
  padding: 16px 10px 0 10px;
  display: table-cell;
  text-align: center;
  vertical-align: top;
}

.sitemap-tree li::before,
.sitemap-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid rgba(0, 0, 0, 0.12);
  width: 50%;
  height: 16px;
}

.sitemap-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid rgba(0, 0, 0, 0.12);
}

.sitemap-tree li:only-child::after,
.sitemap-tree li:only-child::before {
  display: none;
}

.sitemap-tree li:only-child {
  padding-top: 0;
}

.sitemap-tree li:first-child::before,
.sitemap-tree li:last-child::after {
  border: 0 none;
}

.sitemap-tree li:last-child::before {
  border-right: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 0 8px 0 0;
}

.sitemap-tree li:first-child::after {
  border-radius: 8px 0 0 0;
}

.sitemap-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid rgba(0, 0, 0, 0.12);
  width: 0;
  height: 16px;
}

.sitemap-tree .node {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--bg-2);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.sitemap-tree .node a {
  color: var(--text);
  text-decoration: none;
}

.sitemap-tree .node a:hover {
  color: var(--accent-2);
  text-decoration: none;
}

[data-theme="dark"] .sitemap-tree li::before,
[data-theme="dark"] .sitemap-tree li::after,
[data-theme="dark"] .sitemap-tree ul ul::before {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .sitemap-tree .node {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  /* Prevent fixed buttons (e.g., BackToTop) from covering the last content on mobile. */
  .wrap {
    padding-bottom: calc(32px + 96px);
  }

  .blog-container,
  .article-container {
    padding-bottom: calc(40px + 96px);
  }
}